/* ============================================================
   meltdown.quest -- progressive corruption narrative scroll
   ============================================================ */

:root {
    --c-core-dark:    #0a0a0c;
    --c-heat-dark:    #1a0a0a;
    --c-rad-green:    #00ff88;
    --c-melt-red:     #ff3300;
    --c-caution:      #ffcc00;
    --c-readout:      #e0e0e0;
    --c-artifact:     #ff00ff;
    --c-coolant:      #00ccff;

    --bg-current:     #0a0a0c;

    /* Drives all distortion: 0 stable -> 4 meltdown */
    --meltdown-level: 0;

    --f-display: "Syne", "Inter", system-ui, sans-serif;
    --f-body:    "DM Sans", "Inter", system-ui, sans-serif;
    --f-mono:    "Red Hat Mono", "JetBrains Mono", ui-monospace, monospace;
}

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

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

body {
    font-family: var(--f-body);
    color: var(--c-readout);
    background: var(--bg-current);
    line-height: 1.7;
    font-size: 0.95rem;
    -webkit-font-smoothing: antialiased;
    transition: background-color 1.2s ease;
    overflow-x: hidden;
}

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

/* ---------- Global overlays --------------------------------- */

.scan-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.02) 0,
        rgba(255, 255, 255, 0.02) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: overlay;
    opacity: calc(0.35 + var(--meltdown-level) * 0.12);
    transition: opacity 0.4s ease;
}

.vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 91;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
}

/* ---------- Site chrome (fixed header) ---------------------- */

.site-chrome {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.1rem clamp(1.2rem, 4vw, 3.2rem);
    font-family: var(--f-mono);
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-readout);
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 12, 0.82) 0%,
        rgba(10, 10, 12, 0.0) 100%
    );
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
}

.chrome-left, .chrome-right {
    display: flex;
    gap: 1.6rem;
    align-items: center;
}

.chrome-mark {
    color: var(--c-rad-green);
    transition: color 0.6s ease;
}

.chrome-status {
    color: var(--c-readout);
    opacity: 0.7;
    transition: color 0.6s ease, opacity 0.6s ease;
}

.chrome-meter {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.meter-label {
    opacity: 0.6;
    font-size: 0.7rem;
}

.meter-track {
    position: relative;
    width: 130px;
    height: 4px;
    background: rgba(224, 224, 224, 0.12);
    overflow: hidden;
}

.meter-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: linear-gradient(
        to right,
        var(--c-rad-green) 0%,
        var(--c-caution) 45%,
        var(--c-melt-red) 100%
    );
    transition: width 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.meter-value {
    min-width: 3ch;
    color: var(--c-caution);
    font-variant-numeric: tabular-nums;
}

/* ---------- Main scroll container --------------------------- */

.meltdown-scroll {
    position: relative;
    z-index: 1;
}

.stage {
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding: clamp(6rem, 14vh, 10rem) clamp(1.4rem, 6vw, 6rem) clamp(4rem, 10vh, 7rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
}

/* ---------- Stage 0 :: Hero stable -------------------------- */

.stage--stable {
    align-items: center;
    text-align: center;
}

/* radiation rings */
.rings {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 0;
}

.ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    margin: -100px 0 0 -100px;
    border: 1px solid rgba(0, 255, 136, 0.18);
    border-radius: 50%;
    transform: scale(0);
    opacity: 0.3;
    animation: ring-expand 4.5s cubic-bezier(0.2, 0.7, 0.2, 1) infinite;
}

.ring--1 { animation-delay: 0s; }
.ring--2 { animation-delay: 0.9s; }
.ring--3 { animation-delay: 1.8s; }
.ring--4 { animation-delay: 2.7s; }
.ring--5 { animation-delay: 3.6s; }

@keyframes ring-expand {
    from { transform: scale(0);    opacity: 0.45; }
    to   { transform: scale(2.6);  opacity: 0;    }
}

.ring-core {
    position: absolute;
    top: 0; left: 0;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    background: var(--c-rad-green);
    border-radius: 50%;
    box-shadow:
        0 0 8px var(--c-rad-green),
        0 0 24px rgba(0, 255, 136, 0.5),
        0 0 48px rgba(0, 255, 136, 0.25);
    animation: core-pulse 2.4s ease-in-out infinite;
}

@keyframes core-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.35); }
}

.hero-marker {
    position: absolute;
    top: clamp(5rem, 9vh, 7rem);
    left: clamp(1.4rem, 6vw, 6rem);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--c-rad-green);
    opacity: 0.9;
    z-index: 2;
}

.marker-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-rad-green);
    box-shadow: 0 0 10px var(--c-rad-green);
    animation: blink 1.6s steps(2) infinite;
}

@keyframes blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0.25; }
}

.hero-inner {
    position: relative;
    z-index: 3;
    max-width: 880px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
}

.eyebrow {
    font-family: var(--f-mono);
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--c-rad-green);
    opacity: 0.85;
}

.hero-title {
    position: relative;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 7vw, 5.6rem);
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--c-readout);
    text-transform: lowercase;
}

.hero-sub {
    max-width: 640px;
    font-size: 1.05rem;
    color: rgba(224, 224, 224, 0.78);
}

.hero-readouts {
    display: flex;
    gap: clamp(1.2rem, 4vw, 3rem);
    margin-top: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.readout {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: flex-start;
    font-family: var(--f-mono);
}

.readout-key {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(224, 224, 224, 0.5);
}

.readout-val {
    font-size: 1rem;
    color: var(--c-rad-green);
    font-variant-numeric: tabular-nums;
}

.hero-cue {
    margin-top: 2.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--f-mono);
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(224, 224, 224, 0.55);
}

.cue-line {
    width: 1px;
    height: 42px;
    background: linear-gradient(
        to bottom,
        rgba(0, 255, 136, 0.6),
        rgba(0, 255, 136, 0)
    );
    animation: cue-drip 2s ease-in-out infinite;
}

@keyframes cue-drip {
    0%   { transform: scaleY(0); transform-origin: top; opacity: 0.2; }
    50%  { transform: scaleY(1); transform-origin: top; opacity: 1;   }
    100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* ---------- Generic stage grid ------------------------------ */

.stage-grid {
    width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: clamp(1.6rem, 4vw, 4rem);
    align-items: start;
    position: relative;
    z-index: 2;
}

.stage-meta {
    position: sticky;
    top: 8rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    font-family: var(--f-mono);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.stage-index {
    color: rgba(224, 224, 224, 0.45);
}

.stage-label {
    font-size: 0.95rem;
    letter-spacing: 0.22em;
    color: var(--c-readout);
}

.stage-band {
    margin-top: 0.5rem;
    width: 60px;
    height: 4px;
    background: var(--c-rad-green);
    box-shadow: 0 0 14px currentColor;
}
.band--green  { background: var(--c-rad-green);  color: var(--c-rad-green); }
.band--yellow { background: var(--c-caution);    color: var(--c-caution); }
.band--red    { background: var(--c-melt-red);   color: var(--c-melt-red); }
.band--blue   { background: var(--c-coolant);    color: var(--c-coolant); }

.stage-body {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 760px;
}

.stage-title {
    position: relative;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: -0.015em;
    color: var(--c-readout);
    text-transform: lowercase;
    margin-bottom: 0.4rem;
}

.stage-title--big {
    font-size: clamp(2.6rem, 7vw, 6rem);
    letter-spacing: -0.03em;
}

.stage-text {
    font-size: 1rem;
    color: rgba(224, 224, 224, 0.82);
    max-width: 64ch;
}

.stage-text--lg {
    font-size: 1.15rem;
    color: var(--c-readout);
}

.stage-text em {
    font-style: italic;
    color: var(--c-caution);
}

/* ---------- Stage 1 :: Warning ------------------------------ */

.stage--warning {
    border-top: 1px solid rgba(0, 255, 136, 0.08);
}

.signal-list {
    margin-top: 1.6rem;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    border-top: 1px solid rgba(255, 204, 0, 0.18);
}

.signal-list li {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 204, 0, 0.18);
    font-family: var(--f-mono);
}

.sig-key {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(224, 224, 224, 0.55);
}

.sig-val {
    font-size: 1.1rem;
    color: var(--c-caution);
    font-variant-numeric: tabular-nums;
}

/* ---------- Stage 2 :: Critical ----------------------------- */

.hazard-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: repeating-linear-gradient(
        45deg,
        transparent 0,
        transparent 10px,
        rgba(255, 204, 0, 0.05) 10px,
        rgba(255, 204, 0, 0.05) 20px
    );
    opacity: calc(0.4 + var(--meltdown-level) * 0.18);
    transition: opacity 0.6s ease;
}

.hazard-overlay--red {
    background-image: repeating-linear-gradient(
        -45deg,
        transparent 0,
        transparent 8px,
        rgba(255, 51, 0, 0.07) 8px,
        rgba(255, 51, 0, 0.07) 16px
    );
}

.alert-stack {
    margin-top: 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alert {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--c-caution);
    background: rgba(255, 204, 0, 0.04);
    font-family: var(--f-mono);
    font-size: 0.88rem;
    color: rgba(224, 224, 224, 0.92);
    transform: translateX(0);
    transition: transform 0.4s ease, background 0.4s ease;
}

.alert--b { transform: translateX(calc(var(--meltdown-level) * 4px)); }
.alert--c { transform: translateX(calc(var(--meltdown-level) * -6px)); border-left-color: var(--c-melt-red); }
.alert--d { transform: translateX(calc(var(--meltdown-level) * 8px)); border-left-color: var(--c-melt-red); background: rgba(255, 51, 0, 0.05); }

.alert-tag {
    color: var(--c-caution);
    font-weight: 700;
    letter-spacing: 0.12em;
    min-width: 3.6em;
}

.alert--c .alert-tag,
.alert--d .alert-tag { color: var(--c-melt-red); }

.alert-msg {
    flex: 1;
}

/* ---------- Stage 3 :: Meltdown ----------------------------- */

.stage--meltdown {
    border-top: 1px solid rgba(255, 51, 0, 0.18);
    border-bottom: 1px solid rgba(255, 51, 0, 0.18);
}

.bleed {
    position: absolute;
    left: 0; right: 0;
    height: 120px;
    pointer-events: none;
    z-index: 1;
}

.bleed--top {
    top: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 51, 0, 0.18),
        transparent
    );
}

.bleed--bottom {
    bottom: 0;
    background: linear-gradient(
        to top,
        rgba(255, 0, 255, 0.14),
        transparent
    );
}

.melt-words {
    margin-top: 2.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    font-family: var(--f-display);
    font-weight: 800;
    font-size: clamp(1.4rem, 3.4vw, 2.6rem);
    text-transform: lowercase;
    line-height: 1.1;
    color: rgba(255, 51, 0, 0.85);
    letter-spacing: -0.01em;
}

.melt-word {
    position: relative;
    display: inline-block;
    transform: translateY(0);
    transition: transform 0.4s ease, color 0.4s ease;
}

.melt-word--1 { color: var(--c-melt-red); }
.melt-word--2 { color: var(--c-caution); }
.melt-word--3 { color: var(--c-artifact); }
.melt-word--4 { color: var(--c-readout); }
.melt-word--5 { color: var(--c-melt-red); }
.melt-word--6 { color: var(--c-rad-green); }
.melt-word--7 { color: var(--c-artifact); }
.melt-word--8 { color: rgba(224, 224, 224, 0.7); font-style: italic; }

/* ---------- Stage 4 :: Aftermath (recovery) ----------------- */

.stage--aftermath {
    background: linear-gradient(
        to bottom,
        var(--bg-current) 0%,
        #0a0a0c 50%,
        #08080a 100%
    );
    --meltdown-level: 0;
    border-top: 1px solid rgba(0, 204, 255, 0.18);
}

.aftermath-grid {
    width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: clamp(1.6rem, 4vw, 4rem);
    align-items: start;
    position: relative;
    z-index: 2;
}

.stage-meta--cool .stage-label { color: var(--c-coolant); }

.stage-body--cool {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 760px;
}

.aftermath-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(2rem, 4.6vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.015em;
    color: var(--c-readout);
    text-transform: lowercase;
    margin-bottom: 0.2rem;
}

.aftermath-text {
    font-size: 1rem;
    color: rgba(224, 224, 224, 0.85);
    max-width: 64ch;
}

.lesson-row {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0;
    border-top: 1px solid rgba(0, 204, 255, 0.22);
}

.lesson {
    padding: 1.4rem 1.4rem 1.4rem 0;
    border-bottom: 1px solid rgba(0, 204, 255, 0.22);
    border-right: 1px solid rgba(0, 204, 255, 0.10);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.lesson:last-child { border-right: 0; }

.lesson-num {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c-coolant);
}

.lesson-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--c-readout);
    letter-spacing: -0.005em;
}

.lesson-text {
    font-size: 0.92rem;
    color: rgba(224, 224, 224, 0.7);
    line-height: 1.6;
}

.aftermath-foot {
    margin-top: 2.4rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(0, 204, 255, 0.18);
    font-family: var(--f-mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.foot-mark { color: var(--c-coolant); }
.foot-stamp { color: rgba(224, 224, 224, 0.55); }

/* ---------- Site footer ------------------------------------- */

.site-foot {
    position: relative;
    z-index: 2;
    padding: 2rem clamp(1.4rem, 6vw, 6rem);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-family: var(--f-mono);
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(224, 224, 224, 0.5);
    border-top: 1px solid rgba(0, 204, 255, 0.12);
    background: #08080a;
}

.foot-coords {
    color: var(--c-coolant);
}

/* ============================================================
   GLITCH SYSTEM
   Global scaling via --meltdown-level. Each stage layers more.
   ============================================================ */

/* Hero title -- minimal hum at base; scales with meltdown */
.hero-title::before,
.hero-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.hero-title::before {
    color: var(--c-coolant);
    transform: translate(calc(var(--meltdown-level) * 0.3px), 0);
    mix-blend-mode: screen;
    opacity: 0.0;
    animation: glitch-hum 6s steps(1) infinite;
}
.hero-title::after {
    color: var(--c-melt-red);
    transform: translate(calc(var(--meltdown-level) * -0.3px), 0);
    mix-blend-mode: screen;
    opacity: 0.0;
}

@keyframes glitch-hum {
    0%, 96%, 100% { opacity: 0; clip-path: inset(0 0 0 0); }
    97%           { opacity: 0.55; clip-path: inset(20% 0 60% 0); }
    98%           { opacity: 0.55; clip-path: inset(70% 0 12% 0); }
    99%           { opacity: 0; }
}

/* Stage titles -- glitch intensity controlled by --meltdown-level */
.stage-title {
    position: relative;
}

.stage-title::before,
.stage-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0;
}

.stage-title::before {
    color: var(--c-coolant);
    transform: translate(calc(var(--meltdown-level) * -1.4px), calc(var(--meltdown-level) * 0.6px));
    animation: glitch-pre 5s steps(1) infinite;
}

.stage-title::after {
    color: var(--c-melt-red);
    transform: translate(calc(var(--meltdown-level) * 1.6px), calc(var(--meltdown-level) * -0.5px));
    animation: glitch-post 5s steps(1) infinite;
}

@keyframes glitch-pre {
    0%, 88%, 100% { opacity: 0; clip-path: inset(0 0 0 0); }
    89% { opacity: 0.7; clip-path: inset(15% 0 65% 0); }
    91% { opacity: 0.7; clip-path: inset(55% 0 18% 0); }
    93% { opacity: 0.5; clip-path: inset(35% 0 35% 0); }
    95% { opacity: 0;   clip-path: inset(0 0 0 0); }
}

@keyframes glitch-post {
    0%, 84%, 100% { opacity: 0; clip-path: inset(0 0 0 0); }
    85% { opacity: 0.7; clip-path: inset(60% 0 18% 0); }
    87% { opacity: 0.7; clip-path: inset(20% 0 55% 0); }
    89% { opacity: 0.5; clip-path: inset(40% 0 28% 0); }
    91% { opacity: 0;   clip-path: inset(0 0 0 0); }
}

/* Per-stage glitch intensity -- override animation rate / strength */
.stage--stable      { --stage-level: 0; }
.stage--warning     { --stage-level: 1; }
.stage--critical    { --stage-level: 2; }
.stage--meltdown    { --stage-level: 3; }
.stage--aftermath   { --stage-level: 0; }

/* As --meltdown-level rises, stage titles in critical/meltdown
   pick up more frequent / louder glitch pulses */
.stage--critical .stage-title::before {
    transform: translate(calc(-2px + var(--meltdown-level) * -1px), calc(var(--meltdown-level) * 0.6px));
}
.stage--critical .stage-title::after {
    transform: translate(calc(2px + var(--meltdown-level) * 1.5px), calc(var(--meltdown-level) * -0.5px));
}

.stage--meltdown .stage-title {
    color: var(--c-readout);
    text-shadow:
        calc(var(--meltdown-level) * 1px) 0 var(--c-melt-red),
        calc(var(--meltdown-level) * -1px) 0 var(--c-coolant);
}

.stage--meltdown .stage-title::before {
    color: var(--c-artifact);
    transform: translate(calc(-3px + var(--meltdown-level) * -2px), calc(var(--meltdown-level) * 1.1px));
    animation: glitch-pre 1.5s steps(1) infinite;
    opacity: 0.0;
}
.stage--meltdown .stage-title::after {
    color: var(--c-melt-red);
    transform: translate(calc(3px + var(--meltdown-level) * 2px), calc(var(--meltdown-level) * -1.1px));
    animation: glitch-post 1.5s steps(1) infinite;
    opacity: 0.0;
}

/* Aftermath title intentionally clean (no pseudo glitch) */
.aftermath-title::before,
.aftermath-title::after {
    content: none;
}

/* Body text drift in meltdown stage -- subtle distortion,
   not enough to break readability */
.stage--meltdown .stage-text {
    letter-spacing: calc(var(--meltdown-level) * 0.01em);
}

/* Word-level wobble for melt-words at high meltdown levels */
.stage--meltdown .melt-word--1 { animation: drift-a 4s ease-in-out infinite; }
.stage--meltdown .melt-word--2 { animation: drift-b 5s ease-in-out infinite; }
.stage--meltdown .melt-word--3 { animation: drift-c 6s ease-in-out infinite; }
.stage--meltdown .melt-word--4 { animation: drift-a 4.7s ease-in-out infinite; }
.stage--meltdown .melt-word--5 { animation: drift-b 5.5s ease-in-out infinite; }
.stage--meltdown .melt-word--6 { animation: drift-c 4.2s ease-in-out infinite; }
.stage--meltdown .melt-word--7 { animation: drift-a 5.8s ease-in-out infinite; }
.stage--meltdown .melt-word--8 { animation: drift-b 6.2s ease-in-out infinite; }

@keyframes drift-a {
    0%, 100% { transform: translateY(0) skewX(0); }
    50%      { transform: translateY(calc(var(--meltdown-level) * 2px)) skewX(calc(var(--meltdown-level) * 0.5deg)); }
}
@keyframes drift-b {
    0%, 100% { transform: translateY(0) skewX(0); }
    50%      { transform: translateY(calc(var(--meltdown-level) * -3px)) skewX(calc(var(--meltdown-level) * -0.6deg)); }
}
@keyframes drift-c {
    0%, 100% { transform: translateX(0) translateY(0); }
    50%      { transform: translateX(calc(var(--meltdown-level) * 3px)) translateY(calc(var(--meltdown-level) * 1px)); }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 820px) {
    .stage-grid,
    .aftermath-grid {
        grid-template-columns: 1fr;
        gap: 1.4rem;
    }
    .stage-meta {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.8rem 1.2rem;
    }
    .stage-band { margin-top: 0; }
    .site-chrome { font-size: 0.68rem; padding: 0.85rem 1.2rem; }
    .meter-track { width: 80px; }
    .meter-label { display: none; }
    .lesson { border-right: 0; }
}

@media (max-width: 520px) {
    .hero-readouts { gap: 1.2rem; }
    .hero-marker { font-size: 0.62rem; }
    .stage { padding-left: 1.2rem; padding-right: 1.2rem; }
}
