/* =====================================================================
   Базові стилі, типографіка та утиліти
   ===================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
}

body.is-locked {
    overflow: hidden;
}

/* Закриті оверлеї (меню, панель, модалка) мають власний display,
   тому [hidden] треба посилити — інакше вони лишаються в потоці
   й розтягують документ по горизонталі. */
[hidden] {
    display: none !important;
}

img,
picture,
svg,
video {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
    padding: 0;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: var(--r-xs);
}

::selection {
    background: var(--amber-400);
    color: var(--ink-900);
}

/* --- Типографіка --------------------------------------------------- */

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: var(--lh-snug);
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h1 {
    font-size: var(--fs-hero);
    line-height: var(--lh-tight);
    letter-spacing: -0.035em;
}

h2 {
    font-size: var(--fs-h2);
    letter-spacing: -0.03em;
}

h3 {
    font-size: var(--fs-h3);
}

h4 {
    font-size: var(--fs-h4);
}

p {
    text-wrap: pretty;
}

strong {
    font-weight: 700;
}

/* --- Утиліти ------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section-y);
    position: relative;
}

.section--tight {
    padding-block: clamp(56px, 6vw, 96px);
}

.section--dark {
    background: var(--dark-bg);
    color: var(--dark-text);
}

.section--alt {
    background: var(--bg-alt);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--fs-eyebrow);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-text);
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 1px;
    background: currentColor;
    flex: none;
}

.section--dark .eyebrow {
    color: var(--amber-400);
}

.lead {
    font-size: var(--fs-lead);
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 62ch;
}

.section--dark .lead {
    color: var(--dark-muted);
}

.muted {
    color: var(--text-muted);
}

.section--dark .muted {
    color: var(--dark-muted);
}

.section-head {
    display: grid;
    gap: var(--space-5);
    margin-bottom: clamp(40px, 5vw, 72px);
}

.section-head--split {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
}

@media (min-width: 900px) {
    .section-head--split {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        gap: var(--space-8);
    }
}

.section-head__title {
    display: grid;
    gap: var(--space-4);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-4);
    z-index: 500;
    background: var(--ink-900);
    color: var(--sand-50);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--r-sm);
    font-weight: 600;
    transition: top var(--t-base) var(--ease-out);
}

.skip-link:focus {
    top: var(--space-4);
}
