/* ==========================================================================
   СПЕЦТЕХРЕСУРС V2 — base.css
   Дизайн-система «GRAPHITE + ELECTRIC BLUE».
   Токены, сброс, типографика, кнопки, сетка, reveal.
   ========================================================================== */

:root {
    /* ── Палитра ───────────────────────────────────────────────────── */
    --bg:          #07080A;   /* глубокий графит                        */
    --surface:     #0B0E12;   /* поднятые поверхности                   */
    --panel:       #10151B;   /* панели / карточки / формы              */
    --panel-hi:    #151C24;
    --line:        rgba(148, 176, 204, .10);
    --line-strong: rgba(148, 176, 204, .22);

    --text:        #EBEEF3;   /* основной светлый текст                 */
    --text-muted:  #98A2AD;
    --text-dim:    #62707D;

    --accent:      #00A3FF;   /* electric blue                          */
    --accent-bright:#59C4FF;
    --accent-deep: #0077CC;
    --accent-glow: rgba(0, 163, 255, .32);
    --accent-dim:  rgba(0, 163, 255, .12);
    --danger:      #FF5C66;

    --ok:          #34D399;

    /* ── Типографика ──────────────────────────────────────────────── */
    --font-display: "Manrope", "Inter", system-ui, sans-serif;
    --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono:    "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

    /* ── Геометрия ────────────────────────────────────────────────── */
    --radius:       4px;
    --radius-lg:    8px;
    --header-h:     80px;
    --header-h-c:   64px;      /* компактная шапка при скролле          */
    --container:    1280px;
    --ease:         cubic-bezier(.2, .7, .3, 1);
    --ease-io:      cubic-bezier(.65, 0, .35, 1);
}

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

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

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
}

img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }
input, textarea, select { font: inherit; }
[hidden] { display: none !important; }
body.is-locked { overflow: hidden; }

::selection { background: var(--accent); color: #05121E; }

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---------- Utilities ---------- */
.mono {
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .14em;
}

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

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

/* Тонкая инженерная сетка + виньетка для тёмных секций */
.grid-bg {
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 520px at 78% -12%, rgba(0,163,255,.08), transparent 62%),
        radial-gradient(900px 600px at 8% 108%, rgba(0,163,255,.05), transparent 58%),
        linear-gradient(rgba(150,178,204,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(150,178,204,.05) 1px, transparent 1px);
    background-size: auto, auto, 46px 46px, 46px 46px;
}

/* Координатная метка-уголок (mono, едва заметна) */
.corner {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: .14em;
    color: #5A7A96;
    opacity: .82;
    z-index: 1;
}
.corner--tl { top: 26px; left: 24px; }
.corner--br { bottom: 26px; right: 24px; }

/* Тонкий шум поверх тёмных секций — убирает «плоскость» */
.noise::after {
    content: "";
    position: absolute; inset: 0;
    pointer-events: none;
    opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}

/* ---------- Sections ---------- */
.section {
    position: relative;
    padding-block: clamp(84px, 9vw, 140px);
}
.section--skin { background: var(--surface); border-block: 1px solid var(--line); }

/* ---------- Section header ---------- */
.section__head { max-width: 780px; margin-bottom: clamp(40px, 6vw, 80px); }
.section__head--left { margin-left: 0; }
.section__head--center {
    margin-inline: auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section__index {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: .22em;
    color: var(--accent);
    margin-bottom: 20px;
}
.section__index::before {
    content: "";
    width: 26px; height: 1px;
    background: var(--accent);
}

.section__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(32px, 4.6vw, 56px);
    line-height: 1.03;
    letter-spacing: -.025em;
    text-wrap: balance;
    color: var(--text);
}
.section__title .accent { color: var(--accent); }

.section__lead {
    margin-top: 20px;
    max-width: 600px;
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1.6;
}

/* ---------- Buttons ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 17px 28px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14.5px;
    letter-spacing: .02em;
    line-height: 1.1;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .25s ease, color .25s ease,
                border-color .25s ease, transform .28s var(--ease),
                box-shadow .28s ease, opacity .25s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn .arr { transition: transform .28s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn:active { transform: translateY(0) scale(.985); }

.btn--accent {
    background: var(--accent);
    color: #05121E;
}
.btn--accent:hover {
    background: var(--accent-bright);
    transform: translateY(-2px);
    box-shadow: 0 16px 40px -14px var(--accent-glow);
}

.btn--ghost {
    border-color: var(--line-strong);
    color: var(--text);
    background: transparent;
}
.btn--ghost:hover {
    border-color: var(--accent);
    color: var(--accent-bright);
    transform: translateY(-2px);
    background: var(--accent-dim);
}

.btn--line {
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line-strong);
}
.btn--line:hover { color: var(--accent-bright); border-color: var(--accent); }

.btn--sm { padding: 12px 18px; font-size: 13px; gap: 9px; }
.btn--md { padding: 14px 22px; font-size: 14px; }
.btn--lg { padding: 20px 40px; font-size: 16px; }
.btn--block { width: 100%; }

/* ---------- Reveal (scroll-анимации) ---------- */
/* Контент виден сразу: блок лишь слегка «подъезжает» при появлении
   и никогда не бывает невидимым — даже при быстрой прокрутке */
html.js .reveal {
    transform: translateY(14px);
    transition: transform .55s var(--ease) var(--d, 0s);
}
html.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Custom cursor (desktop only) ---------- */
.cursor {
    position: fixed;
    top: 0; left: 0;
    width: 8px; height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: var(--accent);
    pointer-events: none;
    z-index: 999;
    opacity: 0;
    transition: transform .25s var(--ease), opacity .3s ease, background-color .25s ease;
    mix-blend-mode: screen;
}
.cursor::after {
    content: "";
    position: absolute; inset: -9px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    opacity: .5;
    transition: transform .3s var(--ease), opacity .3s ease;
}
.cursor.is-hot { transform: scale(2.2); background: var(--accent-bright); }
.cursor.is-hot::after { transform: scale(1.25); opacity: .15; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
html.no-cursor, html.no-cursor a, html.no-cursor button,
html.no-cursor .tech-card, html.no-cursor .node-ui { cursor: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    html.js .reveal { opacity: 1; transform: none; transition: none; }
    * , *::before, *::after {
        animation-delay: 0s !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .cursor { display: none; }
}