/* =============================================================
   ALCO-TIER · DESIGN TOKENS v9 «Бар после полуночи» (2026-11-14)
   Контракт для всех страниц. Не менять без Lead.
   Тёплая тьма + кремовая бумага + один оранжевый акцент.
   Файл подключается ПЕРВЫМ, после него shell.css и page-css.
   ============================================================= */

:root {
    /* --- тёмная база: тёплый эспрессо, не нейтральный чёрный --- */
    --night: #0B0906;
    --night-2: #100D09;
    --panel: #17130D;
    --panel-2: #1F1912;
    --panel-3: #292117;
    --panel-4: #34291C;

    /* --- кремовая краска / бумага --- */
    --cream: #F2E8D5;
    --cream-2: #FBF5E7;
    --cream-3: #E4D6BA;
    --muted: #B3A48C;
    --muted-2: #8A7C67;

    /* --- линии и обводки --- */
    --line: rgba(242, 232, 213, .12);
    --line-2: rgba(242, 232, 213, .22);
    --line-3: rgba(242, 232, 213, .38);

    /* --- единственный акцент + латунь для цифр --- */
    --accent: #FF5A1F;
    --accent-press: #DE4711;
    --accent-ink: #1A0C05;
    --accent-soft: rgba(255, 90, 31, .14);
    --amber: #E9A64B;
    --amber-soft: rgba(233, 166, 75, .16);

    /* --- светлая плоскость: карточка меню / доска --- */
    --paper: #F1E6D0;
    --paper-2: #E7D9BE;
    --paper-ink: #1B150C;
    --paper-muted: rgba(27, 21, 12, .72);
    --paper-line: rgba(27, 21, 12, .14);
    --paper-line-2: rgba(27, 21, 12, .26);

    /* --- шкала плотности краски (ранги) --- */
    --ink-100: #1C150C;
    --ink-70: #3A2E1F;
    --ink-50: #55452F;
    --ink-30: #78644A;
    --ink-15: #A79374;

    /* --- шрифты (уже подключены в html) --- */
    --font-display: 'Oswald', 'Arial Narrow', sans-serif;
    --font-body: 'Golos Text', 'Segoe UI', system-ui, sans-serif;

    /* --- типографическая шкала --- */
    --fs-display: clamp(3.25rem, 8.6vw, 8.25rem);
    --fs-h2: clamp(2.1rem, 4.2vw, 3.6rem);
    --fs-h3: clamp(1.35rem, 2vw, 1.875rem);
    --fs-h4: clamp(1.05rem, 1.35vw, 1.25rem);
    --fs-lead: clamp(1rem, 1.15vw, 1.1875rem);
    --fs-body: 1rem;
    --fs-sm: .875rem;
    --fs-xs: .8125rem;
    --fs-cap: .75rem;

    /* --- шкала отступов --- */
    --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
    --s-5: 24px;  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;
    --s-9: 96px;  --s-10: 128px;

    /* --- радиусы: карточка > кнопка > поле --- */
    --r-xs: 6px;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-pill: 999px;

    /* --- тени и движение --- */
    --shadow-sm: 0 2px 10px -4px rgba(0, 0, 0, .6);
    --shadow-md: 0 18px 45px -28px rgba(0, 0, 0, .95);
    --shadow-lg: 0 40px 90px -50px rgba(0, 0, 0, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-in-out: cubic-bezier(.65, 0, .35, 1);
    --dur: .32s;

    /* --- каркас --- */
    --maxw: 1240px;
    --gutter: clamp(16px, 4vw, 48px);
    --header-h: 76px;
    --bottom-bar-h: 64px;
    --photo-warm: linear-gradient(180deg, rgba(11, 9, 6, .15) 0%, rgba(11, 9, 6, .55) 55%, rgba(11, 9, 6, .96) 100%);

    /* --- совместимость со старыми слоями (alias.css и пр.) --- */
    --ef-yellow: var(--accent);
    --ef-yellow-hover: var(--accent-press);
    --ef-yellow-dim: var(--accent-soft);
    --border-yellow: var(--accent);
    --text-yellow: var(--accent);
    --bg-page: var(--night);
    --bg-card: var(--panel);
    --bg-card-hover: var(--panel-2);
    --bg-sidebar: var(--night-2);
    --border-light: var(--line);
    --border-dark: var(--line-2);
    --text-main: var(--cream);
    --text-muted: var(--muted);
    --text-light: var(--cream-2);
    --tier-s: var(--accent);
    --tier-a: var(--ink-100);
    --tier-b: var(--ink-70);
    --tier-c: var(--ink-50);
    --tier-d: var(--ink-30);
    --tier-f: var(--ink-15);
    --font-mono: var(--font-body);
    --accent-rgb: 255, 90, 31;
}

/* ============================ база ============================ */

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

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

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1200px 620px at 78% -8%, rgba(233, 166, 75, .10), transparent 62%),
        radial-gradient(900px 520px at 8% 4%, rgba(255, 90, 31, .055), transparent 60%),
        var(--night);
    color: var(--cream);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* зерно: тонкая тёплая текстура поверх фона */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: .35;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='.045'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, h5 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: -.005em;
    line-height: .98;
    color: var(--cream-2);
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
table { border-collapse: collapse; }

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

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 10px; border: 2px solid var(--night); }
::-webkit-scrollbar-thumb:hover { background: var(--panel-4); }

/* ============================ утилиты ============================ */

.u-num { font-variant-numeric: tabular-nums; }
.u-nowrap { white-space: nowrap; }

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

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

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: var(--fs-cap);
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
}
.eyebrow::before {
    content: "";
    width: 22px; height: 1px;
    background: var(--accent);
}

.lead,
.sec-lead {
    font-size: var(--fs-lead);
    line-height: 1.5;
    color: var(--muted);
}

.hairline { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ============================ кнопки ============================ */

.btn {
    --btn-bg: transparent;
    --btn-ink: var(--cream);
    --btn-line: var(--line-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid var(--btn-line);
    border-radius: var(--r-sm);
    background: var(--btn-bg);
    color: var(--btn-ink);
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1;
    text-transform: none;
    white-space: nowrap;
    transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out),
                color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.btn:hover { border-color: var(--line-3); background: rgba(242, 232, 213, .06); }
.btn:active { transform: translateY(1px); }

.btn-primary {
    --btn-bg: var(--accent);
    --btn-ink: var(--accent-ink);
    --btn-line: var(--accent);
    font-weight: 700;
    box-shadow: 0 14px 30px -18px rgba(255, 90, 31, .9);
}
.btn-primary:hover { --btn-bg: var(--accent-press); --btn-line: var(--accent-press); }

.btn-ghost { --btn-bg: rgba(242, 232, 213, .04); }

.btn-paper {
    --btn-bg: var(--paper);
    --btn-ink: var(--paper-ink);
    --btn-line: var(--paper);
    font-weight: 700;
}
.btn-paper:hover { --btn-bg: var(--cream-2); --btn-line: var(--cream-2); }

.btn-sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-xs); border-radius: var(--r-xs); }
.btn-lg { min-height: 54px; padding: 0 30px; font-size: var(--fs-body); }

.link-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    border: 0;
    border-bottom: 1px solid var(--line-2);
    background: none;
    color: var(--cream);
    font-size: var(--fs-sm);
    font-weight: 600;
    transition: border-color var(--dur), color var(--dur);
}
.link-action:hover { border-color: var(--accent); color: var(--cream-2); }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    color: var(--cream);
    transition: background var(--dur), border-color var(--dur);
}
.icon-btn:hover { background: rgba(242, 232, 213, .07); border-color: var(--line-3); }

/* ============================ чипы и метки ============================ */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-pill);
    background: rgba(242, 232, 213, .035);
    color: var(--cream);
    font-size: var(--fs-xs);
    font-weight: 500;
    transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.chip:hover { border-color: var(--line-3); background: rgba(242, 232, 213, .07); }
.chip.is-active,
.chip[aria-pressed="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-xs);
    color: var(--muted);
    font-size: var(--fs-cap);
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.tag--accent { border-color: var(--accent); color: var(--accent); }

.age-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 24px;
    padding: 0 9px;
    border: 1px solid var(--line-3);
    border-radius: var(--r-pill);
    color: var(--cream);
    font-size: var(--fs-cap);
    font-weight: 600;
    letter-spacing: .04em;
    vertical-align: middle;
}
.age-pill--paper { border-color: var(--paper-line-2); color: var(--paper-ink); }

/* ============================ поля ============================ */

.form-group,
.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group > label,
.field > label,
.field-label {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
}

.input-text,
.select-input,
.input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, .28);
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    color: var(--cream-2);
    font-size: var(--fs-sm);
    transition: border-color var(--dur), background var(--dur);
}
.input-text:hover,
.select-input:hover,
.input:hover { border-color: var(--line-3); }
.input-text:focus,
.select-input:focus,
.input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, .42);
    outline: none;
}
.input-text::placeholder { color: var(--muted-2); }

.select-input { appearance: none; padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23B3A48C' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

input[type="range"] {
    accent-color: var(--accent);
    height: 26px;
}

/* поле на кремовой бумаге */
.paper .input-text, .paper .select-input {
    background: rgba(255, 255, 255, .45);
    border-color: var(--paper-line-2);
    color: var(--paper-ink);
}
.paper .input-text::placeholder { color: rgba(27, 21, 12, .42); }
.paper .form-group > label, .paper .field-label { color: var(--paper-muted); }

/* ============================ светлая «бумага» ============================ */

.paper {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .35), transparent 40%),
        var(--paper);
    color: var(--paper-ink);
    border-radius: var(--r-lg);
}
.paper h1, .paper h2, .paper h3, .paper h4 { color: var(--paper-ink); }
.paper .eyebrow { color: var(--paper-muted); }
.paper .sec-lead, .paper .lead { color: var(--paper-muted); }
.paper .hairline { background: var(--paper-line); }
.paper ::selection { background: var(--accent); color: #fff; }

/* ============================ появление на скролле ============================ */

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
    will-change: opacity, transform;
}
.reveal-on-scroll.is-revealed {
    opacity: 1;
    transform: none;
}

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

/* ============================ служебное ============================ */

.is-hidden { display: none !important; }

/* старые декоративные канвасы больше не нужны */
#bgTacticalCanvas,
#heroShaderCanvas,
#opAtmosphereCanvas,
#gpViewportCanvas,
.gameplay-motion-viewport,
.cyber-hud-telemetry,
.b3d-hud,
.hero-bg-overlay,
.tactical-grid-bg,
.ambient-fx { display: none !important; }
