/* =========================================================================
   mores.quest — a behavioral aquarium
   HUD-overlay diving sequence · glassmorphism-as-aquarium-acrylic
   ========================================================================= */

:root {
    --abyss:        #0A2E4D;
    --ocean:        #114D7A;
    --shallow:      #3E9CC9;
    --surface-light:#9FE3E0;
    --foam:         #F4FBFB;
    --coral:        #FF7A59;
    --coral-deep:   #E2502F;
    --sand:         #F6E7CE;
    --chrome:       #C8D6DE;
    --ink:          #0B2236;

    --ease-dive: cubic-bezier(0.16, 1, 0.3, 1);

    --serif-display: "Libre Baskerville", Georgia, serif;
    --serif-body: "Spectral", Georgia, serif;
    --inst: "Space Grotesk", "Inter", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--serif-body);
    color: var(--foam);
    background: var(--abyss);
    overflow-x: hidden;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================================
   LAYER 0 — THE TANK
   ========================================================================= */

.tank {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.tank-gradient {
    position: absolute;
    left: 0; right: 0;
    top: -40vh;
    height: 220vh;
    background: linear-gradient(180deg,
        #6FC4DB 0%,
        var(--shallow) 16%,
        var(--ocean) 48%,
        var(--abyss) 78%,
        #061d33 100%);
    transform: translate3d(0, 0, 0);
    transition: transform 0.18s linear;
}

/* caustic light blobs */
.caustics { position: absolute; inset: -20%; pointer-events: none; }
.caustic {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%,
        rgba(159, 227, 224, 0.30),
        rgba(159, 227, 224, 0.10) 45%,
        transparent 70%);
    mix-blend-mode: screen;
    filter: blur(8px);
}
.caustic.c1 { width: 70vw; height: 70vw; top: -10%; left: -8%; animation: causticDrift1 38s ease-in-out infinite; }
.caustic.c2 { width: 60vw; height: 60vw; top: 30%; right: -12%; animation: causticDrift2 46s ease-in-out infinite; opacity: 0.8; }
.caustic.c3 { width: 50vw; height: 50vw; bottom: -8%; left: 25%; animation: causticDrift3 52s ease-in-out infinite; opacity: 0.6; }

@keyframes causticDrift1 {
    0%,100% { transform: translate(0,0) scale(1) rotate(0deg); }
    50% { transform: translate(8vw, 6vh) scale(1.18) rotate(40deg); }
}
@keyframes causticDrift2 {
    0%,100% { transform: translate(0,0) scale(1.05) rotate(0deg); }
    50% { transform: translate(-7vw, -5vh) scale(0.85) rotate(-30deg); }
}
@keyframes causticDrift3 {
    0%,100% { transform: translate(0,0) scale(0.9) rotate(0deg); }
    50% { transform: translate(5vw, -8vh) scale(1.25) rotate(25deg); }
}

/* bubble columns */
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble {
    position: absolute;
    bottom: -40px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(244,251,251,0.7), rgba(159,227,224,0.18) 60%, transparent 75%);
    box-shadow: inset 0 0 4px rgba(255,255,255,0.5);
    animation-name: bubbleRise;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
@keyframes bubbleRise {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    8%   { opacity: 0.85; }
    50%  { transform: translateY(-52vh) translateX(14px); }
    90%  { opacity: 0.7; }
    100% { transform: translateY(-108vh) translateX(-10px); opacity: 0; }
}
.bubbles.fast .bubble { animation-duration: 5s !important; }

/* fish layer */
.fish-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}
.fish-layer defs path[id^="path"] { display: none; }
.fish { will-change: transform; }
.fish use, .fish > * { }

.big-angel      { fill: var(--coral);          opacity: 0.34; transform-box: fill-box; }
.angel-small    { fill: var(--coral);          opacity: 0.22; }
.wrasse-a       { fill: var(--shallow);        opacity: 0.30; }
.wrasse-b       { fill: var(--surface-light);  opacity: 0.24; }
.tang-a         { fill: var(--surface-light);  opacity: 0.30; }
.boxfish-mid    { fill: var(--coral);          opacity: 0.28; }
.trumpet-a      { fill: var(--shallow);        opacity: 0.26; }
.ascent-trumpet { fill: var(--coral);          opacity: 0.34; }
.card-1, .card-2, .card-3, .card-4, .card-5 { fill: var(--surface-light); opacity: 0.30; }

/* boxfish startle freeze */
.fish-layer.startle #boxfishMotion { /* paused via JS animation API */ }

/* =========================================================================
   LAYER 10 — THE CONTENT REEF
   ========================================================================= */

.reef {
    position: relative;
    z-index: 10;
}

.station {
    position: relative;
    min-height: 100svh;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(10, 1fr);
    align-items: center;
    padding: 6vh 5vw;
    gap: 0;
    overflow: hidden;
}

/* station code label — floating top of each section */
.station-code {
    grid-column: 2 / 8;
    grid-row: 1 / 2;
    align-self: start;
    font-family: var(--inst);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--surface-light);
    opacity: 0.85;
    margin-top: 2vh;
}
.station-code.chrome-dim { color: var(--chrome); opacity: 0.6; }

/* depth ruler — thin glass strip on an edge */
.depth-ruler {
    grid-column: 12 / 13;
    grid-row: 1 / 11;
    position: relative;
    width: 38px;
    justify-self: end;
    margin-right: -2vw;
    background: rgba(244,251,251,0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 1px solid rgba(255,255,255,0.18);
    border-right: 1px solid rgba(159,227,224,0.20);
    overflow: hidden;
}
.station:nth-child(odd) .depth-ruler {
    grid-column: 1 / 2;
    justify-self: start;
    margin-left: -2vw;
    margin-right: 0;
}
.depth-ruler.dark { background: rgba(10,46,77,0.4); }
.ruler-label {
    position: absolute; top: 4px; left: 0; right: 0;
    text-align: center;
    font-family: var(--inst); font-size: 9px; letter-spacing: 0.1em;
    color: var(--chrome); opacity: 0.7;
}
.ruler-tick {
    position: absolute; left: 0; right: 0;
    text-align: center;
    font-family: var(--inst); font-size: 8px; letter-spacing: 0.05em;
    color: var(--surface-light); opacity: 0.55;
    border-top: 1px solid rgba(159,227,224,0.25);
    padding-top: 1px;
}
.ruler-indicator {
    position: absolute; left: 2px; right: 2px;
    height: 3px;
    background: var(--coral);
    box-shadow: 0 0 8px rgba(255,122,89,0.8);
    top: 8%;
    transition: top 0.2s linear;
}
.ruler-indicator.hot { background: var(--coral-deep); box-shadow: 0 0 10px rgba(226,80,47,0.9); }

/* ---------- PANELS ---------- */
.panel {
    position: relative;
    opacity: 0;
    transition:
        transform 0.95s var(--ease-dive),
        opacity 0.8s var(--ease-dive);
    will-change: transform, opacity;
}
.panel.in { opacity: 1; transform: translate(0,0) rotate(var(--rot, 0deg)) scale(1) !important; }

/* slide-reveal initial offsets, depth-coded */
.panel[data-panel="left"]      { transform: translateX(-8vw) rotate(var(--rot,-0.8deg)) scale(0.97); }
.panel[data-panel="left-low"]  { transform: translateX(-8vw) rotate(var(--rot,1.1deg)) scale(0.97); }
.panel[data-panel="right"]     { transform: translateX(8vw) rotate(var(--rot,0.9deg)) scale(0.97); }
.panel[data-panel="right-low"] { transform: translateX(8vw) rotate(var(--rot,-1.2deg)) scale(0.97); }
.panel[data-panel="center"]    { transform: translateY(6vh) rotate(var(--rot,0deg)) scale(0.98); }

/* one-shot caustic light streak on entry */
.panel::after {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(115deg,
        transparent 30%,
        rgba(159,227,224,0.45) 47%,
        rgba(244,251,251,0.65) 50%,
        rgba(159,227,224,0.45) 53%,
        transparent 70%);
    transform: translateX(-130%) skewX(-12deg);
    opacity: 0;
    pointer-events: none;
    border-radius: inherit;
    mix-blend-mode: screen;
}
.panel.in::after {
    animation: lightStreak 0.75s ease-out 0.1s 1;
}
@keyframes lightStreak {
    0%   { transform: translateX(-130%) skewX(-12deg); opacity: 0; }
    15%  { opacity: 1; }
    100% { transform: translateX(130%) skewX(-12deg); opacity: 0; }
}

/* glass panel — physical aquarium acrylic */
.glass {
    background: rgba(244, 251, 251, 0.12);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.28);
    border-top-color: rgba(255,255,255,0.5);
    border-radius: 6px;
    padding: clamp(24px, 3vw, 44px);
    color: var(--foam);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.35),
        inset 0 0 40px rgba(159,227,224,0.12),
        0 0 0 3px rgba(159,227,224,0.10),     /* acrylic thickness */
        1px 0 0 rgba(255,122,89,0.35),         /* chromatic split + */
        -1px 0 0 rgba(62,156,201,0.35),        /* chromatic split - */
        0 22px 50px rgba(6,29,51,0.32);
}
.glass .lede { font-size: clamp(1.05rem, 1.3vw, 1.3rem); color: var(--foam); }
.dark-glass {
    background: rgba(10,46,77,0.34);
    border-color: rgba(159,227,224,0.22);
    border-top-color: rgba(159,227,224,0.4);
    box-shadow:
        inset 0 1px 0 rgba(159,227,224,0.25),
        inset 0 0 50px rgba(10,46,77,0.5),
        0 0 0 3px rgba(10,46,77,0.4),
        1px 0 0 rgba(226,80,47,0.3),
        -1px 0 0 rgba(17,77,122,0.4),
        0 22px 50px rgba(0,0,0,0.45);
}

/* placard — opaque specimen-label panel */
.placard {
    background: var(--sand);
    color: var(--ink);
    border-radius: 4px;
    padding: clamp(20px, 2.2vw, 32px);
    font-size: 0.98rem;
    line-height: 1.55;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.6) inset,
        0 14px 36px rgba(6,29,51,0.28);
    background-image:
        repeating-linear-gradient(0deg, rgba(11,34,54,0.025) 0, rgba(11,34,54,0.025) 1px, transparent 1px, transparent 3px),
        repeating-linear-gradient(90deg, rgba(11,34,54,0.02) 0, rgba(11,34,54,0.02) 1px, transparent 1px, transparent 4px);
}
.placard p + p { margin-top: 0.7em; }
.placard-num {
    display: inline-block;
    font-family: var(--inst);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--coral-deep);
    border: 1px solid rgba(226,80,47,0.4);
    padding: 2px 8px;
    border-radius: 2px;
    margin-bottom: 12px;
}
.placard-num.hot-num { color: #fff; background: var(--coral-deep); border-color: var(--coral-deep); }
.placard-aside { font-style: italic; color: rgba(11,34,54,0.6); font-size: 0.88rem; margin-top: 0.9em; }
.dark-placard {
    background: linear-gradient(180deg, #143a5c, #0c2d49);
    color: var(--foam);
    border: 1px solid rgba(226,80,47,0.3);
}
.dark-placard .placard-aside { color: rgba(244,251,251,0.55); }

.panel-tag {
    font-family: var(--serif-display);
    font-style: italic;
    font-size: clamp(1.05rem, 1.4vw, 1.4rem);
    line-height: 1.45;
}
.panel-tag.placard { color: var(--ink); }

/* ---------- TYPOGRAPHY INSIDE PANELS ---------- */
.title {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: clamp(2rem, 4.2vw, 3.6rem);
    letter-spacing: -0.015em;
    line-height: 1.08;
    margin-bottom: 0.5em;
    color: var(--foam);
}
.placard .title, .dark-placard .title { color: inherit; }
.subhead {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: clamp(1.1rem, 1.7vw, 1.5rem);
    letter-spacing: -0.01em;
    margin-bottom: 0.5em;
    color: var(--surface-light);
}
.dark-glass .subhead { color: var(--coral); }
.lede { margin-bottom: 0.85em; font-style: italic; }
.glass p + p { margin-top: 0.8em; }
.closing { margin-top: 1em; font-family: var(--serif-display); font-weight: 700; }

em { font-style: italic; }
strong { font-weight: 700; }

.reef-list { list-style: none; margin-top: 0.4em; }
.reef-list li {
    padding: 7px 0 7px 22px;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    font-size: 0.98rem;
}
.reef-list li:last-child { border-bottom: none; }
.reef-list li::before {
    content: "";
    position: absolute; left: 0; top: 14px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--coral);
    opacity: 0.7;
}

/* hover terms — get a swinging specimen tag via JS, but also a static affordance */
.term {
    color: var(--coral);
    border-bottom: 1px dotted rgba(255,122,89,0.6);
    cursor: help;
    transition: color 0.25s ease, background 0.25s ease;
    padding: 0 2px;
}
.term:hover { color: var(--coral-deep); background: rgba(255,122,89,0.12); border-radius: 2px; }
.placard .term, .dark-placard .term { color: var(--coral-deep); border-bottom-color: rgba(226,80,47,0.5); }
.placard .term:hover { background: rgba(226,80,47,0.14); }

/* reveal-slow text (drop-off station) */
.reveal-slow {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1.4s var(--ease-dive);
}
.station-dropoff.station-in .reveal-slow { clip-path: inset(0 0 0 0); }

/* =========================================================================
   STATION-SPECIFIC GRID PLACEMENT
   ========================================================================= */

/* ----- 01 SURFACE ----- */
.wordmark-wrap { text-align: center; }
.wordmark-wrap.panel[data-panel="center"] {
    grid-column: 2 / 12;
    grid-row: 2 / 7;
    align-self: center;
}
.station-ascent .wordmark-wrap.panel[data-panel="center"] {
    grid-column: 3 / 11;
    grid-row: 2 / 6;
}
.wordmark {
    position: relative;
    display: inline-block;
    line-height: 0.9;
}
.wordmark-text {
    font-family: var(--serif-display);
    font-weight: 700;
    font-size: clamp(4.5rem, 16vw, 11rem);
    letter-spacing: -0.02em;
    color: var(--foam);
    display: block;
    text-shadow: 0 0 60px rgba(159,227,224,0.4);
}
.wordmark.small .wordmark-text { font-size: clamp(3rem, 9vw, 7rem); }
/* the original — clip to above-water (top half crisp) */
.wordmark > .wordmark-text:first-child { clip-path: inset(0 0 50% 0); }
/* the refraction duplicate — below water-line, scaled, blurred, hue-shifted, wobbling */
.wordmark-refraction {
    position: absolute;
    inset: 0;
    clip-path: inset(50% 0 0 0);
    transform: scaleY(1.05);
    transform-origin: top;
    filter: blur(1.6px) hue-rotate(8deg) brightness(1.1);
    color: var(--surface-light);
    opacity: 0.75;
    animation: refractWobble 6s ease-in-out infinite;
}
@keyframes refractWobble {
    0%,100% { transform: scaleY(1.05) skewX(0.6deg); }
    50%     { transform: scaleY(1.05) skewX(-0.6deg); }
}
.wordmark-sub {
    font-family: var(--serif-display);
    font-style: italic;
    font-size: clamp(0.9rem, 1.4vw, 1.25rem);
    color: var(--surface-light);
    margin-top: 1.4em;
    letter-spacing: 0.02em;
}
.ascent-sub { color: var(--coral); }

.station-surface .panel-hero { grid-column: 2 / 8;  grid-row: 6 / 10; align-self: center; max-width: 640px; }
.station-surface .panel-annot { grid-column: 7 / 12; grid-row: 8 / 11; align-self: start; max-width: 420px; z-index: 3; }

.scroll-hint {
    grid-column: 6 / 8;
    grid-row: 10 / 11;
    align-self: end;
    justify-self: center;
    font-family: var(--inst);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--surface-light);
    opacity: 0.7;
    animation: hintBob 2.4s ease-in-out infinite;
}
@keyframes hintBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ----- 02 SHALLOWS ----- */
.station-shallows .panel-hero  { grid-column: 2 / 8;  grid-row: 2 / 6;  align-self: center; max-width: 640px; }
.station-shallows .panel-annot { grid-column: 7 / 12; grid-row: 4 / 7;  align-self: start; max-width: 420px; z-index: 3; }
.station-shallows .panel-side  { grid-column: 2 / 7;  grid-row: 6 / 10; align-self: center; max-width: 560px; }
.station-shallows .panel-tag   { grid-column: 8 / 12; grid-row: 7 / 10; align-self: center; max-width: 380px; }

/* ----- 03 MIDWATER ----- */
.station-midwater .panel-hero  { grid-column: 6 / 12; grid-row: 2 / 6;  align-self: center; max-width: 640px; }
.station-midwater .panel-annot { grid-column: 2 / 7;  grid-row: 4 / 7;  align-self: start; max-width: 420px; z-index: 3; }
.station-midwater .panel-side  { grid-column: 7 / 12; grid-row: 6 / 10; align-self: center; max-width: 560px; }
.station-midwater .panel-tag   { grid-column: 2 / 6;  grid-row: 7 / 10; align-self: center; max-width: 380px; }
.midwater-card { cursor: pointer; transition: transform 0.4s var(--ease-dive), box-shadow 0.4s ease; }
.midwater-card:hover { transform: translateY(-4px) rotate(var(--rot,0deg)) scale(1.012); box-shadow: 0 26px 60px rgba(6,29,51,0.4); }

/* ----- 04 THERMOCLINE ----- */
.station-thermocline { position: relative; }
.thermo-shimmer {
    position: absolute;
    left: 0; right: 0;
    top: 42%;
    height: 16%;
    background: linear-gradient(180deg, transparent, rgba(159,227,224,0.22) 35%, rgba(255,122,89,0.10) 65%, transparent);
    filter: blur(6px);
    pointer-events: none;
    z-index: 1;
    animation: shimmerBand 7s ease-in-out infinite;
}
@keyframes shimmerBand {
    0%,100% { transform: translateY(0) scaleY(1); opacity: 0.85; }
    50%     { transform: translateY(-12px) scaleY(1.25); opacity: 1; }
}
.station-thermocline .panel-hero  { grid-column: 2 / 8;  grid-row: 2 / 6;  align-self: center; max-width: 640px; }
.station-thermocline .panel-annot { grid-column: 7 / 12; grid-row: 4 / 7;  align-self: start; max-width: 420px; z-index: 3; }
.station-thermocline .panel-side  { grid-column: 7 / 12; grid-row: 6 / 10; align-self: center; max-width: 560px; }
.station-thermocline .panel-tag   { grid-column: 2 / 7;  grid-row: 7 / 10; align-self: center; max-width: 400px; }

/* ----- 05 DROP-OFF ----- */
.station-dropoff { background: linear-gradient(180deg, transparent, rgba(6,29,51,0.5) 60%, rgba(4,18,33,0.7)); }
.hot-line {
    position: absolute;
    left: 0; right: 0; top: 12%;
    height: 2px;
    background: var(--coral-deep);
    box-shadow: 0 0 18px rgba(226,80,47,0.8), 0 0 40px rgba(226,80,47,0.3);
    z-index: 1;
}
.station-dropoff .panel-hero  { grid-column: 2 / 8;  grid-row: 3 / 7;  align-self: center; max-width: 640px; }
.station-dropoff .panel-annot { grid-column: 7 / 12; grid-row: 5 / 8;  align-self: start; max-width: 420px; z-index: 3; }
.station-dropoff .panel-side  { grid-column: 7 / 12; grid-row: 7 / 11; align-self: center; max-width: 560px; }

/* ----- 06 ASCENT ----- */
.station-ascent { background: linear-gradient(180deg, rgba(4,18,33,0.3), transparent 40%, rgba(159,227,224,0.06)); }
.ascent-line {
    position: absolute;
    left: 0; right: 0; top: 80%;
    height: 1px;
    background: rgba(159,227,224,0.5);
    box-shadow: 0 0 16px rgba(159,227,224,0.4);
}
.station-ascent .bubbles.fast { position: absolute; }
.station-ascent .panel-hero  { grid-column: 5 / 12; grid-row: 5 / 10; align-self: center; max-width: 640px; }
.station-ascent .panel-annot { grid-column: 2 / 7;  grid-row: 7 / 11; align-self: center; max-width: 420px; z-index: 3; }

.reef-footer {
    grid-column: 2 / 12;
    grid-row: 10 / 11;
    align-self: end;
    font-family: var(--inst);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--surface-light);
    opacity: 0.6;
    text-align: center;
    padding-bottom: 1vh;
    line-height: 1.7;
}

/* =========================================================================
   LAYER 100 — THE HUD
   ========================================================================= */

.hud {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    font-family: var(--inst);
}
.hud-control { pointer-events: auto; }

/* corner L-brackets */
.bracket {
    position: fixed;
    width: 40px; height: 40px;
    border: 1.5px solid var(--chrome);
    opacity: 0.7;
}
.br-tl { top: 18px; left: 18px; border-right: none; border-bottom: none; }
.br-tr { top: 18px; right: 18px; border-left: none; border-bottom: none; }
.br-bl { bottom: 18px; left: 18px; border-right: none; border-top: none; }
.br-br { bottom: 18px; right: 18px; border-left: none; border-top: none; }

/* depth readout — top-left */
.hud-depth {
    position: fixed;
    top: 30px; left: 36px;
    padding: 10px 16px;
    background: rgba(200,214,222,0.08);
    border: 1px solid rgba(200,214,222,0.35);
    border-radius: 3px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.hud-label {
    display: block;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--chrome);
    opacity: 0.75;
    margin-bottom: 3px;
}
.hud-value {
    font-size: 26px;
    font-weight: 500;
    color: var(--coral);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    line-height: 1;
}
.hud-unit { font-size: 14px; color: var(--chrome); opacity: 0.8; }
.hud-sub {
    display: block;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--surface-light);
    opacity: 0.8;
    margin-top: 5px;
}

/* compass — top-right */
.hud-compass {
    position: fixed;
    top: 30px; right: 36px;
    text-align: center;
}
.compass-svg { width: 72px; height: 72px; display: block; }
.compass-ring { fill: none; stroke: var(--chrome); stroke-width: 1; opacity: 0.6; }
.compass-ring.faint { opacity: 0.3; }
.compass-needle-n { fill: var(--coral); }
.compass-needle-s { fill: var(--chrome); opacity: 0.5; }
.compass-tick { stroke: var(--chrome); stroke-width: 1.2; opacity: 0.7; }
.compass-hub { fill: var(--chrome); }
#compassRose { transform-origin: 40px 40px; transition: transform 0.2s linear; }
.compass-label { margin-top: 2px; font-size: 9px !important; }

/* station selector — bottom-center */
.hud-stations {
    position: fixed;
    bottom: 32px; left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    padding: 9px 16px;
    background: rgba(200,214,222,0.08);
    border: 1px solid rgba(200,214,222,0.3);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.station-dot {
    position: relative;
    width: 11px; height: 11px;
    border-radius: 50%;
    border: 1px solid var(--chrome);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s var(--ease-dive);
    padding: 0;
}
.station-dot:hover { background: rgba(159,227,224,0.4); }
.station-dot.active {
    background: var(--coral);
    border-color: var(--coral);
    transform: scale(1.5);
    box-shadow: 0 0 10px rgba(255,122,89,0.7);
}
.dot-tip {
    position: absolute;
    bottom: 22px; left: 50%;
    transform: translateX(-50%) translateY(6px);
    white-space: nowrap;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--foam);
    background: rgba(10,46,77,0.85);
    padding: 4px 8px;
    border-radius: 2px;
    border: 1px solid rgba(159,227,224,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.station-dot:hover .dot-tip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* reticle — bottom-left, drifts toward cursor */
.hud-reticle {
    position: fixed;
    top: 0; left: 0;
    width: 34px; height: 34px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 101;
    mix-blend-mode: screen;
}
.reticle-h, .reticle-v {
    position: absolute;
    background: var(--coral);
    opacity: 0.85;
}
.reticle-h { left: 0; right: 0; top: 50%; height: 1px; transform: translateY(-50%); }
.reticle-v { top: 0; bottom: 0; left: 50%; width: 1px; transform: translateX(-50%); }
.reticle-ring {
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255,122,89,0.6);
    border-radius: 50%;
}
.reticle-lock {
    position: absolute;
    width: 7px; height: 7px;
    border: 1.5px solid var(--coral);
    opacity: 0;
    transition: opacity 0.2s ease, inset 0.2s ease;
}
.lock-tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.lock-tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.lock-bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.lock-br { bottom: 0; right: 0; border-left: none; border-top: none; }
.hud-reticle.locked .reticle-lock { opacity: 1; animation: lockPulse 0.4s ease 1; }
.hud-reticle.locked .reticle-ring { border-color: var(--coral-deep); }
@keyframes lockPulse {
    0% { transform: scale(2.4); }
    100% { transform: scale(1); }
}

/* specimen tag — swinging museum tag, revealed near a term */
.specimen-tag {
    position: fixed;
    top: 0; left: 0;
    transform: translate(-50%, 0);
    z-index: 102;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    width: 220px;
    transform-origin: top center;
}
.specimen-tag.show { opacity: 1; animation: tagSway 3.2s ease-in-out infinite; }
.tag-string {
    display: block;
    width: 1px; height: 26px;
    background: var(--chrome);
    margin: 0 auto;
    opacity: 0.7;
}
.tag-body {
    display: block;
    background: var(--sand);
    color: var(--ink);
    font-family: var(--serif-body);
    font-size: 0.82rem;
    line-height: 1.4;
    padding: 10px 12px;
    border-radius: 3px;
    box-shadow: 0 10px 24px rgba(6,29,51,0.35);
    border: 1px solid rgba(11,34,54,0.15);
    position: relative;
}
.tag-body::before {
    content: "";
    position: absolute;
    top: -5px; left: 50%;
    width: 9px; height: 9px;
    transform: translateX(-50%) rotate(45deg);
    background: var(--sand);
    border-left: 1px solid rgba(11,34,54,0.15);
    border-top: 1px solid rgba(11,34,54,0.15);
}
@keyframes tagSway {
    0%,100% { transform: translate(-50%, 0) rotate(-2.2deg); }
    50%     { transform: translate(-50%, 0) rotate(2.2deg); }
}

/* =========================================================================
   RESPONSIVE — collapse asymmetric grids toward single-column-with-offset
   ========================================================================= */

@media (max-width: 860px) {
    .station {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 22px;
        padding: 12vh 6vw 14vh;
        align-items: stretch;
    }
    .station > * { grid-column: 1 / 2 !important; grid-row: auto !important; align-self: auto !important; max-width: 100% !important; }
    .station-code { margin-top: 0; }
    .depth-ruler { display: none; }
    .panel-annot, .panel-tag { margin-left: 8vw; }
    .panel-side, .panel-hero { margin-right: 4vw; }
    .wordmark-wrap.panel[data-panel="center"] { margin: 4vh 0; }
    .wordmark-text { font-size: clamp(3.4rem, 22vw, 6rem); }
    .wordmark.small .wordmark-text { font-size: clamp(2.4rem, 16vw, 4rem); }
    .scroll-hint { margin-top: 1vh; }

    .hud-depth { top: 24px; left: 22px; padding: 7px 11px; }
    .hud-value { font-size: 19px; }
    .hud-compass { top: 24px; right: 22px; }
    .compass-svg { width: 50px; height: 50px; }
    .compass-label { display: none; }
    .hud-stations { gap: 11px; bottom: 22px; padding: 7px 12px; }
    .bracket { width: 26px; height: 26px; }
    .br-tl, .br-tr { top: 12px; }
    .br-bl, .br-br { bottom: 12px; }
    .br-tl, .br-bl { left: 12px; }
    .br-tr, .br-br { right: 12px; }
    .hud-reticle, .specimen-tag { display: none; }
    .fish.angel-small, .fish.card-3, .fish.card-4, .fish.card-5, .fish.wrasse-b { display: none; }
}

/* respect reduced motion: freeze fish + caustics, keep composition */
@media (prefers-reduced-motion: reduce) {
    .caustic, .bubble, .wordmark-refraction, .thermo-shimmer, .scroll-hint, .specimen-tag.show, .hud-reticle.locked .reticle-lock { animation: none !important; }
    .fish animateMotion { display: none; }
    .panel { transition-duration: 0.4s; }
}
