:root {
  color-scheme: light;
    --void: #f6f3ec;
    --ink: #fbf9f4;
    --panel: #f1ede4;
    --plate: #e8e3d8;
    --paper: #101619;
    --muted: #45555b;
    --dim: #55666c;
    --line: #d3ccbe;
    --signal: #0f6f7c;
    --deep-signal: #bfdfe4;
    --mono: "Berkeley Mono", "IBM Plex Mono", "Cascadia Mono", "SFMono-Regular", monospace;
    --condensed: "DIN Condensed", "Bahnschrift Condensed", "Aptos Narrow", sans-serif;
    --sans: "Neue Haas Grotesk Text", "Atkinson Hyperlegible", "Aptos", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 0;
    background: var(--void);
    color: var(--paper);
    scroll-behavior: smooth;
}

body {
    min-width: 0;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 78% 12%, color-mix(in srgb, var(--deep-signal) 62%, transparent), transparent 29rem),
        linear-gradient(90deg, color-mix(in srgb, var(--line) 48%, transparent) 1px, transparent 1px),
        linear-gradient(180deg, color-mix(in srgb, var(--line) 42%, transparent) 1px, transparent 1px),
        linear-gradient(135deg, var(--void) 0%, var(--ink) 42%, var(--panel) 100%);
    background-size: auto, 4.75rem 4.75rem, 4.75rem 4.75rem, auto;
    color: var(--paper);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background:
        repeating-linear-gradient(0deg, color-mix(in srgb, var(--paper) 5%, transparent) 0 1px, transparent 1px 5px),
        linear-gradient(90deg, transparent, color-mix(in srgb, var(--signal) 9%, transparent), transparent);
    opacity: 0.38;
    mix-blend-mode: multiply;
}

a {
    color: var(--paper);
    text-decoration-color: var(--signal);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

a:hover,
a:focus-visible {
    color: var(--signal);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10;
    padding: 0.75rem 1rem;
    border: 1px solid var(--signal);
    background: var(--void);
    color: var(--paper);
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.room-header,
.room-footer,
.signal-room {
    width: min(100% - 2rem, 1440px);
    margin-inline: auto;
}

.room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.return-link,
.top-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.return-link {
    text-decoration: none;
}

.return-mark {
    display: grid;
    width: 2.15rem;
    height: 2.15rem;
    place-items: center;
    border: 1px solid var(--signal);
    background: var(--deep-signal);
    color: var(--paper);
    font-family: var(--condensed);
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.top-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.top-nav a,
.room-footer a,
.record-table a {
    overflow-wrap: anywhere;
}

.signal-room {
    display: grid;
    gap: 1rem;
    padding: 1rem 0 3rem;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(19rem, 0.55fr);
    min-height: clamp(33rem, 70vh, 46rem);
    border: 1px solid var(--line);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--line) 50%, transparent) 1px, transparent 1px),
        linear-gradient(180deg, color-mix(in srgb, var(--line) 50%, transparent) 1px, transparent 1px),
        linear-gradient(145deg, color-mix(in srgb, var(--plate) 88%, transparent), color-mix(in srgb, var(--void) 94%, transparent));
    background-size: 2.25rem 2.25rem, 2.25rem 2.25rem, auto;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: clamp(1.25rem, 4vw, 3.25rem);
}

.eyebrow,
.module-head,
.card-index,
.stamp-label,
.record-table dt,
.packet-row span,
.route-figure figcaption,
.rack-title p {
    font-family: var(--mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.eyebrow,
.rack-title p {
    margin: 0;
    color: var(--signal);
    font-size: clamp(0.72rem, 1vw, 0.86rem);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--paper);
    font-family: var(--condensed);
    font-weight: 700;
    line-height: 0.92;
    text-transform: uppercase;
}

h1 {
    max-width: 12ch;
    margin-bottom: 1.4rem;
    font-size: clamp(4.4rem, 12vw, 13.5rem);
    letter-spacing: -0.075em;
}

h2 {
    margin-bottom: 1rem;
    font-size: clamp(2.45rem, 6.8vw, 7.2rem);
    letter-spacing: -0.06em;
}

h3 {
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 4vw, 4.4rem);
    letter-spacing: -0.05em;
}

.lede {
    max-width: 63rem;
    margin: 0;
    color: var(--muted);
    font-size: clamp(1.05rem, 1.8vw, 1.55rem);
    line-height: 1.35;
}

.live-stamp {
    display: grid;
    align-content: stretch;
    border-left: 1px solid var(--line);
    background: color-mix(in srgb, var(--void) 64%, transparent);
}

.live-stamp div {
    display: grid;
    align-content: end;
    gap: 0.65rem;
    min-height: 9rem;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
}

.live-stamp div:last-child {
    border-bottom: 0;
}

.live-stamp strong {
    color: var(--paper);
    font-family: var(--mono);
    font-size: clamp(1rem, 1.7vw, 1.45rem);
    font-weight: 600;
    line-height: 1.12;
    text-transform: uppercase;
}

.stamp-label {
    color: var(--dim);
    font-size: 0.72rem;
}

.console-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
    gap: 1rem;
}

.route-module,
.briefing-module,
.telemetry-card,
.packet-section,
.record-section {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, color-mix(in srgb, var(--plate) 86%, transparent), color-mix(in srgb, var(--panel) 92%, transparent));
}

.module-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--dim);
    font-size: 0.72rem;
}

.module-head p,
.module-head span {
    margin: 0;
}

.module-head p {
    color: var(--signal);
}

.route-figure {
    margin: 0;
    padding: clamp(0.8rem, 2vw, 1.4rem);
}

.route-figure img {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--void);
}

.route-figure figcaption {
    margin-top: 0.85rem;
    color: var(--dim);
    font-size: 0.72rem;
    line-height: 1.5;
}

.briefing-stack {
    display: grid;
    gap: 0;
}

.briefing-stack p {
    margin: 0;
    padding: clamp(1rem, 2vw, 1.45rem);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: clamp(0.98rem, 1.35vw, 1.18rem);
}

.briefing-stack p:last-child {
    border-bottom: 0;
}

.briefing-stack strong {
    color: var(--paper);
}

.telemetry-rack {
    display: grid;
    grid-template-columns: minmax(16rem, 1.1fr) repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.rack-title {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 24rem;
    padding: 1rem;
    border: 1px solid var(--line);
    background:
        repeating-linear-gradient(90deg, transparent 0 1.4rem, color-mix(in srgb, var(--line) 50%, transparent) 1.4rem 1.46rem),
        var(--ink);
}

.rack-title h2 {
    margin: 0;
    font-size: clamp(2.4rem, 4.8vw, 5.7rem);
}

.telemetry-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 24rem;
    padding: 1rem;
    overflow: hidden;
}

.telemetry-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.28rem;
    content: "";
    background: linear-gradient(180deg, var(--signal), var(--deep-signal));
}

.card-index {
    color: var(--signal);
    font-size: 0.78rem;
}

.telemetry-card h3 {
    margin-top: auto;
    overflow-wrap: anywhere;
}

.telemetry-card p {
    color: var(--muted);
    font-size: 0.95rem;
}

.telemetry-card dl,
.record-table {
    display: grid;
    gap: 0;
    margin: 0;
}

.telemetry-card dl {
    margin-top: auto;
    border-top: 1px solid var(--line);
}

.telemetry-card dl div,
.record-table div {
    display: grid;
    grid-template-columns: 0.75fr 1.25fr;
    gap: 0.75rem;
    padding: 0.68rem 0;
    border-bottom: 1px solid var(--line);
}

.telemetry-card dt,
.telemetry-card dd,
.record-table dt,
.record-table dd {
    min-width: 0;
    margin: 0;
}

.telemetry-card dt,
.record-table dt {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.telemetry-card dd,
.record-table dd {
    color: var(--paper);
    font-family: var(--mono);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.packet-section {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    min-height: 30rem;
}

.packet-copy {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(1rem, 3vw, 2.4rem);
    border-right: 1px solid var(--line);
}

.packet-copy p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.6vw, 1.3rem);
}

.packet-board {
    display: grid;
    gap: 0;
    padding: clamp(0.7rem, 2vw, 1.5rem);
    overflow: hidden;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
        linear-gradient(180deg, color-mix(in srgb, var(--line) 48%, transparent) 1px, transparent 1px),
        var(--void);
    background-size: 3rem 3rem, 3rem 3rem, auto;
}

.packet-row {
    position: relative;
    display: grid;
    grid-template-columns: 7rem 1fr;
    align-items: center;
    min-height: 6.5rem;
    border-bottom: 1px solid var(--line);
}

.packet-row:last-child {
    border-bottom: 0;
}

.packet-row span {
    z-index: 1;
    color: var(--dim);
    font-size: 0.74rem;
}

.packet-row i {
    display: block;
    height: 2px;
    background: linear-gradient(90deg, var(--deep-signal), var(--signal), var(--line));
}

.packet-row b {
    position: absolute;
    left: 7rem;
    width: 0.8rem;
    height: 0.8rem;
    border: 1px solid var(--signal);
    background: var(--paper);
    transform: translateX(0) rotate(45deg);
    animation: packet-travel 7.5s linear infinite;
}

.packet-row b:nth-of-type(2) {
    animation-delay: -2.4s;
}

.packet-row b:nth-of-type(3) {
    animation-delay: -4.9s;
}

.row-b b {
    animation-duration: 8.8s;
}

.row-c b {
    animation-duration: 6.8s;
}

.row-d b {
    animation-duration: 9.6s;
}

.record-section {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.record-copy {
    padding: clamp(1rem, 3vw, 2.4rem);
    border-right: 1px solid var(--line);
}

.record-copy p:last-child {
    margin: 0;
    color: var(--muted);
}

.record-table {
    align-content: stretch;
}

.record-table div {
    align-items: end;
    padding: clamp(1rem, 2.5vw, 1.7rem);
}

.record-table dd {
    font-size: clamp(0.9rem, 1.8vw, 1.3rem);
}

.room-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0 2rem;
    border-top: 1px solid var(--line);
    color: var(--dim);
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.room-footer p {
    margin: 0;
}

html.js [data-rise],
html.js [data-reveal] {
    opacity: 1;
    transform: translateY(1.35rem);
    transition: transform 700ms ease;
}

html.js [data-reveal] {
    transform: translateY(0) scale(0.985);
}

html.js [data-rise].is-in,
html.js [data-reveal].is-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

html.js.reveals-complete [data-rise],
html.js.reveals-complete [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
}

.telemetry-card.is-active {
    background: linear-gradient(180deg, color-mix(in srgb, var(--deep-signal) 32%, var(--plate)), var(--panel));
}

[data-pulse].is-hot {
    color: var(--signal);
}

@keyframes packet-travel {
    0% {
        transform: translateX(0) rotate(45deg);
        opacity: 0;
    }
    8% {
        opacity: 1;
    }
    88% {
        opacity: 1;
    }
    100% {
        transform: translateX(min(58vw, 52rem)) rotate(45deg);
        opacity: 0;
    }
}

@media (max-width: 1180px) {
    .telemetry-rack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rack-title {
        grid-column: 1 / -1;
        min-height: 16rem;
    }
}

@media (max-width: 880px) {
    .room-header,
    .room-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-nav {
        justify-content: flex-start;
    }

    .hero-panel,
    .console-grid,
    .packet-section,
    .record-section {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        min-height: 0;
    }

    .live-stamp,
    .packet-copy,
    .record-copy {
        border-left: 0;
        border-right: 0;
        border-top: 1px solid var(--line);
    }

    .live-stamp {
        grid-template-columns: 1fr;
    }

    .packet-section {
        min-height: 0;
    }

    .packet-board {
        min-height: 24rem;
    }
}

@media (max-width: 620px) {
    .room-header,
    .room-footer,
    .signal-room {
        width: min(100% - 1rem, 1440px);
    }

    .hero-copy {
        min-height: 34rem;
    }

    h1 {
        max-width: 10ch;
        font-size: clamp(3.8rem, 22vw, 6.4rem);
    }

    h2 {
        font-size: clamp(2.25rem, 14vw, 4rem);
    }

    h3 {
        font-size: clamp(2rem, 12vw, 3.2rem);
    }

    .telemetry-rack {
        grid-template-columns: 1fr;
    }

    .telemetry-card,
    .rack-title {
        min-height: 18rem;
    }

    .record-table div,
    .telemetry-card dl div {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .packet-row {
        grid-template-columns: 5.6rem 1fr;
        min-height: 5.2rem;
    }

    .packet-row b {
        left: 5.6rem;
    }

    @keyframes packet-travel {
        0% {
            transform: translateX(0) rotate(45deg);
            opacity: 0;
        }
        8% {
            opacity: 1;
        }
        88% {
            opacity: 1;
        }
        100% {
            transform: translateX(62vw) rotate(45deg);
            opacity: 0;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }

    html.js [data-rise],
    html.js [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
