/* ==========================================================================
   npc.quest // styles
   Coastal-blend bioluminescence. HUD-overlay isometric dive.
   ========================================================================== */

:root {
    --c-abyss:        #060D1A;
    --c-bath:         #0A1628;
    --c-kelp:         #1A3A4A;
    --c-aqua:         #7FFFD4;
    --c-cyan:         #4DD0E1;
    --c-foam:         #B2DFDB;
    --c-coral:        #FF6F61;
    --c-drift:        #D7CCC8;
    --c-glacial:      #E0F7FA;
    --c-fog:          #CFD8DC;
    --c-graphite:     #263238;

    --grad-ocean:     linear-gradient(180deg, #0A1628 0%, #060D1A 40%, #1A3A4A 100%);
    --grad-bio:       radial-gradient(ellipse at 50% 80%, rgba(77, 208, 225, 0.18) 0%, transparent 70%);
    --grad-coral:     linear-gradient(135deg, #FF6F61 0%, #7FFFD4 100%);

    --font-head:      'Barlow Condensed', 'Inter', sans-serif;
    --font-sub:       'Barlow Semi Condensed', 'Inter', sans-serif;
    --font-body:      'IBM Plex Sans', 'Inter', sans-serif;
    --font-mono:      'IBM Plex Mono', 'Menlo', monospace;

    --hud-top:        48px;
    --hud-left:       64px;
    --hud-right:      80px;
    --hud-bottom:     40px;

    --ease:           cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--c-abyss);
    color: var(--c-fog);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
    letter-spacing: 0.005em;
}

img, svg { display: block; max-width: 100%; }

/* ==========================================================================
   HUD: Top bar
   ========================================================================== */
.hud-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--hud-top);
    background: rgba(10, 22, 40, 0.86);
    border-bottom: 1px solid rgba(77, 208, 225, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 80;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.hud-top.is-visible { opacity: 1; transform: translateY(0); }
.hud-top__inner {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 32px;
    padding: 0 24px 0 calc(var(--hud-left) + 24px);
}
.hud-top__breadcrumb {
    display: flex;
    gap: 10px;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(207, 216, 220, 0.55);
}
.hud-top__crumb--active {
    color: var(--c-aqua);
    text-shadow: 0 0 8px rgba(127, 255, 212, 0.45);
}
.hud-top__sep { color: rgba(77, 208, 225, 0.4); }
.hud-top__gauge {
    display: flex;
    gap: 12px;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-cyan);
}
.hud-top__gauge-bar {
    width: 220px;
    height: 2px;
    background: rgba(26, 58, 74, 0.9);
    position: relative;
    overflow: hidden;
}
.hud-top__gauge-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: var(--c-cyan);
    box-shadow: 0 0 10px rgba(77, 208, 225, 0.7);
    transition: width 90ms linear;
}
.hud-top__gauge-value { color: var(--c-glacial); min-width: 4ch; text-align: right; }
.hud-top__ping {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-foam);
}
.hud-top__ping-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--c-coral);
    box-shadow: 0 0 8px var(--c-coral);
    animation: ping-blink 2.4s var(--ease) infinite;
}
@keyframes ping-blink {
    0%, 60% { opacity: 1; transform: scale(1); }
    65%, 100% { opacity: 0.25; transform: scale(0.7); }
}

/* ==========================================================================
   HUD: Left rail (inventory)
   ========================================================================== */
.hud-left {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--hud-left);
    background: rgba(6, 13, 26, 0.92);
    border-right: 1px solid rgba(26, 58, 74, 0.85);
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 16px;
    overflow: hidden;
}
.hud-left__brand {
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.hud-left__brand-mark {
    width: 22px; height: 22px;
    background: linear-gradient(135deg, var(--c-aqua), var(--c-cyan));
    transform: rotate(45deg);
    box-shadow: 0 0 14px rgba(127, 255, 212, 0.5);
}
.hud-left__brand-text {
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--c-aqua);
}
.hud-left__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
    align-items: center;
    margin-top: 6px;
}
.hud-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    text-decoration: none;
    color: var(--c-foam);
    transition: transform 0.3s var(--ease);
}
.hud-slot:hover { transform: translateY(-1px); }
.hud-slot__diamond {
    position: relative;
    width: 32px; height: 32px;
    background: var(--c-bath);
    border: 1px solid rgba(77, 208, 225, 0.35);
    transform: rotate(45deg);
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
}
.hud-slot__glyph {
    transform: rotate(-45deg);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--c-fog);
    letter-spacing: 0.05em;
    transition: color 0.3s var(--ease);
}
.hud-slot:hover .hud-slot__diamond {
    border-color: var(--c-cyan);
    box-shadow: 0 0 14px rgba(77, 208, 225, 0.5);
    background: rgba(26, 58, 74, 0.85);
}
.hud-slot:hover .hud-slot__glyph { color: var(--c-cyan); }
.hud-slot.is-active .hud-slot__diamond {
    border-color: var(--c-aqua);
    background: rgba(127, 255, 212, 0.12);
    animation: slot-pulse 2s var(--ease) infinite alternate;
}
.hud-slot.is-active .hud-slot__glyph {
    color: var(--c-aqua);
    text-shadow: 0 0 6px rgba(127, 255, 212, 0.7);
}
@keyframes slot-pulse {
    from { box-shadow: 0 0 6px rgba(127, 255, 212, 0.3); }
    to   { box-shadow: 0 0 18px rgba(127, 255, 212, 0.6); }
}
.hud-slot__tip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: rgba(10, 22, 40, 0.92);
    border: 1px solid rgba(77, 208, 225, 0.35);
    color: var(--c-glacial);
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.hud-slot:hover .hud-slot__tip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.hud-left__sonar {
    position: relative;
    width: 32px; height: 32px;
    margin-top: 12px;
}
.sonar-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(77, 208, 225, 0.5);
    border-radius: 50%;
    opacity: 0;
    animation: sonar 3s var(--ease) infinite;
}
.sonar-ring:nth-child(2) { animation-delay: 1s; }
.sonar-ring:nth-child(3) { animation-delay: 2s; }
@keyframes sonar {
    0%   { transform: scale(0.2); opacity: 0.85; }
    80%  { opacity: 0.05; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* ==========================================================================
   HUD: Right rail (scanner)
   ========================================================================== */
.hud-right {
    position: fixed;
    top: var(--hud-top);
    right: 0;
    bottom: var(--hud-bottom);
    width: var(--hud-right);
    background: rgba(10, 22, 40, 0.78);
    border-left: 1px solid rgba(26, 58, 74, 0.85);
    z-index: 70;
    padding: 18px 12px;
    overflow: hidden;
}
.scanner {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--c-cyan);
    text-transform: uppercase;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.scanner__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px dotted rgba(77, 208, 225, 0.18);
    padding-bottom: 4px;
}
.scanner__key { color: rgba(178, 223, 219, 0.6); }
.scanner__val {
    color: var(--c-glacial);
    text-shadow: 0 0 6px rgba(77, 208, 225, 0.35);
    transition: opacity 0.2s var(--ease);
}
.scanner__val.is-changing { opacity: 0; }
.scanner__divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(77, 208, 225, 0.5), transparent);
    margin: 4px 0;
}
.scanner__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    transition: opacity 0.2s var(--ease);
}
.scanner__tags.is-changing { opacity: 0; }
.scanner__tag {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid rgba(127, 255, 212, 0.3);
    color: var(--c-aqua);
    font-size: 9px;
    letter-spacing: 0.1em;
}
.scanner__heading {
    color: var(--c-foam);
    font-size: 9px;
    letter-spacing: 0.22em;
    margin-top: auto;
}
.scanner__note {
    font-family: var(--font-body);
    font-size: 11px;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
    color: var(--c-fog);
    transition: opacity 0.2s var(--ease);
}
.scanner__note.is-changing { opacity: 0; }
.scanner__waveform {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 22px;
    padding: 2px 0;
    border-top: 1px dotted rgba(77, 208, 225, 0.18);
    border-bottom: 1px dotted rgba(77, 208, 225, 0.18);
}
.scanner__waveform span {
    flex: 1;
    background: var(--c-cyan);
    height: 30%;
    box-shadow: 0 0 4px rgba(77, 208, 225, 0.6);
    animation: wave-bar 1.2s var(--ease) infinite alternate;
}
.scanner__waveform span:nth-child(1)  { animation-delay: 0.0s; }
.scanner__waveform span:nth-child(2)  { animation-delay: 0.08s; }
.scanner__waveform span:nth-child(3)  { animation-delay: 0.16s; }
.scanner__waveform span:nth-child(4)  { animation-delay: 0.24s; }
.scanner__waveform span:nth-child(5)  { animation-delay: 0.32s; }
.scanner__waveform span:nth-child(6)  { animation-delay: 0.40s; }
.scanner__waveform span:nth-child(7)  { animation-delay: 0.48s; }
.scanner__waveform span:nth-child(8)  { animation-delay: 0.56s; }
.scanner__waveform span:nth-child(9)  { animation-delay: 0.64s; }
.scanner__waveform span:nth-child(10) { animation-delay: 0.72s; }
.scanner__waveform span:nth-child(11) { animation-delay: 0.80s; }
.scanner__waveform span:nth-child(12) { animation-delay: 0.88s; }
@keyframes wave-bar {
    from { height: 18%; }
    to   { height: 92%; }
}

/* ==========================================================================
   HUD: Bottom bar (sonar sweep)
   ========================================================================== */
.hud-bottom {
    position: fixed;
    left: var(--hud-left);
    right: var(--hud-right);
    bottom: 0;
    height: var(--hud-bottom);
    background: rgba(6, 13, 26, 0.95);
    border-top: 1px solid rgba(26, 58, 74, 0.9);
    z-index: 70;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.hud-bottom.is-visible { opacity: 1; transform: translateY(0); }
.hud-bottom__inner {
    height: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 0 22px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.hud-bottom__label { color: var(--c-cyan); }
.hud-bottom__readout {
    color: rgba(127, 255, 212, 0.75);
    text-shadow: 0 0 6px rgba(127, 255, 212, 0.3);
}
.hud-bottom__track {
    position: relative;
    height: 2px;
    background: rgba(26, 58, 74, 0.95);
    border-top: 1px dotted rgba(77, 208, 225, 0.15);
    border-bottom: 1px dotted rgba(77, 208, 225, 0.15);
}
.hud-bottom__sweep {
    position: absolute;
    top: 0; bottom: 0;
    width: 60px;
    background: linear-gradient(90deg, transparent, rgba(127, 255, 212, 0.85), transparent);
    box-shadow: 0 0 14px rgba(127, 255, 212, 0.6);
    animation: sonar-sweep 4s linear infinite;
}
@keyframes sonar-sweep {
    from { left: -60px; }
    to   { left: calc(100% + 60px); }
}
.hud-bottom__blip {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--c-cyan);
    box-shadow: 0 0 8px rgba(77, 208, 225, 0.7);
    cursor: pointer;
    transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.hud-bottom__blip:hover {
    background: var(--c-aqua);
    transform: translate(-50%, -50%) scale(1.4);
}
.hud-bottom__blip.is-active {
    background: var(--c-aqua);
    box-shadow: 0 0 14px rgba(127, 255, 212, 0.9);
    transform: translate(-50%, -50%) scale(1.3);
}

/* ==========================================================================
   Particle field
   ========================================================================== */
.particle-field {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--c-cyan);
    box-shadow: 0 0 4px rgba(77, 208, 225, 0.7);
    opacity: 0;
    animation: particle-drift var(--p-dur, 16s) linear infinite;
    animation-delay: var(--p-delay, 0s);
    left: var(--p-x, 50%);
    top: 100%;
    transform: translateY(0);
}
.particle--aqua {
    background: var(--c-aqua);
    box-shadow: 0 0 4px rgba(127, 255, 212, 0.7);
}
@keyframes particle-drift {
    0%   { transform: translate3d(0, 0, 0) scale(0.6); opacity: 0; }
    8%   { opacity: 0.55; }
    50%  { transform: translate3d(var(--p-sway, 12px), -50vh, 0) scale(1); opacity: 0.4; }
    92%  { opacity: 0.2; }
    100% { transform: translate3d(calc(var(--p-sway, 12px) * -1), -110vh, 0) scale(0.4); opacity: 0; }
}

/* ==========================================================================
   Dive container & generic scene
   ========================================================================== */
.dive {
    position: relative;
    margin-left: var(--hud-left);
    margin-right: var(--hud-right);
    padding-top: var(--hud-top);
    padding-bottom: var(--hud-bottom);
    z-index: 2;
}
.scene {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
}
.scene__inner {
    position: relative;
    z-index: 5;
    max-width: 1100px;
    margin: 0 auto;
    padding: 88px 36px 96px;
}
.scene__header {
    max-width: 720px;
    margin-bottom: 56px;
}
.scene__index {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.32em;
    color: var(--c-cyan);
    text-transform: uppercase;
    margin-bottom: 12px;
    text-shadow: 0 0 8px rgba(77, 208, 225, 0.4);
}
.scene__title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1;
    color: var(--c-glacial);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 18px;
    text-shadow: 0 0 24px rgba(127, 255, 212, 0.18);
}
.scene__lede {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--c-fog);
    max-width: 56ch;
}
.scene__signature {
    margin-top: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.24em;
    color: rgba(178, 223, 219, 0.6);
    text-transform: uppercase;
}
.scene__signature-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(77, 208, 225, 0.4), transparent);
}

/* iso grid floor */
.iso-grid {
    position: absolute;
    left: 50%;
    bottom: -10%;
    width: 220%;
    height: 70%;
    transform: translateX(-50%) rotateX(62deg) rotateZ(-45deg);
    transform-origin: 50% 50%;
    background-image:
        linear-gradient(to right, rgba(26, 58, 74, 0.55) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(26, 58, 74, 0.55) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.85;
    pointer-events: none;
    z-index: 1;
    mask-image: radial-gradient(ellipse at 50% 100%, black 35%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 100%, black 35%, transparent 80%);
}
.iso-grid--dark {
    background-image:
        linear-gradient(to right, rgba(77, 208, 225, 0.18) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(77, 208, 225, 0.18) 1px, transparent 1px);
    opacity: 0.65;
}
.iso-grid--abyss {
    background-image:
        linear-gradient(to right, rgba(127, 255, 212, 0.16) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(127, 255, 212, 0.16) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.55;
}

/* shared bio glow */
.bio-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}
.bio-glow--cyan { background: var(--grad-bio); }
.bio-glow--mid {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(127, 255, 212, 0.10) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(77, 208, 225, 0.12) 0%, transparent 60%);
}
.bio-glow--deep {
    background:
        radial-gradient(circle at 50% 50%, rgba(77, 208, 225, 0.18) 0%, transparent 35%),
        radial-gradient(circle at 50% 50%, rgba(255, 111, 97, 0.08) 0%, transparent 50%);
}

/* ==========================================================================
   Scene 01: Surface Entry
   ========================================================================== */
.scene--surface {
    background: linear-gradient(180deg,
        #87CEEB 0%,
        #E0F7FA 28%,
        #B2DFDB 38%,
        #4DD0E1 48%,
        #1A3A4A 62%,
        #0A1628 100%);
}
.surface-sky {
    position: absolute;
    inset: 0 0 55% 0;
    background: radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.65) 0%, transparent 50%);
    pointer-events: none;
}
.surface-water {
    position: absolute;
    inset: 35% 0 0 0;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(127, 255, 212, 0) 0px,
            rgba(127, 255, 212, 0.08) 80px,
            rgba(127, 255, 212, 0) 160px),
        linear-gradient(180deg, rgba(10, 22, 40, 0) 0%, rgba(10, 22, 40, 0.6) 60%, rgba(6, 13, 26, 0.9) 100%);
    pointer-events: none;
}
.surface-content {
    position: relative;
    z-index: 5;
    max-width: 920px;
    margin: 0 auto;
    padding: 26vh 32px 16vh;
    text-align: center;
}
.surface-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 36px;
    color: var(--c-cyan);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}
.surface-meta__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(77, 208, 225, 0.5), transparent);
    max-width: 180px;
}
.surface-meta__text {
    text-shadow: 0 0 8px rgba(77, 208, 225, 0.4);
}
.surface-title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(56px, 9vw, 96px);
    line-height: 1;
    letter-spacing: 0.06em;
    color: var(--c-aqua);
    text-shadow: 0 0 24px rgba(127, 255, 212, 0.55), 0 0 60px rgba(127, 255, 212, 0.2);
    margin-bottom: 12px;
    text-transform: lowercase;
}
.surface-title__dot {
    color: var(--c-coral);
    text-shadow: 0 0 14px rgba(255, 111, 97, 0.6);
    margin: 0 0.04em;
}
.surface-tagline {
    font-family: var(--font-sub);
    font-size: clamp(20px, 2.5vw, 28px);
    color: var(--c-glacial);
    letter-spacing: 0.04em;
    margin-bottom: 22px;
}
.surface-sub {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: rgba(207, 216, 220, 0.78);
    max-width: 56ch;
    margin: 0 auto 56px;
}
.surface-cta {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--c-aqua);
}
.surface-cta__label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: var(--c-aqua);
    text-shadow: 0 0 8px rgba(127, 255, 212, 0.4);
}
.surface-chevron {
    display: inline-flex;
    width: 44px; height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(127, 255, 212, 0.4);
    border-radius: 50%;
    color: var(--c-aqua);
    animation: chev-bounce 1.6s var(--ease) infinite;
    box-shadow: 0 0 16px rgba(127, 255, 212, 0.18);
}
@keyframes chev-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(8px); }
}

/* iso raft */
.iso-raft {
    position: absolute;
    bottom: 8vh;
    left: 50%;
    transform: translateX(-50%) rotateX(60deg) rotateZ(-45deg);
    width: 320px; height: 320px;
    pointer-events: none;
    z-index: 3;
}
.iso-raft__plate {
    position: absolute;
    inset: 50px;
    background: linear-gradient(135deg, rgba(127, 255, 212, 0.18), rgba(77, 208, 225, 0.05));
    border: 1px solid rgba(127, 255, 212, 0.5);
    box-shadow: 0 0 30px rgba(127, 255, 212, 0.25);
}
.iso-raft__plate--2 {
    inset: 100px;
    background: linear-gradient(135deg, rgba(77, 208, 225, 0.18), rgba(127, 255, 212, 0.04));
    border-color: rgba(77, 208, 225, 0.45);
}
.iso-raft__beacon {
    position: absolute;
    top: 50%; left: 50%;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--c-coral);
    box-shadow: 0 0 24px rgba(255, 111, 97, 0.85);
    transform: translate(-50%, -50%);
    animation: beacon-pulse 1.8s var(--ease) infinite;
}
@keyframes beacon-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
    50%      { transform: translate(-50%, -50%) scale(1.4); opacity: 0.55; }
}

/* ==========================================================================
   Scene 02: Reef Shallows
   ========================================================================== */
.scene--shallows {
    background: var(--grad-ocean);
}

/* ==========================================================================
   Card-flip system
   ========================================================================== */
.card-grid {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    perspective: 1400px;
}
.card-grid--shallows {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card-grid--shallows .flip-card:nth-child(2),
.card-grid--shallows .flip-card:nth-child(4) {
    transform: translateY(36px);
}
.card-grid--kelp {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.card-grid--kelp .flip-card:nth-child(odd)  { transform: translateY(0); }
.card-grid--kelp .flip-card:nth-child(even) { transform: translateY(40px); }
.card-grid--kelp-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 720px;
    margin: 56px auto 0;
}
.card-grid--kelp-2 .flip-card:nth-child(2) { transform: translateY(34px); }

.flip-card {
    position: relative;
    width: 100%;
    height: 280px;
    perspective: 1400px;
    cursor: pointer;
    transition: transform 0.6s var(--ease);
}
.flip-card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.flip-card.is-flipped .flip-card__inner {
    transform: rotateY(180deg);
}
.flip-card__face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 8px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.flip-card__face--front {
    background: linear-gradient(165deg, #1A3A4A 0%, #0A1628 100%);
    border: 1px solid rgba(77, 208, 225, 0.4);
    box-shadow: 0 0 0 1px rgba(77, 208, 225, 0.05),
                0 12px 28px rgba(0, 0, 0, 0.4),
                inset 0 0 40px rgba(77, 208, 225, 0.08);
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.flip-card:hover .flip-card__face--front {
    border-color: var(--c-aqua);
    box-shadow: 0 0 0 1px rgba(127, 255, 212, 0.15),
                0 16px 36px rgba(0, 0, 0, 0.5),
                0 0 28px rgba(127, 255, 212, 0.25),
                inset 0 0 50px rgba(127, 255, 212, 0.1);
}
.flip-card__face--back {
    background: linear-gradient(180deg, #0A1628 0%, #060D1A 100%);
    border: 1px solid rgba(127, 255, 212, 0.45);
    transform: rotateY(180deg);
    text-align: left;
    justify-content: flex-start;
    box-shadow: 0 0 0 1px rgba(127, 255, 212, 0.08),
                0 12px 32px rgba(0, 0, 0, 0.55);
}
.flip-card__icon {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 10px rgba(127, 255, 212, 0.45));
    transform: rotate(0deg);
    transition: filter 0.4s var(--ease), transform 0.6s var(--ease);
}
.flip-card:hover .flip-card__icon {
    filter: drop-shadow(0 0 16px rgba(127, 255, 212, 0.7));
    transform: scale(1.04);
}
.flip-card__face-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.28em;
    color: var(--c-cyan);
    margin-top: 12px;
}
.flip-card__face-id {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    color: rgba(178, 223, 219, 0.7);
    margin-top: 6px;
}
.flip-card__corner {
    position: absolute;
    top: 10px; right: 10px;
    width: 8px; height: 8px;
    background: var(--c-aqua);
    box-shadow: 0 0 10px rgba(127, 255, 212, 0.7);
    border-radius: 1px;
    transform: rotate(45deg);
}
.flip-card__corner--coral {
    background: var(--c-coral);
    box-shadow: 0 0 10px rgba(255, 111, 97, 0.8);
}
.flip-card__back-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.26em;
    color: var(--c-coral);
    text-shadow: 0 0 6px rgba(255, 111, 97, 0.4);
    margin-bottom: 12px;
}
.flip-card__back-title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-aqua);
    margin-bottom: 12px;
    line-height: 1.1;
    text-shadow: 0 0 14px rgba(127, 255, 212, 0.3);
}
.flip-card__back-text {
    font-family: var(--font-body);
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--c-fog);
    flex: 1;
}
.flip-card__back-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dotted rgba(77, 208, 225, 0.3);
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(178, 223, 219, 0.65);
}

/* ==========================================================================
   Scene 03: Kelp Forest
   ========================================================================== */
.scene--kelp {
    background:
        linear-gradient(180deg, #0A1628 0%, #060D1A 50%, #0A1628 100%);
    padding: 0;
    min-height: 120vh;
}
.kelp-edge {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(127, 255, 212, 0.18));
}
.kelp-edge--left  { left: 0; }
.kelp-edge--right { right: 0; }
.kelp-edge svg { height: 100%; width: 80px; }

.scene__header--kelp {
    text-align: left;
}

.readout-panel {
    margin: 56px auto;
    background: rgba(10, 22, 40, 0.92);
    border: 1px solid rgba(77, 208, 225, 0.55);
    box-shadow: 0 0 0 1px rgba(77, 208, 225, 0.08),
                0 18px 40px rgba(0, 0, 0, 0.5),
                inset 0 0 40px rgba(77, 208, 225, 0.05);
    max-width: 880px;
    overflow: hidden;
}
.readout-panel__bar {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(77, 208, 225, 0.1);
    border-bottom: 1px solid rgba(77, 208, 225, 0.4);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-cyan);
}
.readout-panel__body {
    padding: 22px 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.06em;
}
.readout-panel__row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 18px;
    border-bottom: 1px dotted rgba(77, 208, 225, 0.18);
    padding-bottom: 8px;
    color: var(--c-glacial);
}
.readout-panel__row:last-child { border-bottom: none; }
.readout-panel__k {
    color: var(--c-foam);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}
.readout-panel__v--coral {
    color: var(--c-coral);
    text-shadow: 0 0 6px rgba(255, 111, 97, 0.35);
}

.scene--kelp .scene__inner {
    padding-left: 100px;
    padding-right: 100px;
    padding-top: 110px;
    padding-bottom: 100px;
}

/* ==========================================================================
   Scene 04: The Abyss
   ========================================================================== */
.scene--abyss {
    background: radial-gradient(ellipse at 50% 50%, #0A1628 0%, #060D1A 60%, #000308 100%);
    min-height: 120vh;
}
.scene__inner--abyss {
    text-align: center;
    padding-top: 110px;
    padding-bottom: 100px;
}
.scene__header--abyss {
    margin: 0 auto 56px;
    max-width: 720px;
}
.scene__title--abyss {
    color: var(--c-aqua);
    text-shadow: 0 0 30px rgba(127, 255, 212, 0.45),
                 0 0 90px rgba(127, 255, 212, 0.15);
}

.abyss-stage {
    position: relative;
    height: 640px;
    margin: 24px auto 0;
}
.vent {
    position: absolute;
    top: 50%; left: 50%;
    width: 220px; height: 320px;
    transform: translate(-50%, -50%);
}
.vent__base {
    position: absolute;
    bottom: 0; left: 50%;
    width: 200px; height: 80px;
    transform: translateX(-50%) rotateX(60deg);
    background: linear-gradient(135deg, #1A3A4A, #0A1628);
    border: 1px solid rgba(127, 255, 212, 0.4);
    box-shadow: 0 0 30px rgba(77, 208, 225, 0.25);
}
.vent__shaft {
    position: absolute;
    bottom: 40px; left: 50%;
    width: 80px; height: 200px;
    transform: translateX(-50%) skewY(-6deg);
    background: linear-gradient(180deg, #0A1628 0%, #1A3A4A 50%, #060D1A 100%);
    border-left: 1px solid rgba(127, 255, 212, 0.4);
    border-right: 1px solid rgba(77, 208, 225, 0.3);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}
.vent__cap {
    position: absolute;
    top: 0; left: 50%;
    width: 100px; height: 30px;
    transform: translateX(-50%) rotateX(60deg);
    background: linear-gradient(135deg, #1A3A4A, #0A1628);
    border: 1px solid rgba(127, 255, 212, 0.55);
    box-shadow: 0 0 20px rgba(127, 255, 212, 0.4);
}
.vent__plume {
    position: absolute;
    bottom: calc(100% - 8px); left: 50%;
    width: 60px; height: 200px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at 50% 100%, rgba(127, 255, 212, 0.55) 0%, rgba(77, 208, 225, 0.18) 35%, transparent 70%);
    filter: blur(6px);
    animation: plume-rise 5s var(--ease) infinite;
    border-radius: 50% 50% 30% 30% / 80% 80% 20% 20%;
}
.vent__plume--2 { animation-delay: 1.6s; opacity: 0.6; }
.vent__plume--3 { animation-delay: 3.2s; opacity: 0.4; }
@keyframes plume-rise {
    0%   { transform: translateX(-50%) translateY(20px) scale(0.5); opacity: 0; }
    25%  { opacity: 0.8; }
    100% { transform: translateX(-50%) translateY(-180px) scale(1.4); opacity: 0; }
}
.vent__ring {
    position: absolute;
    top: -10px; left: 50%;
    width: 80px; height: 80px;
    border: 1px solid rgba(127, 255, 212, 0.6);
    border-radius: 50%;
    transform: translateX(-50%);
    animation: vent-ring 3.6s var(--ease) infinite;
    opacity: 0;
}
.vent__ring--2 { animation-delay: 1.2s; }
.vent__ring--3 { animation-delay: 2.4s; }
@keyframes vent-ring {
    0%   { transform: translate(-50%, 0)   scale(0.4); opacity: 0.85; }
    100% { transform: translate(-50%, -160px) scale(2); opacity: 0; }
}

.abyss-cards {
    position: relative;
    height: 100%;
}
.flip-card--abyss {
    position: absolute;
    top: 50%; left: 50%;
    width: 240px; height: 240px;
    transform: translate(-50%, -50%) translate(var(--orbit-x, 0), var(--orbit-y, 0));
}
.flip-card--abyss .flip-card__face--front {
    background: linear-gradient(165deg, rgba(26, 58, 74, 0.92) 0%, rgba(6, 13, 26, 0.96) 100%);
    border-color: rgba(127, 255, 212, 0.5);
    box-shadow: 0 0 0 1px rgba(127, 255, 212, 0.1),
                0 16px 36px rgba(0, 0, 0, 0.7),
                0 0 30px rgba(127, 255, 212, 0.18),
                inset 0 0 40px rgba(127, 255, 212, 0.08);
}
.flip-card--abyss .flip-card__face--back {
    background: linear-gradient(180deg, rgba(10, 22, 40, 0.96) 0%, rgba(0, 3, 8, 0.98) 100%);
    border-color: rgba(127, 255, 212, 0.55);
}

.scene__signature--abyss { color: rgba(127, 255, 212, 0.6); }

/* ==========================================================================
   Scene 05: Resurface
   ========================================================================== */
.scene--resurface {
    background: linear-gradient(180deg,
        #060D1A 0%,
        #0A1628 30%,
        #1A3A4A 65%,
        #4DD0E1 92%,
        #B2DFDB 100%);
    min-height: 65vh;
}
.resurface-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 100%, rgba(224, 247, 250, 0.55) 0%, transparent 55%);
    pointer-events: none;
}
.scene__inner--resurface {
    padding: 80px 36px 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.resurface-card {
    background: rgba(10, 22, 40, 0.85);
    border: 1px solid rgba(127, 255, 212, 0.55);
    border-radius: 8px;
    padding: 36px 40px 32px;
    max-width: 640px;
    width: 100%;
    box-shadow: 0 0 0 1px rgba(127, 255, 212, 0.08),
                0 18px 50px rgba(0, 0, 0, 0.45),
                inset 0 0 60px rgba(127, 255, 212, 0.06);
}
.resurface-card__head {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--c-cyan);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px dotted rgba(77, 208, 225, 0.35);
}
.resurface-card__title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(40px, 5vw, 56px);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-aqua);
    margin-bottom: 24px;
    text-shadow: 0 0 18px rgba(127, 255, 212, 0.4);
    animation: resurface-pulse 3.4s var(--ease) infinite alternate;
}
@keyframes resurface-pulse {
    from { text-shadow: 0 0 14px rgba(127, 255, 212, 0.3); }
    to   { text-shadow: 0 0 28px rgba(127, 255, 212, 0.55); }
}
.resurface-card__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.resurface-card__list li {
    display: grid;
    grid-template-columns: 16px 1fr;
    gap: 12px;
    align-items: baseline;
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--c-fog);
}
.resurface-card__bullet {
    width: 8px; height: 8px;
    background: var(--c-aqua);
    box-shadow: 0 0 8px rgba(127, 255, 212, 0.7);
    transform: rotate(45deg);
    margin-top: 6px;
}
.resurface-card__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px dotted rgba(77, 208, 225, 0.35);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(178, 223, 219, 0.7);
    flex-wrap: wrap;
    gap: 12px;
}
.resurface-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid var(--c-aqua);
    padding: 10px 18px;
    color: var(--c-aqua);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.resurface-card__btn:hover {
    background: rgba(127, 255, 212, 0.12);
    box-shadow: 0 0 18px rgba(127, 255, 212, 0.5);
}
.resurface-card__btn-glyph {
    width: 8px; height: 8px;
    background: var(--c-aqua);
    box-shadow: 0 0 8px rgba(127, 255, 212, 0.6);
    transform: rotate(45deg);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
    .card-grid--shallows,
    .card-grid--kelp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-grid--shallows .flip-card:nth-child(2),
    .card-grid--shallows .flip-card:nth-child(4),
    .card-grid--kelp .flip-card:nth-child(even) { transform: translateY(20px); }
    .scene--kelp .scene__inner { padding-left: 90px; padding-right: 90px; }
    .abyss-stage { height: 760px; }
    .flip-card--abyss { width: 220px; height: 220px; }
    .flip-card--abyss[style*="-260px"][style*="-120"] { --orbit-x: -180px; --orbit-y: -200px; }
    .flip-card--abyss[style*="260px"][style*="-120"]  { --orbit-x: 180px;  --orbit-y: -200px; }
    .flip-card--abyss[style*="-260px"][style*="120px"] { --orbit-x: -180px; --orbit-y: 200px; }
    .flip-card--abyss[style*="260px"][style*="120px"]  { --orbit-x: 180px;  --orbit-y: 200px; }
}
@media (max-width: 720px) {
    :root {
        --hud-left: 56px;
        --hud-right: 0px;
        --hud-bottom: 36px;
    }
    .hud-right { display: none; }
    .hud-bottom__readout { display: none; }
    .hud-top__breadcrumb { display: none; }
    .hud-top__inner { grid-template-columns: 1fr auto; padding-left: calc(var(--hud-left) + 12px); }
    .card-grid--shallows,
    .card-grid--kelp,
    .card-grid--kelp-2 { grid-template-columns: 1fr; }
    .card-grid--shallows .flip-card,
    .card-grid--kelp .flip-card,
    .card-grid--kelp-2 .flip-card { transform: none; }
    .scene--kelp .scene__inner { padding-left: 80px; padding-right: 24px; }
    .kelp-edge--right { display: none; }
    .abyss-stage { height: auto; padding: 80px 0 24px; }
    .vent { position: relative; transform: none; left: auto; top: auto; margin: 0 auto 60px; }
    .abyss-cards { display: grid; grid-template-columns: 1fr; gap: 24px; height: auto; }
    .flip-card--abyss { position: relative; left: auto; top: auto; width: 100%; height: 240px; transform: none; }
    .surface-content { padding-top: 18vh; padding-bottom: 22vh; }
    .iso-raft { width: 220px; height: 220px; }
}
