:root {
    color-scheme: dark;
    --ink: #070705;
    --ink-soft: #0d0c09;
    --ivory: #f3e9d2;
    --ivory-muted: #bdb19a;
    --gold: #d7b46a;
    --gold-bright: #f1d79c;
    --gold-dark: #765829;
    --line: rgba(215, 180, 106, 0.24);
    --panel: rgba(9, 8, 6, 0.72);
    --online: #7fd58a;
    --warning: #e2ad63;
    --offline: #c88779;
    --focus: #ffe7aa;
    --gutter: clamp(1.25rem, 4.5vw, 5.5rem);
    --header-height: clamp(7.5rem, 15vw, 10.5rem);
    font-family: "Segoe UI Variable", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
    font-synthesis: none;
}

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

html {
    min-width: 20rem;
    min-height: 100%;
    background: var(--ink);
    scroll-behavior: smooth;
}

body {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ivory);
    background:
        radial-gradient(circle at 73% 38%, rgba(98, 70, 31, 0.1), transparent 24rem),
        linear-gradient(116deg, #050504 0%, #090907 46%, #060605 100%);
}

body::before {
    position: fixed;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    content: "";
    background:
        linear-gradient(90deg, rgba(3, 3, 2, 0.58) 0%, rgba(3, 3, 2, 0.14) 49%, rgba(3, 3, 2, 0.03) 72%),
        linear-gradient(180deg, rgba(4, 4, 3, 0.55) 0%, transparent 28%, rgba(4, 3, 2, 0.24) 100%);
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 4px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 50%;
    padding: 0.7rem 1rem;
    color: var(--ink);
    background: var(--gold-bright);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    transform: translate(-50%, -180%);
}

.skip-link:focus {
    transform: translate(-50%, 0);
}

.space-scene {
    position: fixed;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    isolation: isolate;
}

.space-scene::after {
    position: absolute;
    inset: 0;
    content: "";
    background:
        radial-gradient(circle at 85% 79%, rgba(239, 175, 76, 0.2) 0%, transparent 31%),
        linear-gradient(90deg, rgba(5, 5, 4, 0.28) 0%, transparent 58%);
    mix-blend-mode: screen;
}

.starfield,
.starfield::before,
.starfield::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
}

.starfield {
    opacity: 0.86;
    background-image:
        radial-gradient(circle at 7% 17%, rgba(255, 240, 207, 0.84) 0 0.7px, transparent 1px),
        radial-gradient(circle at 14% 64%, rgba(255, 221, 158, 0.5) 0 0.7px, transparent 1px),
        radial-gradient(circle at 25% 31%, rgba(255, 248, 226, 0.7) 0 0.55px, transparent 0.9px),
        radial-gradient(circle at 38% 84%, rgba(255, 228, 174, 0.56) 0 0.65px, transparent 1px),
        radial-gradient(circle at 46% 12%, rgba(242, 225, 196, 0.48) 0 0.75px, transparent 1.1px),
        radial-gradient(circle at 59% 59%, rgba(255, 244, 215, 0.62) 0 0.6px, transparent 1px),
        radial-gradient(circle at 73% 22%, rgba(255, 221, 158, 0.57) 0 0.65px, transparent 1px),
        radial-gradient(circle at 84% 51%, rgba(255, 249, 227, 0.68) 0 0.55px, transparent 0.95px),
        radial-gradient(circle at 93% 11%, rgba(255, 232, 184, 0.65) 0 0.75px, transparent 1.1px),
        radial-gradient(circle at 97% 72%, rgba(255, 244, 220, 0.48) 0 0.65px, transparent 1px);
}

.starfield::before {
    opacity: 0.46;
    background-image:
        radial-gradient(circle at 20% 44%, rgba(219, 178, 103, 0.34), transparent 0.08rem),
        radial-gradient(circle at 52% 73%, rgba(215, 180, 106, 0.32), transparent 0.07rem),
        radial-gradient(circle at 78% 37%, rgba(240, 218, 176, 0.32), transparent 0.08rem);
    background-size: 17rem 13rem, 23rem 19rem, 29rem 17rem;
}

.starfield::after {
    opacity: 0.19;
    background:
        radial-gradient(ellipse at 37% 56%, rgba(117, 84, 48, 0.34), transparent 18%),
        radial-gradient(ellipse at 55% 42%, rgba(82, 82, 78, 0.24), transparent 22%);
    filter: blur(1.2rem);
}

.arrakis {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    pointer-events: none;
    user-select: none;
    object-fit: cover;
    object-position: center;
    filter: saturate(0.93) contrast(1.06) brightness(0.82);
}

.arrakis--foreground,
.arrakis--moons {
    display: none;
}

/*
 * Two aligned copies keep celestial bodies independent from passing craft:
 * the moon layer can sit in front of a distant Highliner, while near craft
 * remain in front of the moons. Arrakis itself always forms the front limb.
 */
@supports ((-webkit-mask-image: radial-gradient(circle, #000, transparent)) or (mask-image: radial-gradient(circle, #000, transparent))) {
    .arrakis--foreground,
    .arrakis--moons {
        position: fixed;
        display: block;
        pointer-events: none;
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
    }

    .arrakis--foreground {
        z-index: 4;
        -webkit-mask-image:
            radial-gradient(ellipse 41.3% 73.3% at 95.1% 116.9%, #000 0 98%, transparent 100%);
        mask-image:
            radial-gradient(ellipse 41.3% 73.3% at 95.1% 116.9%, #000 0 98%, transparent 100%);
    }

    .arrakis--moons {
        z-index: 2;
        -webkit-mask-image:
            radial-gradient(ellipse 1.95% 3.45% at 71.5% 30.4%, #000 0 91%, transparent 100%),
            radial-gradient(ellipse .74% 1.28% at 91.6% 30.7%, #000 0 88%, transparent 100%);
        mask-image:
            radial-gradient(ellipse 1.95% 3.45% at 71.5% 30.4%, #000 0 91%, transparent 100%),
            radial-gradient(ellipse .74% 1.28% at 91.6% 30.7%, #000 0 88%, transparent 100%);
    }
}

.ship-stage {
    position: fixed;
    z-index: 3;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    contain: layout paint;
}

.ship-stage--far {
    z-index: 1;
}

.ship-stage *,
.ship-stage img,
.ship-stage [data-ship],
.ship-stage [data-effect],
.ship-stage .ship,
.ship-stage .effect {
    pointer-events: none !important;
    user-select: none;
}

.site-header {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
    min-height: var(--header-height);
    padding:
        max(1.35rem, env(safe-area-inset-top))
        max(var(--gutter), env(safe-area-inset-right))
        1rem
        max(var(--gutter), env(safe-area-inset-left));
}

.brand {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: clamp(12rem, 22vw, 19rem);
    height: auto;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 0 1.4rem rgba(215, 180, 106, 0.09));
}

.brand-caption {
    margin-top: 0.5rem;
    color: var(--ivory-muted);
    font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: clamp(0.6rem, 0.7vw, 0.72rem);
    font-weight: 650;
    letter-spacing: 0.32em;
    line-height: 1;
    text-transform: uppercase;
}

.scene-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.scene-control {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.25rem;
    padding: 0.52rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ivory-muted);
    background: rgba(8, 8, 6, 0.62);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.018);
    -webkit-backdrop-filter: blur(0.9rem);
    backdrop-filter: blur(0.9rem);
    cursor: pointer;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    line-height: 1;
    text-transform: uppercase;
    transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.scene-control:hover {
    color: var(--ivory);
    border-color: rgba(215, 180, 106, 0.55);
    background: rgba(27, 23, 16, 0.8);
}

.scene-control[aria-pressed="true"] {
    color: var(--gold-bright);
    border-color: rgba(215, 180, 106, 0.56);
}

.scene-control:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.control-mark {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 0.68rem;
    height: 0.68rem;
    color: currentColor;
}

.control-mark--motion::before,
.control-mark--motion::after {
    position: absolute;
    top: 0.02rem;
    bottom: 0.02rem;
    width: 0.16rem;
    content: "";
    border-radius: 0.05rem;
    background: currentColor;
}

.control-mark--motion::before {
    left: 0.1rem;
}

.control-mark--motion::after {
    right: 0.1rem;
}

.control-mark--sound {
    border: 1px solid currentColor;
    border-radius: 50%;
}

.control-mark--sound::after {
    position: absolute;
    top: 50%;
    left: -0.16rem;
    width: 0.95rem;
    height: 1px;
    content: "";
    background: currentColor;
    transform: rotate(-43deg);
    transform-origin: center;
}

.scene-control[aria-pressed="true"] .control-mark--sound::after {
    display: none;
}

.hero {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: flex-end;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
    padding:
        clamp(2rem, 8vh, 6.5rem)
        max(var(--gutter), env(safe-area-inset-right))
        max(clamp(2rem, 7vh, 5.5rem), env(safe-area-inset-bottom))
        max(var(--gutter), env(safe-area-inset-left));
}

.hero-content {
    width: min(100%, 41rem);
}

.hero-kicker {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.1rem;
    color: var(--gold);
    font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: clamp(0.61rem, 0.72vw, 0.72rem);
    font-weight: 650;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.hero-kicker span[aria-hidden="true"] {
    color: var(--gold-dark);
}

.homelab-card {
    position: relative;
    width: min(100%, 40rem);
    padding: clamp(1rem, 2.2vw, 1.5rem);
    border: 1px solid var(--line);
    background:
        linear-gradient(120deg, rgba(18, 15, 10, 0.8), rgba(7, 7, 5, 0.58)),
        var(--panel);
    box-shadow:
        0 1.5rem 5rem rgba(0, 0, 0, 0.26),
        inset 0 1px rgba(255, 248, 231, 0.025);
    -webkit-backdrop-filter: blur(1rem) saturate(0.9);
    backdrop-filter: blur(1rem) saturate(0.9);
}

.homelab-card::before {
    position: absolute;
    top: -1px;
    left: -1px;
    width: clamp(3.5rem, 22%, 8rem);
    height: 1px;
    content: "";
    background: var(--gold-bright);
    box-shadow: 0 0 1.1rem rgba(215, 180, 106, 0.34);
}

.homelab-heading,
.node-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.homelab-heading {
    align-items: flex-start;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(215, 180, 106, 0.12);
}

.section-index {
    margin: 0 0 0.25rem;
    color: var(--gold-dark);
    font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.2em;
}

.homelab-heading h2 {
    margin: 0;
    color: var(--ivory);
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    font-weight: 520;
    letter-spacing: 0.08em;
    line-height: 1.1;
    text-transform: uppercase;
}

.node-row {
    margin-top: 1rem;
}

.node-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ivory-muted);
    font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    line-height: 1;
    text-transform: uppercase;
}

.node-dot {
    width: 0.45rem;
    height: 0.45rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0.75rem currentColor;
}

.node-status[data-state="live"] {
    color: var(--online);
}

.node-status[data-state="cached"],
.node-status[data-state="loading"] {
    color: var(--warning);
}

.node-status[data-state="unavailable"] {
    color: var(--offline);
}

.telemetry-label {
    color: rgba(189, 177, 154, 0.52);
    font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 0.55rem;
    font-weight: 650;
    letter-spacing: 0.17em;
}

.system-summary {
    margin: 0.9rem 0 0;
    overflow-wrap: anywhere;
    color: var(--ivory);
    font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
    font-size: clamp(0.68rem, 1vw, 0.82rem);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.045em;
    line-height: 1.55;
}

.noscript-notice {
    position: fixed;
    z-index: 20;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    width: fit-content;
    max-width: min(40rem, calc(100% - 2rem));
    margin: auto;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    color: var(--ivory);
    background: #14110c;
    font-size: 0.78rem;
    line-height: 1.5;
}

@media (max-width: 48rem) {
    :root {
        --header-height: 9.5rem;
        --gutter: clamp(1rem, 5.5vw, 2rem);
    }

    .site-header {
        gap: 1rem;
    }

    .brand-logo {
        width: clamp(10.5rem, 46vw, 14.5rem);
    }

    .brand-caption {
        letter-spacing: 0.24em;
    }

    .scene-controls {
        max-width: 11rem;
    }

    .scene-control {
        min-height: 2.15rem;
        padding: 0.48rem 0.68rem;
        font-size: 0.58rem;
    }

    .arrakis {
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 92% center;
        opacity: 0.88;
    }

    .arrakis--foreground {
        -webkit-mask-image:
            radial-gradient(ellipse 159% 73.3% at 104% 116.9%, #000 0 98%, transparent 100%);
        mask-image:
            radial-gradient(ellipse 159% 73.3% at 104% 116.9%, #000 0 98%, transparent 100%);
    }

    .arrakis--moons {
        -webkit-mask-image:
            radial-gradient(ellipse 7.6% 3.55% at 13.5% 30.4%, #000 0 91%, transparent 100%),
            radial-gradient(ellipse 2.6% 1.22% at 90.8% 30.7%, #000 0 88%, transparent 100%);
        mask-image:
            radial-gradient(ellipse 7.6% 3.55% at 13.5% 30.4%, #000 0 91%, transparent 100%),
            radial-gradient(ellipse 2.6% 1.22% at 90.8% 30.7%, #000 0 88%, transparent 100%);
    }

    .hero {
        align-items: flex-end;
        padding-top: 2rem;
        padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    }

    .hero-content {
        width: 100%;
    }

    .homelab-card {
        width: min(100%, 36rem);
    }
}

@media (max-width: 34rem) {
    :root {
        --header-height: 10.5rem;
    }

    .site-header {
        flex-direction: column;
        min-height: var(--header-height);
    }

    .scene-controls {
        justify-content: flex-start;
        max-width: none;
    }

    .scene-control {
        width: auto;
    }

    .hero-kicker {
        margin-bottom: 0.7rem;
    }

    .homelab-card {
        border-top: 0;
    }

    .homelab-card::before {
        display: none;
    }

    .telemetry-label {
        display: none;
    }
}

@media (max-height: 39rem) and (min-width: 48.01rem) {
    :root {
        --header-height: 7.25rem;
    }

    .site-header {
        padding-top: 1rem;
    }

    .brand-logo {
        width: 12rem;
    }

    .hero {
        padding-top: 1rem;
        padding-bottom: 1.25rem;
    }

    .hero-kicker {
        margin-bottom: 0.6rem;
    }

    .homelab-card {
        padding: 0.9rem 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

@media (prefers-contrast: more) {
    :root {
        --ivory-muted: #e6dcc7;
        --line: rgba(241, 215, 156, 0.68);
    }

    .homelab-card,
    .scene-control {
        background: rgba(5, 5, 4, 0.94);
    }
}
