/* ==========================================================================
   BEYOND REALITY — design system
   ========================================================================== */

:root {
    --bg: #030405;
    --ink: #ece8df;
    --ink-2: rgba(236, 232, 223, 0.64);
    --ink-3: rgba(236, 232, 223, 0.36);
    --line: rgba(236, 232, 223, 0.13);
    --line-2: rgba(236, 232, 223, 0.26);
    --accent: #ff7a2f;
    --accent-rgb: 255, 122, 47;
    --glass: rgba(9, 11, 13, 0.46);
    --danger: #ff3b30;
    --font-display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
    --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
    --gutter: clamp(16px, 3.2vw, 48px);
    --top-h: 78px;
    --hud-h: 64px;
    --vh: 1vh;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
    background: var(--bg);
    color: var(--ink);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
html.is-loading body { overflow: hidden; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: inherit; }
ol, ul { margin: 0; padding: 0; list-style: none; }
dl, dd, figure { margin: 0; }
::selection { background: var(--accent); color: #050505; }

.mono {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 4px;
}

.skip-link {
    position: fixed; z-index: 400; left: 12px; top: -60px;
    padding: 10px 16px; background: var(--ink); color: #050505;
    font-family: var(--font-mono); font-size: 12px; transition: top .3s var(--ease);
}
.skip-link:focus { top: 12px; }

/* Split text ------------------------------------------------------------- */
.split { display: inline-block; transform-style: preserve-3d; }
.w { display: inline-block; white-space: nowrap; transform-style: preserve-3d; }
.c { display: inline-block; will-change: transform; transform-origin: 50% 80%; backface-visibility: hidden; }

/* Canvas layers ---------------------------------------------------------- */
#gl {
    position: fixed; inset: 0; width: 100%; height: 100%;
    display: block; z-index: 0; touch-action: pan-y;
}
#trail {
    position: fixed; inset: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 150;
}
.grain {
    position: fixed; inset: -50%; z-index: 140; pointer-events: none; opacity: .05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
    animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
    0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
    60% { transform: translate(-4%, -2%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

main { position: relative; z-index: 2; overflow-x: clip; }

/* Worlds ----------------------------------------------------------------- */
.world {
    position: relative;
    height: calc(var(--h, 300) * var(--vh));
    touch-action: pan-y;
}
.world__sticky {
    position: sticky; top: 0;
    height: calc(100 * var(--vh));
    overflow: hidden;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}
.world__sticky input { -webkit-user-select: text; user-select: text; }
.world__sticky > * { pointer-events: auto; }
.world__sticky > [aria-hidden="true"] { pointer-events: none; }

/* Frame corners (reused) */
.frame-corners { position: absolute; inset: 18px; pointer-events: none; }
.frame-corners i { position: absolute; width: 22px; height: 22px; border-color: var(--line-2); border-style: solid; }
.frame-corners i:nth-child(1) { left: 0; top: 0; border-width: 1px 0 0 1px; }
.frame-corners i:nth-child(2) { right: 0; top: 0; border-width: 1px 1px 0 0; }
.frame-corners i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 1px 1px; }
.frame-corners i:nth-child(4) { right: 0; bottom: 0; border-width: 0 1px 1px 0; }

/* ==========================================================================
   Loader
   ========================================================================== */
.loader {
    position: fixed; inset: 0; z-index: 300;
    display: grid; place-items: center;
    background: #020203;
    overflow: hidden;
}
.loader__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.loader__top {
    position: absolute; top: 34px; left: 44px; right: 44px;
    display: flex; justify-content: space-between; color: var(--ink-3);
}
.loader__core { position: relative; width: min(46vmin, 300px); aspect-ratio: 1; }
.loader__ring { width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.loader__ring circle { fill: none; }
.loader__ticks { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 1 6; transform-origin: 100px 100px; animation: spin 24s linear infinite; }
.loader__track { stroke: var(--line); stroke-width: 1; }
.loader__arc { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 1000; stroke-dashoffset: 1000; filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), .8)); }
.loader__inner { stroke: var(--line); stroke-width: 1; stroke-dasharray: 30 12 4 12; transform-origin: 100px 100px; animation: spin 9s linear infinite reverse; }
.loader__pct {
    position: absolute; inset: 0; display: grid; place-content: center; grid-auto-flow: column; align-items: baseline;
    font-family: var(--font-display); font-weight: 300; font-size: clamp(38px, 7vmin, 64px); letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.loader__pct small { font-size: .32em; margin-left: .2em; color: var(--ink-3); }
.loader__title {
    position: absolute; left: 0; right: 0; bottom: 24vh; text-align: center;
    font-family: var(--font-display); font-weight: 700; font-size: clamp(14px, 1.6vw, 20px); letter-spacing: 0.7em;
    text-transform: uppercase; color: var(--ink);
}
.loader__log {
    position: absolute; left: 44px; bottom: 40px; max-width: min(560px, calc(100vw - 88px));
    display: flex; flex-direction: column; gap: 4px; color: var(--ink-3); font-size: 10px;
}
.loader__log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loader__log li b { color: var(--accent); font-weight: 500; }
.loader__enter {
    position: absolute; left: 0; right: 0; bottom: 11vh;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; padding: 0 20px;
}
.loader__note { width: 100%; text-align: center; color: var(--ink-3); font-size: 10px; margin-top: 8px; }
.loader__error {
    position: absolute; left: 50%; bottom: 14vh; transform: translateX(-50%); width: min(560px, 90vw);
    text-align: center; color: var(--danger); line-height: 1.8;
}

/* Buttons ---------------------------------------------------------------- */
.btn-enter {
    position: relative; display: inline-grid; place-items: center;
    min-width: 230px; height: 58px; padding: 0 34px;
    border: 1px solid var(--line-2); border-radius: 60px;
    font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
    overflow: hidden; isolation: isolate;
    transition: border-color .4s var(--ease), color .4s var(--ease);
}
.btn-enter::before {
    content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
    background: var(--accent); transform: translateY(101%); transition: transform .55s var(--ease);
}
.btn-enter:hover, .btn-enter:focus-visible { border-color: var(--accent); color: #060606; }
.btn-enter:hover::before, .btn-enter:focus-visible::before { transform: translateY(0); }
.btn-enter span { pointer-events: none; display: inline-block; }
.btn-enter--ghost { border-style: dashed; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Top bar & navigation
   ========================================================================== */
.topbar {
    position: fixed; z-index: 120; left: 0; right: 0; top: 0; height: var(--top-h);
    display: flex; align-items: center; gap: 24px;
    padding: 0 var(--gutter);
    pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 40px; height: 40px; overflow: visible; }
.brand__orbit { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 4; transform-origin: 24px 24px; animation: spin 18s linear infinite; }
.brand__core { fill: var(--accent); transition: fill .6s; }
.brand__moon { fill: var(--ink); transform-origin: 24px 24px; animation: spin 6s linear infinite; }
.brand__text { font-family: var(--font-display); font-weight: 700; font-size: 11px; line-height: 1.1; letter-spacing: 0.18em; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav__link {
    position: relative; display: flex; align-items: baseline; gap: 8px;
    padding: 10px 14px; border-radius: 40px;
    font-size: 13px; color: var(--ink-2); transition: color .35s var(--ease);
}
.nav__link::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 1px;
    background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease);
}
.nav__link:hover, .nav__link.is-active { color: var(--ink); }
.nav__link.is-active::after, .nav__link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__idx { font-size: 9px; color: var(--accent); }
.nav__link > span { pointer-events: none; display: inline-block; }

.topbar__tools { display: flex; gap: 8px; }
.sound-btn, .map-btn {
    display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px;
    border: 1px solid var(--line); border-radius: 40px; background: rgba(3, 4, 5, .35);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    transition: border-color .3s;
}
.sound-btn:hover, .map-btn:hover { border-color: var(--line-2); }
.sound-btn > *, .map-btn > * { pointer-events: none; }
.sound-btn__bars { display: flex; align-items: center; gap: 2px; height: 14px; }
.sound-btn__bars i { display: block; width: 2px; height: 3px; background: var(--ink-2); border-radius: 2px; transition: height .08s linear; }
.sound-btn[aria-pressed="true"] .sound-btn__bars i { background: var(--accent); }
.map-btn__icon { position: relative; width: 16px; height: 16px; border: 1px solid var(--ink-2); border-radius: 50%; }
.map-btn__icon i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); left: 50%; top: 50%; margin: -1.5px; }
.map-btn__icon i:nth-child(1) { transform: rotate(0deg) translateX(8px); }
.map-btn__icon i:nth-child(2) { transform: rotate(120deg) translateX(8px); }
.map-btn__icon i:nth-child(3) { transform: rotate(240deg) translateX(8px); }
.map-btn:hover .map-btn__icon { animation: spin 2s linear infinite; }

/* Rail ------------------------------------------------------------------- */
.rail {
    position: fixed; z-index: 110; right: calc(var(--gutter) - 6px); top: 50%;
    height: 46vh; width: 14px; transform: translateY(-50%);
}
.rail__track { position: absolute; left: 6px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.rail__fill { position: absolute; left: 0; top: 0; width: 1px; height: 100%; background: var(--accent); transform-origin: top; transform: scaleY(0); box-shadow: 0 0 8px rgba(var(--accent-rgb), .9); }
.rail__nodes li { position: absolute; left: 0; top: calc(var(--i) * 25%); transform: translateY(-50%); }
.rail__nodes button { position: relative; display: block; width: 14px; height: 14px; }
.rail__dot {
    position: absolute; left: 3px; top: 3px; width: 8px; height: 8px; border-radius: 50%;
    border: 1px solid var(--ink-3); background: var(--bg); transition: transform .4s var(--ease), border-color .3s, background .3s;
}
.rail__nodes li.is-passed .rail__dot { border-color: var(--accent); }
.rail__nodes li.is-active .rail__dot { background: var(--accent); border-color: var(--accent); transform: scale(1.5); }
.rail__label {
    position: absolute; right: 24px; top: 50%; transform: translate(8px, -50%); white-space: nowrap; font-size: 9px;
    opacity: 0; transition: opacity .35s var(--ease), transform .35s var(--ease); pointer-events: none; color: var(--ink-2);
}
.rail__nodes button:hover .rail__label, .rail__nodes button:focus-visible .rail__label, .rail__nodes li.is-active .rail__label { opacity: 1; transform: translate(0, -50%); }

/* HUD -------------------------------------------------------------------- */
.hud {
    position: fixed; z-index: 110; left: 0; right: 0; bottom: 0; height: var(--hud-h);
    display: flex; align-items: center; gap: 28px; padding: 0 var(--gutter);
    pointer-events: none; color: var(--ink-2);
}
.hud > * { pointer-events: auto; }
.hud b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.hud__world { display: flex; align-items: baseline; gap: 4px; min-width: 210px; }
.hud__world [data-hud-index] { color: var(--accent); font-size: 13px; }
.hud__world b { margin-left: 14px; letter-spacing: 0.22em; }
.hud__coords { display: flex; gap: 14px; }
.hud__coords b { display: inline-block; min-width: 4.4em; }
.hud__velocity { display: flex; align-items: center; gap: 10px; }
.hud__meter { position: relative; width: 70px; height: 3px; background: var(--line); overflow: hidden; }
.hud__meter i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.hud__time { margin-left: auto; }
.hud__tools { display: flex; gap: 6px; }
.hud-btn {
    height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 30px; font-size: 9px; color: var(--ink-2);
    transition: border-color .3s, color .3s; background: rgba(3, 4, 5, .3);
}
.hud-btn:hover, .hud-btn[aria-pressed="true"], .hud-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--ink); }

/* Anomalies -------------------------------------------------------------- */
.anomalies {
    position: fixed; z-index: 130; right: var(--gutter); bottom: calc(var(--hud-h) + 6px);
    width: min(400px, calc(100vw - 32px)); padding: 18px 20px 16px;
    background: rgba(5, 6, 8, .82); border: 1px solid var(--line-2);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}
.anomalies__head { display: flex; justify-content: space-between; color: var(--accent); margin-bottom: 14px; }
.anomalies__head button { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-2); }
.anomalies__list li { display: grid; grid-template-columns: 22px 1fr; gap: 6px 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.anomalies__list li::before { content: '○'; color: var(--ink-3); font-family: var(--font-mono); }
.anomalies__list li.is-found::before { content: '●'; color: var(--accent); }
.anomalies__list li span { color: var(--ink-2); }
.anomalies__list li.is-found b { color: var(--ink); }
.anomalies__list li b { font-weight: 600; font-size: 12px; letter-spacing: .04em; }
.anomalies__list li span { grid-column: 2; font-size: 12px; line-height: 1.45; }
.anomalies__global { margin-top: 10px; color: var(--ink-3); font-size: 9px; line-height: 1.7; }

/* Toasts ----------------------------------------------------------------- */
.toasts {
    position: fixed; z-index: 160; left: 50%; top: calc(var(--top-h) + 6px); transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(520px, 92vw);
}
.toast {
    display: flex; gap: 12px; align-items: center; padding: 11px 18px;
    background: rgba(5, 6, 8, .78); border: 1px solid var(--accent);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.toast b { color: var(--accent); font-weight: 600; }

/* Warp label ------------------------------------------------------------- */
.warp-label {
    position: fixed; z-index: 145; left: 50%; top: 50%; transform: translate(-50%, -50%);
    font-size: 12px; letter-spacing: .5em; pointer-events: none; opacity: 0; color: #fff; text-align: center; white-space: nowrap;
}

/* Perf ------------------------------------------------------------------- */
.perf {
    position: fixed; z-index: 170; left: var(--gutter); top: calc(var(--top-h) + 8px);
    width: 238px; padding: 12px 14px; background: rgba(3, 4, 5, .82); border: 1px solid var(--line-2);
    font-size: 10px; letter-spacing: .06em; color: var(--ink-2);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.perf__head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; }
.perf__head b { font-size: 26px; color: var(--ink); font-weight: 500; min-width: 2.2ch; font-variant-numeric: tabular-nums; }
.perf__head canvas { margin-left: auto; width: 140px; height: 34px; }
.perf__rows { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.perf__rows dt { color: var(--ink-3); }
.perf__rows dd { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Cursor ----------------------------------------------------------------- */
html.has-cursor, html.has-cursor * { cursor: none !important; }
.cursor { position: fixed; left: 0; top: 0; z-index: 260; pointer-events: none; display: none; }
html.has-cursor .cursor { display: block; }
.cursor__dot {
    position: fixed; left: 0; top: 0; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
    background: var(--ink); mix-blend-mode: difference;
}
.cursor__ring {
    position: fixed; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid rgba(236, 232, 223, .55); transition: border-color .3s, border-radius .3s;
}
.cursor__ring svg { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); overflow: visible; }
.cursor__hold { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 100; stroke-dashoffset: 100; vector-effect: non-scaling-stroke; }
.cursor.is-magnetic .cursor__ring { border-color: var(--accent); border-radius: 30px; }
.cursor.is-grab .cursor__ring { border-color: var(--accent); }
.cursor.is-pressed .cursor__ring { border-color: var(--ink); }
.cursor__label {
    position: fixed; left: 0; top: 0; padding: 4px 8px; font-size: 9px; color: #060606; background: var(--accent);
    white-space: nowrap; opacity: 0; transform-origin: 0 0; transition: opacity .2s;
}
.cursor.has-label .cursor__label { opacity: 1; }

/* ==========================================================================
   Holographic panels & controls
   ========================================================================== */
.holo {
    --mx: 50%; --my: 50%;
    position: relative;
    background:
        linear-gradient(135deg, rgba(var(--accent-rgb), .07), transparent 40%),
        var(--glass);
    border: 1px solid rgba(var(--accent-rgb), .28);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    backdrop-filter: blur(16px) saturate(130%);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
    transform-style: preserve-3d;
    will-change: transform;
}
.holo::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px);
}
.holo__glare {
    position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
    background: radial-gradient(420px circle at var(--mx) var(--my), rgba(var(--accent-rgb), .2), transparent 45%);
}
.holo:hover .holo__glare { opacity: 1; }
.holo__scan {
    position: absolute; left: 0; right: 0; top: 0; height: 40%; pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), .07), transparent);
    animation: scan 5s linear infinite;
}
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(260%); } }
.holo__head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 10px; }
.holo__status { color: var(--accent); }
.holo__status.is-alert { color: var(--danger); animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

.ctl { display: block; margin-bottom: 16px; }
.ctl__label { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 10px; margin-bottom: 8px; }
.ctl__label b { color: var(--ink); font-weight: 500; }
.ctl--row { display: flex; gap: 8px; }

input[type="range"] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0;
    --fill: 45%;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 2px; background: linear-gradient(90deg, var(--accent) var(--fill), var(--line-2) var(--fill));
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 0; transform: rotate(45deg);
    background: var(--bg); border: 1px solid var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), .7);
}
input[type="range"]::-moz-range-thumb {
    width: 12px; height: 12px; border-radius: 0; transform: rotate(45deg); background: var(--bg);
    border: 1px solid var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), .7);
}

.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line-2); }
.seg button { padding: 9px 0; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--ink-2); transition: background .3s, color .3s; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-checked="true"] { background: var(--accent); color: #060606; }
.tog { flex: 1; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line-2); font-size: 10px; color: var(--ink-2); }
.tog i { width: 22px; height: 10px; border: 1px solid var(--ink-3); position: relative; flex: none; }
.tog i::after { content: ''; position: absolute; left: 1px; top: 1px; width: 6px; height: 6px; background: var(--ink-3); transition: transform .3s var(--ease), background .3s; }
.tog[aria-pressed="true"] { color: var(--ink); border-color: rgba(var(--accent-rgb), .6); }
.tog[aria-pressed="true"] i::after { transform: translateX(12px); background: var(--accent); }
.tog > * { pointer-events: none; }
.btn-purge {
    width: 100%; padding: 12px; border: 1px solid var(--danger); color: var(--danger); font-size: 10px;
    background: repeating-linear-gradient(-45deg, rgba(255, 59, 48, .08) 0 6px, transparent 6px 12px);
    transition: background-color .3s, color .3s;
}
.btn-purge:hover { background-color: var(--danger); color: #060606; }

/* Tilt cards -------------------------------------------------------------- */
.tilt-card {
    --mx: 50%; --my: 50%;
    position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px;
    background: rgba(8, 9, 11, .42); border: 1px solid var(--line-2);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    transform-style: preserve-3d; will-change: transform; overflow: hidden;
}
.tilt-card__glare {
    position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(300px circle at var(--mx) var(--my), rgba(255, 255, 255, .14), transparent 50%);
    opacity: 0; transition: opacity .4s;
}
.tilt-card:hover .tilt-card__glare { opacity: 1; }
.tilt-card__k { color: var(--accent); font-size: 9px; }
.tilt-card__v { font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 2.4vw, 34px); letter-spacing: -0.02em; transform: translateZ(30px); }
.tilt-card__d { color: var(--ink-2); font-size: 12px; line-height: 1.4; transform: translateZ(14px); }

/* ==========================================================================
   W01 — Awakening
   ========================================================================== */
.aw-hero {
    position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--hud-h) + 4vh);
}
.aw-kicker { display: flex; align-items: center; gap: 14px; color: var(--ink-2); margin-bottom: 1.6vh; }
.aw-kicker__line { width: 64px; height: 1px; background: var(--accent); }
.aw-title {
    font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
    font-size: clamp(54px, 14.6vw, 250px); line-height: .84; letter-spacing: -0.045em;
    perspective: 900px; margin-left: -0.04em;
}
.aw-title[data-liquid-active] { filter: url(#liquid); }
.aw-title__row { display: block; }
.aw-title__row--outline { color: transparent; -webkit-text-stroke: 1.4px var(--ink); padding-left: 0.62em; }
.aw-sub { max-width: 430px; margin-top: 2.4vh; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.aw-actions { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 2vh; color: var(--ink-3); font-size: 10px; }
.aw-actions li { display: flex; align-items: center; gap: 8px; }
.aw-actions i { width: 5px; height: 5px; background: var(--accent); transform: rotate(45deg); }
.aw-scroll {
    position: absolute; right: calc(var(--gutter) + 40px); bottom: calc(var(--hud-h) + 4vh);
    display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--ink-3); font-size: 9px;
    writing-mode: vertical-rl;
}
.aw-scroll svg { width: 10px; height: 64px; writing-mode: horizontal-tb; }
.aw-scroll__track { stroke: var(--line-2); }
.aw-scroll__pulse { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 14 64; animation: pulse-down 1.8s var(--ease-in-out) infinite; }
@keyframes pulse-down { from { stroke-dashoffset: 14; } to { stroke-dashoffset: -64; } }

.aw-manifesto {
    position: absolute; right: calc(var(--gutter) + 48px); top: 22vh; width: min(560px, 52vw);
    visibility: hidden;
}
.aw-manifesto__text {
    font-family: var(--font-display); font-weight: 300; font-size: clamp(24px, 2.9vw, 46px); line-height: 1.22; letter-spacing: -0.02em;
}
.mood {
    position: relative; display: inline-block; font-weight: 600; color: var(--accent); font-size: inherit; letter-spacing: inherit;
    font-family: inherit; line-height: inherit;
}
.mood::after { content: ''; position: absolute; left: 0; right: 0; bottom: .06em; height: 1px; background: currentColor; transform-origin: left; transition: transform .5s var(--ease); }
.mood:hover::after, .mood:focus-visible::after { transform: scaleX(0); transform-origin: right; }
.mood.is-on { color: var(--ink); text-shadow: 0 0 22px rgba(var(--accent-rgb), .9); }
.aw-manifesto__hint { margin-top: 18px; color: var(--ink-3); font-size: 10px; }
.aw-cards {
    position: absolute; left: var(--gutter); bottom: calc(var(--hud-h) + 4vh);
    display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 14px; perspective: 900px;
    visibility: hidden;
}

/* ==========================================================================
   W02 — Void
   ========================================================================== */
.vd-head { position: absolute; left: var(--gutter); top: calc(var(--top-h) + 4vh); color: var(--ink-2); }
.vd-title {
    margin-top: 10px; font-family: var(--font-display); font-weight: 200; text-transform: uppercase;
    font-size: clamp(44px, 8.4vw, 150px); line-height: .9; letter-spacing: -0.03em; color: var(--ink);
    perspective: 700px;
}
.vd-depth {
    position: absolute; right: calc(var(--gutter) + 48px); top: calc(var(--top-h) + 4vh);
    display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 4px 8px; color: var(--ink-3); text-align: right;
}
.vd-depth__k { grid-column: 1 / -1; }
.vd-depth b { font-family: var(--font-display); font-weight: 300; font-size: clamp(30px, 4vw, 58px); color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.vd-depth__scale { grid-column: 1 / -1; position: relative; height: 1px; background: var(--line); margin-top: 8px; }
.vd-depth__scale i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.vd-structure {
    position: absolute; left: var(--gutter); bottom: calc(var(--hud-h) + 5vh);
    display: flex; flex-direction: column; gap: 6px; color: var(--ink-3);
}
.vd-structure b { font-family: var(--font-display); font-size: clamp(16px, 1.6vw, 24px); letter-spacing: .06em; color: var(--ink); font-weight: 400; }
.vd-structure__d { color: var(--accent); }
.vd-lines { position: absolute; left: 50%; top: 50%; width: min(760px, 86vw); transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.vd-line {
    position: absolute; left: 0; right: 0; top: 0; transform: translateY(-50%);
    font-family: var(--font-display); font-weight: 300; font-size: clamp(22px, 3vw, 44px); line-height: 1.2; letter-spacing: -0.015em;
    opacity: 0; filter: blur(12px);
}
.vd-whisper {
    position: absolute; left: 50%; bottom: calc(var(--hud-h) + 5vh); transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-3); text-align: center;
}
.vd-whisper__line { font-size: 16px; color: var(--accent); letter-spacing: .3em; min-height: 1.4em; }
.vd-whisper__line output { color: var(--ink); }
.caret { display: inline-block; width: .55em; height: 1em; vertical-align: -0.12em; background: var(--accent); animation: blink 1s steps(2) infinite; margin-left: 2px; }
.vd-whisper__input { display: none; }
.vd-whisper__input input {
    width: 220px; padding: 10px 14px; border: 1px solid var(--line-2); background: rgba(3, 4, 5, .5); text-align: center;
    font-family: var(--font-mono); letter-spacing: .25em; text-transform: uppercase; font-size: 13px; outline: none;
}
.vd-whisper__input input:focus { border-color: var(--accent); }
html.is-touch .vd-whisper__input { display: block; }
html.is-touch .vd-whisper__line { display: none; }

/* ==========================================================================
   W03 — Machine
   ========================================================================== */
.mc-head { position: absolute; left: var(--gutter); top: calc(var(--top-h) + 3vh); color: var(--ink-2); max-width: 600px; }
.mc-title {
    margin: 8px 0 12px; font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
    font-size: clamp(36px, 6vw, 104px); line-height: .9; letter-spacing: -0.035em; color: var(--ink);
    perspective: 600px;
}
.mc-title .c { transform-origin: 50% 50% -20px; }
.mc-sub { max-width: 360px; font-size: 14px; }
.mc-panels {
    position: absolute; left: var(--gutter); right: calc(var(--gutter) + 48px); bottom: calc(var(--hud-h) + 3vh);
    display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; pointer-events: none; perspective: 1200px;
}
.mc-panel { pointer-events: auto; width: 300px; padding: 16px 18px 18px; }
.mc-panel--telemetry { width: 340px; }
.mc-panels-toggle { display: none; }
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gauge { position: relative; }
.gauge svg { display: block; width: 100%; height: auto; transform: rotate(135deg); overflow: visible; }
.gauge circle { fill: none; }
.gauge__track { stroke: var(--line-2); stroke-width: 3; stroke-dasharray: 75 100; }
.gauge__arc { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 0 100; filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), .8)); }
.gauge__ticks { stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: .4 2.1; opacity: .6; }
.gauge__needle { stroke: var(--ink); stroke-width: 1; transform-origin: 50px 50px; transform: rotate(90deg); }
.gauge figcaption { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 8px; color: var(--ink-3); padding-top: 4px; }
.gauge figcaption b { font-size: 14px; color: var(--ink); font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.scope { display: block; width: 100%; height: 64px; margin: 12px 0 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mc-log { height: 74px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; font-size: 9px; color: var(--ink-3); letter-spacing: .06em; }
.mc-log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-log li b { color: var(--accent); font-weight: 500; }

/* ==========================================================================
   W04 — Dimension
   ========================================================================== */
.dm-head { position: absolute; left: var(--gutter); top: calc(var(--top-h) + 3vh); color: var(--ink-2); }
.dm-title {
    margin-top: 8px; font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
    font-size: clamp(30px, 5vw, 84px); line-height: .9; letter-spacing: -0.04em; color: var(--ink); perspective: 600px;
    mix-blend-mode: difference;
}
.dm-statements { position: absolute; inset: 0; pointer-events: none; perspective: 1000px; }
.dm-statement {
    position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; padding: 0 var(--gutter);
    font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.04em; line-height: .92;
    font-size: clamp(40px, 8.6vw, 160px); visibility: hidden; transform-style: preserve-3d;
    mix-blend-mode: difference; color: #fff;
}
.dm-statement__text { display: inline-block; transform-style: preserve-3d; }
.dm-statement .c { transform-origin: 50% 50%; backface-visibility: visible; }
.dm-align {
    position: absolute; left: 50%; bottom: calc(var(--hud-h) + 6vh); transform: translateX(-50%);
    display: grid; grid-template-columns: auto auto; align-items: center; gap: 8px 16px; padding: 12px 18px;
    background: rgba(3, 4, 5, .5); border: 1px solid var(--line-2); color: var(--ink-3);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.dm-align b { font-size: 18px; color: var(--ink); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.dm-align__bar { grid-column: 1 / -1; position: relative; width: 260px; height: 2px; background: var(--line-2); }
.dm-align__bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.dm-align__state { grid-column: 1 / -1; text-align: center; font-size: 10px; }
.dm-align.is-locked { border-color: var(--accent); box-shadow: 0 0 30px rgba(var(--accent-rgb), .35); }
.dm-align.is-locked .dm-align__state { color: var(--accent); }
.dm-hint { position: absolute; left: 50%; bottom: calc(var(--hud-h) + 1.5vh); transform: translateX(-50%); color: var(--ink-3); font-size: 9px; white-space: nowrap; }

/* ==========================================================================
   W05 — Singularity
   ========================================================================== */
.sg-head { position: absolute; left: var(--gutter); top: calc(var(--top-h) + 3vh); color: var(--ink-2); max-width: 560px; }
.sg-title {
    margin: 8px 0 12px; font-family: var(--font-display); font-weight: 300; text-transform: uppercase;
    font-size: clamp(30px, 5.2vw, 90px); line-height: .92; letter-spacing: -0.035em; color: var(--ink); perspective: 800px;
}
.sg-sub { max-width: 380px; font-size: 14px; }
.sg-metrics { position: absolute; left: var(--gutter); top: 40%; width: 290px; padding: 14px 18px; font-size: 9px; }
.sg-metrics dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.sg-metrics dl > div:last-child { border-bottom: 0; }
.sg-metrics dt { color: var(--ink-3); }
.sg-metrics dd { color: var(--ink); font-variant-numeric: tabular-nums; }
.sg-uplink { position: absolute; left: var(--gutter); bottom: calc(var(--hud-h) + 2vh); width: min(520px, 44vw); padding: 14px 18px 16px; }
.sg-uplink-toggle { display: none; }
.sg-form { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: end; }
.sg-field { display: flex; flex-direction: column; gap: 6px; color: var(--ink-3); }
.sg-field input {
    width: 100%; padding: 10px 12px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line-2); outline: none;
    font-size: 13px; transition: border-color .3s;
}
.sg-field input:focus { border-color: var(--accent); }
.btn-transmit { height: 40px; padding: 0 18px; border: 1px solid var(--accent); color: var(--accent); font-size: 10px; transition: background .3s, color .3s; }
.btn-transmit:hover, .btn-transmit:focus-visible { background: var(--accent); color: #060606; }
.btn-transmit[disabled] { opacity: .4; pointer-events: none; }
.sg-form__status { grid-column: 1 / -1; min-height: 1.4em; font-size: 9px; color: var(--ink-3); }
.sg-form__status.is-error { color: var(--danger); }
.sg-form__status.is-ok { color: var(--accent); }
.sg-feed { margin-top: 6px; max-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; }
.sg-feed li { display: grid; grid-template-columns: auto 1fr; gap: 10px; font-size: 13px; color: var(--ink-2); }
.sg-feed li b { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--accent); font-weight: 500; padding-top: 2px; }
.sg-feed li.is-new { animation: feed-in 1s var(--ease); }
@keyframes feed-in { from { opacity: 0; transform: translateX(-12px); filter: blur(6px); } }

.collapse-btn {
    position: absolute; right: calc(var(--gutter) + 56px); bottom: calc(var(--hud-h) + 3vh);
    width: 128px; height: 128px; display: grid; place-items: center; border-radius: 50%;
    -webkit-user-select: none; user-select: none; touch-action: none;
}
.collapse-btn svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.collapse-btn circle { fill: none; }
.collapse-btn__ticks { stroke: var(--line-2); stroke-dasharray: 1 5; transform-origin: 60px 60px; animation: spin 20s linear infinite; }
.collapse-btn__track { stroke: var(--line-2); stroke-width: 1; }
.collapse-btn__arc { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 100; stroke-dashoffset: 100; filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), .9)); }
.collapse-btn__label { position: relative; font-size: 9px; line-height: 1.6; text-align: center; pointer-events: none; }
.collapse-btn:hover .collapse-btn__track { stroke: var(--accent); }
.collapse-btn.is-holding { animation: shake .08s linear infinite; }
@keyframes shake { 25% { transform: translate(1px, -1px); } 50% { transform: translate(-1px, 1px); } 75% { transform: translate(1px, 1px); } }

.finale {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
    text-align: center; padding: var(--top-h) var(--gutter) var(--hud-h);
}
.finale[hidden] { display: none; }
.finale__kicker { color: var(--accent); }
.finale__title {
    font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.04em; line-height: .9;
    font-size: clamp(36px, 8vw, 140px);
}
.finale__stats { display: grid; grid-template-columns: repeat(4, auto); gap: 10px 36px; color: var(--ink-3); font-size: 9px; }
.finale__stats dd { margin-top: 6px; font-size: 15px; color: var(--ink); letter-spacing: .04em; }

/* ==========================================================================
   Map overlay (CSS 3D navigator)
   ========================================================================== */
.map {
    position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
    background: radial-gradient(ellipse at 50% 60%, rgba(var(--accent-rgb), .12), rgba(2, 2, 3, .9) 60%);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    clip-path: circle(0% at var(--ox, 90%) var(--oy, 5%));
}
.map[hidden] { display: none; }
.map__head { display: flex; align-items: center; gap: 24px; padding: 26px var(--gutter); color: var(--ink-2); }
.map__help { color: var(--ink-3); font-size: 10px; margin-left: auto; }
.map__close { padding: 10px 16px; border: 1px solid var(--line-2); border-radius: 40px; font-size: 10px; }
.map__close:hover { border-color: var(--accent); }
.map__stage { position: relative; flex: 1; perspective: 1400px; touch-action: none; overflow: hidden; }
.map__ring {
    position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d;
}
.portal {
    --w: clamp(220px, 22vw, 300px);
    position: absolute; left: calc(var(--w) / -2); top: calc(var(--w) * -0.7);
    width: var(--w); height: calc(var(--w) * 1.4);
    display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 8px; padding: 22px;
    text-align: left; border: 1px solid var(--line-2);
    background: linear-gradient(180deg, rgba(14, 15, 18, .3), rgba(6, 6, 8, .92));
    transform-style: preserve-3d; backface-visibility: hidden;
    transition: border-color .4s, box-shadow .4s;
}
.portal.is-front { border-color: var(--accent); box-shadow: 0 0 60px rgba(var(--accent-rgb), .25), inset 0 0 40px rgba(var(--accent-rgb), .08); }
.portal > * { pointer-events: none; }
.portal__emblem { position: absolute; left: 50%; top: 18%; width: 52%; transform: translateX(-50%) translateZ(40px); }
.portal__emblem svg { width: 100%; height: auto; overflow: visible; }
.portal__emblem .e-line { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.portal__emblem .e-fill { fill: var(--accent); }
.portal__emblem .e-void { fill: #000; stroke: var(--accent); stroke-width: 1; }
.portal__emblem .e-glow { stroke: var(--accent); }
.portal__emblem .e-dots circle { fill: var(--ink); }
.portal__emblem .e-spin, .portal__emblem .e-orbit { transform-origin: 50px 50px; animation: spin 10s linear infinite; }
.portal__emblem .e-orbit { animation-duration: 4s; }
.portal__idx { color: var(--accent); }
.portal__name { font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.05; text-transform: uppercase; letter-spacing: -0.01em; }
.portal__desc { color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.map__foot { padding: 0 var(--gutter) 30px; text-align: center; color: var(--ink-2); }

/* ==========================================================================
   Fallback (no WebGL) & noscript
   ========================================================================== */
.noscript { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; background: #030405; padding: 24px; text-align: center; }
html.no-webgl #gl { display: none; }
html.no-webgl .world { overflow: hidden; }
html.no-webgl .world::before {
    content: ''; position: absolute; inset: 0; z-index: -1; opacity: .9;
    background: radial-gradient(ellipse at 70% 40%, var(--fb1, #3b1a08), transparent 60%), radial-gradient(ellipse at 20% 80%, var(--fb2, #0a2a2a), transparent 55%), #030405;
    animation: fb-drift 18s ease-in-out infinite alternate;
}
html.no-webgl .world--void { --fb1: #0b1a2c; --fb2: #050c18; }
html.no-webgl .world--machine { --fb1: #062a24; --fb2: #2a1406; }
html.no-webgl .world--dimension { --fb1: #2a3306; --fb2: #2a0618; }
html.no-webgl .world--singularity { --fb1: #3a2006; --fb2: #1a0606; }
@keyframes fb-drift { to { transform: scale(1.25) rotate(4deg); } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
    .hud__coords { display: none; }
    .nav__label { font-size: 12px; }
    .nav__link { padding: 10px 10px; }
}

@media (max-width: 900px) {
    :root { --top-h: 64px; --hud-h: 54px; }
    .nav { display: none; }
    .topbar__tools { margin-left: auto; }
    .sound-btn__label { display: none; }
    .rail { display: none; }
    .hud { gap: 12px; }
    .hud__velocity, .hud__time { display: none; }
    .hud__world { min-width: 0; }
    .hud__tools { margin-left: auto; }
    .hud-btn[data-motion-toggle] { display: none; }

    .aw-title__row--outline { padding-left: 0.3em; }
    .aw-scroll { display: none; }
    .aw-manifesto { left: var(--gutter); right: var(--gutter); width: auto; top: calc(var(--top-h) + 4vh); }
    .aw-cards { left: var(--gutter); right: var(--gutter); grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .tilt-card { padding: 12px; }
    .tilt-card__d { display: none; }

    .vd-depth { right: var(--gutter); }

    .mc-panels-toggle {
        display: block; position: absolute; right: var(--gutter); top: calc(var(--top-h) + 3vh);
        padding: 10px 14px; border: 1px solid var(--accent); color: var(--accent); background: rgba(3, 4, 5, .5); font-size: 10px; z-index: 3;
    }
    .mc-panels {
        left: 0; right: 0; bottom: var(--hud-h); flex-direction: column; align-items: stretch; gap: 10px;
        padding: 0 var(--gutter) 10px; max-height: calc(100% - var(--top-h) - var(--hud-h) - 90px); overflow-y: auto;
        translate: 0 115%; transition: translate .6s var(--ease); pointer-events: auto;
        overscroll-behavior: contain;
    }
    .mc-panels.is-open { translate: 0 0; }
    .mc-panel, .mc-panel--telemetry { width: 100%; }

    .sg-metrics { top: auto; bottom: calc(var(--hud-h) + 150px); width: calc(100% - 2 * var(--gutter)); }
    .sg-metrics dl { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
    .sg-metrics dl > div { flex-direction: column; gap: 2px; }
    .sg-uplink-toggle {
        display: block; position: absolute; left: var(--gutter); bottom: calc(var(--hud-h) + 60px);
        padding: 12px 16px; border: 1px solid var(--accent); color: var(--accent); background: rgba(3, 4, 5, .5); font-size: 10px;
    }
    .sg-uplink {
        left: 0; right: 0; width: auto; bottom: var(--hud-h); margin: 0 var(--gutter) 8px; z-index: 4;
        translate: 0 135%; transition: translate .6s var(--ease);
    }
    .sg-uplink.is-open { translate: 0 0; }
    .sg-form { grid-template-columns: 1fr; }
    .collapse-btn { right: var(--gutter); bottom: calc(var(--hud-h) + 22px); width: 104px; height: 104px; }
    .finale__stats { grid-template-columns: repeat(2, auto); }

    .dm-align__bar { width: 200px; }
    .dm-hint { white-space: normal; text-align: center; width: 90%; }
}

@media (max-width: 560px) {
    .brand__text { display: none; }
    .aw-sub { font-size: 14px; }
    .aw-actions { display: none; }
    .vd-structure { bottom: calc(var(--hud-h) + 120px); }
    .portal { --w: 66vw; }
    .map__help { display: none; }
    .loader__log { left: 20px; bottom: 24px; }
    .loader__top { left: 20px; right: 20px; }
    .hud-btn { padding: 0 9px; }
}

@media (max-height: 640px) and (min-width: 901px) {
    .aw-cards { display: none; }
    .mc-log { display: none; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
html.reduce-motion .grain,
html.reduce-motion .holo__scan,
html.reduce-motion .loader__ticks,
html.reduce-motion .loader__inner,
html.reduce-motion .brand__orbit,
html.reduce-motion .brand__moon { animation: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
