/* ===========================================================
   interplanetary.quest -- Interplanetary Immigration Authority
   Retro-futuristic / cinematic / NASA-mission-control aesthetic
   =========================================================== */

:root {
    /* Palette per DESIGN.md */
    --void-black:        #0b0e17;
    --nebula-charcoal:   #1a1f2e;
    --solar-amber:       #ffb300;
    --atmosphere-teal:   #00b8a9;
    --reentry-orange:    #ff6f3c;
    --starlight:         #e8e6e1;
    --dust-gray:         #8a8b92;
    --clearance-green:   #2ecc71;
    --rejection-red:     #e74c3c;

    --font-display:  "Chakra Petch", "Inter", system-ui, sans-serif;
    --font-body:     "Source Sans 3", "Inter", "Lato", system-ui, sans-serif;
    --font-mono:     "Space Mono", ui-monospace, "SFMono-Regular", monospace;
    --font-stamp:    "Black Ops One", "Chakra Petch", impact, sans-serif;

    --rail-w: 64px;
    --hud-h: 44px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    background: var(--void-black);
}

body {
    font-family: var(--font-body);
    color: var(--starlight);
    background: var(--void-black);
    line-height: 1.75;
    font-size: 17px;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* selection */
::selection {
    background: rgba(255, 179, 0, 0.45);
    color: var(--void-black);
}

/* ---------- Atmospheric backgrounds ---------- */
#starfield {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    display: block;
}

.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 60;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 179, 0, 0.035) 0,
        rgba(255, 179, 0, 0.035) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: screen;
}

.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 55;
    background:
        radial-gradient(ellipse at center,
            rgba(0,0,0,0) 50%,
            rgba(0,0,0,0.55) 100%);
}

/* ---------- HUD strip ---------- */
.hud {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--hud-h);
    z-index: 70;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    align-items: center;
    gap: 0;
    padding: 0 28px 0 calc(var(--rail-w) + 28px);
    border-bottom: 1px solid rgba(255, 179, 0, 0.18);
    background: linear-gradient(
        to bottom,
        rgba(11, 14, 23, 0.92) 0%,
        rgba(11, 14, 23, 0.78) 100%
    );
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--solar-amber);
}
.hud-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    white-space: nowrap;
}
.hud-key {
    color: var(--dust-gray);
    font-size: 10.5px;
}
.hud-val { color: var(--solar-amber); }
.hud-blink {
    animation: hud-blink 1.6s steps(2, end) infinite;
}
@keyframes hud-blink {
    50% { opacity: 0.35; }
}

/* ---------- Side rail ---------- */
.rail {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--rail-w);
    z-index: 75;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 179, 0, 0.18);
    background: linear-gradient(
        to right,
        rgba(11, 14, 23, 0.96) 0%,
        rgba(11, 14, 23, 0.7) 100%
    );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.rail ul {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
}
.rail-item {
    position: relative;
    cursor: pointer;
    color: var(--dust-gray);
    transition: color 220ms ease;
}
.rail-item:hover { color: var(--solar-amber); }

.rail-dot {
    display: block;
    width: 14px; height: 14px;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: transparent;
    transition: background 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}
.rail-item.active .rail-dot {
    background: var(--solar-amber);
    box-shadow:
        0 0 0 3px rgba(255, 179, 0, 0.18),
        0 0 14px 2px rgba(255, 179, 0, 0.6);
    transform: scale(1.15);
}
.rail-item.active { color: var(--solar-amber); }

.rail-label {
    position: absolute;
    left: calc(var(--rail-w) - 18px);
    top: 50%;
    transform: translate(-12px, -50%);
    opacity: 0;
    pointer-events: none;
    background: var(--nebula-charcoal);
    border: 1px solid rgba(255, 179, 0, 0.25);
    color: var(--solar-amber);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 6px 10px;
    white-space: nowrap;
    transition: transform 220ms ease, opacity 220ms ease;
}
.rail-item:hover .rail-label,
.rail-item.active .rail-label {
    opacity: 1;
    transform: translate(0, -50%);
}

/* ---------- Main / sections ---------- */
main {
    position: relative;
    z-index: 5;
    padding-left: var(--rail-w);
    padding-top: var(--hud-h);
}

.section {
    position: relative;
    min-height: 100vh;
    padding: 12vh 8vw 15vh;
    transition: filter 700ms ease;
    filter: blur(1.4px);
    will-change: filter;
}
.section.in-view { filter: blur(0); }

.section-head {
    max-width: 720px;
    margin: 0 auto 6vh;
    text-align: left;
}
.section-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--solar-amber);
    border-left: 2px solid var(--solar-amber);
    padding-left: 10px;
    margin-bottom: 18px;
}
.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 5.5vw, 4.4rem);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1.05;
    margin: 0 0 0.6em;
    color: var(--starlight);
}
.section-lede {
    color: var(--dust-gray);
    max-width: 56ch;
    font-size: 17px;
}

/* ---------- Parallax layers (per-section) ---------- */
.parallax-layer {
    position: absolute;
    inset: -10%;
    pointer-events: none;
    z-index: 0;
}
.parallax-far {
    background:
        radial-gradient(1px 1px at 12% 22%, rgba(232, 230, 225, 0.5) 50%, transparent 60%),
        radial-gradient(1px 1px at 32% 78%, rgba(232, 230, 225, 0.4) 50%, transparent 60%),
        radial-gradient(1px 1px at 58% 18%, rgba(232, 230, 225, 0.5) 50%, transparent 60%),
        radial-gradient(1.4px 1.4px at 76% 64%, rgba(232, 230, 225, 0.7) 50%, transparent 60%),
        radial-gradient(1px 1px at 88% 38%, rgba(232, 230, 225, 0.45) 50%, transparent 60%);
    opacity: 0.75;
    transform: translate3d(0, var(--p-far, 0), 0);
}
.parallax-near {
    background:
        radial-gradient(1.2px 1.2px at 22% 36%, rgba(0, 184, 169, 0.6) 50%, transparent 60%),
        radial-gradient(1.6px 1.6px at 64% 72%, rgba(255, 179, 0, 0.55) 50%, transparent 60%),
        radial-gradient(1.2px 1.2px at 84% 22%, rgba(232, 230, 225, 0.7) 50%, transparent 60%);
    opacity: 0.85;
    transform: translate3d(0, var(--p-near, 0), 0);
}

/* =========================================================
   1. ARRIVAL GATE
   ========================================================= */
.section-arrival {
    min-height: calc(100vh - var(--hud-h));
    padding-top: 8vh;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    overflow: hidden;
    filter: blur(0);   /* never blur the very first section */
}

.orb {
    position: absolute;
    width: min(78vh, 760px);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    animation: orb-fade 2400ms 200ms ease-out forwards;
    z-index: 1;
}
.orb-primary {
    right: -12vw;
    top: 50%;
    transform: translateY(-50%);
    box-shadow:
        0 0 90px 8px rgba(0, 184, 169, 0.18),
        0 0 220px 30px rgba(255, 111, 60, 0.06),
        inset 30px -10px 80px rgba(0, 0, 0, 0.55);
}
.orb-surface {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        conic-gradient(from 0deg,
            #2a3243, #3a3a4d, #5a4232, #7a3a2a,
            #6a2a2a, #3e2c34, #2a3243, #2a3243);
    filter: contrast(1.05) saturate(0.95);
    animation: orb-rotate 120s linear infinite;
}
.orb-atmos {
    position: absolute;
    inset: -3%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        rgba(0, 184, 169, 0.0) 55%,
        rgba(0, 184, 169, 0.35) 70%,
        rgba(0, 184, 169, 0.0) 90%);
    mix-blend-mode: screen;
}
.orb-shadow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0.0) 30%,
        rgba(0, 0, 0, 0.55) 100%);
}
@keyframes orb-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes orb-fade {
    to { opacity: 1; }
}

.seal {
    position: absolute;
    left: 8vw;
    top: 14vh;
    width: 116px;
    height: 116px;
    color: var(--solar-amber);
    opacity: 0;
    animation: seal-fade 1500ms 800ms ease-out forwards;
    z-index: 2;
}
.seal svg { width: 100%; height: 100%; display: block; }
.seal::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    box-shadow: 0 0 22px 1px rgba(255, 179, 0, 0.22);
    pointer-events: none;
}
@keyframes seal-fade {
    to { opacity: 1; }
}

.arrival-content {
    position: relative;
    z-index: 3;
    max-width: 760px;
    margin-left: 4vw;
}
.kicker {
    font-family: var(--font-mono);
    color: var(--atmosphere-teal);
    font-size: 13px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    margin: 0 0 16px;
    opacity: 0;
    animation: kicker-fade 800ms 600ms ease-out forwards;
}
@keyframes kicker-fade { to { opacity: 1; } }

.arrival-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 6.5vw, 5.6rem);
    line-height: 0.98;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0 0 28px;
    color: var(--starlight);
    text-shadow:
        0 0 1px rgba(232, 230, 225, 0.4),
        0 0 32px rgba(255, 179, 0, 0.08);
}
.type-line {
    display: block;
    white-space: pre;
    font-family: var(--font-mono);
    visibility: hidden;
}
.type-line.typing,
.type-line.done {
    visibility: visible;
}
.type-line.done {
    font-family: var(--font-display);
    transition: font-family 0ms;
}

.arrival-sub {
    max-width: 56ch;
    color: var(--starlight);
    opacity: 0;
    animation: sub-fade 800ms 3200ms ease-out forwards;
    margin: 0 0 32px;
}
@keyframes sub-fade { to { opacity: 1; } }

.arrival-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    max-width: 600px;
    opacity: 0;
    animation: meta-fade 800ms 3600ms ease-out forwards;
}
.arrival-meta > div {
    border-top: 1px solid rgba(255, 179, 0, 0.25);
    padding-top: 10px;
}
.arrival-meta dt {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--dust-gray);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin: 0 0 4px;
}
.arrival-meta dd {
    font-family: var(--font-display);
    color: var(--solar-amber);
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
@keyframes meta-fade { to { opacity: 1; } }

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: var(--solar-amber);
    border: none;
    cursor: pointer;
    font-family: var(--font-mono);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    font-size: 11px;
    opacity: 0;
    animation: cue-fade 800ms 4000ms ease-out forwards;
    padding: 6px 10px;
    z-index: 4;
}
.scroll-cue-arrow {
    width: 12px;
    height: 12px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    animation: cue-pulse 1800ms ease-in-out infinite;
}
@keyframes cue-fade { to { opacity: 1; } }
@keyframes cue-pulse {
    0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.6; }
    50%      { transform: rotate(45deg) translate(4px, 4px); opacity: 1; }
}

/* =========================================================
   2. BRIEFING ROOM -- broken-grid dossiers
   ========================================================= */
.section-briefing {
    background:
        radial-gradient(ellipse at 12% 20%, rgba(0, 184, 169, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 88% 80%, rgba(255, 179, 0, 0.04) 0%, transparent 60%);
}

.dossiers {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px;
    align-items: start;
}
.dossier {
    position: relative;
    background: linear-gradient(
        180deg,
        rgba(26, 31, 46, 0.95) 0%,
        rgba(26, 31, 46, 0.85) 100%);
    border: 1px solid rgba(255, 179, 0, 0.18);
    border-top: none;
    padding: 70px 28px 28px;
    color: var(--starlight);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0,0,0,0.25);
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 600ms ease, transform 600ms ease;
}
.dossier.in {
    opacity: 1;
    transform: none;
}
.dossier-mars  { transform: translateX(-100px); margin-top: 0; }
.dossier-aqua  { transform: translateX(0) translateY(48px); margin-top: 48px; }
.dossier-luna  { transform: translateX(100px); margin-top: 24px; }
.dossier-aqua.in { transform: translateY(48px); }
.dossier-luna.in { transform: translateX(0) translateY(24px); }

/* Torn-edge top using clip-path */
.dossier::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -22px;
    height: 28px;
    background: rgba(26, 31, 46, 0.95);
    border-top: 1px solid rgba(255, 179, 0, 0.18);
    clip-path: polygon(
        0 100%, 4% 60%, 9% 95%, 14% 50%, 20% 80%, 26% 40%, 32% 90%,
        38% 55%, 45% 75%, 52% 35%, 58% 90%, 65% 50%, 72% 85%, 78% 45%,
        85% 80%, 91% 50%, 96% 90%, 100% 60%, 100% 100%
    );
}

.dossier-mars::before {
    clip-path: polygon(
        0 100%, 3% 50%, 8% 92%, 13% 40%, 19% 80%, 25% 30%, 32% 88%,
        39% 50%, 46% 78%, 54% 30%, 60% 90%, 67% 48%, 75% 88%,
        82% 42%, 90% 80%, 96% 50%, 100% 88%, 100% 100%
    );
}
.dossier-aqua::before {
    clip-path: polygon(
        0 100%, 5% 70%, 11% 90%, 17% 45%, 23% 88%, 30% 50%, 36% 84%,
        43% 38%, 50% 88%, 57% 50%, 64% 80%, 71% 40%, 78% 88%,
        85% 50%, 92% 86%, 100% 60%, 100% 100%
    );
}
.dossier-luna::before {
    clip-path: polygon(
        0 100%, 4% 60%, 10% 90%, 16% 40%, 22% 88%, 30% 50%, 38% 92%,
        46% 40%, 54% 88%, 62% 48%, 70% 92%, 78% 42%, 86% 90%,
        94% 52%, 100% 90%, 100% 100%
    );
}

.dossier-orb {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 56px; height: 56px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: inset 6px -2px 16px rgba(0,0,0,0.6);
}
.dossier-orb .orb-surface {
    animation-duration: 80s;
}
.orb-mars .orb-surface {
    background: conic-gradient(from 0deg,
        #5a2c1c, #7a3a2a, #9a4a32, #b25238,
        #8a3a26, #5a2818, #4a2010, #5a2c1c);
}
.orb-mars .orb-atmos {
    background: radial-gradient(circle at 35% 35%,
        rgba(255, 111, 60, 0) 60%,
        rgba(255, 111, 60, 0.45) 78%,
        rgba(255, 111, 60, 0) 100%);
}
.orb-aqua .orb-surface {
    background: conic-gradient(from 0deg,
        #15405a, #1e6a86, #2a8c8a, #1e6a86,
        #15405a, #0e3046, #15405a, #1e6a86);
}
.orb-aqua .orb-atmos {
    background: radial-gradient(circle at 35% 35%,
        rgba(0, 184, 169, 0) 60%,
        rgba(0, 184, 169, 0.45) 78%,
        rgba(0, 184, 169, 0) 100%);
}
.orb-luna .orb-surface {
    background: conic-gradient(from 0deg,
        #6a5e7a, #8a7a9a, #a89cba, #c3b6cf,
        #a89cba, #8a7a9a, #6a5e7a, #5a4e6a);
}
.orb-luna .orb-atmos {
    background: radial-gradient(circle at 35% 35%,
        rgba(200, 180, 220, 0) 60%,
        rgba(200, 180, 220, 0.4) 78%,
        rgba(200, 180, 220, 0) 100%);
}

.dossier-head {
    margin-bottom: 18px;
}
.dossier-code {
    display: block;
    font-family: var(--font-mono);
    color: var(--solar-amber);
    font-size: 11.5px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.dossier-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
    color: var(--starlight);
}

.dossier-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    margin: 0 0 18px;
    padding: 14px 0;
    border-top: 1px dashed rgba(255, 179, 0, 0.2);
    border-bottom: 1px dashed rgba(255, 179, 0, 0.2);
}
.dossier-stats > div { display: flex; flex-direction: column; }
.dossier-stats dt {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--dust-gray);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin: 0 0 2px;
}
.dossier-stats dd {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--starlight);
    margin: 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.dossier-stats dd.ok   { color: var(--clearance-green); }
.dossier-stats dd.warn { color: var(--reentry-orange); }

.dossier-note {
    color: var(--starlight);
    margin: 0 0 18px;
    font-size: 15.5px;
}

.dossier-foot {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--dust-gray);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border-top: 1px dotted rgba(138, 139, 146, 0.3);
    padding-top: 10px;
}

/* =========================================================
   3. THE MANIFEST -- timeline of phases
   ========================================================= */
.section-manifest {
    background:
        linear-gradient(180deg, rgba(11,14,23,1) 0%, rgba(15,19,30,1) 100%);
}
.timeline {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    padding: 30px 0 30px;
}
.timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: 240px;
    height: 100%;
    color: var(--solar-amber);
    pointer-events: none;
    overflow: visible;
}
.phases {
    list-style: none;
    margin: 0; padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 70px;
}
.phase {
    display: grid;
    grid-template-columns: 1fr 160px 1fr;
    align-items: center;
    gap: 0;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.phase.in {
    opacity: 1;
    transform: none;
}
.phase:nth-child(odd) .phase-body {
    grid-column: 1;
    text-align: right;
    padding-right: 28px;
    justify-self: end;
}
.phase:nth-child(even) .phase-body {
    grid-column: 3;
    text-align: left;
    padding-left: 28px;
    justify-self: start;
}
.phase:nth-child(odd) .medallion  { grid-column: 2; }
.phase:nth-child(even) .medallion { grid-column: 2; }

.medallion {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--void-black);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
    color: var(--solar-amber);
}
.phase.in .medallion { transform: scale(1); }

.medallion::before,
.medallion::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.medallion::before {
    /* outer ring */
    inset: -8px;
    border: 4px solid transparent;
    background:
        conic-gradient(from -90deg,
            var(--solar-amber) 0%,
            var(--solar-amber) var(--ring, 0%),
            rgba(255, 179, 0, 0.18) var(--ring, 0%),
            rgba(255, 179, 0, 0.18) 100%) border-box;
    -webkit-mask:
        linear-gradient(#000 0 0) padding-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    transition: --ring 800ms ease;
}
.medallion::after {
    /* inner ring */
    inset: 4px;
    border: 2px solid var(--solar-amber);
    box-shadow: inset 0 0 18px rgba(255, 179, 0, 0.18);
}
.medallion-icon {
    position: relative;
    z-index: 2;
    font-size: 38px;
    line-height: 1;
    color: var(--solar-amber);
    text-shadow: 0 0 14px rgba(255, 179, 0, 0.6);
    font-family: var(--font-display);
}

.phase-body {
    max-width: 360px;
}
.phase-num {
    display: inline-block;
    font-family: var(--font-mono);
    color: var(--atmosphere-teal);
    font-size: 11.5px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.phase-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 8px;
    color: var(--starlight);
}
.phase-body p {
    color: var(--starlight);
    margin: 0 0 6px;
    font-size: 15.5px;
}
.phase-time {
    font-family: var(--font-mono);
    color: var(--dust-gray);
    font-size: 11.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

/* =========================================================
   4. APPLICATION TERMINAL
   ========================================================= */
.section-application {
    background:
        radial-gradient(ellipse at 50% 30%, rgba(255, 179, 0, 0.05) 0%, transparent 60%);
}
.crt {
    max-width: 1080px;
    margin: 0 auto;
    perspective: 1400px;
}
.crt-bezel {
    position: relative;
    background: linear-gradient(180deg, #14141a 0%, #0c0c10 100%);
    border-radius: 18px;
    padding: 22px;
    box-shadow:
        0 30px 60px rgba(0,0,0,0.55),
        inset 0 0 0 1px rgba(255, 179, 0, 0.08),
        inset 0 0 30px rgba(0,0,0,0.6);
}
.crt-bezel::before {
    content: "";
    position: absolute;
    top: 8px; left: 12px; right: 12px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 179, 0, 0.18) 20%,
        rgba(255, 179, 0, 0.08) 80%,
        transparent 100%);
}
.crt-screen {
    position: relative;
    background:
        radial-gradient(ellipse at center, rgba(255, 179, 0, 0.07) 0%, rgba(0,0,0,0) 70%),
        radial-gradient(ellipse at center, #161616 0%, #0a0a0a 70%, #050505 100%);
    border-radius: 38px / 28px;
    padding: 28px 32px 24px;
    color: var(--solar-amber);
    font-family: var(--font-mono);
    box-shadow:
        inset 0 0 60px rgba(255, 179, 0, 0.08),
        inset 0 0 6px rgba(255, 179, 0, 0.18),
        0 0 32px rgba(255, 179, 0, 0.22);
    overflow: hidden;
}
.crt-screen::before {
    /* CRT scanlines, stronger inside the screen */
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 179, 0, 0.06) 0,
        rgba(255, 179, 0, 0.06) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    mix-blend-mode: screen;
    border-radius: inherit;
}
.crt-screen::after {
    /* curvature gloss */
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 35%),
        radial-gradient(ellipse at center, rgba(0,0,0,0) 60%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
    border-radius: inherit;
}
.crt.flicker .crt-screen { animation: crt-flicker 280ms steps(2, end) 3; }
@keyframes crt-flicker {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.25; }
}
.crt.pulse .crt-screen {
    box-shadow:
        inset 0 0 70px rgba(255, 179, 0, 0.16),
        inset 0 0 8px rgba(255, 179, 0, 0.32),
        0 0 60px rgba(255, 179, 0, 0.45);
}

.crt-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    font-size: 11px;
    color: rgba(255, 179, 0, 0.7);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    border-bottom: 1px dashed rgba(255, 179, 0, 0.25);
    padding-bottom: 8px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}
.crt-tag { white-space: nowrap; }
.crt-blink { animation: hud-blink 1.2s steps(2, end) infinite; }

.crt-out {
    margin: 0 0 18px;
    position: relative;
    z-index: 1;
    min-height: 86px;
}
.crt-line {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--solar-amber);
    text-shadow: 0 0 10px rgba(255, 179, 0, 0.35);
}
.crt-line.warn  { color: var(--reentry-orange); text-shadow: 0 0 10px rgba(255, 111, 60, 0.35); }
.crt-line.ok    { color: var(--clearance-green); text-shadow: 0 0 10px rgba(46, 204, 113, 0.35); }

.crt-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 22px;
    position: relative;
    z-index: 1;
}
.crt-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.crt-row:last-of-type,
.crt-actions { grid-column: 1 / -1; }

.crt-row label {
    font-size: 10.5px;
    color: rgba(255, 179, 0, 0.7);
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.crt-row input {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 179, 0, 0.4);
    color: var(--solar-amber);
    font-family: var(--font-mono);
    font-size: 14.5px;
    padding: 6px 2px 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    caret-color: var(--solar-amber);
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.crt-row input::placeholder {
    color: rgba(255, 179, 0, 0.35);
    text-transform: uppercase;
}
.crt-row input:focus {
    border-bottom-color: var(--solar-amber);
    box-shadow: 0 1px 0 0 rgba(255, 179, 0, 0.6);
}

.crt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
    border-top: 1px dashed rgba(255, 179, 0, 0.25);
    padding-top: 14px;
}
.crt-btn {
    background: rgba(255, 179, 0, 0.08);
    color: var(--solar-amber);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 179, 0, 0.5);
    padding: 10px 16px;
    cursor: pointer;
    transition: background 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}
.crt-btn:hover {
    background: rgba(255, 179, 0, 0.18);
    box-shadow: 0 0 18px rgba(255, 179, 0, 0.35);
}
.crt-btn:active { transform: translateY(1px); }
.crt-btn-ghost {
    background: transparent;
    border-color: rgba(138, 139, 146, 0.5);
    color: var(--dust-gray);
}
.crt-btn-ghost:hover {
    color: var(--reentry-orange);
    border-color: var(--reentry-orange);
    box-shadow: 0 0 14px rgba(255, 111, 60, 0.2);
}

.crt-footer {
    margin-top: 16px;
    border-top: 1px dashed rgba(255, 179, 0, 0.25);
    padding-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(255, 179, 0, 0.85);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}
.crt-cursor {
    display: inline-block;
    width: 0.65em;
    height: 1em;
    background: var(--solar-amber);
    box-shadow: 0 0 8px rgba(255, 179, 0, 0.7);
    color: transparent;
    animation: crt-blink-cursor 1s steps(2, end) infinite;
}
@keyframes crt-blink-cursor {
    50% { opacity: 0; }
}

.kbd {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.85em;
    border: 1px solid rgba(255, 179, 0, 0.45);
    color: var(--solar-amber);
    padding: 1px 6px;
    margin: 0 2px;
    border-radius: 3px;
    background: rgba(255, 179, 0, 0.06);
}

/* Stamp overlay */
.stamp {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(1.3) rotate(-8deg);
    z-index: 90;
    font-family: var(--font-stamp);
    font-size: clamp(28px, 5.5vw, 56px);
    color: var(--clearance-green);
    border: 6px solid var(--clearance-green);
    padding: 18px 28px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(11, 14, 23, 0.45);
    box-shadow:
        0 0 0 2px rgba(46, 204, 113, 0.15),
        0 0 60px rgba(46, 204, 113, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: none;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}
.stamp.fire {
    animation: stamp-slam 240ms cubic-bezier(0.5, -0.3, 0.4, 1.4) forwards,
               stamp-fade 600ms 1800ms ease-out forwards;
}
@keyframes stamp-slam {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(1.6) rotate(-10deg); }
    60%  { opacity: 1; transform: translate(-50%, -50%) scale(0.94) rotate(-7deg); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-8deg); }
}
@keyframes stamp-fade {
    0%   { opacity: 1; }
    100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1) rotate(-8deg); }
}

/* Ripple */
.ripple {
    position: absolute;
    pointer-events: none;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 179, 0, 0.55) 0%,
        rgba(255, 179, 0, 0.25) 40%,
        rgba(255, 179, 0, 0) 70%);
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: ripple-out 480ms ease-out forwards;
    z-index: 95;
}
@keyframes ripple-out {
    to {
        transform: translate(-50%, -50%) scale(40);
        opacity: 0;
    }
}

/* =========================================================
   5. DEPARTURE LOUNGE
   ========================================================= */
.section-departure {
    overflow: hidden;
}
.port {
    position: relative;
    max-width: 1280px;
    margin: 0 auto 48px;
    border: 1px solid rgba(255, 179, 0, 0.18);
    aspect-ratio: 12 / 5;
    background: var(--void-black);
    overflow: hidden;
}
.port-svg { display: block; width: 100%; height: 100%; }
.port::after {
    /* horizon haze */
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: 0;
    height: 40%;
    background: linear-gradient(180deg,
        rgba(255, 111, 60, 0) 0%,
        rgba(255, 111, 60, 0.08) 60%,
        rgba(255, 111, 60, 0.18) 100%);
    pointer-events: none;
}

.manifest-card {
    position: relative;
    max-width: 720px;
    margin: 0 auto 36px;
    background: linear-gradient(180deg, rgba(26, 31, 46, 0.95), rgba(26, 31, 46, 0.85));
    border: 1px solid rgba(255, 179, 0, 0.22);
    padding: 24px 26px;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.35);
}
.manifest-card::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px dashed rgba(255, 179, 0, 0.18);
    pointer-events: none;
}
.manifest-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(255, 179, 0, 0.25);
}
.manifest-code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--solar-amber);
    letter-spacing: 0.24em;
    text-transform: uppercase;
}
.manifest-stamp {
    font-family: var(--font-stamp);
    color: var(--clearance-green);
    font-size: 1.1rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border: 2px solid var(--clearance-green);
    padding: 4px 10px;
    transform: rotate(-4deg);
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.25);
}
.manifest-rows {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    margin: 0;
}
.manifest-rows > div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px dotted rgba(138, 139, 146, 0.25);
    padding: 4px 0;
}
.manifest-row-wide { grid-column: 1 / -1; }
.manifest-rows dt {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--dust-gray);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin: 0;
}
.manifest-rows dd {
    font-family: var(--font-display);
    color: var(--starlight);
    margin: 0;
    font-size: 14.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: right;
}
.manifest-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 179, 0, 0.25);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--dust-gray);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.closing {
    max-width: 56ch;
    margin: 0 auto;
    text-align: center;
    color: var(--starlight);
    font-size: 17px;
    line-height: 1.8;
    border-top: 1px dashed rgba(255, 179, 0, 0.2);
    border-bottom: 1px dashed rgba(255, 179, 0, 0.2);
    padding: 22px 0;
}

/* =========================================================
   GROUND footer
   ========================================================= */
.ground {
    position: relative;
    z-index: 5;
    margin-left: var(--rail-w);
    padding: 28px 8vw 38px;
    border-top: 1px solid rgba(255, 179, 0, 0.18);
    background: rgba(11, 14, 23, 0.85);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--dust-gray);
}
.ground-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.ground-row + .ground-row {
    margin-top: 8px;
    color: var(--solar-amber);
}
.ground-thin { color: var(--solar-amber); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
    .dossiers { grid-template-columns: 1fr; }
    .dossier-mars, .dossier-aqua, .dossier-luna {
        margin-top: 0;
    }
    .dossier-mars  { transform: translateY(28px); }
    .dossier-aqua  { transform: translateY(28px); }
    .dossier-luna  { transform: translateY(28px); }
    .dossier-mars.in,
    .dossier-aqua.in,
    .dossier-luna.in { transform: none; }

    .crt-form { grid-template-columns: 1fr; }
    .phase {
        grid-template-columns: 80px 1fr;
        gap: 14px;
    }
    .phase:nth-child(odd) .phase-body,
    .phase:nth-child(even) .phase-body {
        grid-column: 2;
        text-align: left;
        padding: 0;
        justify-self: start;
    }
    .phase:nth-child(odd) .medallion,
    .phase:nth-child(even) .medallion { grid-column: 1; transform-origin: left center; }
    .medallion { width: 80px; height: 80px; }
    .medallion-icon { font-size: 26px; }
    .timeline-line { display: none; }
}

@media (max-width: 720px) {
    :root { --rail-w: 0px; }
    .rail { display: none; }
    main { padding-left: 0; }
    .ground { margin-left: 0; }
    .hud { grid-template-columns: 1fr 1fr; padding: 0 16px; height: auto; padding-top: 6px; padding-bottom: 6px; }
    .hud-cell { font-size: 10px; }
    .hud-status, .hud-coords { display: none; }
    .section { padding: 14vh 6vw 12vh; }
    .seal { left: 6vw; top: 9vh; width: 80px; height: 80px; }
    .arrival-content { margin-left: 0; }
    .orb-primary { right: -30vw; opacity: 0.7; }
    .arrival-meta { grid-template-columns: 1fr 1fr; }
    .manifest-rows { grid-template-columns: 1fr; }
    .manifest-rows dd { text-align: left; }
}
