/* =============================================================
   economic.day — glitch-over-watercolor narrative grid
   (Google Fonts); IntersectionObserver adding state classes. IntersectionObserver for phase transitions (4 sections
   palette: dark-neon over slate watercolor
   ============================================================= */

:root {
    /* Core palette */
    --void-black: #0a0a0f;
    --deep-charcoal: #141419;
    --signal-green: #00ff88;
    --corrupt-magenta: #ff0066;
    --watercolor-slate: #3a4a5c;
    --ink-wash: #1e2a3a;
    --fog-white: #e0e8e4;
    --neon-amber: #ffaa00;
    --residual-teal: #00b4d8;
    --soft-fog: #c8d0cc;

    /* Live state values, written by JS */
    --scroll-progress: 0;
    --phase-intensity: 0;
    --mountain-back: 0px;
    --mountain-mid: 0px;
    --mountain-front: 0px;
    --mountain-hue: 0deg;

    --easing: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
    background: var(--void-black);
    color: var(--soft-fog);
    font-family: "Inter", system-ui, sans-serif;
    font-size: clamp(0.875rem, 1.2vw, 1.1rem);
    line-height: 1.65;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    position: relative;
    background:
        radial-gradient(ellipse at 50% -10%, rgba(0, 180, 216, 0.06), transparent 60%),
        radial-gradient(ellipse at 90% 110%, rgba(255, 0, 102, 0.04), transparent 55%),
        var(--void-black);
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ============== Scroll progress (right edge) ============== */
.scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    width: 2px;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(0, 255, 136, 0.4) 0%,
        rgba(0, 255, 136, 0.4) calc(var(--scroll-progress) * 100%),
        rgba(0, 255, 136, 0.05) calc(var(--scroll-progress) * 100%),
        rgba(0, 255, 136, 0.05) 100%
    );
    z-index: 90;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.25);
}

/* ============== Mountain stage ============== */
.mountain-stage {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    filter: hue-rotate(var(--mountain-hue));
    transition: filter 1.2s var(--easing);
}

.mountains {
    position: absolute;
    left: -5%;
    right: -5%;
    bottom: 0;
    height: 75vh;
    will-change: transform;
}

.mountains--back {
    background: linear-gradient(
        to top,
        var(--ink-wash) 0%,
        rgba(58, 74, 92, 0.45) 60%,
        transparent 100%
    );
    clip-path: polygon(
        0% 100%,
        0% 72%,
        4% 68%, 9% 60%, 14% 64%, 19% 52%, 24% 58%,
        30% 46%, 36% 54%, 42% 42%, 48% 50%, 54% 38%,
        60% 46%, 66% 36%, 72% 44%, 78% 32%, 84% 40%,
        90% 30%, 96% 38%, 100% 34%,
        100% 100%
    );
    opacity: 0.12;
    filter: blur(3px);
    transform: translateY(var(--mountain-back));
}

.mountains--mid {
    background: linear-gradient(
        to top,
        var(--ink-wash) 0%,
        var(--watercolor-slate) 70%,
        rgba(58, 74, 92, 0.3) 100%
    );
    clip-path: polygon(
        0% 100%,
        0% 78%,
        5% 74%, 11% 64%, 17% 70%, 23% 56%, 29% 62%,
        35% 50%, 41% 56%, 47% 44%, 53% 52%, 59% 42%,
        65% 50%, 71% 38%, 77% 46%, 83% 36%, 89% 44%,
        95% 38%, 100% 42%,
        100% 100%
    );
    opacity: 0.25;
    filter: blur(1.5px);
    transform: translateY(var(--mountain-mid));
}

.mountains--front {
    background: linear-gradient(
        to top,
        #0d141d 0%,
        var(--ink-wash) 60%,
        var(--watercolor-slate) 100%
    );
    clip-path: polygon(
        0% 100%,
        0% 92%,
        4% 88%, 8% 80%, 13% 84%, 18% 72%, 23% 76%,
        28% 64%, 34% 70%, 40% 56%, 46% 64%, 52% 50%,
        58% 60%, 64% 48%, 70% 56%, 76% 44%, 82% 52%,
        88% 46%, 94% 54%, 100% 48%,
        100% 100%
    );
    opacity: 0.4;
    filter: blur(0.6px);
    transform: translateY(var(--mountain-front));
}

/* watercolor pigment pools */
.watercolor-pools {
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.55;
}

.pool {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: pool-drift 22s ease-in-out infinite;
}

.pool--1 { left: 10%; bottom: 22%; width: 320px; height: 240px;
    background: radial-gradient(circle, rgba(58, 74, 92, 0.55), transparent 70%);
    animation-delay: 0s; }
.pool--2 { left: 55%; bottom: 38%; width: 260px; height: 200px;
    background: radial-gradient(circle, rgba(30, 42, 58, 0.6), transparent 70%);
    animation-delay: -7s; }
.pool--3 { left: 78%; bottom: 12%; width: 380px; height: 280px;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.18), transparent 70%);
    animation-delay: -14s; }
.pool--4 { left: 30%; bottom: 8%; width: 340px; height: 220px;
    background: radial-gradient(circle, rgba(58, 74, 92, 0.4), transparent 70%);
    animation-delay: -3s; }

@keyframes pool-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.08); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* SVG noise grain */
.grain-overlay {
    position: absolute;
    inset: -2%;
    pointer-events: none;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.18 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    opacity: 0.55;
    mix-blend-mode: overlay;
    animation: grain-shift 1.6s steps(6) infinite;
}

@keyframes grain-shift {
    0%   { transform: translate(0, 0); }
    16%  { transform: translate(-3%, 2%); }
    32%  { transform: translate(2%, -2%); }
    48%  { transform: translate(-2%, -3%); }
    64%  { transform: translate(3%, 1%); }
    80%  { transform: translate(-1%, 3%); }
    100% { transform: translate(0, 0); }
}

/* data-corruption blocks */
.data-corruption {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.corruption-block {
    position: absolute;
    left: var(--cx);
    top: var(--cy);
    width: var(--cw);
    height: var(--ch);
    background: var(--signal-green);
    opacity: 0;
    animation: glitch-block 8s steps(1) infinite;
    animation-delay: var(--cd);
    mix-blend-mode: screen;
}

@keyframes glitch-block {
    0%, 100% { opacity: 0; transform: translate(0); }
    50%  { opacity: 0; }
    51%  { opacity: 0.12; transform: translate(2px, 0); }
    52%  { opacity: 0; }
    62%  { opacity: 0.08; transform: translate(-3px, 1px); }
    63%  { opacity: 0; }
    73%  { opacity: 0.14; transform: translate(1px, -1px); }
    74%  { opacity: 0; }
}

/* ============== CRT scan lines ============== */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 80;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    mix-blend-mode: multiply;
}

/* RGB haze */
.rgb-haze {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 81;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 0, 102, 0.04), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(0, 180, 216, 0.04), transparent 40%);
    mix-blend-mode: screen;
}

/* ============== Economic grid container ============== */
.economic-grid {
    position: relative;
    z-index: 1;
}

/* ============== Phase = a viewport screen ============== */
.phase {
    position: relative;
    min-height: 100vh;
    padding: 6vh 6vw 8vh;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(80px, auto);
    gap: 2px;
    transition:
        grid-template-columns 0.8s var(--easing),
        grid-template-rows 0.8s var(--easing);
}

@media (min-height: 900px) {
    .phase {
        grid-template-rows: 45vh 30vh 25vh;
    }
}

.phase-meta {
    position: absolute;
    top: 2.6vh;
    left: 6vw;
    right: 6vw;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: "Recursive", "Inter", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 500;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(0, 255, 136, 0.55);
    z-index: 2;
}

.phase-meta__tag {
    color: var(--neon-amber);
    opacity: 0.7;
}

/* ============== Cells ============== */
.cell {
    position: relative;
    background: rgba(20, 20, 25, 0.45);
    border: 1px solid rgba(0, 255, 136, 0.15);
    padding: clamp(1rem, 2vw, 2rem);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition:
        opacity 0.6s var(--easing),
        transform 0.6s var(--easing),
        background 0.6s var(--easing),
        border-color 0.6s var(--easing);
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    overflow: hidden;
    animation:
        cell-enter 0.9s var(--easing) both var(--cell-delay, 0s),
        border-pulse 4s ease-in-out infinite,
        border-glitch 11s steps(1) infinite;
}

.phase[data-phase="premarket"] .cell { animation-delay: var(--cell-delay, 0s), 0s, 0s; }

@keyframes cell-enter {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes border-pulse {
    0%, 100% { border-color: rgba(0, 255, 136, 0.15); box-shadow: inset 0 0 0 0 rgba(0, 255, 136, 0); }
    50%      { border-color: rgba(0, 255, 136, 0.4);  box-shadow: inset 0 0 18px -8px rgba(0, 255, 136, 0.5); }
}

@keyframes border-glitch {
    0%, 92%, 100% { transform: translate(0); }
    93% { transform: translate(2px, 0); }
    94% { transform: translate(-3px, 1px); }
    95% { transform: translate(1px, -2px); }
    96% { transform: translate(0); }
}

/* hover RGB split */
.cell:hover {
    border-color: rgba(0, 255, 136, 0.55);
    background: rgba(20, 20, 25, 0.7);
}

.cell:hover .glitch-text,
.cell:hover .fragment-num,
.cell:hover .quote-text,
.cell:hover h1,
.cell:hover h2 {
    text-shadow:
        -2px 0 var(--corrupt-magenta),
        2px 0 var(--residual-teal);
    transition: text-shadow 0.15s ease-in;
}

/* Cell stagger animation delays per cell */
.cell { animation-delay: var(--cell-delay, 0s), calc(var(--cell-delay, 0s) * 1.5), 0s; }

/* ============== Phase 1 — pre-market layout ============== */
.phase--premarket {
    grid-template-rows: minmax(200px, 50vh) minmax(120px, 25vh) minmax(120px, 25vh);
}
.phase--premarket .cell--hero      { grid-column: 1 / span 9;  grid-row: 1; }
.phase--premarket .cell--time      { grid-column: 10 / span 3; grid-row: 1; }
.phase--premarket .cell--fragment  { grid-column: 1 / span 4;  grid-row: 2; }
.phase--premarket .cell--quote     { grid-column: 5 / span 8;  grid-row: 2; }
.phase--premarket .cell--ticker    { grid-column: 1 / span 12; grid-row: 3; }

/* ============== Phase 2 — open layout (denser) ============== */
.phase--open {
    grid-template-rows: minmax(180px, 40vh) minmax(140px, 30vh) minmax(120px, 24vh);
}
.phase--open .cell--headline { grid-column: 1 / span 8;  grid-row: 1; }
.phase--open .cell--time     { grid-column: 9 / span 4;  grid-row: 1; }
.phase--open .cell--fragment { grid-column: span 3; grid-row: 2; }
.phase--open .cell--fragment:nth-of-type(3) { grid-column: 1 / span 3; }
.phase--open .cell--fragment.cell--magenta  { grid-column: 4 / span 3; }
.phase--open .cell--chart    { grid-column: 7 / span 6;  grid-row: 2; }
.phase--open .cell--quote    { grid-column: 1 / span 7;  grid-row: 3; }
.phase--open .cell--feed     { grid-column: 8 / span 5;  grid-row: 3; }

/* ============== Phase 3 — midday (max density) ============== */
.phase--midday {
    grid-template-rows: minmax(160px, 32vh) minmax(140px, 28vh) minmax(140px, 28vh) minmax(100px, 18vh);
}
.phase--midday .cell--headline { grid-column: 1 / span 12; grid-row: 1; }

.phase--midday .cell--fragment:nth-of-type(3) { grid-column: 1 / span 3;  grid-row: 2; }
.phase--midday .cell--fragment:nth-of-type(4) { grid-column: 4 / span 3;  grid-row: 2; }
.phase--midday .cell--fragment:nth-of-type(5) { grid-column: 7 / span 3;  grid-row: 2; }
.phase--midday .cell--fragment:nth-of-type(6) { grid-column: 10 / span 3; grid-row: 2; }

.phase--midday .cell--chart  { grid-column: 1 / span 4;  grid-row: 3 / span 2; }
.phase--midday .cell--quote  { grid-column: 5 / span 5;  grid-row: 3; }
.phase--midday .cell--feed   { grid-column: 10 / span 3; grid-row: 3 / span 2; }
.phase--midday .cell--scrambled { grid-column: 5 / span 5; grid-row: 4; }
.phase--midday .cell--time   { grid-column: 1 / span 12; grid-row: 4; opacity: 0; pointer-events: none; }

@media (max-width: 900px) {
    .phase { padding: 8vh 5vw 8vh; }
    .phase--premarket .cell--hero,
    .phase--premarket .cell--time,
    .phase--premarket .cell--fragment,
    .phase--premarket .cell--quote,
    .phase--premarket .cell--ticker,
    .phase--open .cell,
    .phase--midday .cell,
    .phase--afterhours .cell {
        grid-column: 1 / span 12 !important;
        grid-row: auto !important;
    }
    .phase--midday .cell--time { display: none; }
}

/* ============== Phase 4 — after hours (dissolving) ============== */
.phase--afterhours {
    grid-template-rows: minmax(180px, 40vh) minmax(140px, 30vh) minmax(140px, 30vh);
    background:
        radial-gradient(ellipse at 50% 80%, rgba(58, 74, 92, 0.18), transparent 70%),
        linear-gradient(to bottom, transparent 0%, rgba(10, 10, 15, 0.4) 100%);
}
.phase--afterhours .cell--final     { grid-column: 2 / span 10; grid-row: 1; align-self: end; border-color: rgba(0, 255, 136, 0.05); background: transparent; }
.phase--afterhours .cell--residual  { grid-column: 2 / span 10; grid-row: 2; border-color: rgba(0, 255, 136, 0.04); background: transparent; }
.phase--afterhours .cell--epigraph  { grid-column: 3 / span 8;  grid-row: 3; border-color: rgba(0, 255, 136, 0.03); background: transparent; }
.phase--afterhours .cell--time      { grid-column: 1 / span 12; grid-row: 3; align-self: end; justify-self: end; border-color: transparent; background: transparent; }

.phase--afterhours .cell {
    animation: cell-enter 1.2s var(--easing) both var(--cell-delay, 0s);
}

/* ============== Hero / headlines ============== */
.cell--hero { display: flex; flex-direction: column; justify-content: center; gap: 1.2rem; }
.cell--headline { display: flex; flex-direction: column; justify-content: center; gap: 0.8rem; }
.cell--final { display: flex; flex-direction: column; justify-content: flex-end; gap: 0.8rem; }

h1.glitch-text {
    font-family: "Recursive", "Inter", sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 0.95;
    color: var(--fog-white);
    font-variation-settings: 'MONO' 0, 'CASL' 0.5, 'wght' 800, 'slnt' 0, 'CRSV' 0;
    letter-spacing: -0.02em;
    position: relative;
    transition: font-variation-settings 1.4s var(--easing);
}

h2.glitch-text {
    font-family: "Recursive", "Inter", sans-serif;
    font-size: clamp(1.8rem, 4.5vw, 3.6rem);
    line-height: 1;
    color: var(--fog-white);
    font-variation-settings: 'MONO' 0, 'CASL' 0.4, 'wght' 700, 'slnt' 0, 'CRSV' 0;
    letter-spacing: -0.015em;
    position: relative;
    transition: font-variation-settings 1.4s var(--easing);
}

/* CASL morph driven by phase */
.phase--premarket h1.glitch-text,
.phase--premarket h2.glitch-text { font-variation-settings: 'MONO' 0, 'CASL' 0,    'wght' 700, 'slnt' 0, 'CRSV' 0; }
.phase--open h2.glitch-text     { font-variation-settings: 'MONO' 0, 'CASL' 0.35, 'wght' 800, 'slnt' -2, 'CRSV' 0; }
.phase--midday h2.glitch-text   { font-variation-settings: 'MONO' 0.3, 'CASL' 0.8, 'wght' 900, 'slnt' -6, 'CRSV' 0.4; }
.phase--afterhours h2.glitch-text { font-variation-settings: 'MONO' 0, 'CASL' 0.2, 'wght' 500, 'slnt' 0, 'CRSV' 0; opacity: 0.85; }

/* glitch shake (shake-error pattern) */
.glitch-text {
    animation: glitch-shake 8s steps(1) infinite;
}

.glitch-text--intense { animation: glitch-shake 5s steps(1) infinite; }
.glitch-text--soft    { animation: glitch-shake 14s steps(1) infinite; opacity: 0.92; }

@keyframes glitch-shake {
    0%, 92% { transform: translate(0); clip-path: inset(0 0 0 0); }
    93% { transform: translate(-2px, 1px); clip-path: inset(20% 0 60% 0); }
    94% { transform: translate(3px, -1px); clip-path: inset(50% 0 20% 0); }
    95% { transform: translate(-1px, 2px); clip-path: inset(10% 0 70% 0); }
    96%, 100% { transform: translate(0); clip-path: inset(0 0 0 0); }
}

/* RGB ghost layers via data-text */
.glitch-text {
    --ghost-magenta: var(--corrupt-magenta);
    --ghost-cyan: var(--residual-teal);
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
    color: inherit;
    mix-blend-mode: screen;
}

.glitch-text::before {
    color: var(--ghost-magenta);
    animation: ghost-shift-a 6s steps(1) infinite;
}
.glitch-text::after {
    color: var(--ghost-cyan);
    animation: ghost-shift-b 6s steps(1) infinite;
}

@keyframes ghost-shift-a {
    0%, 95%, 100% { opacity: 0; transform: translate(0); }
    96% { opacity: 0.7; transform: translate(-2px, 0); }
    97% { opacity: 0; }
    98% { opacity: 0.5; transform: translate(-3px, 1px); }
    99% { opacity: 0; }
}
@keyframes ghost-shift-b {
    0%, 95%, 100% { opacity: 0; transform: translate(0); }
    96% { opacity: 0.7; transform: translate(2px, 0); }
    97% { opacity: 0; }
    98% { opacity: 0.5; transform: translate(3px, -1px); }
    99% { opacity: 0; }
}

.subtext {
    font-family: "Inter", sans-serif;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    color: var(--soft-fog);
    opacity: 0.72;
    max-width: 56ch;
    font-weight: 300;
}

.hero-fragments {
    display: flex;
    gap: 1.6rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.fragment {
    font-family: "Recursive", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 400;
    font-size: 0.8rem;
    color: rgba(0, 255, 136, 0.55);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ============== Fragments / numbers ============== */
.cell--fragment {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, rgba(20, 20, 25, 0.6), rgba(20, 20, 25, 0.3));
}

.fragment-num {
    font-family: "Recursive", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 500;
    font-size: clamp(1.4rem, 2.6vw, 2.4rem);
    color: rgba(0, 255, 136, 0.85);
    letter-spacing: 0.04em;
    line-height: 1;
    animation: shake-error 9s steps(1) infinite;
}

.cell--magenta .fragment-num { color: rgba(255, 0, 102, 0.85); }
.cell--amber   .fragment-num { color: rgba(255, 170, 0, 0.85); }

.fragment-label {
    font-family: "Recursive", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 400;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--soft-fog);
    opacity: 0.5;
}

.dim { opacity: 0.45; }

@keyframes shake-error {
    0%, 92% { transform: translateX(0); }
    93% { transform: translateX(-2px); }
    94% { transform: translateX(2px); }
    95% { transform: translateX(-1px); }
    96%, 100% { transform: translateX(0); }
}

/* ============== Quote cells ============== */
.cell--quote, .cell--epigraph {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
}

.quote-text {
    font-family: "Recursive", "Inter", sans-serif;
    font-variation-settings: 'MONO' 0, 'CASL' 0.7, 'wght' 400, 'slnt' -3;
    font-size: clamp(1rem, 1.6vw, 1.4rem);
    line-height: 1.45;
    color: var(--fog-white);
    opacity: 0.88;
    max-width: 60ch;
}

.quote-text--soft {
    opacity: 0.6;
    font-variation-settings: 'MONO' 0, 'CASL' 0.3, 'wght' 300, 'slnt' 0;
}

.quote-attr {
    font-family: "Recursive", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 400;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(0, 255, 136, 0.5);
}

/* ============== Ticker cell ============== */
.cell--ticker {
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: center;
}

.ticker {
    display: flex;
    gap: 4rem;
    width: max-content;
    padding: 0 2rem;
    animation: ticker-scroll 38s linear infinite;
    font-family: "Recursive", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 500;
    color: rgba(0, 255, 136, 0.78);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
}

.ticker-row em {
    font-style: normal;
    color: var(--soft-fog);
    opacity: 0.4;
    margin: 0 0.4em;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* duplicate the ticker content via JS for seamless loop */

/* ============== Time cells ============== */
.cell--time {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.4rem;
}

.big-time {
    font-family: "Recursive", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 300;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 1;
    color: var(--fog-white);
    letter-spacing: 0.02em;
}

.big-time--soft { opacity: 0.4; font-weight: 200; }

.blink {
    color: var(--signal-green);
    animation: blink 1.6s steps(2) infinite;
}

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

.time-zone {
    font-family: "Recursive", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 400;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(224, 232, 228, 0.45);
}

/* ============== Charts ============== */
.cell--chart {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.6rem;
    color: var(--signal-green);
    padding: clamp(1rem, 1.6vw, 1.4rem);
}

.line-chart, .bars-chart {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 70px;
}

.bars-chart .bars rect {
    fill: var(--signal-green);
    opacity: 0.7;
}

.bars-chart .bars rect:nth-child(odd)   { fill: var(--corrupt-magenta); opacity: 0.55; }
.bars-chart .bars rect:nth-child(3n)    { fill: var(--neon-amber);     opacity: 0.6; }

.chart-label {
    font-family: "Recursive", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 400;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(0, 255, 136, 0.55);
}

/* ============== Feed cells ============== */
.cell--feed {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
    font-family: "Recursive", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 400;
    font-size: 0.85rem;
}

.feed-line {
    color: rgba(224, 232, 228, 0.7);
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.feed-line em { font-style: normal; }
.feed-line .green   { color: var(--signal-green); }
.feed-line .magenta { color: var(--corrupt-magenta); }
.feed-line .amber   { color: var(--neon-amber); }

.cell--feed.cell--dense { gap: 0.4rem; font-size: 0.78rem; }

/* ============== Scrambled / residual ============== */
.cell--scrambled {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: "Recursive", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 500;
    font-size: clamp(0.9rem, 1.4vw, 1.2rem);
    color: rgba(0, 255, 136, 0.75);
    letter-spacing: 0.06em;
}

.scramble {
    display: inline-block;
    min-width: 10ch;
    text-align: center;
}

.cell--residual {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 2rem;
    flex-wrap: wrap;
}

.residual-num {
    font-family: "Recursive", monospace;
    font-variation-settings: 'MONO' 1, 'CASL' 0, 'wght' 400;
    font-size: clamp(0.85rem, 1.3vw, 1.1rem);
    color: rgba(224, 232, 228, 0.55);
    letter-spacing: 0.06em;
}

.residual-num--green { color: rgba(0, 255, 136, 0.6); }

/* ============== Phase active state — intensify glitch in midday ============== */
.phase--active.phase--midday h2.glitch-text { animation-duration: 4s; }
.phase--active.phase--midday .cell { border-color: rgba(0, 255, 136, 0.28); }
.phase--active.phase--midday .fragment-num { animation-duration: 5s; }

.phase--active.phase--afterhours .cell {
    background: transparent;
    border-color: rgba(0, 255, 136, 0.04);
}

/* ============== Reduced motion ============== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
    .ticker { animation: none !important; }
    .mountains { transform: none !important; }
    .grain-overlay { opacity: 0.3; }
}
