/* ============================================================
   SUNFARERS — console shell stylesheet
   Structure:
     1. Tokens
     2. Base + backdrop
     3. Console shell (header / nav / main / status / footer)
     4. Section furniture (headers, leads, quotes, cards, buttons)
     5. Panel-specific components
     6. Motion + reveal
     7. Responsive
   ============================================================ */

/* ===== 1. TOKENS =====
   Colour sources: SpaceSimMenuTheme.cs (gold #FFD66B, light purple #C9A0FF,
   salmon #FFB36B, utility violet #AD75FF, station teal #42EBBD, combat orange
   #FF7A29) over the game's crimson nebula space. Fonts are the in-game trio:
   Tektur (readouts), Alegreya Sans (text), Barlow Condensed (Command Deck). */
:root {
    /* surfaces — crimson-black, like the game's red nebula space */
    --bg: #10060b;
    --bg-lift: #180a10;
    --line: rgba(201, 160, 255, 0.13);
    --line-soft: rgba(201, 160, 255, 0.07);
    --surface: rgba(201, 160, 255, 0.035);
    --surface-hi: rgba(201, 160, 255, 0.065);

    /* ink */
    --text: #ece3d6;
    --body-text: rgba(236, 227, 214, 0.84);
    --dim: rgba(236, 227, 214, 0.58);
    --faint: rgba(236, 227, 214, 0.34);

    /* brand — instrument palette from the game HUD */
    --purple: #c9a0ff;
    --glow: #d879ff;
    --gold: #ffd66b;
    /* magenta panel-border triplet, like the game's hand-drawn UI frames */
    --panel-line-rgb: 216, 121, 255;

    /* per-section accent, driven by app.js */
    --accent-rgb: 255, 214, 107;
    --accent: rgb(var(--accent-rgb));

    /* type */
    --f-display: 'Tektur', sans-serif;
    --f-body: 'Alegreya Sans', system-ui, sans-serif;
    --f-mono: 'Tektur', ui-monospace, monospace;
    --f-cond: 'Barlow Condensed', sans-serif;

    --t-display: clamp(2.2rem, 4.9vw, 4.3rem);
    --t-title: clamp(1.5rem, 3.1vw, 2.45rem);
    --t-lead: clamp(1rem, 1.2vw, 1.16rem);
    --t-body: clamp(0.94rem, 1.02vw, 1.02rem);
    --t-h3: clamp(0.72rem, 1.05vw, 0.86rem);
    --t-label: clamp(0.56rem, 0.78vw, 0.68rem);

    /* rhythm */
    --gap: clamp(1rem, 1.9vw, 1.5rem);
    --block: clamp(1.9rem, 3.2vw, 2.8rem);
    --measure: 68ch;
    --content-w: 940px;

    /* motion */
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

/* ===== 2. BASE + BACKDROP ===== */
html, body { height: 100%; overflow: hidden }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--f-body);
    font-weight: 400;
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
}

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0 }

/* Film layer: scanlines + grain + edge vignette. Purely decorative. */
.film {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    background:
        repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0, 0, 0, 0.018) 3px 6px),
        radial-gradient(ellipse 120% 90% at 50% 45%, transparent 55%, rgba(10, 3, 7, 0.55) 100%);
}

.film::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.035;
    mix-blend-mode: overlay;
    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'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Instrument corner brackets on the viewport frame. */
.frame-corner {
    position: fixed;
    width: 22px;
    height: 22px;
    z-index: 99;
    pointer-events: none;
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    transition: border-color 0.6s var(--ease);
}
.frame-tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0 }
.frame-tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0 }
.frame-bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0 }
.frame-br { bottom: 10px; right: 10px; border-left: 0; border-top: 0 }

::selection { background: rgba(var(--accent-rgb), 0.3); color: var(--text) }

:focus-visible {
    outline: 1px solid rgba(var(--accent-rgb), 0.75);
    outline-offset: 3px;
}

/* ===== 3. CONSOLE SHELL ===== */
.console {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    /* minmax(0,...) not 1fr: a bare 1fr is minmax(auto,1fr), whose auto floor
       is the widest child's min-content width — that inflated the column past
       the viewport on narrow screens and pushed every panel off-screen. */
    grid-template-columns: minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    width: 100vw;
}

/* --- header --- */
/* Every child is placed explicitly. .scroll-veil shares row 3 with the main
   panel, and a single explicitly-placed child makes grid auto-placement skip
   that cell for its siblings — so nothing here may rely on auto-placement. */
.console-header { grid-row: 1; grid-column: 1 }
.sidebar { grid-row: 2; grid-column: 1 }
.main-panel { grid-row: 3; grid-column: 1 }
.scroll-veil { grid-row: 3; grid-column: 1 }
.status-bar { grid-row: 4; grid-column: 1 }
.console-footer { grid-row: 5; grid-column: 1 }

.console-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.18rem;
    padding: 0.7rem 1.5rem 0.85rem;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(24, 9, 17, 0.82), rgba(18, 6, 12, 0.62));
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

/* warm flare behind the wordmark */
.console-header::before {
    content: '';
    position: absolute;
    inset: -140% -20% 35% -20%;
    background: radial-gradient(ellipse at center,
        rgba(255, 214, 107, 0.2) 0%, rgba(255, 214, 107, 0.06) 30%, transparent 66%);
    filter: blur(14px);
    animation: headerFlare 11s ease-in-out infinite;
    pointer-events: none;
}

/* accent hairline that re-tints per section */
.console-header::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(var(--accent-rgb), 0.08) 25%,
        rgba(var(--accent-rgb), 0.55) 50%,
        rgba(var(--accent-rgb), 0.08) 75%,
        transparent 100%);
    transition: background 0.6s var(--ease);
}

.header-sun {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(100px, 15vw, 200px);
    height: clamp(100px, 15vw, 200px);
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 228, 160, 0.2) 0%, rgba(245, 189, 79, 0.1) 15%,
        rgba(245, 189, 79, 0.04) 30%, transparent 68%);
    animation: sunPulse 5.2s ease-in-out infinite;
    pointer-events: none;
}

.header-tagline {
    font-size: clamp(0.6rem, 1vw, 0.72rem);
    letter-spacing: 0.2em;
    font-style: italic;
    color: rgba(236, 227, 214, 0.6);
    text-shadow: 0 0 18px rgba(255, 214, 107, 0.22);
    position: relative;
    z-index: 1;
}

.header-title {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(1.2rem, 2.7vw, 1.85rem);
    line-height: 1.1;
    letter-spacing: 0.17em;
    padding-left: 0.17em;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 1;
    color: transparent;
    background: linear-gradient(130deg, #f0e2cc 12%, #ffd66b 48%, #c9a0ff 86%);
    background-size: 190% 190%;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 30px rgba(192, 132, 252, 0.2), 0 0 44px rgba(255, 214, 107, 0.22);
    animation: headerTitleShift 9s ease-in-out infinite;
}

/* RGB-split glitch layers driven from app.js */
.header-title::before,
.header-title::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.header-title::before {
    color: rgba(255, 50, 50, 0.75);
    clip-path: inset(var(--g-t1, 100%) 0 var(--g-b1, 0%) 0);
    transform: translate(var(--g-x1, 0px), 0) skewX(var(--g-sk1, 0deg));
}
.header-title::after {
    color: rgba(50, 220, 210, 0.75);
    clip-path: inset(var(--g-t2, 100%) 0 var(--g-b2, 0%) 0);
    transform: translate(var(--g-x2, 0px), 0) skewX(var(--g-sk2, 0deg));
}

.header-sub {
    font-family: var(--f-display);
    font-size: clamp(0.5rem, 0.85vw, 0.64rem);
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: rgba(201, 160, 255, 0.72);
    text-shadow: 0 0 14px rgba(201, 160, 255, 0.24);
    position: relative;
    z-index: 1;
}

/* --- tab rail --- */
.sidebar {
    display: flex;
    align-items: stretch;
    /* Centred via auto margins rather than justify-content:center — centred
       flex overflow spills off both edges and the leading tabs become
       unreachable by scrolling. Auto margins collapse to 0 when it overflows. */
    justify-content: flex-start;
    padding: 0 0.4rem;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(18, 6, 12, 0.66);
    backdrop-filter: blur(8px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    position: relative;
}
.sidebar::-webkit-scrollbar { display: none }
.sidebar > :first-child { margin-left: auto }
.sidebar > :last-child { margin-right: auto }
.sidebar.scroll-right { box-shadow: inset -26px 0 18px -14px rgba(13, 4, 9, 0.85) }
.sidebar.scroll-left { box-shadow: inset 26px 0 18px -14px rgba(13, 4, 9, 0.85) }
.sidebar.scroll-left.scroll-right {
    box-shadow: inset -26px 0 18px -14px rgba(13, 4, 9, 0.85),
                inset 26px 0 18px -14px rgba(13, 4, 9, 0.85);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 46px;
    padding: 0.7rem 0.95rem;
    /* Barlow Condensed, like the game's Command Deck hotbar buttons */
    font-family: var(--f-cond);
    font-weight: 500;
    font-size: clamp(0.74rem, 1vw, 0.88rem);
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--dim);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav-item:hover { color: var(--text); background: rgba(201, 160, 255, 0.05) }
.nav-item.active {
    color: var(--accent);
    background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.09));
    border-bottom-color: var(--accent);
}
.nav-item.active::after {
    content: '';
    position: absolute;
    left: 20%; right: 20%; bottom: -2px;
    height: 2px;
    background: var(--accent);
    filter: blur(4px);
    opacity: 0.9;
}
.nav-icon { font-size: 0.85rem; opacity: 0.45; transition: opacity 0.25s var(--ease) }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { opacity: 0.95 }

/* --- scrolling main region --- */
.main-panel {
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding: clamp(1.8rem, 3.4vw, 3.2rem) clamp(1rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-rgb), 0.22) transparent;
    scroll-behavior: smooth;
}
.main-panel::-webkit-scrollbar { width: 7px }
.main-panel::-webkit-scrollbar-track { background: transparent }
.main-panel::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), 0.22);
    border-radius: 4px;
}
.main-panel::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb), 0.4) }

.main-panel.tour-mode { padding: 0; overflow: hidden }

/* Bottom fade so cut-off content reads as "more below". It shares the grid
   cell with .main-panel rather than living inside it — an absolutely
   positioned child of a scroll container scrolls with the content. */
.scroll-veil {
    align-self: end;
    width: 100%;
    height: 84px;
    z-index: 9;
    pointer-events: none;
    background: linear-gradient(to top, rgba(16, 5, 11, 0.95) 10%, rgba(16, 5, 11, 0.55) 55%, transparent);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
}
.console.can-scroll .scroll-veil { opacity: 1 }

.panel {
    display: none;
    width: 100%;
    max-width: var(--content-w);
    margin: 0 auto;
}
.panel.active { display: block; animation: panelIn 0.5s var(--ease) both }

/* --- status bar --- */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.42rem 1.2rem;
    border-top: 1px solid var(--line-soft);
    background: rgba(18, 6, 12, 0.75);
    backdrop-filter: blur(8px);
    min-height: 1.9rem;
}
.status-text {
    font-family: var(--f-mono);
    font-size: clamp(0.55rem, 0.82vw, 0.68rem);
    color: rgba(var(--accent-rgb), 0.62);
    letter-spacing: 0.03em;
    transition: color 0.5s var(--ease);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.status-text.crack { color: rgba(201, 160, 255, 0.5); font-style: italic }
.status-caret {
    display: inline-block;
    width: 0.5em;
    height: 0.95em;
    margin-left: 2px;
    background: rgba(var(--accent-rgb), 0.6);
    vertical-align: text-bottom;
    animation: blink 1.05s step-end infinite;
}
.status-meta {
    font-family: var(--f-mono);
    font-size: clamp(0.5rem, 0.74vw, 0.6rem);
    letter-spacing: 0.16em;
    color: var(--faint);
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- footer --- */
.console-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    padding: 0.55rem 1.2rem;
    border-top: 1px solid var(--line-soft);
    background: rgba(18, 6, 12, 0.72);
    backdrop-filter: blur(8px);
    flex-wrap: wrap;
}
.footer-left { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; justify-content: center }
.footer-copy { font-size: 0.6rem; color: rgba(236, 227, 214, 0.26); letter-spacing: 0.06em }

.footer-signup-form { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap }
.footer-signup-label {
    font-family: var(--f-display);
    font-size: 0.5rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(201, 160, 255, 0.62);
}
.footer-signup-row { display: flex; align-items: stretch }
.footer-signup-input {
    width: min(290px, 52vw);
    min-width: 0;
    font-family: var(--f-mono);
    font-size: 0.66rem;
    letter-spacing: 0.04em;
    color: var(--text);
    background: rgba(201, 160, 255, 0.055);
    border: 1px solid rgba(201, 160, 255, 0.2);
    border-right: 0;
    padding: 0.62em 0.9em;
    outline: none;
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.footer-signup-input::placeholder { color: rgba(236, 227, 214, 0.24) }
.footer-signup-input:focus {
    border-color: rgba(255, 214, 107, 0.45);
    background: rgba(201, 160, 255, 0.09);
}
.footer-signup-btn {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 0.55rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(255, 214, 107, 0.09);
    border: 1px solid rgba(255, 214, 107, 0.32);
    padding: 0.74em 1.2em;
    cursor: pointer;
    transition: background 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}
.footer-signup-btn:hover:not(:disabled) {
    background: rgba(255, 214, 107, 0.17);
    border-color: rgba(255, 214, 107, 0.55);
    box-shadow: 0 0 18px rgba(255, 214, 107, 0.18);
}
.footer-signup-btn:disabled { opacity: 0.45; cursor: default }
.footer-signup-msg {
    font-family: var(--f-mono);
    font-size: 0.58rem;
    min-height: 1em;
    color: rgba(236, 227, 214, 0.45);
}
.footer-signup-msg.success { color: rgba(255, 214, 107, 0.85) }
.footer-signup-msg.error { color: rgba(201, 160, 255, 0.78) }

/* ===== 4. SECTION FURNITURE ===== */

/* Section header: index numeral over kicker over title, centred as a lockup. */
.sec-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.45rem;
    margin-bottom: 1.1rem;
}
.sec-index {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(1.5rem, 3vw, 2.3rem);
    line-height: 0.9;
    letter-spacing: 0.04em;
    color: transparent;
    -webkit-text-stroke: 1px rgba(var(--accent-rgb), 0.45);
    opacity: 0.85;
    user-select: none;
}
/* full width so long titles ("Navigation & Propulsion") stay on one line;
   the kicker below caps itself at the measure so its rules stay tidy */
.sec-head-text { min-width: 0; width: 100% }
.sec-kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    font-family: var(--f-mono);
    font-size: var(--t-label);
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(var(--accent-rgb), 0.72);
    margin: 0 auto 0.45rem;
    max-width: var(--measure);
}
/* symmetric hairlines so the kicker reads as a centred rule */
.sec-kicker::before,
.sec-kicker::after {
    content: '';
    flex: 1;
    height: 1px;
    min-width: 20px;
}
.sec-kicker::before { background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.4)) }
.sec-kicker::after { background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.4), transparent) }
.sec-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: var(--t-title);
    line-height: 1.12;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text);
    text-shadow: 0 0 34px rgba(var(--accent-rgb), 0.22);
}

.sec-lead {
    font-size: var(--t-lead);
    color: var(--body-text);
    line-height: 1.78;
    text-align: center;
    max-width: var(--measure);
    margin: 0 auto clamp(1.6rem, 2.8vw, 2.4rem);
}

.section-sep {
    height: 1px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.22), rgba(201, 160, 255, 0.06) 55%, transparent);
    margin: var(--block) 0;
}

/* body blocks — copy stays left-aligned inside the centred column, as before */
.feature-block { margin-bottom: 2.1rem }
.feature-block:last-child { margin-bottom: 0 }
.feature-block-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--f-display);
    font-size: var(--t-h3);
    letter-spacing: 0.19em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.65rem;
}
.feature-block-title::before {
    content: '';
    width: 14px;
    height: 1px;
    background: rgba(var(--accent-rgb), 0.6);
    flex-shrink: 0;
}
.feature-block p { font-size: var(--t-body); color: var(--body-text); line-height: 1.8 }
.section-top { margin-top: var(--block) }
.feature-followup { margin-top: 0.9rem }

/* pull quotes */
.lore-quote {
    position: relative;
    padding: 1.15rem 1.5rem 1.15rem 1.7rem;
    margin: 1.8rem 0;
    font-style: italic;
    color: rgba(236, 227, 214, 0.66);
    font-size: clamp(0.92rem, 1.05vw, 1.02rem);
    line-height: 1.78;
    max-width: 60ch;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.05), transparent 70%);
    border-left: 1px solid rgba(var(--accent-rgb), 0.4);
}
.lore-quote::before {
    content: '\201C';
    position: absolute;
    top: -0.15em; left: 0.35rem;
    font-family: var(--f-display);
    font-size: 2.4rem;
    line-height: 1;
    color: rgba(var(--accent-rgb), 0.18);
    pointer-events: none;
}
.lore-quote .lore-src {
    display: block;
    margin-top: 0.65rem;
    font-style: normal;
    font-family: var(--f-mono);
    font-size: 0.56rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(var(--accent-rgb), 0.55);
}

/* card grids */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(262px, 1fr));
    gap: var(--gap);
    margin-top: 1.6rem;
}

.feature-card, .home-card {
    position: relative;
    overflow: hidden;
    padding: 1.5rem 1.4rem;
    background: linear-gradient(165deg, rgba(201, 160, 255, 0.055), rgba(20, 8, 14, 0.28));
    border: 1px solid var(--line-soft);
    transition: border-color 0.35s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
/* accent rule along the top edge, lights up on hover */
.feature-card::before, .home-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.65), rgba(var(--accent-rgb), 0.06) 60%, transparent);
    opacity: 0.5;
    transition: opacity 0.35s var(--ease);
}
.feature-card:hover, .home-card:hover {
    border-color: rgba(var(--accent-rgb), 0.28);
    transform: translateY(-3px);
    box-shadow: 0 12px 34px -18px rgba(var(--accent-rgb), 0.5), inset 0 0 40px rgba(var(--accent-rgb), 0.045);
}
.feature-card:hover::before, .home-card:hover::before { opacity: 1 }
/* scan sweep */
.feature-card::after, .home-card::after {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.55), transparent);
    opacity: 0;
    pointer-events: none;
}
.feature-card:hover::after, .home-card:hover::after { animation: scanSweep 0.85s var(--ease) forwards }

.feature-card-title, .home-card-title {
    font-family: var(--f-display);
    font-size: clamp(0.62rem, 0.94vw, 0.75rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.55rem;
}
.feature-card p, .home-card p {
    font-size: clamp(0.88rem, 0.98vw, 0.96rem);
    color: var(--body-text);
    line-height: 1.75;
}

.story-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) }
.story-grid .feature-card { grid-column: span 2 }
.story-grid .feature-card:nth-last-child(-n+2) { grid-column: span 3 }

/* small stat strip used under the hero */
.spec-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 1px;
    margin: 1.9rem auto 0;
    max-width: 620px;
    text-align: center;
    background: var(--line-soft);
    border: 1px solid var(--line-soft);
}
.spec {
    padding: 0.85rem 1rem;
    background: rgba(18, 6, 12, 0.55);
}
.spec dt {
    font-family: var(--f-mono);
    font-size: 0.5rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 0.3rem;
}
.spec dd {
    font-family: var(--f-display);
    font-size: clamp(0.7rem, 1vw, 0.86rem);
    letter-spacing: 0.06em;
    color: rgba(236, 227, 214, 0.82);
}
.spec dd em { font-style: normal; color: var(--accent) }

/* SVG clipart */
.clipart { display: block; margin: 1.4rem auto; max-width: 400px; width: 100% }
.clipart-small { display: block; margin: 1.2rem auto; max-width: 165px; width: 100% }

/* ===== 5. PANEL COMPONENTS ===== */

/* --- HOME: hero --- */
.panel-home { position: relative; max-width: none }

.home-intro {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    opacity: 0;
    visibility: hidden;
    z-index: 3;
    pointer-events: none;
}
.panel-home.intro-playing .home-intro { opacity: 1; visibility: visible }
.home-intro-sun {
    position: absolute;
    width: min(58vw, 560px);
    height: min(58vw, 560px);
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 214, 107, 0.8) 0%, rgba(255, 214, 107, 0.45) 17%,
        rgba(201, 160, 255, 0.18) 40%, rgba(20, 8, 14, 0) 72%);
    filter: blur(10px);
    opacity: 0.22;
    transform: scale(0.45);
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
}
.home-intro-title {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: clamp(2.1rem, 9.5vw, 7rem);
    letter-spacing: 0.2em;
    color: var(--text);
    text-shadow: 0 0 18px rgba(201, 160, 255, 0.34), 0 0 40px rgba(255, 214, 107, 0.2);
    padding-left: 0.2em;
    position: relative;
    z-index: 2;
    will-change: transform, opacity;
    backface-visibility: hidden;
}
.home-intro-tag {
    font-family: var(--f-mono);
    font-size: clamp(0.62rem, 1.5vw, 0.9rem);
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(236, 227, 214, 0.56);
    position: relative;
    z-index: 2;
    will-change: transform, opacity;
    backface-visibility: hidden;
}
.panel-home.intro-playing .home-intro-sun { animation: homeIntroSun 3.6s ease-in-out forwards }
.panel-home.intro-playing .home-intro-title { animation: homeIntroTitle 3.6s ease-in-out forwards }
.panel-home.intro-playing .home-intro-tag { animation: homeIntroTag 3.6s ease-in-out forwards }

.home-content {
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.panel-home.intro-complete .home-content { opacity: 1; transform: none; pointer-events: auto }

/* hero: centred lockup, with the orrery below it (matching the original
   centred home composition, SNOAS columns flanking the orrery) */
.hero {
    max-width: var(--content-w);
    margin: 0 auto;
    text-align: center;
    position: relative;
    isolation: isolate;
}

/* Soft-masked nebula backdrop behind the whole hero lockup + orrery, so the
   first screen leads with the game's actual space instead of a flat field.
   Sits at z-index -1 inside the hero's own stacking context. */
.hero::before {
    content: '';
    position: absolute;
    inset: -3rem -16% -2rem;
    z-index: -1;
    background: url('shots/hero-nebula.jpg') center 42% / cover no-repeat;
    opacity: 0.34;
    -webkit-mask-image: radial-gradient(ellipse 78% 74% at 50% 42%, black 38%, transparent 76%);
    mask-image: radial-gradient(ellipse 78% 74% at 50% 42%, black 38%, transparent 76%);
    pointer-events: none;
}
.hero-copy { position: relative; z-index: 2; min-width: 0 }
.hero-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: var(--f-mono);
    font-size: var(--t-label);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 214, 107, 0.78);
    margin-bottom: 0.9rem;
}
.hero-eyebrow::before,
.hero-eyebrow::after {
    content: '';
    width: clamp(20px, 4vw, 44px);
    height: 1px;
    background: rgba(255, 214, 107, 0.55);
}
.hero-title {
    font-family: var(--f-display);
    font-weight: 900;
    font-size: var(--t-display);
    line-height: 0.96;
    letter-spacing: 0.04em;
    margin-bottom: 0.7rem;
    /* padding-right keeps the gradient box wider than the glyphs: a
       background-clip:text run that overflows its box loses its fill. */
    padding-right: 0.14em;
    color: transparent;
    background: linear-gradient(120deg, #f4e8d2 8%, #ffd66b 42%, #c9a0ff 88%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 60px rgba(192, 132, 252, 0.18);
}
.hero-sub {
    font-family: var(--f-display);
    font-size: clamp(0.62rem, 1.05vw, 0.8rem);
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: rgba(201, 160, 255, 0.8);
    margin-bottom: 1.3rem;
}
.hero-lead {
    font-size: var(--t-lead);
    color: var(--body-text);
    line-height: 1.82;
    max-width: 62ch;
    margin: 0 auto;
}
.hero-lead strong { font-weight: 400; color: var(--text) }

/* orrery sits centred beneath the lockup, flanked by the SNOAS columns */
.hero-orrery-col {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: clamp(1.2rem, 2.4vw, 2rem);
}
.home-orrery {
    position: relative;
    width: min(100%, clamp(280px, 38vw, 500px));
    aspect-ratio: 1;
}
.home-orrery::before {
    content: '';
    position: absolute;
    inset: -20%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 214, 107, 0.12) 0%, rgba(124, 58, 237, 0.08) 40%, transparent 70%);
    pointer-events: none;
}
.home-sun {
    position: absolute;
    top: 50%; left: 50%;
    width: 14px; height: 14px;
    background: radial-gradient(circle at 30% 30%, #ffe4a0, var(--gold));
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px var(--gold), 0 0 40px rgba(245, 189, 79, 0.5),
                0 0 80px rgba(245, 189, 79, 0.2), 0 0 120px rgba(245, 189, 79, 0.08);
    z-index: 2;
}
.home-orbit {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(201, 160, 255, 0.14);
    border-radius: 50%;
    animation: spin var(--orbitDur) linear infinite;
    animation-delay: var(--orbitDelay);
}
/* Negative delays set each world's starting angle (angle = delay / dur * 360).
   They are chosen to spread the seven bodies around the disc rather than
   letting the outer orbits bunch on one side. */
.home-o1 { width: 18%; height: 18%; --orbitDur: 26s; --orbitDelay: -1.4s }   /* 20deg  */
.home-o2 { width: 28%; height: 28%; --orbitDur: 38s; --orbitDelay: -10s }    /* 95deg  */
.home-o3 { width: 38%; height: 38%; --orbitDur: 52s; --orbitDelay: -24.3s }  /* 168deg */
.home-o4 { width: 48%; height: 48%; --orbitDur: 68s; --orbitDelay: -46.5s }  /* 246deg */
.home-o5 { width: 58%; height: 58%; --orbitDur: 84s; --orbitDelay: -71.2s }  /* 305deg */
.home-o6 { width: 72%; height: 72%; --orbitDur: 104s; --orbitDelay: -12.1s } /* 42deg  */
.home-o7 { width: 90%; height: 90%; --orbitDur: 132s; --orbitDelay: -48.8s } /* 133deg */
.home-planet-group {
    position: absolute;
    left: 50%; top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    transform: translate(0, -50%) rotate(0deg);
    transform-origin: 0 50%;
    animation: counterSpin var(--orbitDur) linear infinite;
    animation-delay: var(--orbitDelay);
}
.home-planet {
    --size: 6px;
    width: var(--size); height: var(--size);
    margin-left: calc(var(--size) / -2);
    border-radius: 50%;
    transition: box-shadow 0.3s var(--ease), transform 0.2s var(--ease);
}
.home-label {
    font-family: var(--f-mono);
    font-size: clamp(0.48rem, 0.72vw, 0.62rem);
    letter-spacing: 0.08em;
    color: rgba(236, 227, 214, 0.44);
    line-height: 1;
    transition: color 0.6s var(--ease);
    text-shadow: 0 0 12px rgba(16, 5, 11, 0.9);
}
.home-p-io28 { --size: 5px; background: #e8a862; box-shadow: 0 0 6px rgba(255, 179, 107, 0.7) }
.home-p-sanc { --size: 7px; background: #e07830; box-shadow: 0 0 8px rgba(224, 120, 48, 0.6) }
.home-p-xim { --size: 7px; background: #68b89a; box-shadow: 0 0 8px rgba(66, 235, 189, 0.6) }
.home-p-chlo { --size: 6px; background: #d4b876; box-shadow: 0 0 7px rgba(212, 184, 118, 0.6) }
.home-p-nm { --size: 4px; background: var(--gold); box-shadow: 0 0 6px rgba(245, 189, 79, 0.7) }
.home-p-rav {
    --size: 11px;
    background: radial-gradient(circle at 35% 35%, #8a9bb0, #5a6e82);
    box-shadow: 0 0 10px rgba(107, 126, 150, 0.5), 0 0 20px rgba(107, 126, 150, 0.2);
    position: relative;
}
.home-p-end {
    --size: 6px;
    background: #7c3aed;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.8), 0 0 20px rgba(124, 58, 237, 0.3);
    animation: ePulse 2.5s ease-in-out infinite;
}
.home-moon-orbit {
    position: absolute;
    top: 50%; left: 50%;
    width: 24px; height: 24px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(201, 160, 255, 0.05);
    border-radius: 50%;
    animation: spin 9s linear infinite;
}
.home-moon {
    position: absolute;
    left: 50%; top: 0;
    transform: translate(-50%, -50%);
    width: 4px; height: 4px;
    border-radius: 50%;
    background: #9aa8b8;
    box-shadow: 0 0 5px rgba(154, 168, 184, 0.5);
}

/* SNOAS telemetry columns flanking the orrery */
.home-snoas-overlay {
    position: absolute;
    bottom: 0;
    width: calc(50% - clamp(150px, 20vw, 260px) - 12px);
    max-width: 240px;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.4em;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 22%, black 45%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 22%, black 45%);
}
.home-snoas-left { left: 0 }
.home-snoas-right { right: 0; text-align: right }
.home-snoas-msg {
    font-family: var(--f-mono);
    font-size: clamp(0.46rem, 0.68vw, 0.58rem);
    color: rgba(180, 170, 150, 0.22);
    line-height: 1.5;
    flex-shrink: 0;
    transition: color 0.4s var(--ease);
}
.home-snoas-prompt { color: rgba(201, 160, 255, 0.2) }
.home-snoas-cursor {
    display: inline-block;
    width: 0.45em;
    height: 0.85em;
    background: rgba(201, 160, 255, 0.2);
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
    margin-left: 1px;
}
.home-snoas-msg.crack { color: rgba(201, 160, 255, 0.2) }

/* clickable worlds + registry popup (game-panel styling, wavy magenta frame) */
.home-planet-group { cursor: pointer }
.home-planet-group:focus-visible {
    outline: 1px solid rgba(var(--panel-line-rgb), 0.8);
    outline-offset: 4px;
}
.orrery-popup {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: min(350px, 86vw);
    padding: 1.1rem 1.35rem 1rem;
    background: rgba(24, 9, 17, 0.95);
    z-index: 4;
    text-align: left;
    box-shadow: 0 0 34px rgba(var(--panel-line-rgb), 0.2);
}
.orrery-popup-frame {
    position: absolute;
    inset: -3px;
    border: 2px solid rgba(var(--panel-line-rgb), 0.6);
    filter: url(#wavy-edge);
    pointer-events: none;
}
.orrery-popup-close {
    position: absolute;
    top: 0.3rem; right: 0.45rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: rgba(201, 160, 255, 0.7);
    font-size: 1.05rem;
    line-height: 1;
    font-family: var(--f-body);
    padding: 0.2rem 0.35rem;
}
.orrery-popup-close:hover { color: var(--purple) }
.orrery-popup-name {
    font-family: var(--f-display);
    font-size: 0.85rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.2rem;
    padding-right: 1.2rem;
}
.orrery-popup-motto {
    font-style: italic;
    font-size: 0.82rem;
    color: rgba(201, 160, 255, 0.8);
    margin-bottom: 0.55rem;
}
.orrery-popup-text {
    font-size: 0.9rem;
    color: var(--body-text);
    line-height: 1.65;
    margin-bottom: 0.6rem;
}
.orrery-popup-src {
    font-family: var(--f-mono);
    font-size: 0.52rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(var(--panel-line-rgb), 0.6);
}

.home-pillars { max-width: var(--content-w); margin: var(--block) auto 0 }
.home-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
    gap: var(--gap);
    margin-top: 1.5rem;
}

/* pillar cards (2x2) sharing the row with the field-recording screenshot */
.home-pillar-row {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--gap);
    align-items: stretch;
    margin-top: 1.5rem;
}
.home-pillar-row .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
}
.home-shot {
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.home-shot .viewport-inner { flex: 1; min-height: 0 }
.home-shot .viewport-inner img { width: 100%; height: 100%; object-fit: cover }

/* --- HOME: launch-signal signup panel (the page's one conversion point) --- */
.signal-panel {
    position: relative;
    max-width: 560px;
    margin: var(--block) auto 0;
    padding: 1.9rem 2rem 1.7rem;
    text-align: center;
    background: rgba(24, 9, 17, 0.72);
    box-shadow: 0 0 34px rgba(var(--panel-line-rgb), 0.14);
}
.signal-panel-frame {
    position: absolute;
    inset: -3px;
    border: 2px solid rgba(var(--panel-line-rgb), 0.5);
    filter: url(#wavy-edge);
    pointer-events: none;
}
.signal-kicker {
    font-family: var(--f-mono);
    font-size: var(--t-label);
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: rgba(var(--panel-line-rgb), 0.65);
    margin-bottom: 0.5rem;
}
.signal-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    text-shadow: 0 0 24px rgba(255, 214, 107, 0.25);
    margin-bottom: 0.55rem;
}
.signal-sub {
    font-size: clamp(0.88rem, 1vw, 0.98rem);
    color: var(--body-text);
    line-height: 1.65;
    max-width: 40ch;
    margin: 0 auto 1.2rem;
}
.signal-form { display: flex; justify-content: center; align-items: stretch }
.signal-input { width: min(320px, 60vw); font-size: 0.78rem }
.signal-btn { font-size: 0.68rem }
.signal-msg { margin-top: 0.6rem; font-size: 0.66rem }

/* --- Guided flow: "next section" control at each panel's end --- */
.panel-next {
    display: flex;
    justify-content: center;
    margin-top: var(--block);
}
.panel-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--f-cond);
    font-weight: 600;
    font-size: clamp(0.82rem, 1.1vw, 0.98rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(255, 214, 107, 0.06);
    border: 1px solid rgba(255, 214, 107, 0.28);
    padding: 0.85em 1.5em;
    cursor: pointer;
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
                box-shadow 0.3s var(--ease);
}
.panel-next-btn:hover {
    background: rgba(255, 214, 107, 0.13);
    border-color: rgba(255, 214, 107, 0.55);
    box-shadow: 0 0 24px -6px rgba(255, 214, 107, 0.45);
}
.panel-next-arrow { transition: transform 0.3s var(--ease) }
.panel-next-btn:hover .panel-next-arrow { transform: translateX(4px) }

/* scroll cue under hero */
.hero-cue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: clamp(2.4rem, 6vw, 5rem);
    font-family: var(--f-mono);
    font-size: 0.55rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--faint);
}
.hero-cue::before, .hero-cue::after {
    content: '';
    width: clamp(30px, 8vw, 90px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 160, 255, 0.28), transparent);
}

/* --- TOUR --- */
.panel-tour { max-width: none; height: 100%; margin: 0 }
.tour-host {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 540px;
    background: rgba(18, 6, 12, 0.45);
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}
.tour-loading, .tour-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: rgba(201, 160, 255, 0.55);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --- SHIP: cruise pass — stylised player ship crossing the band, gold wake --- */
.ship-flight {
    position: relative;
    height: clamp(130px, 17vw, 180px);
    margin: 1.6rem auto 0.4rem;
    overflow: hidden;
}
.ship-flight-glow {
    position: absolute;
    inset: 12% 6%;
    background: radial-gradient(ellipse at 50% 55%, rgba(var(--accent-rgb), 0.07), transparent 70%);
    pointer-events: none;
}
.ship-mover {
    position: absolute;
    top: 50%;
    left: -150px;
    margin-top: -26px;
    animation: shipCruise 17s linear infinite;
}
.ship-bob { position: relative; animation: shipBob 3.6s ease-in-out infinite }
.ship-sprite {
    display: block;
    width: clamp(112px, 14vw, 150px);
    height: auto;
    filter: drop-shadow(0 0 14px rgba(66, 235, 189, 0.28));
}
.ship-wake-speck {
    position: absolute;
    top: 50%; left: 4px;
    width: 3px; height: 3px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 6px rgba(255, 214, 107, 0.8);
    opacity: 0;
    animation: wakeSpeck var(--wd, 1.6s) linear infinite;
    animation-delay: var(--wdel, 0s);
}
.wsp-1 { --wd: 1.5s; --wdel: 0s; --dy: -7px }
.wsp-2 { --wd: 1.9s; --wdel: 0.3s; --dy: 5px }
.wsp-3 { --wd: 1.4s; --wdel: 0.65s; --dy: -2px }
.wsp-4 { --wd: 2.1s; --wdel: 0.9s; --dy: 9px }
.wsp-5 { --wd: 1.7s; --wdel: 1.2s; --dy: -10px }
.wsp-6 { --wd: 1.55s; --wdel: 1.45s; --dy: 2px }

/* --- SHIP: hull zone strip --- */
.ship-hull {
    position: relative;
    width: 100%;
    margin: 1.6rem auto 0;
    height: clamp(100px, 11vw, 138px);
    border: 1px solid rgba(var(--accent-rgb), 0.16);
    border-radius: 45px 14px 14px 45px;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.05), rgba(20, 8, 14, 0.3));
    display: flex;
    overflow: hidden;
}
.ship-zone {
    flex: 1;
    border-right: 1px solid var(--line-soft);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: background 0.3s var(--ease);
    position: relative;
    padding: 0.5rem 0.2rem;
}
.ship-zone:last-child { border-right: none; padding-right: 0.3rem }
.ship-zone:first-child { padding-left: 1rem }
.ship-zone:hover, .ship-zone.active { background: rgba(var(--accent-rgb), 0.09) }
.ship-zone.active::before {
    content: '';
    position: absolute;
    bottom: 0; left: 15%; right: 15%;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.8);
}
.zone-icon { font-size: clamp(0.9rem, 1.3vw, 1.2rem); opacity: 0.45; transition: opacity 0.3s var(--ease) }
.ship-zone:hover .zone-icon, .ship-zone.active .zone-icon { opacity: 0.85 }
.zone-label {
    font-family: var(--f-display);
    font-size: clamp(0.42rem, 0.62vw, 0.52rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(var(--accent-rgb), 0.62);
    text-align: center;
    transition: color 0.3s var(--ease);
}
.ship-zone:hover .zone-label, .ship-zone.active .zone-label { color: rgba(var(--accent-rgb), 0.95) }
.zone-detail {
    width: 100%;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s var(--ease), padding 0.45s var(--ease);
    border: 1px solid transparent;
    border-top: none;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.05), transparent);
}
.zone-detail.visible {
    max-height: 380px;
    padding: 1.3rem 1.6rem;
    border-color: rgba(var(--accent-rgb), 0.14);
}
.zone-title {
    font-family: var(--f-display);
    font-size: clamp(0.76rem, 1vw, 0.9rem);
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.zone-desc {
    font-size: var(--t-body);
    color: var(--body-text);
    margin-bottom: 0.85rem;
    line-height: 1.72;
    font-style: italic;
    max-width: 70ch;
}
.zone-features { list-style: none; margin-bottom: 0.85rem }
.zone-features li {
    font-family: var(--f-mono);
    font-size: clamp(0.64rem, 0.85vw, 0.76rem);
    color: var(--body-text);
    padding: 0.25rem 0 0.25rem 1.2rem;
    position: relative;
}
.zone-features li::before {
    content: '\25B8';
    position: absolute;
    left: 0;
    color: rgba(var(--accent-rgb), 0.6);
}
.zone-snoas {
    font-family: var(--f-mono);
    font-size: clamp(0.55rem, 0.78vw, 0.66rem);
    color: rgba(var(--accent-rgb), 0.5);
}

/* --- NAVIGATION: static orrery --- */
.orrery-wrap {
    position: relative;
    width: clamp(220px, 26vw, 360px);
    height: clamp(220px, 26vw, 360px);
    margin: 1.4rem auto var(--block);
}
.orrery-sun {
    position: absolute;
    top: 50%; left: 50%;
    width: 12px; height: 12px;
    background: radial-gradient(circle at 30% 30%, #ffe4a0, var(--gold));
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px var(--gold), 0 0 30px rgba(245, 189, 79, 0.4), 0 0 60px rgba(245, 189, 79, 0.15);
    z-index: 2;
}
.orrery-orbit {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(201, 160, 255, 0.13);
    border-radius: 50%;
    animation: orrSpin var(--dur) linear infinite;
    animation-delay: var(--delay, 0s);
}
.orrery-orbit .orrery-planet {
    position: absolute;
    left: 50%; top: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: orrCounter var(--dur) linear infinite;
    animation-delay: var(--delay, 0s);
}
.orr-1 { width: 18%; height: 18%; --dur: 22s; --delay: -1.2s }
.orr-2 { width: 28%; height: 28%; --dur: 32s; --delay: -8.4s }
.orr-3 { width: 38%; height: 38%; --dur: 46s; --delay: -21.5s }
.orr-4 { width: 48%; height: 48%; --dur: 60s; --delay: -41s }
.orr-5 { width: 58%; height: 58%; --dur: 76s; --delay: -64.4s }
.orr-6 { width: 72%; height: 72%; --dur: 96s; --delay: -11.2s }
.orr-7 { width: 90%; height: 90%; --dur: 122s; --delay: -45.1s }
.orrery-wall {
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px dashed rgba(124, 58, 237, 0.14);
    animation: wallPulse 8s ease-in-out infinite;
}
.op-io28 { width: 5px; height: 5px; background: #e8a862; box-shadow: 0 0 5px rgba(255, 179, 107, 0.6) }
.op-sanc { width: 6px; height: 6px; background: #e07830; box-shadow: 0 0 6px rgba(224, 120, 48, 0.5) }
.op-xim { width: 7px; height: 7px; background: #68b89a; box-shadow: 0 0 7px rgba(66, 235, 189, 0.5) }
.op-chlo { width: 6px; height: 6px; background: #d4b876; box-shadow: 0 0 6px rgba(212, 184, 118, 0.5) }
.op-nm { width: 4px; height: 4px; background: var(--gold); box-shadow: 0 0 5px rgba(245, 189, 79, 0.6) }
.op-rav {
    width: 9px; height: 9px;
    background: radial-gradient(circle at 35% 35%, #8a9bb0, #5a6e82);
    box-shadow: 0 0 8px rgba(107, 126, 150, 0.4);
    position: relative;
}
.orr-moon-orbit {
    position: absolute;
    top: 50%; left: 50%;
    width: 20px; height: 20px;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(201, 160, 255, 0.05);
    border-radius: 50%;
    animation: orrSpin 8s linear infinite;
}
.orr-moon {
    position: absolute;
    left: 50%; top: 0;
    transform: translate(-50%, -50%);
    width: 3px; height: 3px;
    border-radius: 50%;
    background: #9aa8b8;
    box-shadow: 0 0 4px rgba(154, 168, 184, 0.4);
}
.op-end {
    width: 6px; height: 6px;
    background: #7c3aed;
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.7), 0 0 16px rgba(124, 58, 237, 0.25);
    animation: ePulse 2.5s ease-in-out infinite;
}

/* --- TRADE: ticker --- */
.ticker-wrap {
    overflow: hidden;
    width: 100%;
    border-top: 1px solid rgba(var(--accent-rgb), 0.18);
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.18);
    padding: 0.65rem 0;
    margin-bottom: 1.8rem;
    position: relative;
    -webkit-mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
}
.ticker-track { display: flex; white-space: nowrap; animation: tickerScroll 52s linear infinite; width: max-content }
.ticker-wrap:hover .ticker-track { animation-play-state: paused }
.ticker-item {
    font-family: var(--f-mono);
    font-size: clamp(0.64rem, 0.86vw, 0.76rem);
    padding: 0 1.6rem;
    flex-shrink: 0;
    letter-spacing: 0.05em;
}
.ticker-up { color: var(--gold) }
.ticker-down { color: rgba(201, 160, 255, 0.62) }

/* --- SALVAGE console --- */
.salvage-console {
    margin: 1.5rem auto var(--block);
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    background: rgba(18, 6, 12, 0.5);
    box-shadow: inset 0 0 44px rgba(var(--accent-rgb), 0.05);
    overflow: hidden;
}
.salvage-console-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.68rem 0.95rem;
    border-bottom: 1px solid var(--line-soft);
    font-family: var(--f-mono);
    font-size: clamp(0.52rem, 0.78vw, 0.64rem);
    letter-spacing: 0.12em;
    color: rgba(var(--accent-rgb), 0.6);
}
.salvage-console-head strong { font-weight: 400; color: rgba(255, 214, 107, 0.72) }
.salvage-viewport {
    position: relative;
    aspect-ratio: 16 / 7;
    min-height: 220px;
    overflow: hidden;
    background:
        radial-gradient(circle at 57% 45%, rgba(var(--accent-rgb), 0.13), transparent 32%),
        linear-gradient(rgba(201, 160, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 160, 255, 0.035) 1px, transparent 1px);
    background-size: auto, 32px 32px, 32px 32px;
}
.salvage-viewport::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 45%, rgba(16, 5, 11, 0.72) 100%);
    pointer-events: none;
}
.salvage-wreck {
    position: absolute;
    left: 55%; top: 47%;
    width: 23%; height: 22%;
    transform: translate(-50%, -50%) rotate(-8deg);
    border: 1px solid rgba(221, 208, 192, 0.32);
    clip-path: polygon(0 40%, 12% 14%, 58% 0, 100% 24%, 91% 77%, 46% 100%, 9% 83%);
    background: linear-gradient(145deg, rgba(221, 208, 192, 0.07), rgba(201, 160, 255, 0.1));
    box-shadow: 0 0 30px rgba(201, 160, 255, 0.12);
}
.salvage-wreck::before, .salvage-wreck::after { content: ''; position: absolute; background: rgba(201, 160, 255, 0.3) }
.salvage-wreck::before { left: 22%; top: -30%; width: 1px; height: 145%; transform: rotate(21deg) }
.salvage-wreck::after { left: -10%; right: -10%; top: 54%; height: 1px; transform: rotate(-5deg) }
.salvage-shard {
    position: absolute;
    width: var(--w, 13px); height: var(--h, 4px);
    left: var(--x); top: var(--y);
    border: 1px solid rgba(221, 208, 192, var(--a, 0.3));
    background: rgba(201, 160, 255, 0.06);
    transform: rotate(var(--r));
    animation: salvageDrift var(--dur, 14s) ease-in-out infinite alternate;
}
.salvage-s1 { --x: 10%; --y: 28%; --w: 20px; --h: 5px; --r: 18deg; --dur: 16s }
.salvage-s2 { --x: 18%; --y: 71%; --w: 8px; --h: 14px; --r: 44deg; --dur: 13s }
.salvage-s3 { --x: 31%; --y: 19%; --w: 16px; --h: 4px; --r: -24deg; --dur: 18s }
.salvage-s4 { --x: 38%; --y: 76%; --w: 24px; --h: 5px; --r: 12deg; --dur: 15s }
.salvage-s5 { --x: 68%; --y: 18%; --w: 9px; --h: 17px; --r: 32deg; --dur: 12s }
.salvage-s6 { --x: 76%; --y: 70%; --w: 19px; --h: 5px; --r: -18deg; --dur: 17s }
.salvage-s7 { --x: 88%; --y: 35%; --w: 12px; --h: 8px; --r: 51deg; --dur: 14s }
.salvage-s8 { --x: 84%; --y: 84%; --w: 6px; --h: 15px; --r: -35deg; --dur: 19s }
.salvage-scan {
    position: absolute;
    inset: -25%;
    border-radius: 50%;
    border: 1px solid rgba(66, 235, 189, 0);
    transform: scale(0.1);
    opacity: 0;
    pointer-events: none;
}
.salvage-console.scanning .salvage-scan { animation: salvageScan 1.5s ease-out forwards }
.salvage-signal {
    position: absolute;
    width: 9px; height: 9px;
    border: 1px solid rgba(255, 214, 107, 0.85);
    transform: rotate(45deg) scale(0.2);
    opacity: 0;
    transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
    box-shadow: 0 0 10px rgba(255, 214, 107, 0.25);
    z-index: 2;
}
.salvage-signal::after { content: ''; position: absolute; inset: -5px; border: 1px solid rgba(255, 214, 107, 0.2) }
.sig-a { left: 48%; top: 37% }
.sig-b { left: 60%; top: 49% }
.sig-c { left: 53%; top: 62% }
.salvage-console.surveyed .salvage-signal { opacity: 1; transform: rotate(45deg) scale(1) }
.salvage-ship {
    position: absolute;
    left: 16%; top: 49%;
    width: 54px; height: 17px;
    border: 1px solid rgba(66, 235, 189, 0.6);
    clip-path: polygon(0 50%, 22% 0, 82% 12%, 100% 50%, 82% 88%, 22% 100%);
    background: rgba(66, 235, 189, 0.1);
    box-shadow: 0 0 16px rgba(66, 235, 189, 0.15);
}
.salvage-eva {
    position: absolute;
    left: 38%; top: 49%;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(201, 160, 255, 0.55);
    box-shadow: 0 0 12px rgba(201, 160, 255, 0.4);
    opacity: 0;
    transform: scale(0.3);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.salvage-watchline {
    position: absolute;
    left: 21%; top: 50%;
    width: 18%; height: 1px;
    background: linear-gradient(90deg, rgba(66, 235, 189, 0.32), rgba(201, 160, 255, 0.48));
    transform-origin: left center;
    opacity: 0;
    transition: opacity 0.5s var(--ease);
}
.salvage-console.eva-ready .salvage-eva { opacity: 1; transform: scale(1) }
.salvage-console.eva-ready .salvage-watchline { opacity: 1; animation: watchlinePulse 1.8s ease-in-out infinite }
.salvage-readouts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
}
.salvage-readout { padding: 0.75rem 0.8rem; border-right: 1px solid var(--line-soft) }
.salvage-readout:last-child { border-right: none }
.salvage-readout span {
    display: block;
    font-family: var(--f-mono);
    font-size: 0.48rem;
    letter-spacing: 0.15em;
    color: var(--faint);
    margin-bottom: 0.28rem;
}
.salvage-readout strong {
    display: block;
    font-family: var(--f-display);
    font-size: clamp(0.56rem, 0.86vw, 0.7rem);
    font-weight: 400;
    letter-spacing: 0.09em;
    color: rgba(236, 227, 214, 0.72);
}
.salvage-controls { display: flex; align-items: center; gap: 1rem; padding: 0.9rem }
.salvage-survey-btn {
    flex-shrink: 0;
    font-family: var(--f-display);
    font-size: 0.56rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(255, 214, 107, 0.07);
    border: 1px solid rgba(255, 214, 107, 0.28);
    padding: 0.75rem 0.95rem;
    cursor: pointer;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.salvage-survey-btn:hover:not(:disabled) {
    background: rgba(255, 214, 107, 0.14);
    border-color: rgba(255, 214, 107, 0.5);
    box-shadow: 0 0 20px -6px rgba(255, 214, 107, 0.5);
}
.salvage-survey-btn:disabled { opacity: 0.45; cursor: default }
.salvage-log {
    font-family: var(--f-mono);
    font-size: clamp(0.54rem, 0.8vw, 0.66rem);
    line-height: 1.55;
    color: rgba(var(--accent-rgb), 0.6);
}
.salvage-roles { display: flex; justify-content: center; gap: 0.7rem; flex-wrap: wrap; margin: 1.3rem 0 var(--block) }
.salvage-role {
    min-width: 152px;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--line-soft);
    background: rgba(201, 160, 255, 0.028);
}
.salvage-role strong, .salvage-role span { display: block }
.salvage-role strong {
    font-family: var(--f-display);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 400;
    margin-bottom: 0.25rem;
}
.salvage-role span { font-family: var(--f-mono); font-size: 0.56rem; color: var(--dim) }
.salvage-role.pilot strong { color: #e8a862 }
.salvage-role.eva strong { color: var(--purple) }
.salvage-role.cargo strong { color: #68b89a }

/* --- SHARED INSTRUMENT FRAME ---
   Wraps a live graphic in a bezel with a mono caption, so small visuals read
   as console readouts instead of stray art floating in the column. */
.instrument {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 560px;
    margin: 1.4rem auto var(--block);
    overflow: hidden;
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    background:
        radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb), 0.08), transparent 60%),
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.04), rgba(20, 8, 14, 0.3));
}
.instrument::after {
    content: attr(data-caption);
    position: absolute;
    left: 0.75rem; bottom: 0.55rem;
    font-family: var(--f-mono);
    font-size: 0.48rem;
    letter-spacing: 0.16em;
    color: rgba(var(--accent-rgb), 0.5);
}

/* --- COMBAT --- */
.command-deck {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 1.5rem 0 var(--block);
}
.command-cell {
    position: relative;
    min-height: 98px;
    padding: 0.9rem 0.75rem;
    border: 1px solid rgba(var(--accent-rgb), 0.16);
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.07), rgba(20, 8, 14, 0.2));
    overflow: hidden;
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.command-cell:hover { border-color: rgba(var(--accent-rgb), 0.4); transform: translateY(-2px) }
.command-cell::before {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: var(--charge, 65%);
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    box-shadow: 0 0 9px rgba(var(--accent-rgb), 0.6);
}
.command-cell-domain {
    display: block;
    font-family: var(--f-mono);
    font-size: 0.5rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: rgba(255, 214, 107, 0.55);
    margin-bottom: 0.45rem;
}
.command-cell-name {
    display: block;
    font-family: var(--f-cond);
    font-weight: 500;
    font-size: clamp(0.74rem, 1vw, 0.9rem);
    line-height: 1.35;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(236, 227, 214, 0.82);
}
.command-cell-state {
    display: block;
    position: absolute;
    left: 0.75rem; bottom: 0.6rem;
    font-family: var(--f-mono);
    font-size: 0.48rem;
    letter-spacing: 0.13em;
    color: rgba(var(--accent-rgb), 0.55);
}

.ai-profiles { display: flex; justify-content: center; gap: 1.6rem; flex-wrap: wrap; margin-top: 1.5rem }
.ai-profile { text-align: center; cursor: default }
.ai-profile-icon {
    font-size: 1.25rem;
    opacity: 0.5;
    margin-bottom: 0.2rem;
    color: var(--accent);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.ai-profile:hover .ai-profile-icon { opacity: 1; transform: translateY(-2px) }
.ai-profile-name {
    font-family: var(--f-mono);
    font-size: clamp(0.6rem, 0.8vw, 0.7rem);
    letter-spacing: 0.1em;
    color: var(--dim);
}

/* --- CREW dossier --- */
.dossier {
    max-width: 500px;
    width: 100%;
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    padding: 1.4rem 1.6rem;
    font-family: var(--f-mono);
    background: linear-gradient(165deg, rgba(var(--accent-rgb), 0.05), rgba(20, 8, 14, 0.3));
    margin: 0 auto var(--block);
    position: relative;
    text-align: left;
}
.dossier::before, .dossier::after {
    content: '';
    position: absolute;
    width: 12px; height: 12px;
    border: 1px solid rgba(var(--accent-rgb), 0.5);
}
.dossier::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0 }
.dossier::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0 }
.dossier-header {
    font-family: var(--f-display);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    color: rgba(var(--accent-rgb), 0.75);
    margin-bottom: 0.9rem;
    text-transform: uppercase;
}
.dossier-field { font-size: clamp(0.68rem, 0.9vw, 0.78rem); color: var(--body-text); margin-bottom: 0.28rem }
.dossier-label { color: rgba(var(--accent-rgb), 0.6); display: inline-block; width: 6em }
.dossier-divider { border: none; border-top: 1px solid var(--line-soft); margin: 0.8rem 0 }
.stat-row { display: flex; justify-content: space-between; gap: 1.3rem; margin-bottom: 0.55rem; flex-wrap: wrap }
.stat-item { flex: 1; min-width: 130px }
.stat-name { font-size: 0.58rem; color: rgba(var(--accent-rgb), 0.6); letter-spacing: 0.06em; margin-bottom: 0.15rem }
.stat-bar-track { width: 100%; height: 5px; background: rgba(201, 160, 255, 0.1); position: relative }
.stat-bar-fill { height: 100%; width: 0; transition: width 1.3s var(--ease) }
.stat-bar-fill.gold { background: linear-gradient(90deg, rgba(255, 214, 107, 0.35), rgba(255, 214, 107, 0.75)) }
.stat-bar-fill.purple { background: linear-gradient(90deg, rgba(201, 160, 255, 0.3), rgba(201, 160, 255, 0.65)) }
.stat-bar-fill.green { background: linear-gradient(90deg, rgba(66, 235, 189, 0.3), rgba(66, 235, 189, 0.65)) }
.stat-val { position: absolute; right: 0; top: -0.85rem; font-size: 0.55rem; color: var(--dim) }
.dossier-status { margin-top: 0.7rem; display: flex; gap: 0.35rem; flex-wrap: wrap }
.status-tag {
    font-size: 0.55rem;
    padding: 0.2em 0.55em;
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    color: rgba(var(--accent-rgb), 0.68);
}

/* --- SYSTEM: factions --- */
.faction-row { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.2rem }
.faction-badge {
    padding: 0.5em 1em;
    border: 1px solid;
    cursor: pointer;
    font-family: var(--f-mono);
    font-size: clamp(0.58rem, 0.8vw, 0.72rem);
    letter-spacing: 0.06em;
    background: transparent;
    color: inherit;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease),
                border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.faction-badge:hover, .faction-badge.active { transform: translateY(-2px) }
.faction-detail {
    width: 100%;
    text-align: center;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s var(--ease), padding 0.45s var(--ease), opacity 0.35s var(--ease);
    opacity: 0;
    padding: 0 1.2rem;
}
.faction-detail.visible {
    max-height: 300px;
    padding: 1rem 1.2rem;
    opacity: 1;
}
.faction-detail-name {
    font-family: var(--f-display);
    font-size: clamp(0.78rem, 1.05vw, 0.95rem);
    letter-spacing: 0.2em;
    margin-bottom: 0.35rem;
}
.faction-detail-motto {
    font-style: italic;
    font-size: clamp(0.88rem, 1.02vw, 0.98rem);
    color: var(--body-text);
    margin-bottom: 0.6rem;
}
.faction-detail-desc { font-size: var(--t-body); color: var(--body-text); line-height: 1.75; max-width: var(--measure); margin: 0 auto }

/* --- SOUND --- */
.instrument-wave { min-height: 200px }
.waveform {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    height: 104px;
    width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
}
.wave-bar {
    width: 5px;
    border-radius: 1px;
    background: linear-gradient(to top, rgba(var(--accent-rgb), 0.35), var(--accent));
    animation: wavePulse var(--wave-dur, 1.2s) ease-in-out infinite alternate;
    animation-delay: var(--wave-delay, 0s);
}
.audio-tracks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
    gap: var(--gap);
    margin-top: 2rem;
}
.audio-track {
    border: 1px solid var(--line-soft);
    padding: 1.2rem 1.35rem;
    background: linear-gradient(165deg, rgba(201, 160, 255, 0.045), rgba(20, 8, 14, 0.28));
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.audio-track:hover { border-color: rgba(var(--accent-rgb), 0.25) }
.audio-track.playing {
    border-color: rgba(255, 214, 107, 0.4);
    box-shadow: inset 0 0 40px rgba(255, 214, 107, 0.05);
}
.audio-track-header { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.55rem }
.audio-play-btn {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    background: rgba(var(--accent-rgb), 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
    font-size: 0.7rem;
    transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.audio-play-btn:hover { border-color: rgba(var(--accent-rgb), 0.55); background: rgba(var(--accent-rgb), 0.1) }
.audio-play-btn.playing {
    border-color: rgba(255, 214, 107, 0.45);
    background: rgba(255, 214, 107, 0.09);
    color: var(--gold);
    box-shadow: 0 0 18px -4px rgba(255, 214, 107, 0.6);
}
.audio-track-name {
    font-family: var(--f-display);
    font-size: clamp(0.62rem, 0.88vw, 0.74rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}
.audio-track-label { font-family: var(--f-mono); font-size: 0.58rem; color: var(--dim); letter-spacing: 0.06em }
.audio-track-desc { font-size: clamp(0.86rem, 0.98vw, 0.93rem); color: var(--body-text); line-height: 1.68 }

/* --- VIEWPORT: embedded gameplay screenshots ---
   Framed like the game's own UI panels: dark fill, wavy magenta border
   (SVG displacement filter #wavy-edge defined in index.html), gold readout
   caption. The frame lives on a pseudo-layer so the image stays crisp. */
.viewport {
    position: relative;
    max-width: 820px;
    margin: 1.7rem auto var(--block);
}
.viewport-frame {
    position: absolute;
    inset: -3px;
    border: 2px solid rgba(var(--panel-line-rgb), 0.55);
    filter: url(#wavy-edge);
    pointer-events: none;
    z-index: 2;
}
.viewport-inner {
    position: relative;
    background: var(--bg-lift);
    box-shadow: 0 0 26px rgba(var(--panel-line-rgb), 0.14),
                inset 0 0 30px rgba(var(--panel-line-rgb), 0.05);
}
.viewport img {
    display: block;
    width: 100%;
    height: auto;
}
/* soft vignette so the shot sits into the page like a console feed */
.viewport-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 62%, rgba(16, 5, 11, 0.42) 100%);
}
.viewport-caption {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.2rem 0;
}
.viewport-caption strong {
    font-family: var(--f-mono);
    font-weight: 500;
    font-size: clamp(0.56rem, 0.82vw, 0.68rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 214, 107, 0.78);
}
.viewport-caption span {
    font-family: var(--f-mono);
    font-size: clamp(0.5rem, 0.72vw, 0.6rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(201, 160, 255, 0.45);
    white-space: nowrap;
}

/* ===== 6. MOTION ===== */
@keyframes sunPulse {
    0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1) }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) }
}
@keyframes headerTitleShift {
    0%, 100% { background-position: 0% 50% }
    50% { background-position: 100% 50% }
}
@keyframes headerFlare {
    0%, 100% { transform: translateX(0) scale(1); opacity: 0.55 }
    50% { transform: translateX(4%) scale(1.12); opacity: 0.95 }
}
@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg) }
    to { transform: translate(-50%, -50%) rotate(360deg) }
}
@keyframes counterSpin {
    from { transform: translate(0, -50%) rotate(0deg) }
    to { transform: translate(0, -50%) rotate(-360deg) }
}
@keyframes orrSpin {
    from { transform: translate(-50%, -50%) rotate(0deg) }
    to { transform: translate(-50%, -50%) rotate(360deg) }
}
@keyframes orrCounter {
    from { transform: translate(-50%, -50%) rotate(0deg) }
    to { transform: translate(-50%, -50%) rotate(-360deg) }
}
@keyframes wallPulse {
    0%, 100% { border-color: rgba(124, 58, 237, 0.09); opacity: 0.6 }
    50% { border-color: rgba(124, 58, 237, 0.22); opacity: 1 }
}
@keyframes ePulse {
    0%, 100% { box-shadow: 0 0 6px rgba(124, 58, 237, 0.6) }
    50% { box-shadow: 0 0 12px rgba(124, 58, 237, 0.9), 0 0 24px rgba(124, 58, 237, 0.35) }
}
@keyframes tickerScroll {
    0% { transform: translateX(0) }
    100% { transform: translateX(-50%) }
}
@keyframes wavePulse {
    0% { height: 8% }
    100% { height: var(--wave-h, 70%) }
}
@keyframes scanSweep {
    0% { top: 0; opacity: 0.9 }
    80% { opacity: 0.35 }
    100% { top: 100%; opacity: 0 }
}
@keyframes blink {
    0%, 100% { opacity: 1 }
    50% { opacity: 0 }
}
@keyframes panelIn {
    from { opacity: 0; transform: translateY(12px) }
    to { opacity: 1; transform: none }
}
@keyframes shipCruise {
    from { left: -150px }
    to { left: 100% }
}
@keyframes shipBob {
    0%, 100% { transform: translateY(0) rotate(-1.2deg) }
    50% { transform: translateY(-9px) rotate(1.4deg) }
}
@keyframes wakeSpeck {
    0% { transform: translate(0, -50%); opacity: 0 }
    12% { opacity: 0.9 }
    100% { transform: translate(-74px, calc(-50% + var(--dy, 0px))); opacity: 0 }
}
@keyframes salvageDrift {
    from { translate: -4px -2px; rotate: -2deg }
    to { translate: 6px 4px; rotate: 3deg }
}
@keyframes salvageScan {
    0% { transform: scale(0.1); opacity: 0.8; border-color: rgba(66, 235, 189, 0.48) }
    100% { transform: scale(1); opacity: 0; border-color: rgba(66, 235, 189, 0) }
}
@keyframes watchlinePulse {
    0%, 100% { filter: brightness(0.75) }
    50% { filter: brightness(1.45) }
}
@keyframes homeIntroSun {
    0% { opacity: 0.12; transform: scale(0.35); filter: blur(16px) }
    38% { opacity: 0.95; transform: scale(0.95); filter: blur(8px) }
    76% { opacity: 0.72; transform: scale(1.15); filter: blur(7px) }
    100% { opacity: 0; transform: scale(1.35); filter: blur(18px) }
}
@keyframes homeIntroTitle {
    0% { opacity: 0; text-shadow: 0 0 8px rgba(201, 160, 255, 0.25) }
    18% { opacity: 1 }
    60% { opacity: 1; text-shadow: 0 0 22px rgba(201, 160, 255, 0.45), 0 0 54px rgba(255, 214, 107, 0.5) }
    100% { opacity: 0; text-shadow: 0 0 72px rgba(255, 214, 107, 0.38) }
}
@keyframes homeIntroTag {
    0%, 24% { opacity: 0 }
    38%, 76% { opacity: 0.82 }
    100% { opacity: 0 }
}

/* reveal-on-scroll */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    transition-delay: var(--reveal-delay, 0s);
}
.reveal.in { opacity: 1; transform: none }

/* ===== 7. RESPONSIVE ===== */
@media (max-width: 1100px) {
    .home-snoas-overlay { display: none }
    .home-pillar-row { grid-template-columns: 1fr }
    .home-shot { max-width: 820px; margin: 0 auto; width: 100% }
    .home-shot .viewport-inner { flex: none }
    .home-shot .viewport-inner img { height: auto }
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
    .story-grid .feature-card,
    .story-grid .feature-card:nth-last-child(-n+2) { grid-column: auto }
    .command-deck { grid-template-columns: repeat(3, minmax(0, 1fr)) }
}

@media (max-width: 768px) {
    :root { --measure: 100% }
    .console-header { padding: 0.45rem 0.8rem 0.6rem }
    .header-tagline, .header-sub { display: none }
    .header-sun { width: 70px; height: 70px }
    .frame-corner { display: none }
    .sidebar { padding: 0 }
    .nav-item { padding: 0.55rem 0.72rem; font-size: 0.52rem }
    .main-panel { padding: 1.4rem 1rem 2.6rem }
    .main-panel.tour-mode { padding: 0 }
    .sec-head { gap: 0.8rem }
    .sec-index { font-size: 1.5rem }
    .features-grid, .home-cards, .audio-tracks { grid-template-columns: 1fr }
    .story-grid { grid-template-columns: 1fr }
    .command-deck { grid-template-columns: repeat(2, minmax(0, 1fr)) }
    .command-cell:last-child { grid-column: 1 / -1 }
    .ship-hull { height: auto; flex-wrap: wrap; border-radius: 12px }
    .ship-zone {
        flex: 1 1 20%;
        min-width: 0;
        border-right: 1px solid var(--line-soft);
        border-bottom: 1px solid var(--line-soft);
        min-height: 62px;
        padding: 0.4rem 0.15rem;
    }
    .ship-zone:first-child { padding-left: 0.15rem }
    .ship-zone:nth-child(5n) { border-right: none }
    .ship-zone:nth-child(n+6) { border-bottom: none }
    .zone-detail.visible { max-height: 500px; padding: 1rem }
    .salvage-readouts { grid-template-columns: repeat(2, 1fr) }
    .salvage-readout:nth-child(2) { border-right: none }
    .salvage-readout:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft) }
    .salvage-controls { align-items: stretch; flex-direction: column }
    .salvage-viewport { aspect-ratio: 4 / 3; min-height: 240px }
    .stat-row { flex-direction: column; gap: 0.5rem }
    .faction-row { gap: 0.32rem }
    .faction-badge { font-size: 0.55rem; padding: 0.4em 0.65em }
    .status-meta { display: none }
    .console-footer { flex-direction: column; gap: 0.55rem; padding: 0.5rem 0.8rem }
    .footer-signup-form { justify-content: center }
    .footer-signup-row { width: 100% }
    .footer-signup-input { width: 100% }
    .tour-host { min-height: 440px }
    .btn { flex: 1 1 auto; justify-content: center }
    .clipart { max-width: 260px }
    .clipart-small { max-width: 120px }
    .lore-quote { padding: 0.9rem 1rem 0.9rem 1.3rem }
}

@media (max-width: 480px) {
    .header-title { font-size: 1.1rem }
    .nav-item .nav-icon { display: none }
    .nav-item { padding: 0.5rem 0.55rem; font-size: 0.48rem; min-height: 38px }
    .home-intro-title { font-size: clamp(1.8rem, 10vw, 3.4rem); letter-spacing: 0.06em; padding-left: 0.06em }
    .home-intro-tag { letter-spacing: 0.14em; text-align: center; padding: 0 0.9rem }
    .footer-signup-btn { font-size: 0.5rem; padding: 0.6em 0.8em }
    .spec-strip { grid-template-columns: repeat(2, 1fr) }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .panel.active { opacity: 1 !important }
    .reveal { opacity: 1 !important; transform: none !important }
    .ticker-track { animation: none !important }
    .wave-bar { animation: none !important; height: var(--wave-h, 50%) !important }
    .salvage-shard { animation: none !important }
    .salvage-console.scanning .salvage-scan { display: none }
    .salvage-console.eva-ready .salvage-watchline { animation: none !important }
    .main-panel { scroll-behavior: auto }

    /* Pin the ship cruise centred; without animation the mover would sit at
       its base position off-screen left. Sprite is up to 150px wide. */
    .ship-mover { left: 50%; margin-left: -75px; animation: none !important }
    .ship-bob { animation: none !important }
    .ship-wake-speck { display: none }

    /* With animations off, the negative delays that set each world's starting
       angle never apply and all seven stack at 12 o'clock. Pin the same
       angles statically, counter-rotating the labels so they stay upright. */
    .home-o1 { transform: translate(-50%, -50%) rotate(20deg) }
    .home-o2 { transform: translate(-50%, -50%) rotate(95deg) }
    .home-o3 { transform: translate(-50%, -50%) rotate(168deg) }
    .home-o4 { transform: translate(-50%, -50%) rotate(246deg) }
    .home-o5 { transform: translate(-50%, -50%) rotate(305deg) }
    .home-o6 { transform: translate(-50%, -50%) rotate(42deg) }
    .home-o7 { transform: translate(-50%, -50%) rotate(133deg) }
    .home-o1 .home-planet-group { transform: translate(0, -50%) rotate(-20deg) }
    .home-o2 .home-planet-group { transform: translate(0, -50%) rotate(-95deg) }
    .home-o3 .home-planet-group { transform: translate(0, -50%) rotate(-168deg) }
    .home-o4 .home-planet-group { transform: translate(0, -50%) rotate(-246deg) }
    .home-o5 .home-planet-group { transform: translate(0, -50%) rotate(-305deg) }
    .home-o6 .home-planet-group { transform: translate(0, -50%) rotate(-42deg) }
    .home-o7 .home-planet-group { transform: translate(0, -50%) rotate(-133deg) }
    .orr-1 { transform: translate(-50%, -50%) rotate(20deg) }
    .orr-2 { transform: translate(-50%, -50%) rotate(95deg) }
    .orr-3 { transform: translate(-50%, -50%) rotate(168deg) }
    .orr-4 { transform: translate(-50%, -50%) rotate(246deg) }
    .orr-5 { transform: translate(-50%, -50%) rotate(305deg) }
    .orr-6 { transform: translate(-50%, -50%) rotate(42deg) }
    .orr-7 { transform: translate(-50%, -50%) rotate(133deg) }
}
