/* ==========================================================================
   Базовые стили: сброс, документ, типографика, контейнер, утилиты
   ========================================================================== */

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

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

body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: 1.6;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }

:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: 4px; }

::selection { background: var(--color-accent); color: var(--color-white); }

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

.h-hero, h1 {
    font-size: var(--fs-hero);
    line-height: var(--lh-hero);
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--color-white);
    text-wrap: balance;
}

.h-section, h2 {
    font-size: var(--fs-h2);
    line-height: var(--lh-h2);
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--color-white);
    text-wrap: balance;
}

h3 {
    font-size: var(--fs-h3);
    line-height: 1.1;
    font-weight: 500;
    color: var(--color-white);
}

p { color: var(--color-muted); }
p strong, li strong { color: var(--color-white); font-weight: 500; }

.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--color-muted); max-width: 640px; }

/* Надзаголовок-«бейдж» синего цвета, как «THE OPEN NETWORK» на ton.org */
.eyebrow {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--color-accent);
}

.mono { font-family: var(--font-mono); }
.text-white { color: var(--color-white); }
.text-accent { color: var(--color-accent); }
.text-safe { color: var(--color-safe); }
.text-risk { color: var(--color-risk); }
.text-warn { color: var(--color-warn); }

/* ---------- Контейнер и секции ---------- */

.container {
    width: 100%;
    max-width: calc(var(--grid-max) + var(--pad-inline) * 2);
    margin-inline: auto;
    padding-inline: var(--pad-inline);
}

.section { padding-block: 120px; position: relative; }
.section--tight { padding-block: 80px; }
.section--flush-top { padding-top: 0; }

.section-head { display: grid; gap: 20px; margin-bottom: 56px; max-width: 760px; }
.section-head--center { margin-inline: auto; text-align: center; justify-items: center; }

@media (max-width: 1023px) {
    .section { padding-block: 88px; }
    .section-head { margin-bottom: 40px; }
}
@media (max-width: 639px) {
    .section { padding-block: 64px; }
    .section--tight { padding-block: 48px; }
    .section-head { gap: 14px; margin-bottom: 32px; }
}

/* ---------- Утилиты ---------- */

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 200;
    padding: 10px 16px; border-radius: var(--r-pill);
    background: var(--color-accent); color: var(--color-white); font-weight: 500;
}
.skip-link:focus { top: 12px; }

/* Плавное появление блоков при прокрутке (main.js добавляет .is-in) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
html:not(.js) .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
