/* =========================================================
   aiice.dev / STATION 07
   Mid-century industrial chrome HUD over a cryogenic stage.
   Palette is hard chrome; type is engraved; fish are warm.
   ========================================================= */

:root {
    --chrome:        #C7CBD1;
    --chrome-mist:   #D9E4EA;
    --chrome-light:  #F4F6F8;
    --steel:         #8A9099;
    --gunmetal:      #4A5058;
    --cryo-dark:     #1B1E24;
    --signal-red:    #FF4A3D;
    --warning-amber: #E8A54A;

    --font-display: 'Antonio', 'Oswald', 'Impact', sans-serif;
    --font-display2: 'Big Shoulders Display', 'Antonio', sans-serif;
    --font-body:    'IBM Plex Sans', 'Inter', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

    --chrome-grad: linear-gradient(135deg,
        var(--chrome-light) 15%,
        var(--chrome)       45%,
        var(--steel)        75%,
        var(--gunmetal)     95%);

    --plate-grad: linear-gradient(180deg,
        var(--chrome-light) 0%,
        var(--chrome)       18%,
        var(--steel)        100%);

    --plate-grad-dim: linear-gradient(180deg,
        var(--chrome) 0%,
        var(--steel)  100%);

    --pivot-x: 38.2%;
}

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

html {
    background: var(--cryo-dark);
    color: var(--gunmetal);
    font-family: var(--font-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 120% 80% at 30% 0%, rgba(217, 228, 234, 0.08), transparent 60%),
        radial-gradient(ellipse 100% 70% at 75% 100%, rgba(74, 80, 88, 0.35), transparent 60%),
        var(--cryo-dark);
    overflow-x: hidden;
    position: relative;
}

/* fluorescent hum */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(217, 228, 234, 0.04) 0%,
        transparent 8%,
        transparent 92%,
        rgba(27, 30, 36, 0.4) 100%);
    pointer-events: none;
    z-index: 1;
}

/* ---------- Crosshatch background ---------- */
.crosshatch-bg {
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(45deg,
            rgba(74, 80, 88, 0.04) 0,
            rgba(74, 80, 88, 0.04) 1px,
            transparent 1px,
            transparent 8px);
    pointer-events: none;
    z-index: 1;
}

/* ---------- Fish layer ---------- */
.fish-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}
.fish {
    position: absolute;
    left: 0;
    will-change: transform;
    transform: translate3d(-100%, 0, 0);
    filter: drop-shadow(0 1px 0 rgba(244, 246, 248, 0.18));
}
.fish-trigger    { width: 320px; top: 22%; }
.fish-idol       { width: 240px; top: 48%; }
.fish-angel      { width: 360px; top: 70%; }
.fish-hawk       { width: 130px; top: 86%; }
.fish-trigger-2  { width: 180px; top: 62%; }

.fish-stroke {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: drawStroke 2.4s cubic-bezier(.5,.0,.2,1) forwards;
}
.fish .fish-stroke.fish-body   { animation-delay: 0.0s; }
.fish .fish-stroke.fish-fin,
.fish .fish-stroke.fish-dorsal,
.fish .fish-stroke.fish-tail   { animation-delay: 0.5s; }
.fish .fish-stroke.fish-eye    { animation-delay: 1.4s; }
.fish .fish-stroke.fish-spot,
.fish .fish-stroke.fish-stripe,
.fish .fish-stroke.fish-mouth,
.fish .fish-stroke.fish-snout  { animation-delay: 1.7s; }

@keyframes drawStroke {
    from { stroke-dashoffset: 600; }
    to   { stroke-dashoffset: 0;   }
}

/* ---------- HUD foundation ---------- */
.hud {
    position: fixed;
    z-index: 100;
    font-family: var(--font-mono);
    color: var(--gunmetal);
    pointer-events: none;
}
.hud .hud-plate, .hud .continue-key {
    pointer-events: auto;
}

.hud-plate {
    position: relative;
    background: var(--plate-grad);
    border-top: 1px solid var(--chrome-light);
    border-left: 1px solid rgba(244, 246, 248, 0.5);
    border-right: 1px solid var(--gunmetal);
    border-bottom: 1px solid var(--gunmetal);
    box-shadow:
        inset 0 1px 0 rgba(244, 246, 248, 0.7),
        inset 0 -1px 0 rgba(74, 80, 88, 0.6),
        0 2px 0 rgba(27, 30, 36, 0.4);
    padding: 10px 14px;
    color: var(--gunmetal);
    border-radius: 1px;
}

.mono { font-family: var(--font-mono); letter-spacing: 0.08em; }

/* chrome-wipe transition mask layer over plates */
.hud-plate::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
        transparent 0%,
        rgba(244, 246, 248, 0.0) 30%,
        rgba(244, 246, 248, 0.5) 50%,
        rgba(244, 246, 248, 0.0) 70%,
        transparent 100%);
    transform: translateX(-120%);
    pointer-events: none;
    transition: none;
}
.hud.wipe .hud-plate::after {
    animation: chromeWipe 240ms cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
@keyframes chromeWipe {
    from { transform: translateX(-120%); }
    to   { transform: translateX(120%);  }
}

/* ---------- HUD top-left ---------- */
.hud-tl { top: 18px; left: 18px; }
.hud-tl .hud-plate {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--cryo-dark);
}
.hud-tl .hud-divider { color: var(--steel); }
.hud-tl .hud-cursor {
    color: var(--signal-red);
    font-weight: 500;
    animation: blink 1.05s step-end infinite;
    margin-left: 4px;
}
@keyframes blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}
.hud-tl .hud-sub {
    font-size: 9px;
    color: var(--steel);
    text-transform: uppercase;
    margin-top: 6px;
    padding-left: 4px;
    letter-spacing: 0.18em;
    text-shadow: 0 0 0.5px rgba(217, 228, 234, 0.5);
}

/* ---------- HUD top-right (gauge) ---------- */
.hud-tr { top: 18px; right: 18px; }
.gauge-plate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 78px;
    padding: 12px 10px 10px;
    position: relative;
}
.gauge-label {
    font-size: 8px;
    text-transform: uppercase;
    color: var(--cryo-dark);
    letter-spacing: 0.16em;
    text-align: center;
    line-height: 1.2;
}
.gauge-track {
    position: relative;
    width: 6px;
    height: 140px;
    background: linear-gradient(180deg, var(--gunmetal), var(--cryo-dark));
    border: 1px solid var(--gunmetal);
    border-top-color: var(--chrome-light);
    overflow: hidden;
}
.gauge-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64%;
    background: linear-gradient(180deg,
        var(--signal-red) 0%,
        #c93225 100%);
    box-shadow: 0 0 6px rgba(255, 74, 61, 0.6);
    transition: height 800ms cubic-bezier(.5,0,.5,1);
}
.gauge-tick {
    position: absolute;
    left: -3px;
    width: 12px;
    height: 1px;
    background: var(--steel);
}
.gauge-readout {
    font-size: 10px;
    font-weight: 500;
    color: var(--cryo-dark);
    letter-spacing: 0.1em;
}

/* pulse rings emanating from gauge */
.pulse-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}
.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border: 1px solid var(--chrome-light);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    will-change: transform, opacity;
    animation: pulseRing 4s linear infinite;
}
.pulse-ring:nth-child(2) { animation-delay: 0.5s; }
.pulse-ring:nth-child(3) { animation-delay: 1s;   }
@keyframes pulseRing {
    0%   { width: 0;     height: 0;     opacity: 0;   }
    5%   { opacity: 0.6; }
    40%  { width: 320px; height: 320px; opacity: 0;   }
    100% { width: 320px; height: 320px; opacity: 0;   }
}

/* ---------- HUD bottom-left (transcript) ---------- */
.hud-bl { bottom: 18px; left: 18px; }
.transcript-plate {
    width: 280px;
    padding: 10px 12px 12px;
}
.transcript-label {
    font-size: 8.5px;
    text-transform: uppercase;
    color: var(--cryo-dark);
    letter-spacing: 0.18em;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(74, 80, 88, 0.5);
    padding-bottom: 4px;
}
.transcript {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 54px;
}
.transcript-line {
    font-size: 10px;
    color: var(--cryo-dark);
    text-shadow: 0 0 0.5px rgba(217, 228, 234, 0.5);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    animation: tlineEnter 360ms ease-out both;
}
.transcript-line.error { color: var(--signal-red); }
@keyframes tlineEnter {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- HUD bottom-right (numeral) ---------- */
.hud-br { bottom: 18px; right: 18px; }
.plate-amber {
    background: var(--plate-grad);
    padding: 8px 14px 10px;
    text-align: right;
    min-width: 100px;
    position: relative;
}
.plate-amber::before {
    content: '';
    position: absolute;
    inset: 1px;
    border: 1px solid rgba(232, 165, 74, 0.5);
    pointer-events: none;
}
.numeral-label {
    font-size: 8.5px;
    color: var(--cryo-dark);
    text-transform: uppercase;
    letter-spacing: 0.22em;
}
.numeral {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    margin-top: 4px;
    letter-spacing: 0.02em;
    background: linear-gradient(180deg, var(--warning-amber) 0%, #a06a1f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 0 rgba(244,246,248,0.2);
}

/* ---------- HUD bottom-center key ---------- */
.hud-bc {
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}
.continue-key {
    pointer-events: auto;
    appearance: none;
    background: var(--plate-grad);
    border-top: 1px solid var(--chrome-light);
    border-left: 1px solid rgba(244, 246, 248, 0.5);
    border-right: 1px solid var(--gunmetal);
    border-bottom: 1px solid var(--gunmetal);
    box-shadow:
        inset 0 1px 0 rgba(244, 246, 248, 0.7),
        inset 0 -1px 0 rgba(74, 80, 88, 0.6),
        0 2px 0 rgba(27, 30, 36, 0.4);
    border-radius: 1px;
    padding: 10px 22px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cryo-dark);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    position: relative;
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.continue-key .continue-arrow {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--cryo-dark);
}
.continue-key:hover {
    transform: translateY(1px);
    box-shadow:
        inset 0 1px 0 rgba(244, 246, 248, 0.7),
        inset 0 -1px 0 rgba(74, 80, 88, 0.6),
        0 1px 0 rgba(27, 30, 36, 0.4),
        0 0 0 1px var(--warning-amber),
        0 0 14px rgba(232, 165, 74, 0.4);
}
.continue-key:active { transform: translateY(2px); }

/* ---------- Stage ---------- */
.stage {
    position: relative;
    z-index: 10;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    padding-left: var(--pivot-x);
    padding-right: 8vw;
    scrollbar-width: none;
}
.stage::-webkit-scrollbar { display: none; }

.frame {
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14vh 0 16vh;
    max-width: 56ch;
    position: relative;
}

.frame-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--steel);
    font-size: 10px;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.meta-mode {
    color: var(--chrome-mist);
    text-shadow: 0 0 0.5px rgba(217, 228, 234, 0.6);
}
.meta-rule {
    flex: 0 0 80px;
    height: 1px;
    background: linear-gradient(90deg, var(--steel), transparent);
}
.meta-id { color: var(--steel); }

/* ---------- Hero headline ---------- */
.hero-headline {
    font-family: var(--font-display2);
    font-weight: 800;
    font-size: clamp(4rem, 10vw, 11rem);
    line-height: 0.84;
    letter-spacing: -0.03em;
    margin: 0;
    text-transform: uppercase;
    color: var(--chrome-mist);
}
.hero-line {
    display: block;
    overflow: hidden;
    background: var(--chrome-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 0 rgba(244, 246, 248, 0.2);
}
.hero-line .word {
    display: inline-block;
    margin-right: 0.3em;
}
.hero-line .char {
    display: inline-block;
    transform: translateY(110%);
    animation: charDrop 720ms cubic-bezier(.2,.8,.2,1) forwards;
}
.hero-period {
    color: var(--signal-red);
    -webkit-text-fill-color: var(--signal-red);
    text-shadow: 0 0 8px rgba(255, 74, 61, 0.6);
}
@keyframes charDrop {
    from { transform: translateY(110%); }
    to   { transform: translateY(0);    }
}

/* ---------- Section anchor word ---------- */
.anchor-word {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(5rem, 14vw, 14rem);
    line-height: 0.82;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    margin: 0 0 24px;
    display: flex;
    flex-wrap: nowrap;
    background: var(--chrome-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 1px 0 rgba(244, 246, 248, 0.2);
    position: relative;
}
.anchor-word::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 1px;
    background: linear-gradient(90deg, var(--steel) 0%, transparent 70%);
}
.anchor-letter {
    display: inline-block;
    overflow: hidden;
    line-height: 0.95;
}
.anchor-inner {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 540ms cubic-bezier(.2,.8,.2,1);
}
.frame.in-view .anchor-inner {
    transform: translateY(0);
}
.frame.in-view .anchor-letter:nth-child(1) .anchor-inner { transition-delay: 0ms; }
.frame.in-view .anchor-letter:nth-child(2) .anchor-inner { transition-delay: 60ms; }
.frame.in-view .anchor-letter:nth-child(3) .anchor-inner { transition-delay: 120ms; }
.frame.in-view .anchor-letter:nth-child(4) .anchor-inner { transition-delay: 180ms; }
.frame.in-view .anchor-letter:nth-child(5) .anchor-inner { transition-delay: 240ms; }
.frame.in-view .anchor-letter:nth-child(6) .anchor-inner { transition-delay: 300ms; }
.frame.in-view .anchor-letter:nth-child(7) .anchor-inner { transition-delay: 360ms; }

/* ---------- Body ---------- */
.frame-body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--chrome);
    margin: 0 0 28px;
    max-width: 48ch;
    font-weight: 400;
    text-wrap: pretty;
}
.frame-body em {
    font-style: normal;
    color: var(--chrome-light);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.05em;
    padding: 1px 6px;
    border: 1px solid rgba(138, 144, 153, 0.4);
    background: rgba(74, 80, 88, 0.18);
    margin: 0 1px;
}

.alice-fragment {
    display: inline;
    font-family: var(--font-display2);
    font-weight: 400;
    font-size: 1em;
    color: var(--warning-amber);
    letter-spacing: 0.01em;
    border-bottom: 1px solid rgba(232, 165, 74, 0.3);
    padding: 0 2px;
    margin: 0 4px;
    text-shadow: 0 0 6px rgba(232, 165, 74, 0.18);
}

/* ---------- Frame footer (data row) ---------- */
.frame-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 22px 36px;
    padding-top: 18px;
    border-top: 1px solid rgba(138, 144, 153, 0.25);
    font-size: 10.5px;
    text-transform: uppercase;
}
.meta-pair {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--chrome);
}
.meta-key { color: var(--steel); font-size: 9px; letter-spacing: 0.2em; }
.meta-val { color: var(--chrome-light); font-weight: 500; letter-spacing: 0.12em; }

/* ---------- Final RELEASE button ---------- */
.release-row {
    margin-top: 36px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.release-btn {
    appearance: none;
    background: var(--plate-grad);
    border-top: 1px solid var(--chrome-light);
    border-left: 1px solid rgba(244, 246, 248, 0.5);
    border-right: 1px solid var(--gunmetal);
    border-bottom: 1px solid var(--gunmetal);
    box-shadow:
        inset 0 1px 0 rgba(244, 246, 248, 0.7),
        inset 0 -1px 0 rgba(74, 80, 88, 0.6),
        0 2px 0 rgba(27, 30, 36, 0.6);
    color: var(--cryo-dark);
    padding: 12px 22px;
    cursor: pointer;
    position: relative;
    border-radius: 1px;
    transition: transform 120ms ease;
}
.release-btn:hover { transform: translateY(1px); }
.release-bevel {
    position: absolute;
    inset: 2px;
    border: 1px solid rgba(232, 165, 74, 0.4);
    pointer-events: none;
}
.release-label {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 500;
}
.release-hint {
    color: var(--steel);
    font-size: 10px;
    letter-spacing: 0.14em;
}

/* ---------- Final fade veil ---------- */
.release-veil {
    position: fixed;
    inset: 0;
    background: var(--cryo-dark);
    opacity: 0;
    pointer-events: none;
    z-index: 50;   /* below fish layer (5? -> we want above; adjust) */
    transition: opacity 1.2s ease;
}
.release-veil.active {
    opacity: 1;
    pointer-events: auto;
}
/* Fish layer should remain visible; we drop HUD opacity instead */
body.releasing .hud { opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
body.releasing .stage { opacity: 0; transition: opacity 1.2s ease; }
body.releasing .release-veil { opacity: 1; }
/* Fish layer needs to be above the veil during release */
body.releasing .fish-layer { z-index: 60; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .stage { padding-left: 28%; padding-right: 5vw; }
    .hud-tl .hud-sub { display: none; }
    .transcript-plate { width: 220px; }
}
@media (max-width: 720px) {
    .stage { padding-left: 6vw; padding-right: 6vw; }
    .hud-bl { display: none; }
    .hud-tr { top: 12px; right: 12px; }
    .hud-tl { top: 12px; left: 12px; }
    .gauge-plate { width: 60px; }
    .gauge-track { height: 90px; }
    .hero-headline { font-size: clamp(2.6rem, 14vw, 6rem); }
    .anchor-word { font-size: clamp(3.5rem, 18vw, 8rem); }
    .frame-meta { font-size: 9px; }
    .frame-body { font-size: 14.5px; }
}
