/* ============================================================
   namu.farm  |  Memphis x Deep-Ocean HUD
   ============================================================ */

:root {
    /* Ocean Deep palette */
    --abyss-black:    #0B0C10;
    --midnight:       #0D1B2A;
    --bathyal:        #1B2838;
    --cerulean:       #00B4D8;
    --cyan-soft:      #48CAE4;
    --ice-pale:       #CAF0F8;
    --aqua-mist:      #90E0EF;

    /* Memphis accents */
    --coral:          #FF6B6B;
    --kelp-gold:      #FFD93D;
    --plankton:       #6BCB77;
    --vent:           #FF8C42;

    /* Functional */
    --panel-bg:       rgba(27, 40, 56, 0.42);
    --panel-bg-deep:  rgba(13, 27, 42, 0.55);
    --panel-stroke:   rgba(0, 180, 216, 0.55);
    --panel-stroke-soft: rgba(72, 202, 228, 0.32);
    --text-glow:      0 0 8px rgba(72, 202, 228, 0.4);

    --font-display:   'Righteous', 'Inter', sans-serif;
    --font-tech:      'Chakra Petch', 'Space Mono', monospace;
    --font-body:      'IBM Plex Sans', 'Inter', sans-serif;
    --font-mono:      'Share Tech Mono', 'Space Mono', monospace;
    --font-prose:     'Lora', Georgia, serif;
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    background: var(--abyss-black);
    color: var(--ice-pale);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-y: scroll;
}

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   LAYER 0: Persistent Ocean Backdrop
   ============================================================ */

.ocean-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ocean-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 60% at 50% 110%, rgba(0, 180, 216, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 20% 30%, rgba(27, 40, 56, 0.65) 0%, transparent 70%),
        linear-gradient(180deg, var(--abyss-black) 0%, var(--midnight) 45%, var(--bathyal) 100%);
    transition: background 1.6s ease;
}

body.is-surfacing .ocean-gradient {
    background:
        radial-gradient(ellipse 90% 60% at 50% 0%, rgba(72, 202, 228, 0.22) 0%, transparent 60%),
        linear-gradient(180deg, var(--bathyal) 0%, var(--midnight) 50%, var(--abyss-black) 100%);
}

.particle-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(202, 240, 248, 0.95) 0%, rgba(0, 180, 216, 0.45) 45%, transparent 75%);
    opacity: 0.55;
    will-change: transform;
    animation: drift var(--p-dur, 30s) ease-in-out infinite;
    animation-delay: var(--p-delay, 0s);
}

.particle.is-warm {
    background: radial-gradient(circle, rgba(255, 217, 61, 0.95) 0%, rgba(255, 140, 66, 0.4) 50%, transparent 75%);
}

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); opacity: 0; }
    10%  { opacity: var(--p-op, 0.55); }
    50%  { transform: translate(var(--p-dx, 30px), var(--p-dy, -50px)) scale(1.3); opacity: var(--p-op, 0.55); }
    90%  { opacity: var(--p-op, 0.55); }
    100% { transform: translate(calc(var(--p-dx, 30px) * 1.6), calc(var(--p-dy, -50px) * 2)) scale(0.7); opacity: 0; }
}

.current-flows {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.18;
    mix-blend-mode: screen;
}

.current-line {
    fill: none;
    stroke: var(--cerulean);
    stroke-width: 1.5;
    stroke-dasharray: 4 14;
    animation: currentDrift 28s linear infinite;
}

.current-line:nth-child(2) {
    stroke: var(--cyan-soft);
    animation-duration: 36s;
    animation-direction: reverse;
}

.current-line:nth-child(3) {
    stroke: var(--cerulean);
    animation-duration: 44s;
}

@keyframes currentDrift {
    from { stroke-dashoffset: 0; }
    to   { stroke-dashoffset: -360; }
}

/* ============================================================
   LAYER 1: Drifting Memphis Geometry (mid-ground)
   ============================================================ */

.memphis-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.memphis-shape {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: clamp(140px, 18vw, 280px);
    opacity: 0.22;
    filter: drop-shadow(0 0 12px rgba(0, 180, 216, 0.18));
    animation: memphisDrift var(--dur, 50s) ease-in-out infinite;
    transform: translate(-50%, -50%);
}

.memphis-circle-square { width: clamp(180px, 22vw, 340px); }
.memphis-zigzag-bg     { width: clamp(220px, 30vw, 460px); opacity: 0.18; }
.memphis-squiggle-bg   { width: clamp(220px, 26vw, 400px); }
.memphis-triangle-cluster { width: clamp(160px, 18vw, 260px); }
.memphis-dot-grid-bg   { width: clamp(140px, 14vw, 220px); opacity: 0.28; }

@keyframes memphisDrift {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg) translateX(0) translateY(0); }
    25%      { transform: translate(-50%, -50%) rotate(15deg) translateX(40px) translateY(-30px); }
    50%      { transform: translate(-50%, -50%) rotate(-10deg) translateX(-30px) translateY(20px); }
    75%      { transform: translate(-50%, -50%) rotate(8deg) translateX(50px) translateY(40px); }
}

/* ============================================================
   HUD Status Bar (persistent top)
   ============================================================ */

.hud-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(20px, 3vw, 48px);
    background: linear-gradient(180deg, rgba(11, 12, 16, 0.92) 0%, rgba(13, 27, 42, 0.65) 100%);
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    border-bottom: 1px solid var(--panel-stroke);
    font-family: var(--font-tech);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cyan-soft);
}

.status-left, .status-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-brand {
    font-family: var(--font-display);
    font-size: 18px;
    letter-spacing: 0.06em;
    color: var(--ice-pale);
    text-transform: uppercase;
}

.status-mono {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--cyan-soft);
    text-shadow: var(--text-glow);
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--coral);
    box-shadow: 0 0 8px var(--coral);
    animation: pulseDot 2.6s ease-in-out infinite;
}
.status-right .status-dot:nth-child(2) { background: var(--kelp-gold); box-shadow: 0 0 8px var(--kelp-gold); animation-delay: 0.7s; }
.status-right .status-dot:nth-child(4) { background: var(--plankton); box-shadow: 0 0 8px var(--plankton); animation-delay: 1.4s; }

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.6); opacity: 0.55; }
}

.status-nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-item {
    font-family: var(--font-tech);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--aqua-mist);
    opacity: 0.6;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: color 240ms ease, opacity 240ms ease, border-color 240ms ease;
}

.nav-item:hover { opacity: 1; color: var(--ice-pale); }

.nav-item.is-active {
    opacity: 1;
    color: var(--cerulean);
    border-bottom-color: var(--cerulean);
    text-shadow: 0 0 6px rgba(0, 180, 216, 0.6);
}

.nav-sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--bathyal);
    border: 1px solid var(--panel-stroke-soft);
}

/* ============================================================
   Persistent Depth Indicator (right side)
   ============================================================ */

.depth-indicator {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    width: 56px;
    height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.depth-track {
    position: relative;
    width: 100%;
    flex: 1;
    background: linear-gradient(180deg, rgba(72, 202, 228, 0.05) 0%, rgba(0, 180, 216, 0.18) 100%);
    border-left: 1px solid var(--panel-stroke);
    border-right: 1px solid var(--panel-stroke);
}

.depth-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--cyan-soft);
    letter-spacing: 0.1em;
    text-shadow: var(--text-glow);
}

.depth-marker[data-depth="0"]    { top: 4%; }
.depth-marker[data-depth="1000"] { top: 28%; }
.depth-marker[data-depth="2000"] { top: 50%; }
.depth-marker[data-depth="3000"] { top: 72%; }
.depth-marker[data-depth="4000"] { top: 94%; }

.depth-needle {
    position: absolute;
    left: -8px;
    right: -8px;
    height: 3px;
    background: var(--coral);
    box-shadow: 0 0 10px var(--coral);
    top: 0;
    transition: top 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.depth-needle::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent var(--coral);
}

.depth-label {
    font-family: var(--font-tech);
    font-size: 9px;
    letter-spacing: 0.22em;
    color: var(--aqua-mist);
    text-align: center;
    line-height: 1.2;
}

/* ============================================================
   HUD Stage / Screens
   ============================================================ */

.hud-stage {
    position: relative;
    z-index: 10;
}

.hud-screen {
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding: 88px clamp(28px, 5vw, 80px) 64px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: grid;
    overflow: hidden;
}

/* ============================================================
   PANEL BASE (HUD chrome)
   ============================================================ */

.hud-panel {
    position: relative;
    background: var(--panel-bg);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border: 1px solid var(--panel-stroke);
    padding: 24px 26px;
    color: var(--ice-pale);
    overflow: hidden;
    /* morph-ready clip */
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    transition: clip-path 1100ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 800ms ease;
}

.hud-panel::before {
    /* subtle topographic texture overlay */
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, transparent 0 22px, rgba(0, 180, 216, 0.04) 22px 23px),
        repeating-linear-gradient(90deg, transparent 0 22px, rgba(0, 180, 216, 0.04) 22px 23px);
    pointer-events: none;
    opacity: 0.7;
}

.panel-bracket {
    position: absolute;
    width: 22px;
    height: 22px;
    pointer-events: none;
}
.bracket-tl { top: -2px; left: -2px; border-top: 3px solid var(--ice-pale); border-left: 3px solid var(--ice-pale); }
.bracket-br { bottom: -2px; right: -2px; border-bottom: 3px solid var(--ice-pale); border-right: 3px solid var(--ice-pale); }

.panel-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    position: relative;
}

.panel-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    color: var(--cyan-soft);
    text-shadow: var(--text-glow);
    text-transform: uppercase;
}

.panel-title {
    font-family: var(--font-tech);
    font-weight: 700;
    font-size: clamp(20px, 2vw, 28px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cerulean);
}

.panel-body { position: relative; }

.panel-divider {
    margin: 14px 0;
    height: 12px;
}
.panel-divider svg { width: 100%; height: 100%; }

.panel-list {
    list-style: none;
    display: grid;
    gap: 8px;
    margin-top: 4px;
}

.panel-list li {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: baseline;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    border-bottom: 1px dashed rgba(72, 202, 228, 0.18);
    padding: 6px 0;
}

.panel-list li b {
    color: var(--kelp-gold);
    font-weight: 400;
    text-shadow: 0 0 6px rgba(255, 217, 61, 0.35);
}

.panel-list li span {
    color: var(--cyan-soft);
    text-shadow: var(--text-glow);
    text-align: right;
}

/* ============================================================
   SCREEN 1: DESCENT
   ============================================================ */

.screen-descent {
    place-items: center;
}

.descent-core {
    position: relative;
    text-align: center;
    padding: 60px clamp(20px, 4vw, 80px);
    max-width: 1100px;
    width: min(96%, 1100px);
}

.descent-prelude {
    margin-bottom: 28px;
}

.descent-mono {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.3em;
    color: var(--cerulean);
    text-shadow: var(--text-glow);
    text-transform: uppercase;
}

.descent-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(56px, 12vw, 144px);
    line-height: 0.95;
    letter-spacing: 0.04em;
    color: var(--ice-pale);
    text-transform: uppercase;
    text-shadow:
        0 0 24px rgba(0, 180, 216, 0.45),
        0 0 56px rgba(72, 202, 228, 0.18);
    margin-bottom: 18px;
}

.title-word { display: inline-block; }
.title-dot {
    display: inline-block;
    color: var(--coral);
    transform: translateY(-0.05em);
    text-shadow: 0 0 18px var(--coral);
    margin: 0 0.04em;
}

.descent-tagline {
    font-family: var(--font-tech);
    font-size: clamp(11px, 1.1vw, 14px);
    letter-spacing: 0.36em;
    color: var(--cyan-soft);
    text-transform: uppercase;
    margin-bottom: 56px;
}

.descent-counter {
    display: inline-flex;
    align-items: baseline;
    gap: 14px;
    font-family: var(--font-mono);
    padding: 14px 28px;
    border: 1px solid var(--panel-stroke);
    background: rgba(13, 27, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 36px;
}

.counter-label, .counter-unit {
    font-size: 11px;
    letter-spacing: 0.26em;
    color: var(--aqua-mist);
}

.counter-value {
    font-size: clamp(36px, 5vw, 64px);
    color: var(--cerulean);
    text-shadow: 0 0 14px rgba(0, 180, 216, 0.55);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    min-width: 5ch;
    display: inline-block;
    text-align: right;
}

.descent-pressure-row {
    display: flex;
    justify-content: center;
    gap: clamp(20px, 4vw, 56px);
    flex-wrap: wrap;
}

.prelude-cell {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-mono);
    align-items: center;
}

.prelude-cell b {
    font-size: 10px;
    letter-spacing: 0.26em;
    color: var(--kelp-gold);
    font-weight: 400;
    text-shadow: 0 0 6px rgba(255, 217, 61, 0.35);
}

.prelude-cell i {
    font-style: normal;
    font-size: 14px;
    color: var(--cyan-soft);
    text-shadow: var(--text-glow);
    letter-spacing: 0.1em;
}

.descent-squiggle {
    position: absolute;
    width: clamp(280px, 60%, 720px);
    height: 80px;
}
.descent-squiggle-top    { top: 14px;    left: 50%; transform: translateX(-50%); }
.descent-squiggle-bottom { bottom: 14px; left: 50%; transform: translateX(-50%); }

.descent-corner {
    position: absolute;
    width: 36px;
    height: 36px;
}
.descent-corner-tl { top: -2px; left: -2px;
    border-top: 3px solid var(--cerulean); border-left: 3px solid var(--cerulean);
    box-shadow: -1px -1px 12px rgba(0, 180, 216, 0.6); }
.descent-corner-tr { top: -2px; right: -2px;
    border-top: 3px solid var(--cerulean); border-right: 3px solid var(--cerulean);
    box-shadow: 1px -1px 12px rgba(0, 180, 216, 0.6); }
.descent-corner-bl { bottom: -2px; left: -2px;
    border-bottom: 3px solid var(--cerulean); border-left: 3px solid var(--cerulean);
    box-shadow: -1px 1px 12px rgba(0, 180, 216, 0.6); }
.descent-corner-br { bottom: -2px; right: -2px;
    border-bottom: 3px solid var(--cerulean); border-right: 3px solid var(--cerulean);
    box-shadow: 1px 1px 12px rgba(0, 180, 216, 0.6); }

.descent-scroll-cue {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: var(--font-tech);
    font-size: 10px;
    letter-spacing: 0.36em;
    color: var(--aqua-mist);
    opacity: 0.7;
    animation: scrollCue 2.4s ease-in-out infinite;
}

.descent-scroll-cue svg {
    width: 18px;
    height: 18px;
}

@keyframes scrollCue {
    0%, 100% { transform: translate(-50%, 0); opacity: 0.5; }
    50%      { transform: translate(-50%, 8px); opacity: 1; }
}

/* ============================================================
   SCREEN 2: OVERVIEW (corner-anchored 4-panel HUD)
   ============================================================ */

.screen-overview {
    grid-template-columns: minmax(280px, 5fr) 2fr minmax(280px, 5fr);
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
        "tl center tr"
        "bl center br";
    gap: clamp(16px, 2vw, 32px);
    padding-top: 100px;
}

.panel-tl { grid-area: tl; align-self: start; }
.panel-tr { grid-area: tr; align-self: start; }
.panel-bl { grid-area: bl; align-self: end; }
.panel-br { grid-area: br; align-self: end; }

.panel-corner { max-width: 460px; }

.panel-tl { justify-self: start; }
.panel-tr { justify-self: end; }
.panel-bl { justify-self: start; }
.panel-br { justify-self: end; }

.panel-lead {
    font-family: var(--font-prose);
    font-size: clamp(15px, 1.1vw, 17px);
    line-height: 1.55;
    color: var(--ice-pale);
    margin-bottom: 12px;
    font-style: italic;
}

.panel-text {
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.7;
    color: rgba(144, 224, 239, 0.92);
}

.illu-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.illu-kelp {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 6px rgba(0, 180, 216, 0.5));
}

.illu-strokes path,
.illu-strokes circle,
.illu-strokes rect,
.illu-strokes polygon {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.illu-caption {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.illu-coords {
    color: var(--kelp-gold);
    text-shadow: 0 0 6px rgba(255, 217, 61, 0.35);
}

.illu-name {
    color: var(--cyan-soft);
    text-shadow: var(--text-glow);
}

/* Data readout */
.data-body {
    display: grid;
    gap: 14px;
}

.data-cell {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: baseline;
    column-gap: 8px;
    row-gap: 4px;
    font-family: var(--font-mono);
    border-bottom: 1px dashed rgba(72, 202, 228, 0.18);
    padding-bottom: 8px;
}

.data-label {
    grid-column: 1;
    font-size: 10.5px;
    letter-spacing: 0.22em;
    color: var(--aqua-mist);
    text-transform: uppercase;
}

.data-value {
    grid-column: 2;
    font-size: 22px;
    color: var(--cerulean);
    text-shadow: 0 0 10px rgba(0, 180, 216, 0.5);
    font-variant-numeric: tabular-nums;
}

.data-unit {
    grid-column: 3;
    font-size: 11px;
    color: var(--kelp-gold);
    letter-spacing: 0.14em;
}

.data-bar {
    grid-column: 1 / -1;
    height: 4px;
    background: rgba(72, 202, 228, 0.12);
    overflow: hidden;
    position: relative;
    margin-top: 4px;
}

.data-bar i {
    display: block;
    height: 100%;
    width: var(--w, 50%);
    background: linear-gradient(90deg, var(--cerulean) 0%, var(--cyan-soft) 100%);
    box-shadow: 0 0 8px rgba(0, 180, 216, 0.6);
    transform-origin: left center;
    animation: barFill 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes barFill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* Nav body */
.nav-body {
    display: grid;
    gap: 10px;
}

.nav-btn {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--panel-stroke-soft);
    background: rgba(0, 180, 216, 0.06);
    text-align: left;
    font-family: var(--font-tech);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.18em;
    color: var(--ice-pale);
    text-transform: uppercase;
    transition: background 220ms ease, transform 220ms ease, border-color 220ms ease;
}

.nav-btn:hover {
    background: rgba(0, 180, 216, 0.14);
    transform: translateX(4px);
    border-color: var(--cerulean);
}

.nav-glyph {
    width: 16px;
    height: 16px;
    border: 2px solid var(--coral);
    transform: rotate(45deg);
    background: rgba(255, 107, 107, 0.18);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.45);
}

.nav-btn:nth-child(2) .nav-glyph { border-color: var(--kelp-gold); background: rgba(255, 217, 61, 0.18); box-shadow: 0 0 8px rgba(255, 217, 61, 0.5); }
.nav-btn:nth-child(3) .nav-glyph { border-color: var(--plankton);  background: rgba(107, 203, 119, 0.18); box-shadow: 0 0 8px rgba(107, 203, 119, 0.5); }

.nav-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--cyan-soft);
    letter-spacing: 0.18em;
    text-shadow: var(--text-glow);
}

.memphis-center {
    grid-area: center;
    place-self: center;
    width: clamp(180px, 22vw, 360px);
    opacity: 0.55;
    animation: memphisDrift 38s ease-in-out infinite;
}

/* ============================================================
   SCREEN 3: CULTIVATION
   ============================================================ */

.screen-cultivation {
    grid-template-columns: 6fr 4fr;
    grid-template-areas: "main side";
    gap: clamp(20px, 3vw, 56px);
    padding-top: 100px;
    padding-bottom: 80px;
}

.cultivation-main {
    grid-area: main;
    padding: 38px 44px;
    border: none;
    background: rgba(13, 27, 42, 0.55);
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
}

.cultivation-main::before { display: none; }

.zigzag-border {
    position: absolute;
    left: 0;
    right: 0;
    height: 18px;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(0, 180, 216, 0.55));
}
.zigzag-border svg { width: 100%; height: 100%; }
.zigzag-top    { top: -9px; }
.zigzag-bottom { bottom: -9px; }

.zigzag-side {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18px;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(0, 180, 216, 0.55));
}
.zigzag-side svg { width: 100%; height: 100%; }
.zigzag-left  { left: -9px; }
.zigzag-right { right: -9px; }

.cultivation-header {
    margin-bottom: 28px;
}

.cultivation-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(36px, 5.5vw, 72px);
    line-height: 1;
    letter-spacing: 0.04em;
    color: var(--ice-pale);
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(0, 180, 216, 0.4);
    margin-top: 12px;
}

.cultivation-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: clamp(20px, 3vw, 48px);
    align-items: start;
}

.cultivation-prose {
    font-family: var(--font-prose);
    font-size: clamp(15px, 1.1vw, 17px);
    line-height: 1.75;
    color: var(--aqua-mist);
}

.cultivation-prose p {
    margin-bottom: 16px;
}

.prose-accent {
    color: var(--kelp-gold);
    font-weight: 600;
    font-style: italic;
    text-shadow: 0 0 6px rgba(255, 217, 61, 0.4);
}

.inline-illu {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 16px;
    padding: 10px 14px;
    border: 1px solid var(--panel-stroke-soft);
    background: rgba(0, 180, 216, 0.06);
}

.inline-illu svg {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 0 6px rgba(0, 180, 216, 0.5));
}

.inline-cap {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--cyan-soft);
    text-transform: uppercase;
    text-shadow: var(--text-glow);
}

.cultivation-illu {
    position: relative;
    padding: 16px;
    background: rgba(11, 12, 16, 0.45);
    border: 1px solid var(--panel-stroke-soft);
}

.cultivation-illu svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 6px rgba(0, 180, 216, 0.5));
}

.cultivation-illu .illu-coords {
    display: block;
    margin-top: 8px;
    text-align: center;
    font-size: 10.5px;
    letter-spacing: 0.22em;
}

.cultivation-stack {
    grid-area: side;
    display: grid;
    gap: clamp(14px, 2vw, 22px);
    align-content: start;
}

.data-readout {
    padding: 18px 22px;
    display: grid;
    gap: 8px;
}

.readout-title {
    font-family: var(--font-tech);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.18em;
    color: var(--ice-pale);
    text-transform: uppercase;
    margin-top: 4px;
}

.readout-figure {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-mono);
}

.readout-num {
    font-size: clamp(28px, 3vw, 42px);
    color: var(--cerulean);
    text-shadow: 0 0 12px rgba(0, 180, 216, 0.6);
    font-variant-numeric: tabular-nums;
}

.readout-unit {
    font-size: 14px;
    color: var(--kelp-gold);
    letter-spacing: 0.14em;
    text-shadow: 0 0 6px rgba(255, 217, 61, 0.35);
}

.readout-meta {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    color: var(--cyan-soft);
    text-shadow: var(--text-glow);
    text-transform: uppercase;
}

.cultivation-bg-motif {
    position: absolute;
    right: -40px;
    bottom: -60px;
    width: clamp(360px, 40vw, 600px);
    pointer-events: none;
    z-index: 0;
    animation: cultivationMotif 60s linear infinite;
    opacity: 0.55;
}

.cultivation-bg-motif svg { width: 100%; height: auto; }

@keyframes cultivationMotif {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============================================================
   SCREEN 4: ECOSYSTEM
   ============================================================ */

.screen-ecosystem {
    grid-template-rows: auto 1fr;
    gap: 28px;
    padding-top: 88px;
    padding-bottom: 64px;
}

.ecosystem-head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.ecosystem-head .panel-tag {
    margin-bottom: 8px;
}

.ecosystem-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(40px, 6vw, 84px);
    letter-spacing: 0.04em;
    color: var(--ice-pale);
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 12px;
    text-shadow: 0 0 18px rgba(0, 180, 216, 0.4);
}

.ecosystem-sub {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--aqua-mist);
    line-height: 1.6;
}

.ecosystem-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: clamp(14px, 2vw, 26px);
    align-content: stretch;
}

.species-card {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: 8px;
    text-align: center;
    padding: 18px 18px 22px;
    min-height: 180px;
}

.species-id {
    align-self: start;
    justify-self: start;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    color: var(--kelp-gold);
    text-shadow: 0 0 6px rgba(255, 217, 61, 0.4);
}

.species-illu {
    display: grid;
    place-items: center;
    width: 100%;
    height: clamp(120px, 14vw, 180px);
}

.species-illu svg {
    width: clamp(100px, 60%, 180px);
    height: 100%;
    filter: drop-shadow(0 0 6px rgba(0, 180, 216, 0.5));
}

.species-name {
    font-family: var(--font-tech);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.16em;
    color: var(--ice-pale);
    text-transform: uppercase;
}

.species-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--cyan-soft);
    text-shadow: var(--text-glow);
}

/* Sonar pulses */
.sonar-origin {
    position: absolute;
    left: 50%;
    top: 60%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    pointer-events: none;
    z-index: 12;
}

.sonar-core {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--cyan-soft);
    box-shadow: 0 0 18px rgba(72, 202, 228, 0.8);
}

.sonar-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--cyan-soft);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    animation: sonarPulse 8s ease-out infinite;
}

.sonar-ring:nth-child(2) { animation-delay: 0.4s; }
.sonar-ring:nth-child(3) { animation-delay: 0.8s; }

@keyframes sonarPulse {
    0%   { transform: translate(-50%, -50%) scale(0);  opacity: 0.6; }
    8%   { opacity: 0.6; }
    50%  { transform: translate(-50%, -50%) scale(28); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(28); opacity: 0; }
}

.ecosystem-dotgrid {
    position: absolute;
    width: clamp(80px, 12vw, 160px);
    opacity: 0.45;
    pointer-events: none;
    animation: dotgridPulse 4.4s ease-in-out infinite;
}

.eco-dot-1 { left: 2vw;  top: 70%; }
.eco-dot-2 { right: 2vw; top: 18%; animation-delay: 1.4s; }

@keyframes dotgridPulse {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50%      { opacity: 0.85; transform: scale(1.05); }
}

/* ============================================================
   SCREEN 5: SURFACING
   ============================================================ */

.screen-surfacing {
    place-items: center;
    text-align: center;
    padding: 100px clamp(20px, 5vw, 80px) 80px;
}

.surfacing-core {
    position: relative;
    max-width: 880px;
    width: 100%;
    padding: 40px 30px;
}

.surfacing-prelude {
    margin-bottom: 24px;
}

.surfacing-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(48px, 8vw, 120px);
    line-height: 0.95;
    letter-spacing: 0.04em;
    color: var(--ice-pale);
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(72, 202, 228, 0.4);
    margin-bottom: 28px;
}

.surfacing-text {
    font-family: var(--font-prose);
    font-size: clamp(15px, 1.2vw, 18px);
    color: var(--aqua-mist);
    max-width: 540px;
    margin: 0 auto 36px;
    line-height: 1.7;
    font-style: italic;
}

.surfacing-counter {
    margin-bottom: 36px;
}

.surfacing-cta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(20px, 4vw, 48px);
    flex-wrap: wrap;
}

.surfacing-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border: 1px solid var(--cerulean);
    background: rgba(0, 180, 216, 0.12);
    font-family: var(--font-tech);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.28em;
    color: var(--ice-pale);
    text-transform: uppercase;
    transition: background 240ms ease, transform 240ms ease, box-shadow 240ms ease;
}

.surfacing-cta:hover {
    background: rgba(0, 180, 216, 0.22);
    transform: translateY(-2px);
    box-shadow: 0 0 18px rgba(0, 180, 216, 0.5);
}

.surfacing-mono {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.24em;
    color: var(--cyan-soft);
    text-shadow: var(--text-glow);
    text-transform: uppercase;
}

.surfacing-squiggle {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 36px;
    height: 60px;
}

/* ============================================================
   SVG draw-on animation utility
   ============================================================ */

.draw-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawIn 2.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.is-active .draw-path {
    animation: drawIn 2.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.hud-screen.is-active .draw-path { animation-play-state: running; }

@keyframes drawIn {
    to { stroke-dashoffset: 0; }
}

/* Stagger panel morph entrance per screen */
.hud-screen .hud-panel { opacity: 0.4; }
.hud-screen.is-active .hud-panel {
    opacity: 1;
    animation: panelMorphIn 1100ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.hud-screen.is-active .hud-panel:nth-of-type(2) { animation-delay: 120ms; }
.hud-screen.is-active .hud-panel:nth-of-type(3) { animation-delay: 240ms; }
.hud-screen.is-active .hud-panel:nth-of-type(4) { animation-delay: 360ms; }
.hud-screen.is-active .hud-panel:nth-of-type(5) { animation-delay: 480ms; }
.hud-screen.is-active .hud-panel:nth-of-type(6) { animation-delay: 600ms; }
.hud-screen.is-active .hud-panel:nth-of-type(7) { animation-delay: 720ms; }

@keyframes panelMorphIn {
    0%   { clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%); opacity: 0; }
    100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); opacity: 1; }
}

.species-card { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
.hud-screen.is-active .species-card {
    animation: speciesMorphIn 1000ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.hud-screen.is-active .species-card:nth-child(1) { animation-delay: 120ms; }
.hud-screen.is-active .species-card:nth-child(2) { animation-delay: 220ms; }
.hud-screen.is-active .species-card:nth-child(3) { animation-delay: 320ms; }
.hud-screen.is-active .species-card:nth-child(4) { animation-delay: 420ms; }
.hud-screen.is-active .species-card:nth-child(5) { animation-delay: 520ms; }
.hud-screen.is-active .species-card:nth-child(6) { animation-delay: 620ms; }

@keyframes speciesMorphIn {
    0%   { clip-path: circle(0% at 50% 50%); }
    100% { clip-path: circle(140% at 50% 50%); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .screen-overview {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        grid-template-areas: "tl" "tr" "bl" "br";
        gap: 18px;
        padding-top: 88px;
    }
    .panel-corner, .panel-tl, .panel-tr, .panel-bl, .panel-br {
        max-width: 100%;
        justify-self: stretch;
    }
    .memphis-center { display: none; }

    .screen-cultivation {
        grid-template-columns: 1fr;
        grid-template-areas: "main" "side";
        gap: 24px;
    }

    .cultivation-grid {
        grid-template-columns: 1fr;
    }

    .cultivation-stack {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: auto;
    }
}

@media (max-width: 720px) {
    .hud-status-bar {
        flex-direction: column;
        height: auto;
        padding: 10px 14px;
        gap: 6px;
    }
    .status-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .nav-sep { display: none; }
    .hud-screen { padding-top: 132px; }
    .depth-indicator { display: none; }

    .ecosystem-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cultivation-stack {
        grid-template-columns: 1fr;
    }

    .descent-title { letter-spacing: 0.02em; }
}

@media (max-width: 480px) {
    .ecosystem-grid {
        grid-template-columns: 1fr;
    }

    .descent-pressure-row { gap: 18px; }
    .surfacing-cta-row { flex-direction: column; }
}
