/* ==========================================================================
   RV CHIP-01 — shipboard UI
   Deep-space glass HUD over a three.js scene. Type voices:
   Newsreader (titles) · Instrument Sans (reading) · IBM Plex Mono (systems).
   Palette: void navy, hull cyan, signal amber, bone text — a night-shift
   companion to the main site's research reading surface.
   ========================================================================== */

:root {
    --void: #101e31;
    --void-2: #17263b;
    --glass: rgba(10, 16, 30, 0.82);
    --glass-soft: rgba(10, 16, 30, 0.6);
    --cyan: #8fd8ea;
    --cyan-dim: rgba(143, 216, 234, 0.32);
    --cyan-line: rgba(143, 216, 234, 0.22);
    --amber: #ffb454;
    --amber-dim: rgba(255, 180, 84, 0.25);
    --bone: #eef1f7;
    --bone-2: #aeb6c8;
    --bone-3: #a0b0c6;
    --good: #7ce8a8;
    --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
    --font-text: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --sai-t: env(safe-area-inset-top, 0px);
    --sai-b: env(safe-area-inset-bottom, 0px);
    --sai-l: env(safe-area-inset-left, 0px);
    --sai-r: env(safe-area-inset-right, 0px);
}

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

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    background: var(--void);
    color: var(--bone);
    font-family: var(--font-text);
    -webkit-font-smoothing: antialiased;
    touch-action: none;
}

.mono { font-family: var(--font-mono); }

a { color: var(--cyan); }

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

[hidden] { display: none !important; }

#scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}

/* ==========================================================================
   Boot screen
   ========================================================================== */

#boot {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    background:
        radial-gradient(120% 90% at 50% 110%, rgba(38, 60, 110, 0.35), transparent 60%),
        var(--void);
    transition: opacity 0.6s var(--ease-out);
}

#boot.is-done { opacity: 0; pointer-events: none; }

.boot-inner { text-align: center; width: min(420px, 86vw); }

.boot-registry {
    font-size: 1rem;
    letter-spacing: 0.32em;
    color: var(--bone-3);
}

.boot-title {
    font-family: var(--font-display);
    font-weight: 380;
    font-size: clamp(2.6rem, 9vw, 4rem);
    letter-spacing: 0.08em;
    margin: 0.4rem 0 0.2rem;
    color: var(--bone);
}

.boot-sub {
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: var(--bone-2);
    margin-bottom: 2rem;
}

.boot-bar {
    height: 2px;
    background: rgba(143, 216, 234, 0.14);
    border-radius: 2px;
    overflow: hidden;
}

#boot-bar-fill {
    display: block;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--amber));
    transition: width 0.3s var(--ease-out);
}

.boot-status {
    margin-top: 0.8rem;
    font-size: 1rem;
    letter-spacing: 0.06em;
    color: var(--bone-3);
    text-transform: uppercase;
}

/* ==========================================================================
   Landing / title
   ========================================================================== */

#landing {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    overflow-y: auto;
    background:
        radial-gradient(90% 70% at 70% 20%, rgba(64, 46, 110, 0.28), transparent 55%),
        radial-gradient(120% 90% at 30% 100%, rgba(28, 62, 105, 0.35), transparent 60%),
        var(--void);
    transition: opacity 0.7s var(--ease-out);
}

#landing.is-leaving { opacity: 0; pointer-events: none; }

.landing-stars {
    position: absolute;
    inset: -50%;
    background-image:
        radial-gradient(1px 1px at 12% 28%, rgba(238, 241, 247, 0.9), transparent 60%),
        radial-gradient(1px 1px at 38% 64%, rgba(238, 241, 247, 0.55), transparent 60%),
        radial-gradient(1.5px 1.5px at 58% 18%, rgba(178, 222, 255, 0.8), transparent 60%),
        radial-gradient(1px 1px at 74% 48%, rgba(238, 241, 247, 0.6), transparent 60%),
        radial-gradient(1.5px 1.5px at 87% 76%, rgba(255, 199, 130, 0.7), transparent 60%),
        radial-gradient(1px 1px at 24% 86%, rgba(238, 241, 247, 0.5), transparent 60%),
        radial-gradient(1px 1px at 49% 41%, rgba(238, 241, 247, 0.42), transparent 60%),
        radial-gradient(1.2px 1.2px at 66% 90%, rgba(178, 222, 255, 0.55), transparent 60%),
        radial-gradient(1px 1px at 92% 12%, rgba(238, 241, 247, 0.65), transparent 60%);
    background-size: 640px 640px;
    animation: drift 160s linear infinite;
    opacity: 0.85;
}

@keyframes drift {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-320px, -200px, 0); }
}

.landing-inner {
    position: relative;
    text-align: center;
    width: min(720px, 92vw);
    padding: 2rem 0 calc(2rem + var(--sai-b));
}

.landing-kicker {
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--amber);
    text-transform: uppercase;
}

.landing-title {
    font-family: var(--font-display);
    font-weight: 340;
    font-size: clamp(3.4rem, 11vw, 6rem);
    letter-spacing: 0.04em;
    line-height: 1.02;
    margin: 0.6rem 0 0.4rem;
    text-shadow: none;
}

.landing-vessel {
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--cyan);
}

.landing-brief {
    max-width: 54ch;
    margin: 1.6rem auto 0;
    color: var(--bone-2);
    font-size: 1.1rem;
    line-height: 1.65;
}

.landing-brief a { color: var(--cyan); text-underline-offset: 3px; }

.landing-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.6rem;
    margin: 1.8rem auto 0;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: var(--bone-3);
}

.landing-controls b, .landing-controls-touch b {
    color: var(--bone);
    font-weight: 500;
    border: 1px solid var(--cyan-line);
    border-radius: 4px;
    padding: 0.15em 0.5em;
    margin-right: 0.35em;
    background: rgba(143, 216, 234, 0.07);
}

.landing-controls-touch {
    margin-top: 1.6rem;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: var(--bone-3);
}

.board-btn {
    position: relative;
    margin-top: 2.4rem;
    padding: 1.05rem 3.4rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--void);
    background: var(--cyan);
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(143, 216, 234, 0.4), 0 12px 50px rgba(143, 216, 234, 0.22);
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.board-btn:hover, .board-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(143, 216, 234, 0.7), 0 18px 70px rgba(143, 216, 234, 0.35);
}

.board-btn-ring {
    position: absolute;
    inset: -7px;
    border: 1px solid rgba(143, 216, 234, 0.35);
    border-radius: 999px;
    display: none;
}

@keyframes ring-pulse {
    0%   { transform: scale(1); opacity: 1; }
    70%  { transform: scale(1.12); opacity: 0; }
    100% { transform: scale(1.12); opacity: 0; }
}

.landing-foot {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.2rem;
    margin-top: 2.2rem;
    font-size: 1rem;
    letter-spacing: 0.12em;
    color: var(--bone-3);
}

.landing-perf { display: inline-flex; align-items: center; gap: 0.5em; cursor: pointer; }
.landing-perf input { accent-color: var(--amber); }

.landing-classic { color: var(--bone-3); text-decoration-color: var(--bone-3); }
.landing-classic:hover { color: var(--bone); }

/* ==========================================================================
   Fallbacks
   ========================================================================== */

#no-webgl { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: var(--void); }

.fallback-card {
    width: min(560px, 90vw);
    padding: 2.4rem;
    border: 1px solid var(--cyan-line);
    border-radius: 14px;
    background: var(--glass);
    text-align: center;
}

.fallback-card h1 { font-family: var(--font-display); font-weight: 400; margin-bottom: 0.8rem; }
.fallback-card p { color: var(--bone-2); line-height: 1.6; margin-bottom: 1.4rem; }
.fallback-link { color: var(--amber); font-family: var(--font-mono); letter-spacing: 0.08em; }

.noscript-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 80;
}

/* ==========================================================================
   HUD
   ========================================================================== */

#hud {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

#hud.hud-hidden > * { opacity: 0 !important; }

.hud-topbar {
    position: absolute;
    top: calc(14px + var(--sai-t));
    left: calc(18px + var(--sai-l));
    right: calc(18px + var(--sai-r));
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.hud-vessel {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--cyan-line);
    border-radius: 10px;
    background: var(--glass-soft);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.hud-vessel-name {
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--bone-3);
}

.hud-zone {
    font-size: 1rem;
    letter-spacing: 0.06em;
    color: var(--cyan);
    transition: opacity 0.4s;
}

.hud-objective {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    padding: 0.6rem 0.95rem;
    border: 1px solid var(--amber-dim);
    border-radius: 999px;
    background: var(--glass-soft);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: var(--amber);
    transition: border-color 0.3s;
}

.hud-objective:hover { border-color: var(--amber); }

.hud-objective-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 10px var(--amber);
    animation: blink 2.4s ease-in-out infinite;
}

.hud-objective.is-done { color: var(--good); border-color: rgba(124, 232, 168, 0.4); }
.hud-objective.is-done .hud-objective-dot { background: var(--good); box-shadow: 0 0 10px var(--good); animation: none; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Crosshair */
#crosshair {
    position: absolute;
    top: 50%; left: 50%;
    width: 26px; height: 26px;
    transform: translate(-50%, -50%);
}

#crosshair span {
    position: absolute;
    top: 50%; left: 50%;
    width: 4px; height: 4px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(238, 241, 247, 0.85);
    box-shadow: 0 0 6px rgba(238, 241, 247, 0.6);
    transition: transform 0.18s var(--ease-out), background 0.18s;
}

#crosshair::before, #crosshair::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(143, 216, 234, 0);
    border-radius: 50%;
    transition: border-color 0.18s, transform 0.18s var(--ease-out);
    transform: scale(0.5);
}

#crosshair.is-target span { background: var(--amber); box-shadow: 0 0 10px var(--amber); transform: translate(-50%, -50%) scale(1.4); }
#crosshair.is-target::before { border-color: rgba(255, 180, 84, 0.65); transform: scale(1); }
#crosshair.is-target::after { border-color: rgba(255, 180, 84, 0.2); transform: scale(1.45); }

/* Interaction prompt */
#prompt {
    position: absolute;
    left: 50%;
    bottom: calc(17vh + var(--sai-b));
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.62rem 1.1rem 0.62rem 0.62rem;
    border: 1px solid var(--cyan-line);
    border-radius: 10px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: var(--bone);
    white-space: nowrap;
    animation: prompt-in 0.25s var(--ease-out);
}

@keyframes prompt-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.prompt-key {
    display: inline-grid;
    place-items: center;
    min-width: 1.9em;
    height: 1.9em;
    padding: 0 0.4em;
    border: 1px solid var(--cyan);
    border-radius: 6px;
    background: rgba(143, 216, 234, 0.12);
    color: var(--cyan);
    font-weight: 500;
    box-shadow: 0 0 14px rgba(143, 216, 234, 0.25);
}

/* Toasts (tutorial + discoveries) */
#toast-stack {
    position: absolute;
    top: calc(76px + var(--sai-t));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: min(560px, 92vw);
}

.toast {
    display: inline-flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--cyan-line);
    border-radius: 999px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.03em;
    color: var(--bone);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.toast.is-in { opacity: 1; transform: translateY(0); }
.toast.toast-discover { border-color: var(--amber-dim); color: var(--amber); }
.toast.toast-done { border-color: rgba(124, 232, 168, 0.45); color: var(--good); }
.toast b { color: var(--cyan); font-weight: 500; }
.toast.toast-discover b { color: inherit; }

/* Minimap */
.hud-minimap {
    position: absolute;
    left: calc(18px + var(--sai-l));
    bottom: calc(18px + var(--sai-b));
    padding: 8px;
    border: 1px solid var(--cyan-line);
    border-radius: 12px;
    background: var(--glass-soft);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#minimap-canvas { display: block; width: 156px; height: 186px; }

.minimap-hint {
    display: block;
    margin-top: 6px;
    text-align: center;
    font-size: 1rem;
    letter-spacing: 0.06em;
    color: var(--bone-3);
}

/* Key cheat row */
.hud-keys {
    position: absolute;
    right: calc(18px + var(--sai-r));
    bottom: calc(18px + var(--sai-b));
    display: flex;
    gap: 1.1rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid rgba(143, 216, 234, 0.12);
    border-radius: 10px;
    background: var(--glass-soft);
    font-size: 1rem;
    letter-spacing: 0.12em;
    color: var(--bone-3);
}

.hud-keys b { color: var(--bone-2); font-weight: 500; }

/* ==========================================================================
   Touch controls
   ========================================================================== */

#touch-ui { position: fixed; inset: 0; z-index: 25; pointer-events: none; }

#stick-zone {
    position: absolute;
    left: 0; bottom: 0;
    width: 46%;
    height: 52%;
    pointer-events: auto;
}

#stick-base {
    position: absolute;
    left: calc(34px + var(--sai-l));
    bottom: calc(34px + var(--sai-b));
    width: 116px; height: 116px;
    border: 1px solid var(--cyan-line);
    border-radius: 50%;
    background: rgba(10, 16, 30, 0.42);
    opacity: 0.85;
}

#stick-nub {
    position: absolute;
    top: 50%; left: 50%;
    width: 52px; height: 52px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(143, 216, 234, 0.3);
    border: 1px solid var(--cyan);
}

#touch-interact {
    position: absolute;
    right: calc(30px + var(--sai-r));
    bottom: calc(110px + var(--sai-b));
    width: 76px; height: 76px;
    pointer-events: auto;
    border: 1px solid var(--amber);
    border-radius: 50%;
    background: rgba(255, 180, 84, 0.16);
    color: var(--amber);
    font-size: 1.5rem;
    box-shadow: 0 0 26px rgba(255, 180, 84, 0.3);
}

#touch-menu {
    position: absolute;
    top: calc(64px + var(--sai-t));
    right: calc(18px + var(--sai-r));
    width: 42px; height: 42px;
    pointer-events: auto;
    border: 1px solid var(--cyan-line);
    border-radius: 10px;
    background: var(--glass-soft);
    color: var(--bone-2);
    font-size: 1.1rem;
}

@media (hover: none) and (pointer: coarse) {
    .hud-keys { display: none; }
    .minimap-hint { display: none; }
    #minimap-canvas { width: 120px; height: 143px; }
}

/* ==========================================================================
   Info panel
   ========================================================================== */

#panel {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: grid;
    place-items: center;
    padding: calc(20px + var(--sai-t)) 16px calc(20px + var(--sai-b));
    background: rgba(4, 7, 14, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.panel-frame {
    display: flex;
    flex-direction: column;
    width: min(860px, 96vw);
    max-height: min(86vh, 980px);
    border: 1px solid var(--cyan-line);
    border-radius: 16px;
    background:
        linear-gradient(160deg, rgba(143, 216, 234, 0.05), transparent 30%),
        var(--glass);
    box-shadow: 0 30px 120px rgba(0, 0, 0, 0.6), inset 0 0 60px rgba(143, 216, 234, 0.03);
    overflow: hidden;
    animation: panel-in 0.32s var(--ease-out);
}

@keyframes panel-in {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.15rem 1.4rem 0.95rem;
    border-bottom: 1px solid rgba(143, 216, 234, 0.14);
    background: linear-gradient(180deg, rgba(143, 216, 234, 0.05), transparent);
}

.panel-kicker {
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--amber);
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.panel-title {
    font-family: var(--font-display);
    font-weight: 420;
    font-size: clamp(1.3rem, 3.4vw, 1.8rem);
    letter-spacing: 0.01em;
}

.panel-close {
    flex: none;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(143, 216, 234, 0.25);
    border-radius: 8px;
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: var(--bone-2);
    transition: color 0.2s, border-color 0.2s;
}

.panel-close:hover { color: var(--bone); border-color: var(--cyan); }

.panel-body {
    overflow-y: auto;
    padding: 1.3rem 1.4rem 1.6rem;
    line-height: 1.62;
    scrollbar-width: thin;
    scrollbar-color: rgba(143, 216, 234, 0.3) transparent;
    overscroll-behavior: contain;
}

.panel-body::-webkit-scrollbar { width: 8px; }
.panel-body::-webkit-scrollbar-thumb { background: rgba(143, 216, 234, 0.22); border-radius: 8px; }

.panel-foot {
    padding: 0.7rem 1.4rem;
    border-top: 1px solid rgba(143, 216, 234, 0.1);
    font-size: 1rem;
    letter-spacing: 0.26em;
    color: var(--bone-3);
    text-transform: uppercase;
}

/* ---- shared content styles inside panels ---- */

.panel-body a { color: var(--cyan); text-underline-offset: 3px; }
.panel-body a:hover { color: var(--bone); }
.panel-body mark { background: rgba(255, 180, 84, 0.22); color: var(--bone); padding: 0 0.15em; border-radius: 3px; }
.panel-body p + p { margin-top: 0.9rem; }

.sys-note {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.2em;
    color: var(--bone-3);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.sys-divider {
    display: flex;
    align-items: center;
    gap: 0.8em;
    margin: 1.6rem 0 0.9rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.26em;
    color: var(--amber);
    text-transform: uppercase;
}

.sys-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 180, 84, 0.2); }

/* profile header */
.profile-head {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    margin-bottom: 1.2rem;
}

.profile-photo {
    width: 86px; height: 86px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--cyan-line);
    box-shadow: 0 0 30px rgba(143, 216, 234, 0.15);
}

.profile-id h3 { font-family: var(--font-display); font-weight: 460; font-size: 1.25rem; }
.profile-id .cn { font-weight: 400; color: var(--bone-2); margin-left: 0.4em; }
.profile-id p { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.04em; color: var(--bone-2); margin-top: 0.35rem; }
.profile-id .loc { color: var(--bone-3); }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.9rem 0; }

.chip {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.1em;
    padding: 0.32em 0.75em;
    border: 1px solid var(--cyan-line);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(143, 216, 234, 0.06);
}

.chip.amber { border-color: var(--amber-dim); color: var(--amber); background: rgba(255, 180, 84, 0.06); }

/* data tables / ledgers */
.ledger { list-style: none; }

.ledger li {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(143, 216, 234, 0.1);
}

.ledger li:last-child { border-bottom: none; }
.ledger .l-main { min-width: 0; }
.ledger .l-title { display: block; font-weight: 600; color: var(--bone); }
.ledger .l-venue { display: block; color: var(--bone-2); font-size: 0.88rem; margin-top: 0.15rem; }
.ledger .l-detail { display: block; color: var(--bone-3); font-size: 1rem; margin-top: 0.4rem; line-height: 1.55; }
.ledger .l-date { flex: none; font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.1em; color: var(--amber); padding-top: 0.25rem; white-space: nowrap; }

/* stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin: 1.1rem 0; }

.stat-tile {
    padding: 0.9rem 1rem;
    border: 1px solid var(--cyan-line);
    border-radius: 12px;
    background: rgba(143, 216, 234, 0.04);
    text-align: center;
}

.stat-tile b { display: block; font-family: var(--font-display); font-size: 1.7rem; font-weight: 480; color: var(--cyan); }
.stat-tile span { display: block; margin-top: 0.25rem; font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.03em; color: var(--bone-3); text-transform: uppercase; }

/* interest cards */
.interest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.8rem; margin-top: 0.4rem; }

.interest-card {
    padding: 0.95rem 1.05rem;
    border: 1px solid rgba(143, 216, 234, 0.14);
    border-radius: 12px;
    background: rgba(143, 216, 234, 0.03);
}

.interest-card .num { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.2em; color: var(--amber); }
.interest-card b { display: block; margin: 0.3rem 0 0.35rem; }
.interest-card span { color: var(--bone-2); font-size: 1rem; line-height: 1.55; }

/* education trail */
.edu-list { list-style: none; position: relative; padding-left: 1.3rem; }
.edu-list::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: rgba(143, 216, 234, 0.25); }
.edu-list li { position: relative; padding: 0.45rem 0; }
.edu-list li::before {
    content: "";
    position: absolute;
    left: -1.3rem; top: 0.95rem;
    width: 9px; height: 9px;
    border-radius: 50%;
    border: 1px solid var(--cyan);
    background: var(--void);
}
.edu-list .school { display: block; font-weight: 600; }
.edu-list .degree { display: block; color: var(--bone-2); font-size: 0.86rem; }
.edu-list .note { display: block; color: var(--bone-3); font-size: 1rem; font-style: italic; }

/* news log */
.log-list { list-style: none; }

.log-list li {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px dashed rgba(143, 216, 234, 0.14);
}

.log-list li:last-child { border-bottom: none; }
.log-date { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.12em; color: var(--amber); padding-top: 0.2rem; }
.log-body { color: var(--bone-2); }
.log-body .flag { display: inline-block; margin-left: 0.6em; font-family: var(--font-display); font-style: italic; color: var(--cyan); font-size: 0.88em; }

/* publications browser */
.pub-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    position: sticky;
    top: -1.3rem;
    padding: 0.6rem 0;
    background: linear-gradient(180deg, rgba(10, 16, 30, 0.97) 75%, transparent);
    z-index: 2;
}

.pub-tab {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.12em;
    padding: 0.45em 0.95em;
    border: 1px solid rgba(143, 216, 234, 0.2);
    border-radius: 999px;
    color: var(--bone-2);
    transition: all 0.2s;
}

.pub-tab:hover { color: var(--bone); border-color: var(--cyan); }
.pub-tab.is-active { color: var(--void); background: var(--cyan); border-color: var(--cyan); font-weight: 500; }

.pub-year { margin: 1.4rem 0 0.4rem; font-family: var(--font-display); font-size: 1.3rem; font-weight: 460; color: var(--amber); }
.pub-year:first-of-type { margin-top: 0.2rem; }

.pub-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(143, 216, 234, 0.09);
    color: var(--bone-2);
    font-size: 1rem;
    line-height: 1.6;
}

.pub-item strong { color: var(--bone); }
.pub-item em { color: var(--bone-2); }

.pub-meta { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.55rem; }

.pub-tag {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.1em;
    padding: 0.3em 0.7em;
    border-radius: 999px;
    border: 1px solid rgba(143, 216, 234, 0.25);
    color: var(--cyan);
}

.pub-tag.tone-award { border-color: var(--amber-dim); color: var(--amber); }
.pub-tag.tone-selective { border-color: rgba(124, 232, 168, 0.35); color: var(--good); }
.pub-tag.tone-status { border-color: rgba(174, 182, 200, 0.3); color: var(--bone-2); }

.pub-pdf {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.12em;
    padding: 0.3em 0.7em;
    border-radius: 999px;
    border: 1px solid var(--amber-dim);
    color: var(--amber) !important;
    text-decoration: none;
}

.pub-pdf:hover { background: rgba(255, 180, 84, 0.12); }

.pub-count { font-family: var(--font-mono); font-size: 1rem; color: var(--bone-3); letter-spacing: 0.04em; margin-left: auto; align-self: center; }

/* project dossier */
.proj-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--cyan-line);
    margin-bottom: 1.1rem;
    background: var(--void-2);
}

.proj-role { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.03em; color: var(--amber); text-transform: uppercase; margin-bottom: 0.7rem; }
.proj-desc { color: var(--bone-2); }

.proj-link-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }

.btn-launch {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    padding: 0.65rem 1.3rem;
    border-radius: 999px;
    background: var(--cyan);
    color: var(--void) !important;
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}

.btn-launch:hover { transform: translateY(-1px); box-shadow: 0 8px 30px rgba(143, 216, 234, 0.3); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    padding: 0.65rem 1.3rem;
    border-radius: 999px;
    border: 1px solid rgba(143, 216, 234, 0.3);
    color: var(--bone) !important;
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.btn-ghost:hover { border-color: var(--cyan); }

/* gallery index inside panel */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.8rem; }

.gallery-card {
    text-align: left;
    border: 1px solid rgba(143, 216, 234, 0.14);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(143, 216, 234, 0.03);
    transition: border-color 0.2s, transform 0.2s var(--ease-out);
}

.gallery-card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.gallery-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: var(--void-2); }
.gallery-card .g-body { padding: 0.7rem 0.85rem 0.85rem; }
.gallery-card b { display: block; font-size: 0.92rem; }
.gallery-card span { display: block; margin-top: 0.2rem; font-size: 1rem; color: var(--bone-3); }

/* contact / comms */
.comms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; margin-top: 0.4rem; }

.comms-link {
    display: flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(143, 216, 234, 0.14);
    border-radius: 10px;
    text-decoration: none;
    color: var(--bone) !important;
    transition: border-color 0.2s, background 0.2s;
}

.comms-link:hover { border-color: var(--cyan); background: rgba(143, 216, 234, 0.07); }
.comms-link .code { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.1em; color: var(--amber); border: 1px solid var(--amber-dim); border-radius: 5px; padding: 0.25em 0.45em; min-width: 3.2em; text-align: center; }
.comms-link .lbl { font-size: 0.86rem; }

.comms-primary { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1rem 0 0.4rem; }

/* service */
.review-list { list-style: none; }
.review-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid rgba(143, 216, 234, 0.08); font-size: 1rem; color: var(--bone-2); }
.review-list li:last-child { border: none; }
.review-list .yrs { flex: none; font-family: var(--font-mono); font-size: 1rem; color: var(--amber); letter-spacing: 0.1em; padding-top: 0.2rem; }

.cloud { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.cloud span { font-size: 1rem; color: var(--bone-2); border: 1px solid rgba(143, 216, 234, 0.16); border-radius: 999px; padding: 0.32em 0.85em; }

/* directory (fast travel) */
.dir-list { display: grid; gap: 0.6rem; }

.dir-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 0.9rem;
    text-align: left;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(143, 216, 234, 0.14);
    border-radius: 12px;
    transition: border-color 0.2s, background 0.2s;
}

.dir-item:hover { border-color: var(--cyan); background: rgba(143, 216, 234, 0.05); }
.dir-item .d-ico { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.06em; color: var(--void); background: var(--cyan); border-radius: 8px; padding: 0.45em 0; text-align: center; font-weight: 600; }
.dir-item.unvisited .d-ico { background: rgba(143, 216, 234, 0.16); color: var(--cyan); }
.dir-item b { display: block; }
.dir-item .d-sub { display: block; font-size: 1rem; color: var(--bone-3); margin-top: 0.1rem; }
.dir-item .d-go { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.04em; color: var(--amber); }

/* help table */
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 0.55rem 1.4rem; align-items: center; }
.help-grid .hk { font-family: var(--font-mono); font-size: 1rem; color: var(--cyan); border: 1px solid var(--cyan-line); border-radius: 6px; padding: 0.3em 0.7em; text-align: center; white-space: nowrap; }
.help-grid .hd { color: var(--bone-2); font-size: 1rem; }

/* ==========================================================================
   Map overlay
   ========================================================================== */

#map-overlay {
    position: fixed;
    inset: 0;
    z-index: 34;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(4, 7, 14, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.map-frame {
    width: min(960px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--cyan-line);
    border-radius: 16px;
    background: var(--glass);
    padding: 1.1rem 1.3rem 1.2rem;
    animation: panel-in 0.32s var(--ease-out);
}

.map-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.8rem; }
.map-head h2 { font-size: 1rem; letter-spacing: 0.08em; color: var(--cyan); font-weight: 500; }

#bigmap-canvas {
    width: 100%;
    height: auto;
    min-height: 0;
    border: 1px solid rgba(143, 216, 234, 0.12);
    border-radius: 12px;
    background: rgba(7, 11, 20, 0.6);
}

.map-legend { margin-top: 0.7rem; font-size: 1rem; letter-spacing: 0.04em; color: var(--bone-3); }

.map-stations { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }

.map-stations button {
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.1em;
    padding: 0.45em 0.9em;
    border: 1px solid rgba(143, 216, 234, 0.2);
    border-radius: 999px;
    color: var(--bone-2);
}

.map-stations button:hover { border-color: var(--amber); color: var(--amber); }

/* ==========================================================================
   Pause menu
   ========================================================================== */

#pause {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    background: rgba(4, 7, 14, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pause-frame {
    width: min(620px, 94vw);
    max-height: 92vh;
    overflow-y: auto;
    padding: 2rem 2.1rem;
    border: 1px solid var(--cyan-line);
    border-radius: 18px;
    background: var(--glass);
    animation: panel-in 0.3s var(--ease-out);
}

.pause-kicker { font-size: 1rem; letter-spacing: 0.08em; color: var(--amber); }
.pause-title { font-family: var(--font-display); font-weight: 380; font-size: 2rem; letter-spacing: 0.06em; margin: 0.4rem 0 1.4rem; }

.pause-nav { display: grid; gap: 0.45rem; margin-bottom: 1.5rem; }

.pause-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(143, 216, 234, 0.14);
    border-radius: 10px;
    text-align: left;
    transition: border-color 0.2s, background 0.2s;
}

.pause-item:hover { border-color: var(--cyan); background: rgba(143, 216, 234, 0.06); }
.pause-item b { font-weight: 600; }
.pause-item .mono { font-size: 1rem; letter-spacing: 0.2em; color: var(--bone-3); }

.pause-settings { border-top: 1px solid rgba(143, 216, 234, 0.12); padding-top: 1.2rem; margin-bottom: 1.4rem; }
.pause-settings-label { font-size: 1rem; letter-spacing: 0.26em; color: var(--bone-3); margin-bottom: 0.8rem; }

.pause-setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.45rem 0;
    font-size: 1rem;
    color: var(--bone-2);
}

.pause-setting input[type="range"] { width: 150px; accent-color: var(--cyan); }

.pause-setting select {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--bone);
    background: var(--void-2);
    border: 1px solid rgba(143, 216, 234, 0.25);
    border-radius: 7px;
    padding: 0.35em 0.6em;
}

.pause-exit { display: inline-block; font-size: 1rem; letter-spacing: 0.03em; color: var(--bone-3); }
.pause-exit:hover { color: var(--amber); }

/* ==========================================================================
   Small screens & motion preferences
   ========================================================================== */

@media (max-width: 640px) {
    .hud-topbar { right: calc(70px + var(--sai-r)); }
    .hud-keys { display: none; }
    .panel-frame { max-height: 92vh; }
    .panel-body { padding: 1rem 1rem 1.3rem; }
    .panel-head { padding: 1rem 1rem 0.8rem; }
    .log-list li { grid-template-columns: 1fr; gap: 0.2rem; }
    .ledger li { flex-direction: column; gap: 0.2rem; }
    .ledger .l-date { padding-top: 0; }
    .stat-grid { grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
    .stat-tile b { font-size: 1.25rem; }
    .landing-controls { gap: 0.45rem 1rem; }
    #prompt { bottom: calc(24vh + var(--sai-b)); }
}

@media (prefers-reduced-motion: reduce) {
    .landing-stars, .board-btn-ring, .hud-objective-dot { animation: none; }
    .toast, .panel-frame, .map-frame, .pause-frame { animation: none; }
}

/* Shared reading typography, with the vessel's controls kept independent. */
@font-face { font-family: Newsreader; src: url('/assets/fonts/newsreader.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('/assets/fonts/instrument-sans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
::selection { background: var(--cyan); color: var(--void); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; } }

/* Visitor-first flight deck. The scene supplies the hero; panels stay readable. */
body { font-size: 16px; }
button, a, input, select { touch-action: manipulation; }
#landing { justify-items: start; background: linear-gradient(90deg, rgba(7,15,23,.96) 0%, rgba(7,15,23,.86) 37%, rgba(7,15,23,.12) 100%); }
.landing-stars { display: none; }
.landing-inner { width: min(640px, 94vw); text-align: left; margin-left: clamp(22px,6vw,100px); padding: 40px 24px 40px 0; }
.landing-title { font-family: var(--font-text); font-weight: 600; font-size: clamp(2.4rem,4.8vw,4.6rem); letter-spacing: -.055em; line-height: 1.06; margin: 24px 0; }
.landing-brief { margin: 0; color: #d3dfe3; font-size: 1.15rem; }
.landing-kicker { color: #b9c8cd; text-transform: none; font-size: 1rem; margin-top: 18px; }
.landing-vessel { font-size: .82rem; letter-spacing: .12em; line-height: 1.7; }
.landing-choices { display: grid; gap: 12px; margin-top: 30px; }
.board-btn { border-radius: 8px; margin: 0; text-align: left; padding: 18px 24px; font-family: var(--font-text); font-size: 1.15rem; letter-spacing: 0; font-weight: 600; box-shadow: none; }
.board-btn span { display: block; font-size: .9rem; margin-top: 5px; font-weight: 400; opacity: .85; }
.board-btn.secondary { color: var(--bone); background: #172a35; border: 1px solid #48616d; }
.landing-controls, .landing-foot { justify-content: flex-start; font-size: .9rem; gap: 16px; letter-spacing: 0; }
.landing-foot { flex-wrap: wrap; margin-top: 24px; }
.landing-classic { color: var(--bone); padding: 12px 0; font-size: 1rem; }
.landing-perf input { width: 18px; height: 18px; }
.visor-frame { position: absolute; inset: 10px; border: 1px solid #9ed4d528; border-radius: 11% / 15%; box-shadow: inset 0 0 55px #0006; pointer-events: none; }
.visor-frame::before, .visor-frame::after { content: ''; position: absolute; top: 30%; height: 28%; width: 4px; border-block: 2px solid #93cdd7aa; }
.visor-frame::before { left: 15px; border-left: 1px solid #93cdd755; }
.visor-frame::after { right: 15px; border-right: 1px solid #93cdd755; }
.visor-frame span, .visor-frame i { position: absolute; bottom: 13px; font: 11px var(--font-mono); font-style: normal; letter-spacing: .1em; color: #acced5; }
.visor-frame span { left: 8%; }.visor-frame i { right: 8%; }
.hud-topbar { top: 24px; left: 30px; right: 30px; }
.hud-vessel { border-radius: 4px 4px 16px 4px; padding: 12px 16px; }
.hud-vessel-name { font-size: .8rem; color: #b5c9cf; letter-spacing: .06em; }
.hud-zone { font-size: 1rem; letter-spacing: .03em; }
.hud-objective { border-radius: 6px; min-height: 48px; font: 1rem var(--font-text); letter-spacing: 0; }
.hud-actions { pointer-events: auto; position: absolute; top: 86px; right: 30px; display: flex; gap: 8px; }
.hud-actions button { padding: 12px 16px; border: 1px solid #89adba66; border-radius: 6px; background: #101f2eed; font-size: 1rem; }
kbd { font: .85em var(--font-mono); border: 1px solid #aac6ce66; padding: 2px 5px; border-radius: 3px; margin-left: 5px; }
.hud-minimap { bottom: 58px; opacity: .85; }
#minimap-canvas { width: 110px; height: 130px; }
.minimap-hint { font-size: .8rem; letter-spacing: 0; }
.hud-keys { bottom: 50px; font: .9rem var(--font-text); letter-spacing: 0; gap: 16px; }
#prompt { pointer-events: auto; bottom: 130px; font: 1.1rem var(--font-text); letter-spacing: 0; white-space: normal; width: max-content; max-width: calc(100vw - 40px); border-color: #b2e7e8; box-shadow: 0 8px 32px #0006; }
#toast-stack { top: 154px; width: min(620px,90vw); }
.toast { font: 1rem/1.55 var(--font-text); letter-spacing: 0; border-radius: 8px; display: block; text-align: center; }
#guide-card { pointer-events: auto; position: absolute; left: 30px; bottom: 70px; width: min(410px, calc(100vw - 60px)); padding: 22px; background: #0c1b29f2; border: 1px solid #9dbecf77; border-left: 3px solid var(--amber); border-radius: 8px; box-shadow: 0 16px 48px #0006; }
#guide-step { font-size: .8rem; color: var(--amber); letter-spacing: .08em; }
#guide-title { font-size: 1.5rem; margin: 8px 0; font-weight: 500; }
#guide-copy { font-size: 1rem; line-height: 1.6; color: #c6d8df; margin: 12px 0 18px; }
#guide-card > div { display: flex; gap: 8px; flex-wrap: wrap; }
#guide-card button { min-height: 44px; padding: 10px 14px; border: 1px solid #8aaeb9; border-radius: 5px; font-size: .95rem; }
#guide-read { background: var(--cyan); color: var(--void); }
#guide-card #guide-stop { border: 0; padding: 12px 0 0; color: #bed0d5; font-size: .85rem; text-decoration: underline; }
#hud.guided .hud-minimap, #hud.guided .hud-keys { display: none; }
#hud.guided #prompt { left: auto; right: 30px; transform: none; }
.pause-title, .panel-title { font-family: var(--font-text); letter-spacing: -.025em; }
.pause-title { font-size: 2.4rem; margin-bottom: 12px; }
.pause-intro { color: #c6d3de; font-size: 1.05rem; line-height: 1.6; margin-bottom: 24px; }
.pause-item { min-height: 56px; font-size: 1.1rem; }
.pause-item .mono { font-size: .85rem; }
.pause-exit { display: block; padding: 18px; background: #284450; color: #e4f3f4; border: 1px solid #87b4c1; border-radius: 8px; font: 1.05rem var(--font-text); text-align: center; letter-spacing: 0; text-decoration: none; }
.pause-setting select, .pause-setting input { min-height: 44px; }
.panel-frame { background: #101f2ef7; }
.panel-body { font-size: 1.05rem; touch-action: pan-y; }
.panel-close { min-height: 44px; font-size: .95rem; letter-spacing: 0; }
.dir-item { min-height: 82px; }.dir-item .d-sub { font-size: 1rem; }.dir-item .d-go { font-size: .85rem; letter-spacing: 0; }
.map-frame { overflow-y: auto; touch-action: pan-y; }.map-stations button { min-height: 44px; font-size: 1rem; letter-spacing: 0; }
#pause, #landing, .pause-frame { touch-action: pan-y; }
* { scrollbar-color: #608392 #101e31; scrollbar-width: thin; }
@media(max-width: 700px) {
    #landing { background: #091623df; }.landing-inner { margin-left: 22px; padding-right: 22px; width: calc(100vw - 22px); }
    .landing-title { font-size: 2.7rem; }.landing-brief { font-size: 1rem; }.landing-controls { font-size: .85rem; }
    .hud-topbar { top: 14px; left: 14px; right: 14px; gap: 8px; }.hud-vessel-name { font-size: .65rem; }.hud-zone { font-size: .85rem; }
    .hud-objective { font-size: .85rem; padding: 10px; }.hud-vessel { padding: 10px; max-width: 64%; }
    .hud-actions { right: 14px; top: 92px; }.hud-actions button { padding: 10px; font-size: .9rem; }
    .hud-minimap, .visor-frame span, .visor-frame i { display: none; }
    #guide-card { left: 14px; bottom: 22px; width: calc(100vw - 28px); padding: 16px; }
    #guide-copy { font-size: .95rem; margin: 8px 0 12px; }#guide-title { font-size: 1.25rem; }
    #hud.guided #prompt { display: none; }#toast-stack { top: 152px; }.toast { font-size: .95rem; }
    #prompt { bottom: 190px; }.pause-frame { padding: 24px; }.pause-setting { flex-wrap: wrap; }
    .pause-setting input[type=range] { width: 140px; }.map-frame { padding: 16px; }.map-head h2 { font-size: 1rem; }
    #touch-menu { display: none; }#touch-interact { font-size: 1rem; width: 90px; border-radius: 14px; }
}

/* Camera views keep the scene interactive and the return path explicit. */
#viewer { position:fixed; inset:0; z-index:24; pointer-events:none; background:linear-gradient(180deg,#07101b88,transparent 25%); }
.viewer-head { display:flex; justify-content:space-between; gap:20px; align-items:start; padding:28px; }
.viewer-head h2 { font-size:clamp(1.2rem,3vw,2rem); margin:6px 0; }.viewer-head p { margin:0; color:var(--cyan); }
#viewer button, #viewer input { pointer-events:auto; min-height:44px; }
#orbit-actions { position:absolute; bottom:24px; left:50%; transform:translateX(-50%); width:max-content; max-width:95%; text-align:center; padding:14px; border-radius:14px; background:#0a1521e8; }
#orbit-actions p { margin:0 0 12px; } #orbit-actions button { margin:3px; }
#scope-notes { position:absolute; right:24px; top:25%; width:300px; padding:24px; border:1px solid #8fd8ea55; border-radius:16px; background:#0a1521e8; line-height:1.65; }
#scope-notes input { width:100%; } #scope-notes h3 { font-size:1.6rem; line-height:1.2; }
@media(max-width:700px) { .viewer-head {padding:15px; flex-wrap:wrap;} #scope-notes {top:auto;bottom:12px;left:12px;right:12px;width:auto;padding:15px;font-size:.95rem;} #scope-notes h3 {margin:8px 0;} #scope-notes p {margin:8px 0;} #orbit-actions {bottom:12px;} }
#scope-notes { pointer-events:auto; }
@media(max-width:700px) { #scope-notes { max-height:35dvh; overflow:auto; } }
