/* CSS Variables */
:root {
    --color-frame-1: #000000;
    --color-frame-2: #0f1419;
    --color-frame-3: #1a2f4a;
    --color-frame-4: #2d3e47;
    --color-frame-5: #1a1a2e;
    --color-frame-6: #2c1a3e;
    --color-frame-7: #1a2e2e;
    --color-frame-8: #3e1a1a;
    --color-frame-9: #000000;

    --text-color: #ffffff;
    --text-muted: #cccccc;

    --font-family: Georgia, serif;
    --font-size-base: 16px;
    --font-size-title-large: 3.5rem;
    --font-size-title: 2.5rem;
    --font-size-takeaway: 1.25rem;
    --font-size-number: 2rem;

    --spacing-large: 3rem;
    --transition-smooth: all 0.6s ease-out;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    line-height: 1.6;
    font-size: var(--font-size-base);
    background: #000;
}

/* Main Layout */
main {
    width: 100%;
    overflow-x: hidden;
}

/* Progress Indicator */
.progress-indicator {
    position: fixed;
    top: 2rem;
    right: 2rem;
    font-size: 1.125rem;
    color: var(--text-muted);
    z-index: 999;
    font-weight: 300;
    letter-spacing: 0.05em;
}

#current-frame {
    color: var(--text-color);
    font-weight: 500;
}

/* Frame Base Styles */
.frame {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-large);
    position: relative;
    overflow: hidden;
}

.frame-content {
    text-align: center;
    max-width: 80%;
    opacity: 1;
    transform: none;
    animation: softFadeUp 600ms ease-out both;
}

@keyframes softFadeUp {
    from {
        opacity: 0.2;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.frame[data-frame="1"] .frame-content { animation-delay: 0ms; }
.frame[data-frame="2"] .frame-content { animation-delay: 40ms; }
.frame[data-frame="3"] .frame-content { animation-delay: 80ms; }
.frame[data-frame="4"] .frame-content { animation-delay: 120ms; }
.frame[data-frame="5"] .frame-content { animation-delay: 160ms; }
.frame[data-frame="6"] .frame-content { animation-delay: 200ms; }
.frame[data-frame="7"] .frame-content { animation-delay: 240ms; }
.frame[data-frame="8"] .frame-content { animation-delay: 280ms; }
.frame[data-frame="9"] .frame-content { animation-delay: 320ms; }

/* Individual Frame Background Colors */
.frame-1 {
    background-color: var(--color-frame-1);
}

.frame-2 {
    background-color: var(--color-frame-2);
}

.frame-3 {
    background-color: var(--color-frame-3);
}

.frame-4 {
    background-color: var(--color-frame-4);
}

.frame-5 {
    background-color: var(--color-frame-5);
}

.frame-6 {
    background-color: var(--color-frame-6);
}

.frame-7 {
    background-color: var(--color-frame-7);
}

.frame-8 {
    background-color: var(--color-frame-8);
}

.frame-9 {
    background-color: var(--color-frame-9);
}

/* Frame Content Elements */
.frame-number {
    font-size: var(--font-size-number);
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 300;
    letter-spacing: 0.1em;
}

.frame-title {
    font-size: var(--font-size-title);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

.frame-1 .frame-title,
.frame-9 .frame-title {
    font-size: var(--font-size-title-large);
}

.frame-takeaway {
    font-size: var(--font-size-takeaway);
    color: var(--text-muted);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ===================================================================
   Frame 1 — "The Reframe" (Opening)
   Asymmetric weighted contrast: the discarded idea recedes while the
   new idea dominates, so the type hierarchy performs the argument.
   Fail-safe: all text rests at opacity 1; animation only enhances it.
   =================================================================== */

/* Left-aligned editorial column — overrides the global centered content.
   The shared .frame-content fade is disabled here so the only motion is
   the inner-block stagger below (one animation concept, no layering). */
.frame-1 .frame-content {
    text-align: left;
    max-width: min(90%, 60rem);
    animation: none;
}

.frame-1 .frame-title {
    margin-bottom: 0;
}

/* Discarded idea — small, dim, receding */
.frame-1 .reframe-discard {
    display: block;
    font-size: clamp(1.05rem, 2.4vw, 1.45rem);
    line-height: 1.5;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: clamp(1.75rem, 4vw, 3rem);
    opacity: 1; /* fail-safe resting state */
    animation: softFadeUp 850ms ease-out both;
}

/* New idea — large, bright, dominant */
.frame-1 .reframe-keep {
    display: block;
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--text-color);
    opacity: 1; /* fail-safe resting state */
    /* 220ms delay lifts the dominant block just after the discarded line */
    animation: softFadeUp 850ms ease-out 220ms both;
}

/* Gold accent — marks the pivot, on the verbs only */
.frame-1 .reframe-verb {
    color: #f5c518;
}

/* ===================================================================
   Frame 2 — "The New Reality" (The Stream)
   A single accumulating column of short fragments. The shift from
   Frame 1: air -> compression, two calm blocks -> many tight lines.
   Hierarchy: title size, then color-alpha tiers fading down the stream.
   Motion (one idea): a staggered top-down fade-in, so the column reads
   as if it is still filling. Fail-safe: dimming uses color alpha, never
   opacity, so every line stays visible/readable without any animation.
   =================================================================== */

/* Narrow, left-aligned column — a feed, not Frame 1's wide editorial
   column. The shared .frame-content fade is disabled; the only motion
   is the per-element stagger defined below (one animation concept). */
.frame-2 .frame-content {
    animation: none;
    text-align: left;
    max-width: min(92%, 26rem);
}

/* "02" — small and quiet; sets the column's left edge.
   Joins the cascade first (no delay). */
.frame-2 .frame-number {
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.18em;
    margin-bottom: 0.6rem;
    opacity: 1; /* fail-safe resting state */
    animation: softFadeUp 600ms ease-out 0ms both;
}

/* Title still carries weight, but sits tighter to its content than
   Frame 1 — the compression starts here. */
.frame-2 .frame-title {
    font-size: clamp(1.9rem, 6vw, 2.6rem);
    margin-bottom: 1.4rem;
    opacity: 1; /* fail-safe resting state */
    animation: softFadeUp 600ms ease-out 80ms both;
}

/* The stream — stacked fragments with compressed but intentional
   spacing. No bullets: order and rhythm carry the meaning. */
.frame-2 .stream {
    display: flex;
    flex-direction: column;
}

.frame-2 .stream-line {
    font-size: 1.05rem;
    line-height: 1.34;
    margin: 0.14rem 0;
    color: rgba(255, 255, 255, 0.9);
    opacity: 1; /* fail-safe resting state — visible with or without motion */
    animation: softFadeUp 600ms ease-out both;
}

/* The numbers carry a gold "beat", tying back to Frame 1's accent. */
.frame-2 .count {
    color: #f5c518;
}

/* Dimming tiers — the stream fades downward, implying it never ends.
   Driven by color alpha (not opacity) so motion never owns visibility. */
.frame-2 .stream-line-dim-1 { color: rgba(255, 255, 255, 0.68); }
.frame-2 .stream-line-dim-2 { color: rgba(255, 255, 255, 0.5); }
.frame-2 .stream-line-dim-3 { color: rgba(255, 255, 255, 0.4); }

/* Closing punch — brightest line, set apart by a hairline rule.
   Reuses the existing .frame-takeaway element/role. */
.frame-2 .stream-close {
    font-size: 1.35rem;
    line-height: 1.4;
    color: var(--text-color);
    text-align: left;
    max-width: none;
    margin: 1.15rem 0 0;
    padding-top: 1.05rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 1; /* fail-safe resting state */
    animation: softFadeUp 600ms ease-out 970ms both;
}

/* Staggered accumulation — ~80ms steps make the column feel like it is
   still filling as the eye runs down it. This is the one motion idea. */
.frame-2 .stream-line:nth-child(1)  { animation-delay: 170ms; }
.frame-2 .stream-line:nth-child(2)  { animation-delay: 250ms; }
.frame-2 .stream-line:nth-child(3)  { animation-delay: 330ms; }
.frame-2 .stream-line:nth-child(4)  { animation-delay: 410ms; }
.frame-2 .stream-line:nth-child(5)  { animation-delay: 490ms; }
.frame-2 .stream-line:nth-child(6)  { animation-delay: 570ms; }
.frame-2 .stream-line:nth-child(7)  { animation-delay: 650ms; }
.frame-2 .stream-line:nth-child(8)  { animation-delay: 730ms; }
.frame-2 .stream-line:nth-child(9)  { animation-delay: 810ms; }
.frame-2 .stream-line:nth-child(10) { animation-delay: 890ms; }

/* ===================================================================
   Frame 3 — "The Structural Shift" (Compression Stack)
   Frame 2's single dimming stream resolves into structure: two named
   zones stacked old -> new. The "Losing value" cluster is small, dim
   and tightly compressed; the "Gaining value" block is large, bright
   and open. The density jump *is* the argument — compression shown,
   not explained. Hierarchy: scale + whitespace + color alpha.
   Motion (one idea): a single reveal of the dominant (new) zone.
   Fail-safe: every line rests at opacity 1; dimming uses color alpha,
   never opacity, so all text is readable with or without motion/JS.
   =================================================================== */

/* Left-aligned column — wider than Frame 2's feed so the new zone can
   breathe. The shared .frame-content fade is disabled; the only motion
   is the new-zone reveal defined below (one animation concept). */
.frame-3 .frame-content {
    animation: none;
    text-align: left;
    max-width: min(92%, 34rem);
}

/* "03" — small and quiet, matching Frame 2's frame-number. */
.frame-3 .frame-number {
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.18em;
    margin-bottom: 0.6rem;
}

/* Title — weighted, sits tight to the zones below. */
.frame-3 .frame-title {
    font-size: clamp(1.9rem, 6vw, 2.6rem);
    margin-bottom: 1.6rem;
}

/* Shared zone label — small, wide-tracked, uppercase. */
.frame-3 .shift-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    margin-bottom: 0.5rem;
}

/* --- Losing value: the compressed zone ---------------------------- */
.frame-3 .shift-old {
    margin-bottom: 1.4rem;
}

.frame-3 .shift-label-old {
    color: rgba(255, 255, 255, 0.4);
}

/* Old terms — small, low-alpha, lines almost touching: the cluster
   reads as physically squeezed. Dimming via color alpha (fail-safe). */
.frame-3 .shift-term-old {
    font-size: 1rem;
    line-height: 1.12;
    letter-spacing: -0.005em;
    color: rgba(255, 255, 255, 0.38);
    margin: 0.04rem 0;
}

/* --- The structural break ----------------------------------------- */
/* A hairline pivot. The short gold segment marks where value moves —
   the gold accent ties back to Frames 1 and 2. */
.frame-3 .shift-break {
    position: relative;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 0 1.4rem;
}

.frame-3 .shift-break::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2.5rem;
    height: 1px;
    background: #f5c518;
}

/* --- Gaining value: the dominant zone ----------------------------- */
/* Large, bright, open. This is the one block that animates.
   Fail-safe: rests at opacity 1; softFadeUp only enhances the reveal. */
.frame-3 .shift-new {
    opacity: 1;
    animation: softFadeUp 700ms ease-out 160ms both;
}

.frame-3 .shift-label-new {
    color: #f5c518;
}

/* New terms — large, bright, generously spaced. Scale + whitespace
   carry the priority; the lead term is biggest, so the eye lands there. */
.frame-3 .shift-term-new {
    font-size: clamp(1.5rem, 4.6vw, 2.15rem);
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--text-color);
    margin: 0.5rem 0;
}

.frame-3 .shift-term-lead {
    font-size: clamp(1.85rem, 6vw, 2.85rem);
}

/* Takeaway — closing structural conclusion, left-aligned to the column
   and set apart by a hairline rule (echoes Frame 2's stream-close). */
.frame-3 .frame-takeaway {
    text-align: left;
    max-width: none;
    margin: 1.6rem 0 0;
    padding-top: 1.05rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    :root {
        --font-size-title-large: 2.5rem;
        --font-size-title: 2rem;
        --font-size-takeaway: 1.125rem;
        --font-size-number: 1.75rem;
        --spacing-large: 2rem;
    }

    .progress-indicator {
        top: 1.5rem;
        right: 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    :root {
        --font-size-title-large: 2rem;
        --font-size-title: 1.75rem;
        --font-size-takeaway: 1rem;
        --font-size-number: 1.5rem;
        --spacing-large: 1.5rem;
    }

    .frame {
        padding: var(--spacing-large);
    }

    .frame-content {
        max-width: 95%;
    }

    .progress-indicator {
        top: 1rem;
        right: 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-title-large: 1.5rem;
        --font-size-title: 1.375rem;
        --font-size-takeaway: 0.9375rem;
        --font-size-number: 1.25rem;
        --spacing-large: 1rem;
    }

    .frame {
        padding: var(--spacing-large);
    }

    .frame-content {
        max-width: 100%;
    }

    .progress-indicator {
        top: 0.75rem;
        right: 0.75rem;
        font-size: 0.75rem;
    }

    .frame-title {
        margin-bottom: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .frame-content {
        animation: none;
        opacity: 1;
        transform: none;
    }

    /* Frame 1 staggered blocks — drop motion, keep full visibility */
    .frame-1 .reframe-discard,
    .frame-1 .reframe-keep {
        animation: none;
        opacity: 1;
        transform: none;
    }

    /* Frame 2 stream cascade — drop motion, keep full visibility.
       Dimming is color alpha, so the designed hierarchy still holds. */
    .frame-2 .frame-number,
    .frame-2 .frame-title,
    .frame-2 .stream-line,
    .frame-2 .stream-close {
        animation: none;
        opacity: 1;
        transform: none;
    }

    /* Frame 3 new-zone reveal — drop motion, keep full visibility.
       The compression hierarchy is static (scale/alpha), so it holds. */
    .frame-3 .shift-new {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
