/* ==========================================================================
   ATLANTIS — the Inverted Earth
   Brass and riveted glass from the Nautilus, bioluminescent cyan from the
   deep, and 1930s newsprint from the salamander age.
   ========================================================================== */

:root {
    --abyss: #02121a;
    --abyss-2: #04222c;
    --deep: #06323d;
    --glass: rgba(4, 26, 32, 0.78);
    --glass-2: rgba(8, 40, 46, 0.66);
    --brass: #c49a4a;
    --brass-hi: #efd38e;
    --brass-lo: #6b4718;
    --brass-dk: #3a250b;
    --verdigris: #4fa392;
    --verdigris-dk: #24564d;
    --biolum: #5ff5e1;
    --biolum-dim: rgba(95, 245, 225, 0.35);
    --parchment: #ecdfbf;
    --ink: #d4c7a3;
    --ink-muted: #9d9378;
    --rust: #c8452b;
    --sand: #d8c9a3;

    --f-display: 'IM Fell English SC', 'Cinzel', Georgia, serif;
    --f-italic: 'IM Fell English', Georgia, serif;
    --f-body: 'EB Garamond', Georgia, serif;
    --f-mono: 'Share Tech Mono', ui-monospace, monospace;
    --f-type: 'Special Elite', 'Courier New', monospace;

    --gutter: 16px;
    color-scheme: dark;
}

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

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--abyss);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    background:
        radial-gradient(120% 70% at 50% -10%, rgba(79, 163, 146, 0.30), transparent 60%),
        radial-gradient(90% 60% at 50% 110%, rgba(0, 0, 0, 0.9), transparent 70%),
        linear-gradient(180deg, #06343f 0%, #032029 38%, #010b10 100%);
}

a { color: var(--biolum); }
button { font: inherit; color: inherit; }
h1:focus { outline: none; }

/* ---------- boot splash (static SSR) ---------- */
.boot-splash {
    position: fixed; inset: 0;
    display: grid; place-content: center; text-align: center;
    color: var(--brass-hi);
}
.boot-title { font-family: var(--f-display); font-size: clamp(2.6rem, 8vw, 5rem); letter-spacing: .18em; }
.boot-sub { font-family: var(--f-italic); font-style: italic; color: var(--ink-muted); animation: breathe 2.4s ease-in-out infinite; }

@keyframes breathe { 50% { opacity: .35; } }

/* ---------- stage ---------- */
.atlas { position: fixed; inset: 0; overflow: hidden; }

.globe-host { position: absolute; inset: 0; }
.atlantis-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.atlantis-canvas:active { cursor: grabbing; }

/* vignette + light shafts from the surface, far above */
.porthole {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 75% 70% at 50% 50%, transparent 55%, rgba(0, 6, 9, 0.75) 100%);
}
.porthole::before {
    content: ""; position: absolute; inset: -20% -10% 30% -10%;
    background: repeating-conic-gradient(from 172deg at 50% -10%,
        rgba(160, 240, 225, 0.00) 0deg, rgba(160, 240, 225, 0.045) 2deg, rgba(160, 240, 225, 0.00) 5deg, rgba(160, 240, 225, 0.00) 9deg);
    mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
    animation: shafts 14s ease-in-out infinite alternate;
    mix-blend-mode: screen;
}
@keyframes shafts { from { transform: rotate(-2deg); opacity: .6; } to { transform: rotate(2.5deg); opacity: 1; } }

/* ---------- title cartouche ---------- */
.cartouche {
    position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
    text-align: center; pointer-events: none;
    padding: 6px 34px 10px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
}
.cartouche::before, .cartouche::after {
    content: ""; position: absolute; top: 50%; width: 70px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--brass));
}
.cartouche::before { right: 100%; }
.cartouche::after { left: 100%; transform: scaleX(-1); }
.cartouche h1 {
    margin: 0; line-height: .95;
    font-family: var(--f-display); font-weight: 400;
    font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: .2em; padding-left: .2em;
    background: linear-gradient(180deg, var(--brass-hi) 10%, var(--brass) 55%, var(--brass-lo) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .7));
}
.cartouche-kicker { font-family: var(--f-italic); font-style: italic; font-size: .9rem; color: var(--ink-muted); letter-spacing: .04em; }
.cartouche-sub { font-family: var(--f-display); font-size: .95rem; letter-spacing: .22em; color: var(--ink); }
.cartouche .formula { font-family: var(--f-mono); letter-spacing: .05em; color: var(--biolum); text-shadow: 0 0 10px var(--biolum-dim); }

/* ---------- riveted brass panels ---------- */
.panel {
    position: absolute; top: 18px; bottom: 96px; width: 304px;
    display: flex; flex-direction: column; pointer-events: none;
    z-index: 5;
}
.panel.ballast { left: var(--gutter); }
.panel.log { right: var(--gutter); }

.panel-body {
    pointer-events: auto;
    max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
    padding: 18px 18px 16px;
    background:
        radial-gradient(circle at 10px 10px, var(--brass-hi) 0 2px, var(--brass-lo) 2.6px, transparent 3.4px),
        radial-gradient(circle at calc(100% - 10px) 10px, var(--brass-hi) 0 2px, var(--brass-lo) 2.6px, transparent 3.4px),
        radial-gradient(circle at 10px calc(100% - 10px), var(--brass-hi) 0 2px, var(--brass-lo) 2.6px, transparent 3.4px),
        radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), var(--brass-hi) 0 2px, var(--brass-lo) 2.6px, transparent 3.4px),
        linear-gradient(180deg, var(--glass-2), var(--glass));
    border: 1px solid var(--brass);
    outline: 3px solid rgba(58, 37, 11, .85);
    outline-offset: 0;
    box-shadow:
        inset 0 0 0 4px rgba(4, 26, 32, .9),
        inset 0 0 0 5px rgba(196, 154, 74, .45),
        inset 0 0 40px rgba(95, 245, 225, .05),
        0 12px 40px rgba(0, 0, 0, .55);
    border-radius: 3px;
    backdrop-filter: blur(6px) saturate(1.2);
    -webkit-backdrop-filter: blur(6px) saturate(1.2);
    scrollbar-width: thin; scrollbar-color: var(--brass-lo) transparent;
}
.panel:not(.open) .panel-body { display: none; }

.panel-tab {
    pointer-events: auto; align-self: flex-start;
    margin-bottom: 6px; padding: 3px 12px 2px;
    font-family: var(--f-display); letter-spacing: .14em; font-size: .85rem;
    color: var(--brass-dk);
    background: linear-gradient(180deg, var(--brass-hi), var(--brass) 60%, var(--brass-lo));
    border: 1px solid var(--brass-dk); border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .5); cursor: pointer;
}
.log .panel-tab { align-self: flex-end; }

.panel h2 {
    margin: 0 0 12px; text-align: center;
    font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; letter-spacing: .16em;
    color: var(--brass-hi);
    display: flex; align-items: center; gap: 10px;
}
.panel h2::before, .panel h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--brass)); }
.panel h2::after { transform: scaleX(-1); }
.panel h3 { margin: 14px 0 6px; font-family: var(--f-display); font-weight: 400; letter-spacing: .1em; font-size: 1rem; color: var(--brass-hi); }

/* brass buttons */
.brass-btn {
    padding: 5px 10px 4px; cursor: pointer;
    font-family: var(--f-display); letter-spacing: .08em; font-size: .9rem;
    color: var(--ink);
    background: linear-gradient(180deg, rgba(196, 154, 74, .22), rgba(107, 71, 24, .25));
    border: 1px solid rgba(196, 154, 74, .6); border-radius: 2px;
    transition: background .2s, color .2s, box-shadow .2s;
}
.brass-btn:hover:not(:disabled) { color: var(--parchment); box-shadow: 0 0 0 1px var(--brass), 0 0 12px rgba(239, 211, 142, .2); }
.brass-btn.on { color: var(--brass-dk); background: linear-gradient(180deg, var(--brass-hi), var(--brass) 60%, var(--brass-lo)); border-color: var(--brass-dk); }
.brass-btn:disabled { opacity: .4; cursor: default; }
.brass-btn:focus-visible, .flip-btn:focus-visible, .panel-tab:focus-visible { outline: 2px solid var(--biolum); outline-offset: 2px; }

.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.mode-help { margin: 8px 0 4px; min-height: 3.6em; font-family: var(--f-italic); font-style: italic; font-size: .92rem; line-height: 1.25; color: var(--ink-muted); }

/* dial */
.dial { display: block; width: 100%; max-width: 230px; margin: 4px auto 0; }
.dial-num { font-family: var(--f-mono); font-size: 10px; fill: var(--parchment); }
.dial-unit { font-family: var(--f-display); font-size: 8px; letter-spacing: .2em; fill: var(--brass); }

/* levers (range inputs) */
.lever { display: block; margin: 10px 0 4px; }
.lever-label { display: flex; justify-content: space-between; font-size: .92rem; color: var(--ink); }
.lever-label b { font-family: var(--f-mono); font-weight: 400; color: var(--biolum); }
.lever input[type=range] {
    -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 2px 0 0; cursor: pointer;
}
.lever input[type=range]::-webkit-slider-runnable-track {
    height: 6px; border-radius: 3px;
    background: linear-gradient(180deg, #02090c, #0b2a30); border: 1px solid var(--brass-lo);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .8);
}
.lever input[type=range]::-moz-range-track {
    height: 6px; border-radius: 3px; background: #06171b; border: 1px solid var(--brass-lo);
}
.lever input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 16px; height: 20px; margin-top: -8px; border-radius: 3px;
    background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi) 45%, var(--brass) 60%, var(--brass-lo));
    border: 1px solid var(--brass-dk); box-shadow: 0 2px 4px rgba(0, 0, 0, .6);
}
.lever input[type=range]::-moz-range-thumb {
    width: 14px; height: 18px; border-radius: 3px;
    background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi) 45%, var(--brass) 60%, var(--brass-lo));
    border: 1px solid var(--brass-dk);
}
.lever input[type=range]:focus-visible { outline: 2px solid var(--biolum); outline-offset: 2px; }

/* toggles */
.toggles { display: grid; gap: 6px; margin: 12px 0; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .95rem; }
.toggle input {
    -webkit-appearance: none; appearance: none; flex: none; margin: 0;
    width: 30px; height: 16px; border-radius: 8px; position: relative; cursor: pointer;
    background: #041216; border: 1px solid var(--brass-lo); transition: background .2s;
}
.toggle input::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--ink-muted); transition: transform .2s, background .2s, box-shadow .2s;
}
.toggle input:checked { background: var(--verdigris-dk); border-color: var(--verdigris); }
.toggle input:checked::after { transform: translateX(14px); background: var(--biolum); box-shadow: 0 0 8px var(--biolum); }
.toggle input:focus-visible { outline: 2px solid var(--biolum); outline-offset: 2px; }

/* the great lever */
.flip-btn {
    width: 100%; margin: 4px 0 8px; padding: 10px 12px 9px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--f-display); letter-spacing: .12em; font-size: 1.05rem;
    color: var(--brass-dk);
    background: linear-gradient(180deg, var(--brass-hi), var(--brass) 55%, var(--brass-lo));
    border: 1px solid var(--brass-dk); border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 4px 14px rgba(0, 0, 0, .5);
}
.flip-btn:hover:not(:disabled) { filter: brightness(1.08); }
.flip-btn:disabled { opacity: .55; cursor: progress; }
.flip-glyph { font-size: 1.4rem; line-height: 1; display: inline-block; transition: transform .6s; }
.flip-btn:hover:not(:disabled) .flip-glyph { transform: rotate(-180deg); }

/* survey */
.survey { border-top: 1px solid rgba(196, 154, 74, .35); margin-top: 8px; }
.survey dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 8px 0; font-size: .92rem; }
.survey dt { color: var(--ink-muted); }
.survey dd { margin: 0; font-family: var(--f-mono); color: var(--parchment); text-align: right; }
.fine { font-size: .78rem; color: var(--ink-muted); font-style: italic; margin: 6px 0 0; line-height: 1.3; }

.hypso { margin: 4px 0 0; }
.hypso figcaption { font-size: .78rem; color: var(--ink-muted); font-style: italic; margin-bottom: 2px; }
.hypso svg { display: block; width: 100%; height: auto; }
.hypso-grid { stroke: rgba(212, 199, 163, .12); stroke-width: 1; }
.hypso-tick { font-family: var(--f-mono); font-size: 8px; fill: var(--ink-muted); }
.hypso-area { fill: rgba(196, 154, 74, .18); }
.hypso-line { fill: none; stroke: var(--brass-hi); stroke-width: 2; stroke-linejoin: round; }
.hypso-sea { stroke: var(--biolum); stroke-width: 2; }
.hypso-sea-label { font-family: var(--f-mono); font-size: 9px; fill: var(--parchment); }
.hypso-hit { fill: transparent; }
.hypso-hit:hover { fill: rgba(95, 245, 225, .08); }

/* ---------- expedition log ---------- */
.search { position: relative; }
.search input {
    width: 100%; padding: 8px 10px; font: inherit; font-size: .98rem;
    color: var(--parchment); background: rgba(1, 10, 13, .7);
    border: 1px solid var(--brass-lo); border-radius: 2px;
}
.search input::placeholder { color: var(--ink-muted); font-style: italic; }
.search input:focus { outline: none; border-color: var(--biolum); box-shadow: 0 0 0 1px var(--biolum-dim); }
.results {
    position: absolute; z-index: 3; left: 0; right: 0; top: calc(100% + 2px);
    margin: 0; padding: 4px 0; list-style: none;
    background: #03161b; border: 1px solid var(--brass); box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}
.results button, .wonders button {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
    padding: 4px 10px; border: 0; background: none; cursor: pointer;
}
.results button:hover, .wonders button:hover, .wonders button.active { background: rgba(95, 245, 225, .08); color: var(--parchment); }
.results small { margin-left: auto; color: var(--ink-muted); font-style: italic; }

.kind-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.k-city   { background: var(--biolum); box-shadow: 0 0 6px var(--biolum); }
.k-peak   { background: #f2efe6; clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.k-abyss  { background: #1c5dd6; box-shadow: 0 0 0 1px #8fb4ff; }
.k-island { background: var(--sand); box-shadow: 0 0 0 1px var(--brass); }
.k-wonder { background: var(--brass-hi); transform: rotate(45deg); border-radius: 1px; }

.entry {
    margin: 12px 0 4px; padding: 12px 14px;
    background: linear-gradient(180deg, #efe3c4, #dccb9f);
    color: #2c1f0d; border-radius: 2px;
    box-shadow: inset 0 0 30px rgba(120, 80, 20, .35), 0 6px 18px rgba(0, 0, 0, .5);
    transform: rotate(-.4deg);
}
.entry-kind { font-family: var(--f-type); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #6b4718; }
.entry h3 { margin: 2px 0; color: #2c1f0d; font-size: 1.25rem; }
.entry-depth { font-family: var(--f-type); font-size: .82rem; color: #7a2a17; }
.entry p { margin: 8px 0; font-size: .98rem; line-height: 1.35; }
.entry-coords { font-family: var(--f-mono); font-size: .78rem; color: #5b4a2a; }

.tour { margin-top: 14px; }
.tour-head { display: flex; align-items: baseline; justify-content: space-between; }
.tour-head span { font-family: var(--f-mono); color: var(--ink-muted); }
.tour-buttons { display: grid; grid-template-columns: 1fr 1.6fr; gap: 6px; }

.sub { margin-top: 16px !important; }
.wonders { list-style: none; margin: 0; padding: 0; font-size: .97rem; }
.wonder-group { margin: 8px 0 2px; font-family: var(--f-italic); font-style: italic; color: var(--brass); font-size: .88rem; border-bottom: 1px dotted rgba(196, 154, 74, .35); }

.log-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.log-actions .brass-btn { flex: 1 1 auto; font-size: .82rem; }

/* ---------- hover readout (Subnautica HUD) ---------- */
.readout {
    position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%);
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px;
    max-width: calc(100vw - 2 * var(--gutter));
    padding: 7px 16px; z-index: 4;
    font-family: var(--f-mono); font-size: .92rem; color: var(--parchment);
    background: rgba(2, 18, 24, .72);
    border: 1px solid rgba(95, 245, 225, .45); border-radius: 18px;
    box-shadow: 0 0 18px rgba(95, 245, 225, .12), inset 0 0 12px rgba(95, 245, 225, .08);
    pointer-events: none; white-space: nowrap;
}
.readout b { font-weight: 400; color: var(--biolum); }
.ro-sep { color: rgba(95, 245, 225, .35); }
.ro-depth.wet { color: #8fd8ff; }
.ro-depth.dry { color: var(--sand); }
.ro-hint { color: var(--ink-muted); font-family: var(--f-italic); font-style: italic; font-size: .95rem; white-space: normal; text-align: center; }

/* ---------- the Salamander Gazette ---------- */
.gazette {
    position: absolute; left: 0; right: 0; bottom: 0; height: 30px; z-index: 6;
    display: flex; align-items: stretch;
    background: #e4d6b0; color: #231a0c;
    border-top: 2px solid var(--brass-dk);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, .45);
    font-family: var(--f-type); font-size: .85rem;
}
.gazette-mast {
    flex: none; display: flex; align-items: center; gap: 6px; padding: 0 14px;
    background: #231a0c; color: #e4d6b0;
    font-family: var(--f-display); letter-spacing: .1em; font-size: .9rem;
}
.gazette-mast span { font-family: var(--f-italic); font-style: italic; font-size: .78rem; color: var(--brass); letter-spacing: 0; }
.gazette-track { flex: 1; overflow: hidden; position: relative; display: flex; align-items: center; }
.gazette-roll { display: flex; white-space: nowrap; animation: roll 210s linear infinite; }
.gazette:hover .gazette-roll { animation-play-state: paused; }
.gazette-item { padding: 0 28px; position: relative; }
.gazette-item::after { content: "❦"; position: absolute; right: -6px; color: #7a2a17; }

/* "More…" at the right-hand end of the Gazette bar, cut like its masthead */
.gazette-track { margin-right: 78px; }
.more-btn {
    position: absolute; right: 0; bottom: 0; height: 30px; z-index: 7; padding: 2px 14px 0;
    background: #231a0c; color: #e4d6b0; border: 0; border-top: 2px solid var(--brass-dk); cursor: pointer;
    font-family: var(--f-display); letter-spacing: .1em; font-size: .9rem;
}
.more-btn:hover, .more-btn:focus-visible { color: var(--brass-hi); background: #3a2a12; outline: none; }
@keyframes roll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- place cards on the globe ---------- */
.label-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.atl-label {
    position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; cursor: pointer;
    pointer-events: auto; display: flex; align-items: center; gap: 6px;
    transform-origin: 0 0; will-change: transform;
    margin: -5px 0 0 -5px;
    text-align: left; transition: opacity .25s;
}
.atl-label.atl-hidden { visibility: hidden; pointer-events: none; }
.atl-pin { width: 10px; height: 10px; flex: none; border-radius: 50%; }
.atl-text { display: flex; flex-direction: column; line-height: 1.05; text-shadow: 0 1px 3px #000, 0 0 8px rgba(0, 0, 0, .9); }
.atl-name { font-family: var(--f-display); font-size: .86rem; letter-spacing: .06em; color: var(--parchment); white-space: nowrap; }
.atl-cap { font-family: var(--f-mono); font-size: .68rem; color: var(--biolum); white-space: nowrap; opacity: .85; }
.atl-label:hover .atl-name, .atl-label:focus-visible .atl-name { color: #fff; }
.atl-label:focus-visible { outline: 1px dashed var(--biolum); outline-offset: 3px; }

.atl-city .atl-pin { background: radial-gradient(circle, #fff 0 15%, var(--biolum) 35%, rgba(95, 245, 225, 0) 70%); box-shadow: 0 0 10px 2px rgba(95, 245, 225, .55); animation: glow 3.6s ease-in-out infinite; }
.atl-peak .atl-pin { background: #f2efe6; clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.atl-peak .atl-cap { color: var(--sand); }
.atl-abyss .atl-pin { background: radial-gradient(circle, #000 0 35%, #1c5dd6 40% 55%, transparent 60%); box-shadow: 0 0 0 1px #8fb4ff; }
.atl-abyss .atl-cap { color: #8fb4ff; }
.atl-island .atl-pin { background: var(--sand); box-shadow: 0 0 0 1px var(--brass-dk), 0 0 6px var(--sand); }
.atl-island .atl-cap { color: var(--sand); }
.atl-wonder .atl-pin { background: var(--brass-hi); transform: rotate(45deg) scale(.8); border-radius: 1px; }
.atl-wonder .atl-cap { color: var(--brass-hi); }
@keyframes glow { 50% { box-shadow: 0 0 16px 4px rgba(95, 245, 225, .75); } }

/* ---------- loading ---------- */
.loading {
    position: absolute; inset: 0; z-index: 20; display: grid; place-items: center;
    background: radial-gradient(circle at 50% 45%, rgba(4, 34, 44, .55), rgba(1, 8, 11, .92));
}
.loading-card { width: min(420px, calc(100vw - 2 * var(--gutter))); text-align: center; }
.loading-kicker { font-family: var(--f-italic); font-style: italic; color: var(--ink-muted); }
.loading-title { font-family: var(--f-display); font-size: 1.7rem; letter-spacing: .1em; color: var(--brass-hi); margin: 4px 0 16px; }
.gauge { height: 10px; border: 1px solid var(--brass); border-radius: 5px; background: #01080b; overflow: hidden; box-shadow: inset 0 1px 3px #000; }
.gauge-fill { height: 100%; background: linear-gradient(90deg, var(--verdigris-dk), var(--biolum)); box-shadow: 0 0 12px var(--biolum); transition: width .25s; }
.loading-detail { margin-top: 10px; font-family: var(--f-mono); font-size: .9rem; color: var(--ink); }

.refining {
    position: absolute; top: 166px; left: 50%; transform: translateX(-50%); z-index: 4;
    font-family: var(--f-mono); font-size: .78rem; color: var(--ink-muted);
    padding: 3px 10px; border: 1px solid rgba(196, 154, 74, .35); border-radius: 10px; background: rgba(2, 18, 24, .6);
}

.toast {
    position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 30;
    max-width: calc(100vw - 2 * var(--gutter)); overflow-wrap: anywhere;
    padding: 8px 16px; font-family: var(--f-type); font-size: .9rem;
    background: #e4d6b0; color: #231a0c; border: 1px solid var(--brass-dk); box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
    animation: toastIn .25s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- credits modal ---------- */
.modal-scrim { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: var(--gutter); background: rgba(0, 6, 9, .7); }
.modal {
    width: min(560px, 100%); max-height: calc(100vh - 2 * var(--gutter)); overflow-y: auto;
    padding: 22px 26px;
    background: linear-gradient(180deg, #efe3c4, #dccb9f); color: #2c1f0d;
    border: 1px solid var(--brass-dk); box-shadow: inset 0 0 50px rgba(120, 80, 20, .35), 0 20px 60px #000;
}
.modal h2, .modal h3 { font-family: var(--f-display); font-weight: 400; letter-spacing: .1em; color: #3a250b; margin: 0 0 10px; }
.modal h3 { margin-top: 16px; font-size: 1.05rem; }
.modal a { color: #7a2a17; }
.modal p, .modal li { line-height: 1.4; }
.modal .brass-btn { margin-top: 10px; }

/* ---------- More from TripGeo ---------- */
.more-modal { width: min(720px, 100%); }
.more-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.more-head h2 { margin: 0; }
.more-close { border: 0; background: none; padding: 0 4px; font-size: 1.6rem; line-height: 1; cursor: pointer; color: #3a250b; }
.more-close:hover { color: #000; }
.more-kicker { margin: 6px 0 12px; font-family: var(--f-italic); font-style: italic; color: #5a4526; }
.more-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.more-list a {
    display: flex; flex-direction: column; gap: 2px; height: 100%; box-sizing: border-box; padding: 8px 10px;
    color: #2c1f0d; text-decoration: none;
    background: rgba(255, 255, 255, .28); border: 1px solid rgba(58, 37, 11, .28);
    transition: background .15s, border-color .15s;
}
.more-list a:hover, .more-list a:focus-visible { background: rgba(255, 255, 255, .55); border-color: #7a2a17; outline: none; }
.more-name { font-family: var(--f-display); letter-spacing: .06em; font-size: 1.02rem; color: #3a250b; }
.more-url { font-family: var(--f-mono); font-size: .72rem; color: #7a2a17; }
.more-blurb { font-size: .86rem; line-height: 1.3; color: #3d2d14; }
.more-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.more-foot .brass-btn { margin-top: 0; }


/* ---------- the movie: a brass tab beside the Log, and its picture-house dialog ---------- */
.movie-btn {
    position: absolute; top: 18px; right: calc(var(--gutter) + 68px); z-index: 6;
    display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px 2px;
    font-family: var(--f-display); letter-spacing: .14em; font-size: .85rem; line-height: inherit;
    color: var(--brass-dk);
    background: linear-gradient(180deg, var(--brass-hi), var(--brass) 60%, var(--brass-lo));
    border: 1px solid var(--brass-dk); border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .5); cursor: pointer;
}
.movie-btn svg { width: .62em; height: .62em; fill: currentColor; flex: none; }
.movie-btn:hover { filter: brightness(1.08); }
.movie-btn:focus-visible { outline: 2px solid var(--biolum); outline-offset: 2px; }

.movie-scrim { background: rgba(0, 6, 9, .86); outline: none; }
.movie-modal {
    width: min(1180px, 100%, calc((100vh - 2 * var(--gutter) - 60px) * 16 / 9));
    padding: 10px 12px 12px;
    background: linear-gradient(180deg, #0a2a33, var(--abyss));
    border: 1px solid var(--brass); outline: 3px solid rgba(58, 37, 11, .85);
    box-shadow: inset 0 0 0 4px rgba(4, 26, 32, .9), inset 0 0 0 5px rgba(196, 154, 74, .45), 0 20px 70px #000;
    border-radius: 3px;
}
.movie-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 8px; }
.movie-head h2 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 1.2rem; letter-spacing: .16em; color: var(--brass-hi); }
.movie-head h2 span { font-family: var(--f-italic); font-style: italic; font-size: .95rem; letter-spacing: .02em; color: var(--ink-muted); }
.movie-close { border: 0; background: none; padding: 0 4px; font-size: 1.7rem; line-height: 1; cursor: pointer; color: var(--brass); }
.movie-close:hover, .movie-close:focus-visible { color: var(--brass-hi); outline: none; }
.movie-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--brass-dk); }

/* ---------- not found ---------- */
.lost { height: 100%; display: grid; place-content: center; text-align: center; padding: var(--gutter); }
.lost h1 { font-family: var(--f-display); font-weight: 400; color: var(--brass-hi); letter-spacing: .12em; }

/* ---------- narrow screens ---------- */
@media (max-width: 900px) {
    .cartouche { top: 8px; padding: 2px 10px; }
    .cartouche::before, .cartouche::after, .cartouche-kicker { display: none; }
    .panel { top: 96px; bottom: 120px; width: auto; }
    .panel.ballast { left: var(--gutter); right: var(--gutter); }
    .panel.log { left: var(--gutter); right: var(--gutter); }
    .panel.ballast.open ~ .panel.log .panel-body { display: none; }
    .panel.log .panel-tab { position: absolute; right: 0; top: 0; }
    .movie-btn { top: 10px; right: var(--gutter); }   /* the Log's row is full here: take the free corner above it */
    .readout { bottom: 40px; font-size: .78rem; white-space: normal; border-radius: 10px; }
    .gazette-mast span { display: none; }
}

/* phones: no room beside the title or the view switch for the word, so the play mark stands alone */
@media (max-width: 480px) {
    .movie-btn { padding: 7px 10px; }
    .movie-btn span { display: none; }
    .movie-btn svg { width: .8em; height: .8em; }
}

@media (prefers-reduced-motion: reduce) {
    .gazette-roll, .porthole::before, .atl-city .atl-pin, .boot-sub { animation: none; }
}

body:has(.atlas) .boot-splash { display: none; }
