/* ═══════════════════════════════════════════════════════════════════════════
   НЕО — Base layer
   Сброс, типографика, фокус, фон. Никаких компонентов.
   ═══════════════════════════════════════════════════════════════════════════ */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--t-base);
    font-weight: 400;
    line-height: var(--lh-normal);
    letter-spacing: var(--tr-normal);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Зерно. Разбивает цифровую плоскость фона, не даёт ему «пластиковый» вид. */
.grain {
    position: fixed;
    inset: 0;
    z-index: var(--z-base);
    pointer-events: none;
    opacity: 0.022;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: var(--lh-tight);
    letter-spacing: var(--tr-tight);
    color: var(--text-strong);
    text-wrap: balance;
}

h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-xl); letter-spacing: var(--tr-snug); }
h4 { font-size: var(--t-lg); letter-spacing: var(--tr-snug); }
h5 { font-size: var(--t-md); letter-spacing: var(--tr-normal); }
h6 { font-size: var(--t-base); letter-spacing: var(--tr-normal); }

p { text-wrap: pretty; }

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--d-fast) var(--e-out);
}

/* Цифры в интерфейсе данных должны выстраиваться в колонку. */
.tabular,
th, td,
[class*='stat-val'],
[class*='stat-value'],
[class*='-num'] {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}

code, kbd, pre, samp, .mono {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

/* Мелкие капсы — метки, а не заголовки. Положительный трекинг. */
.eyebrow,
.label-caps {
    font-size: var(--t-2xs);
    font-weight: 600;
    letter-spacing: var(--tr-caps);
    text-transform: uppercase;
    color: var(--text-faint);
}

/* ── Формы ───────────────────────────────────────────────────────────── */

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

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

::placeholder { color: var(--text-faint); opacity: 1; }

/* ── Фокус ───────────────────────────────────────────────────────────── */

:focus { outline: none; }

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

.skip-link {
    position: absolute;
    top: var(--s-2);
    left: var(--s-2);
    z-index: var(--z-toast);
    padding: var(--s-3) var(--s-5);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    font-size: var(--t-sm);
    font-weight: 500;
    transform: translateY(calc(-100% - var(--s-4)));
    transition: transform var(--d-base) var(--e-out);
}

.skip-link:focus-visible { transform: translateY(0); }

/* ── Выделение и полосы прокрутки ────────────────────────────────────── */

::selection {
    background: var(--accent-line);
    color: var(--text-strong);
}

* { scrollbar-width: thin; scrollbar-color: var(--g-700) transparent; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--g-700);
    border: 3px solid var(--bg);
    border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--g-600); }

/* ── Утилиты ─────────────────────────────────────────────────────────── */

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

.container-wide { max-width: var(--container-wide); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

[hidden] { display: none !important; }
