/* ═══════════════════════════════════════════════════════════
   DEMO PAGE — Lenis × GSAP Integration Patterns
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --c-bg:       #fff;
    --c-surface:  #f1f1f1;
    --c-border:   rgba(255,255,255,0.07);
    --c-text:     #000;
    --c-muted:    rgba(242,242,242,0.42);
    --c-accent-a: #ff5c35;   /* orange */
    --c-accent-b: #6b35ff;   /* purple */
    --c-accent-c: #35ffb0;   /* mint */
    --c-accent-d: #ffb535;   /* gold */
    --f-sans:  'Space Grotesk', system-ui, sans-serif;
    --f-serif: 'Instrument Serif', Georgia, serif;
    --radius:  1.25rem;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; }

body {
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--f-sans);
    line-height: 1.65;
    overflow-x: hidden;
    /* cursor: none; /**/
}

a { color: inherit; text-decoration: none; }
button { background: none; border: none; font: inherit; color: inherit; cursor: none; }
code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82em;
    color: var(--c-accent-c);
    background: rgba(53,255,176,0.08);
    padding: 0.1em 0.45em;
    border-radius: 0.3em;
}

/* ── Custom Cursor ─────────────────────────────────────────── */
.demo-cursor {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}
.demo-cursor__dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
}
.demo-cursor__ring {
    position: absolute;
    width: 38px;
    height: 38px;
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
    transition: border-color 0.3s;
}

/* ── Velocity HUD ──────────────────────────────────────────── */
.velocity-hud {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(10,10,10,0.7);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--c-border);
    border-radius: 2rem;
    padding: 0.45rem 1rem;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.velocity-hud__label { color: var(--c-muted); }
.velocity-bar-wrap {
    width: 50px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}
.velocity-bar {
    height: 100%;
    width: 0;
    background: var(--c-accent-a);
    border-radius: 2px;
    transition: width 0.08s linear;
}
.velocity-value {
    color: #fff;
    font-weight: 600;
    min-width: 2.8rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Demo Nav ──────────────────────────────────────────────── */
.demo-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(8,8,8,0);
    backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent;
    transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
}
.demo-nav.is-scrolled {
    background: rgba(8,8,8,0.8);
    backdrop-filter: blur(20px);
    border-color: var(--c-border);
}
.demo-nav__back {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-muted);
    transition: color 0.2s;
}
.demo-nav__back:hover { color: #fff; }
.demo-nav__title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
}
.demo-nav__tag {
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--c-muted);
    border: 1px solid var(--c-border);
    padding: 0.25rem 0.7rem;
    border-radius: 2rem;
}

/* ── Shared Section Styles ─────────────────────────────────── */
.demo-section {
    position: relative;
    padding: 9rem 0 8rem;
}
.demo-section__badge {
    position: absolute;
    top: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-muted);
    border: 1px solid var(--c-border);
    border-radius: 2rem;
    padding: 0.3rem 0.9rem;
    white-space: nowrap;
    opacity: 0;          /* animated in by JS */
}
.demo-section__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.5rem;
}
.demo-section__inner--centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   01 — HERO
   ═══════════════════════════════════════════════════════════ */
.demo-hero {
    position: relative;
    height: 100svh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Grid background */
.demo-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 30%, transparent 80%);
}

/* Orbs */
.demo-hero__orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.orb-demo {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.2;
    will-change: transform;
}
.orb-demo--a {
    width: 700px; height: 700px;
    background: radial-gradient(circle, var(--c-accent-a) 0%, transparent 65%);
    top: -200px; left: -150px;
}
.orb-demo--b {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--c-accent-b) 0%, transparent 65%);
    bottom: -150px; right: -100px;
}
.orb-demo--c {
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--c-accent-c) 0%, transparent 65%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.1;
}

/* Content */
.demo-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 1rem;
}
.demo-eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-bottom: 2.5rem;
    display: block;
}
.demo-hero__title {
    font-size: clamp(5rem, 15vw, 13rem);
    font-weight: 700;
    line-height: 0.88;
    letter-spacing: -0.045em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.12em;
    margin-bottom: 2rem;
}
.demo-hero__sep {
    font-size: 0.48em;
    color: var(--c-accent-a);
    font-style: italic;
    opacity: 0.75;
    display: inline-block;
}
.demo-hero__sub {
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: var(--c-muted);
    letter-spacing: 0.04em;
    margin-bottom: 5rem;
}
.demo-hero__scroll-cue {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-muted);
}
.demo-hero__scroll-line {
    width: 1px;
    height: 56px;
    background: linear-gradient(to bottom, rgba(242,242,242,0.4), transparent);
    animation: scrollPulse 1.8s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%,100% { opacity: 1; transform: scaleY(1); }
    50%      { opacity: 0.3; transform: scaleY(0.5); }
}

/* Scroll progress bar */
.demo-progress-bar {
    position: fixed;
    bottom: 0; left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--c-accent-a), var(--c-accent-b));
    z-index: 10000;
    transition: width 0.05s linear;
}

/* ═══════════════════════════════════════════════════════════
   02 — FONDATION / SKEW LINES
   ═══════════════════════════════════════════════════════════ */
.demo-foundation {
    background: var(--c-bg);
    border-top: 1px solid var(--c-border);
}
.demo-foundation .demo-section__inner {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 5rem;
    align-items: center;
}
.demo-section__copy h2 {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}
.demo-section__copy h2 em {
    font-family: var(--f-serif);
    font-style: italic;
    color: var(--c-accent-a);
}
.demo-section__copy p {
    color: var(--c-muted);
    line-height: 1.8;
    margin-bottom: 2rem;
    font-size: 0.97rem;
}
.demo-section__copy strong { color: var(--c-text); }

.demo-code {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--c-border);
    border-radius: 0.75rem;
    padding: 1.2rem 1.5rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--c-accent-c);
    line-height: 2;
    white-space: pre;
    overflow-x: auto;
}

/* Skew lines */
.skew-lines {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}
.skew-line {
    overflow: hidden;
    border-bottom: 1px solid var(--c-border);
}
.skew-line__inner {
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(242,242,242,0.18);
    padding: 0.55rem 0;
    white-space: nowrap;
    transform-origin: left center;
    will-change: transform;
}
.skew-line:nth-child(3n+1) .skew-line__inner { color: rgba(242,242,242,0.12); }
.skew-line:nth-child(3n+2) .skew-line__inner { color: rgba(242,242,242,0.22); }
.skew-line:nth-child(3n+3) .skew-line__inner { color: rgba(255,92,53,0.25); }

/* ═══════════════════════════════════════════════════════════
   03 — HORIZONTAL SCROLL
   ═══════════════════════════════════════════════════════════ */
.demo-horizontal {
    padding: 0;
    background: var(--c-bg);
}
.demo-horizontal .demo-section__badge {
    top: 1.5rem;
    z-index: 100;
}
.demo-h-container {
    width: 100%;
    overflow: hidden;
    height: 100svh;
    position: relative;
}
.demo-h-track {
    display: flex;
    height: 100%;
    will-change: transform;
}
.demo-h-panel {
    flex: 0 0 100vw;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--c-border);
}

/* Panel backgrounds */
.demo-h-panel--1 { background: linear-gradient(145deg, #0e0a06 0%, #1e0d00 100%); }
.demo-h-panel--2 { background: linear-gradient(145deg, #06080e 0%, #000a1e 100%); }
.demo-h-panel--3 { background: linear-gradient(145deg, #08060e 0%, #0d0020 100%); }
.demo-h-panel--4 { background: linear-gradient(145deg, #0e0d06 0%, #1a1600 100%); }

/* Large ghost word */
.demo-h-panel__bg-word {
    position: absolute;
    font-size: clamp(8rem, 20vw, 18rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    opacity: 0.04;
    user-select: none;
    pointer-events: none;
    right: -0.1em;
    bottom: -0.1em;
    line-height: 1;
}
.demo-h-panel--1 .demo-h-panel__bg-word { color: var(--c-accent-a); }
.demo-h-panel--2 .demo-h-panel__bg-word { color: #356bff; }
.demo-h-panel--3 .demo-h-panel__bg-word { color: var(--c-accent-b); }
.demo-h-panel--4 .demo-h-panel__bg-word { color: var(--c-accent-d); }

.demo-h-panel__content {
    max-width: 480px;
    padding: 3rem 4rem;
    position: relative;
    z-index: 1;
}
.demo-h-panel__num {
    display: block;
    font-size: clamp(4rem, 8vw, 7rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.06em;
    margin-bottom: 1.5rem;
    opacity: 0.15;
}
.demo-h-panel--1 .demo-h-panel__num { color: var(--c-accent-a); opacity: 0.4; }
.demo-h-panel--2 .demo-h-panel__num { color: #356bff; opacity: 0.4; }
.demo-h-panel--3 .demo-h-panel__num { color: var(--c-accent-b); opacity: 0.4; }
.demo-h-panel--4 .demo-h-panel__num { color: var(--c-accent-d); opacity: 0.4; }

.demo-h-panel__content h3 {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.2rem;
}
.demo-h-panel__content p {
    color: var(--c-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}
.demo-h-panel__content em { font-family: var(--f-serif); font-style: italic; }
.demo-h-panel__content code { font-size: 0.8em; }

/* Nav dots */
.demo-h-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}
.demo-h-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: background 0.3s, transform 0.3s;
}
.demo-h-dot.is-active {
    background: #fff;
    transform: scale(1.4);
}

/* ═══════════════════════════════════════════════════════════
   04 — TEXT REVEAL
   ═══════════════════════════════════════════════════════════ */
.demo-text-reveal {
    background: linear-gradient(180deg, var(--c-bg) 0%, #0c0810 50%, var(--c-bg) 100%);
}
.reveal-quote {
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 3rem;
    list-style: none;
}
.reveal-line {
    display: block;
    overflow: hidden;
    margin-bottom: 0.15em;
    padding-bottom: 0.05em;
}
.reveal-line em {
    font-family: var(--f-serif);
    font-style: italic;
    color: var(--c-accent-a);
}
.reveal-line strong {
    font-weight: 900;
    background: linear-gradient(90deg, var(--c-accent-a), var(--c-accent-b));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.reveal-source {
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2);
    display: block;
}

/* ═══════════════════════════════════════════════════════════
   05 — PARALLAX GRID
   ═══════════════════════════════════════════════════════════ */
.demo-parallax {
    overflow: hidden;
    background: var(--c-bg);
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 4rem;
}
.parallax-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 0 1.5rem;
    height: 85vh;
    align-items: start;
    overflow: hidden;
    margin-bottom: 2rem;
}
.parallax-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    will-change: transform;
}
.parallax-item {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 1.2rem;
}
.parallax-item__label {
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Gradient blocks acting as "images" */
.pitem--1 { height: 380px; background: linear-gradient(135deg, #ff5c35 0%, #cc2200 100%); }
.pitem--2 { height: 260px; background: linear-gradient(135deg, #ff35cc 0%, #ff5c35 100%); }
.pitem--3 { height: 320px; background: linear-gradient(135deg, #6b35ff 0%, #356bff 100%); }
.pitem--4 { height: 380px; background: linear-gradient(135deg, #356bff 0%, #35ffb0 100%); }
.pitem--5 { height: 280px; background: linear-gradient(135deg, #35ffb0 0%, #35b0ff 100%); }
.pitem--6 { height: 420px; background: linear-gradient(135deg, #ffb535 0%, #ff5c35 100%); }

.parallax-legend {
    display: flex;
    justify-content: space-around;
    padding: 0 1.5rem;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    color: var(--c-muted);
}
.parallax-legend code { font-size: 0.85em; }

/* ═══════════════════════════════════════════════════════════
   06 — CARD STACK
   ═══════════════════════════════════════════════════════════ */
.demo-cards-section {
    padding-top: 5rem;
    padding-bottom: 0;
    background: var(--c-bg);
}
.demo-stack-wrapper {
    position: relative;
}
.demo-card {
    position: sticky;
    min-height: 72vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    will-change: transform, filter;
}
.demo-card--1 {
    top: 5rem;
    background: linear-gradient(160deg, #1a0a00, #2a1500);
    border: 1px solid rgba(255,92,53,0.18);
    z-index: 1;
}
.demo-card--2 {
    top: calc(5rem + 40px);
    background: linear-gradient(160deg, #08001a, #150035);
    border: 1px solid rgba(107,53,255,0.18);
    z-index: 2;
}
.demo-card--3 {
    top: calc(5rem + 80px);
    background: linear-gradient(160deg, #00140a, #002f1e);
    border: 1px solid rgba(53,255,176,0.18);
    z-index: 3;
}
/* Noise texture overlay */
.demo-card__noise {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
}
.demo-card__inner {
    position: relative;
    z-index: 1;
    max-width: 600px;
    text-align: center;
    padding: 3rem;
}
.demo-card__tag {
    display: inline-block;
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-muted);
    border: 1px solid var(--c-border);
    border-radius: 2rem;
    padding: 0.3rem 0.9rem;
    margin-bottom: 2rem;
}
.demo-card__title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.2rem;
}
.demo-card--1 .demo-card__title { color: var(--c-accent-a); }
.demo-card--2 .demo-card__title { color: var(--c-accent-b); }
.demo-card--3 .demo-card__title { color: var(--c-accent-c); }

.demo-card__body {
    color: var(--c-muted);
    font-size: 1rem;
    line-height: 1.75;
}
.demo-card__body code { font-size: 0.85em; }

.demo-card__corner {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    font-size: 1.4rem;
    opacity: 0.15;
}

/* ═══════════════════════════════════════════════════════════
   07 — VELOCITY MARQUEE
   ═══════════════════════════════════════════════════════════ */
.demo-marquee-section {
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    padding: 8rem 0 6rem;
    overflow: hidden;
}
.demo-marquee-desc {
    text-align: center;
    color: var(--c-muted);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    margin-bottom: 3rem;
}
.vel-marquee {
    overflow: hidden;
    padding: 0.6rem 0;
}
.vel-marquee--bot {
    margin-top: 0.5rem;
}
.vel-marquee__track {
    display: flex;
    width: fit-content;
}
.vel-marquee__content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
}
.vm-item {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    padding: 0 0.8rem;
}
.vm-item--small {
    font-size: clamp(1rem, 2vw, 1.8rem);
    font-weight: 400;
    color: var(--c-muted);
    letter-spacing: 0.02em;
}
.vm-sep {
    color: var(--c-accent-a);
    font-size: 0.5em;
    padding: 0 0.2rem;
    opacity: 0.7;
}
.vm-sep--alt {
    color: var(--c-accent-b);
}

/* ═══════════════════════════════════════════════════════════
   08 — STATS / COUNTERS
   ═══════════════════════════════════════════════════════════ */
.demo-stats {
    background: var(--c-bg);
}
.demo-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 3rem 0;
}
.demo-stat {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.4rem;
    transition: border-color 0.3s, background 0.3s;
    position: relative;
    overflow: hidden;
}
.demo-stat::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,92,53,0.04) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
}
.demo-stat:hover { border-color: rgba(255,255,255,0.15); }
.demo-stat:hover::before { opacity: 1; }

.demo-stat__track {
    display: flex;
    align-items: baseline;
    gap: 0.1em;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.demo-stat__num {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    color: #fff;
}
.demo-stat__unit {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--c-accent-a);
    margin-top: 0.2rem;
}
.demo-stat__label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-muted);
}
.demo-stat__bar-wrap {
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    margin-top: 1.5rem;
    overflow: hidden;
}
.demo-stat__bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--c-accent-a), var(--c-accent-b));
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════
   09 — SCRAMBLE TEXT
   ═══════════════════════════════════════════════════════════ */
.demo-scramble {
    background: linear-gradient(180deg, var(--c-bg) 0%, #08000f 50%, var(--c-bg) 100%);
}
.demo-scramble__hint {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-muted);
    margin-bottom: 4rem;
}
.scramble-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
}
.scramble-word {
    font-size: clamp(1.5rem, 3vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    transition: border-color 0.3s, transform 0.2s;
}
.scramble-word:hover { transform: scale(1.04); }

.scramble-word:nth-child(1) { color: var(--c-accent-a); border-color: rgba(255,92,53,0.25); }
.scramble-word:nth-child(2) { color: var(--c-accent-b); border-color: rgba(107,53,255,0.25); }
.scramble-word:nth-child(3) { color: var(--c-accent-c); border-color: rgba(53,255,176,0.25); }
.scramble-word:nth-child(4) { color: var(--c-accent-d); border-color: rgba(255,181,53,0.25); }
.scramble-word:nth-child(5) { color: #ff35cc; border-color: rgba(255,53,204,0.25); }
.scramble-word:nth-child(6) { color: #35ccff; border-color: rgba(53,204,255,0.25); }

.demo-scramble__sub {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--c-muted);
}

/* ── Footer ────────────────────────────────────────────────── */
.demo-footer {
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    padding: 3rem 2.5rem;
}
.demo-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.demo-footer__left p {
    font-size: 0.82rem;
    color: var(--c-muted);
    margin-bottom: 0.4rem;
}
.demo-footer__credits {
    font-size: 0.7rem !important;
}
.demo-footer__credits a {
    color: rgba(255,255,255,0.5);
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: color 0.2s, text-decoration-color 0.2s;
}
.demo-footer__credits a:hover {
    color: var(--c-accent-a);
    text-decoration-color: var(--c-accent-a);
}
.demo-footer__back {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-muted);
    border: 1px solid var(--c-border);
    padding: 0.7rem 1.4rem;
    border-radius: 2rem;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.demo-footer__back:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

/* ── Word clip helper (SplitText) ──────────────────────────── */
.word {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    line-height: 1.2;
}

/* ═══════════════════════════════════════════════════════════
   10 — ROLLING TEXT
   ═══════════════════════════════════════════════════════════ */
.demo-rolling {
    background: linear-gradient(180deg, var(--c-bg) 0%, #0d0508 50%, var(--c-bg) 100%);
    border-top: 1px solid var(--c-border);
}
.rolling-layout {
    display: flex;
    align-items: center;
    gap: 3rem;
    overflow: hidden;
}
.rolling-static {
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: rgba(255,255,255,0.2);
    flex-shrink: 0;
}
.rolling-ticker {
    flex: 1;
    position: relative;
}
.rolling-ticker__window {
    height: clamp(4rem, 9.5vw, 8.2rem);  /* exactly one word height */
    overflow: hidden;
    position: relative;
}
.rolling-ticker__reel {
    display: flex;
    flex-direction: column;
    will-change: transform;
}
.rolling-word {
    display: block;
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--c-text);
    white-space: nowrap;
    padding: 0.04em 0;
}
.rolling-word strong {
    background: linear-gradient(90deg, var(--c-accent-a), var(--c-accent-b));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.rolling-ticker__line {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--c-accent-a), var(--c-accent-b));
    opacity: 0.5;
}
.rolling-hint {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--c-muted);
    margin-top: 3rem;
}

/* ═══════════════════════════════════════════════════════════
   11 — ANIMATED TEXT (CHAR STORM)
   ═══════════════════════════════════════════════════════════ */
.demo-charwave {
    background: var(--c-bg);
}
.charwave-block {
    margin-bottom: 4rem;
}
.charwave-line {
    font-size: clamp(4rem, 12vw, 11rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: -0.05em;
    display: block;
    will-change: transform;
}
.cw--a { color: var(--c-accent-a); }
.cw--b { color: var(--c-text); }
.cw--c {
    background: linear-gradient(90deg, var(--c-accent-b), var(--c-accent-c));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* Individual chars need display: inline-block for transform to work */
.cw-char {
    display: inline-block;
    will-change: transform, opacity;
}
.charwave-hint {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--c-muted);
}

/* ═══════════════════════════════════════════════════════════
   12 — BOUNCE CTA
   ═══════════════════════════════════════════════════════════ */
.demo-bounce-section {
    background: linear-gradient(160deg, #0c0008 0%, #08000c 50%, #0a0800 100%);
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    overflow: hidden;
}
.demo-bounce-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 70vh;
    padding: 4rem 2rem;
    gap: 3rem;
}
.bounce-text-wrap {
    line-height: 0.88;
    letter-spacing: -0.04em;
}
.bounce-line {
    display: block;
    font-size: clamp(5rem, 16vw, 14rem);
    font-weight: 800;
}
.bounce-line--a {
    color: rgba(255,255,255,0.12);
}
.bounce-line--b {
    background: linear-gradient(90deg, var(--c-accent-a), var(--c-accent-b));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.bounce-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--c-text);
    color: var(--c-bg);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.03em;
    padding: 1.1rem 2.4rem;
    border-radius: 3rem;
    text-decoration: none;
    cursor: none;
    will-change: transform;
    transform-origin: center;
}
.bounce-btn svg { transition: transform 0.3s; }
.bounce-btn:hover svg { transform: translateX(4px); }
.bounce-hint {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--c-muted);
}

/* ═══════════════════════════════════════════════════════════
   13 — DYNAMIC MORPHING
   ═══════════════════════════════════════════════════════════ */
.demo-morphing {
    background: var(--c-bg);
    border-top: 1px solid var(--c-border);
}
.morph-arena {
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    gap: 3rem;
    align-items: center;
}
.morph-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}
.morph-blob,
.morph-clip {
    width: 220px;
    height: 220px;
    will-change: transform, border-radius, clip-path;
}
.morph-blob {
    background: linear-gradient(135deg, var(--c-accent-a) 0%, var(--c-accent-b) 100%);
    border-radius: 50%;
}
.morph-clip {
    background: linear-gradient(135deg, var(--c-accent-b) 0%, var(--c-accent-c) 100%);
    clip-path: polygon(50% 0%, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0% 50%, 15% 15%);
}
.morph-label {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--c-muted);
}
.morph-desc {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.25);
    text-align: center;
}
.morph-center-copy {
    text-align: center;
}
.morph-center-copy h2 {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2rem;
}
.morph-center-copy h2 em {
    font-family: var(--f-serif);
    font-style: italic;
    color: var(--c-accent-a);
}
.morph-code-snip {
    text-align: left;
    font-size: 0.72rem;
    line-height: 1.9;
}

/* ═══════════════════════════════════════════════════════════
   14 — INFINITE CARD SLIDER
   ═══════════════════════════════════════════════════════════ */
.demo-islider-section {
    padding-bottom: 0;
    background: linear-gradient(180deg, var(--c-bg) 0%, #080010 100%);
    border-top: 1px solid var(--c-border);
}
.islider-gallery {
    position: relative;
    width: 100%;
    height: 100svh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.islider-cards {
    position: absolute;
    inset: 0;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.islider-card {
    position: absolute;
    width: 14rem;
    height: 20rem;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 1.2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    will-change: transform, opacity;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
}
.icard__label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* Card gradient fills */
.icard--1 { background: linear-gradient(160deg, #ff5c35 0%, #cc1a00 100%); }
.icard--2 { background: linear-gradient(160deg, #356bff 0%, #001aaa 100%); }
.icard--3 { background: linear-gradient(160deg, #35ffb0 0%, #00aa55 100%); }
.icard--4 { background: linear-gradient(160deg, #ffb535 0%, #cc6600 100%); }
.icard--5 { background: linear-gradient(160deg, #ff35cc 0%, #aa0077 100%); }
.icard--6 { background: linear-gradient(160deg, #35ccff 0%, #0077aa 100%); }
.icard--7 { background: linear-gradient(160deg, #cc35ff 0%, #6600aa 100%); }
.icard--8 { background: linear-gradient(160deg, #35ff6b 0%, #00aa22 100%); }

.islider-drag-proxy {
    position: absolute;
    inset: 0;
    visibility: hidden;
}
.islider-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--c-bg);
    border-top: 1px solid var(--c-border);
}
.islider-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--c-muted);
    cursor: none;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
    background: transparent;
}
.islider-btn:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    transform: scale(1.1);
}
.islider-hint {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-muted);
}

/* ═══════════════════════════════════════════════════════════
   SECTION 18 — Scroll Storytelling Pin
   ═══════════════════════════════════════════════════════════ */
.demo-storypin {
    padding: 0;
    overflow: hidden;
}
.demo-storypin .demo-section__badge {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

/* ── Pinned wrapper — fills the viewport ────────────────── */
.storypin-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* ── Left column: text ──────────────────────────────────── */
.storypin-text {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8rem 4rem 4rem 5vw;
    background: var(--c-bg);
    overflow: hidden;
}

.storypin-step {
    position: absolute;
    left: 5vw;
    right: 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    opacity: 0;
    transform: translateY(32px);
    pointer-events: none;
}
.storypin-step.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.sp-num {
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-muted);
    font-variant-numeric: tabular-nums;
}
.sp-title {
    font-size: clamp(2rem, 3.5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-family: var(--f-sans);
}
.sp-body {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--c-muted);
    max-width: 40ch;
}
.sp-body strong { color: var(--c-text); font-weight: 600; }
.sp-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.45em 0.9em;
    border-radius: 2em;
    border: 1px solid var(--c-border);
    font-size: 0.68rem;
    color: var(--c-muted);
    width: fit-content;
}

/* ── Progress dots ──────────────────────────────────────── */
.storypin-dots {
    position: absolute;
    bottom: 3rem;
    left: 5vw;
    display: flex;
    gap: 0.6rem;
    pointer-events: auto;
}
.sp-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    cursor: none;
    transition: background 0.3s, transform 0.3s;
    padding: 0;
}
.sp-dot.is-active {
    background: var(--c-text);
    transform: scale(1.4);
}

/* ── Right column: visuals ──────────────────────────────── */
.storypin-visuals {
    position: relative;
    overflow: hidden;
    background: var(--c-surface);
}
.storypin-visual {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    transform: scale(1.04);
    will-change: opacity, transform;
    display: flex;
    align-items: flex-end;
    padding: 2.5rem;
}
.storypin-visual.is-active {
    opacity: 1;
    transform: scale(1);
}

/* Per-panel gradient backgrounds */
.sp-visual--0 { background: linear-gradient(140deg, #1a0a00 0%, #3d0f00 50%, #1a0500 100%); }
.sp-visual--1 { background: linear-gradient(140deg, #08001a 0%, #1a0044 50%, #08001a 100%); }
.sp-visual--2 { background: linear-gradient(140deg, #001208 0%, #003d1a 50%, #001208 100%); }
.sp-visual--3 { background: linear-gradient(140deg, #1a0f00 0%, #3d2000 50%, #1a0a00 100%); }

/* Subtle dot grid */
.spv__grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

/* Giant background word */
.spv__bg-word {
    position: absolute;
    bottom: -0.15em;
    right: -0.05em;
    font-size: clamp(6rem, 15vw, 14rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1;
    opacity: 0.04;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* Panel 0 — velocity bars */
.spv__bars {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    padding: 20% 15% 30% 15%;
    pointer-events: none;
}
.spv__bars span {
    flex: 1;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(to top, rgba(255,92,53,0.8), rgba(255,92,53,0.1));
    will-change: height;
    transform-origin: bottom;
}
.spv__bars span:nth-child(1) { height: 30%; }
.spv__bars span:nth-child(2) { height: 60%; }
.spv__bars span:nth-child(3) { height: 85%; }
.spv__bars span:nth-child(4) { height: 45%; }
.spv__bars span:nth-child(5) { height: 70%; }
.spv__bars span:nth-child(6) { height: 55%; }
.spv__bars span:nth-child(7) { height: 90%; }
.spv__bars span:nth-child(8) { height: 35%; }

/* Panel 1 — concentric rings */
.spv__rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.spv__ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid;
    transform: translate(-50%, -50%);
}
.spv__ring--a { width: 120px; height: 120px; border-color: rgba(107,53,255,0.7); }
.spv__ring--b { width: 220px; height: 220px; border-color: rgba(107,53,255,0.4); }
.spv__ring--c { width: 340px; height: 340px; border-color: rgba(107,53,255,0.2); }

/* Panel 2 — scrub track */
.spv__scrub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
}
.spv__scrub-track {
    width: 100%;
    height: 3px;
    background: rgba(53,255,176,0.15);
    border-radius: 2px;
    position: relative;
    overflow: visible;
}
.spv__scrub-head {
    position: absolute;
    left: 0;
    top: 50%;
    width: 18px;
    height: 18px;
    background: var(--c-accent-c);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 16px rgba(53,255,176,0.6);
    will-change: left;
}
.spv__scrub-label {
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(53,255,176,0.5);
}
.spv__scrub-val {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--c-accent-c);
    font-variant-numeric: tabular-nums;
}

/* Panel 3 — easing curve */
.spv__curve {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(140px, 40%, 220px);
    height: clamp(140px, 40%, 220px);
    pointer-events: none;
}
.spv__curve-path {
    stroke: rgba(255,181,53,0.7);
    stroke-width: 2;
    stroke-dasharray: 350;
    stroke-dashoffset: 350;
}
.spv__curve-dot {
    fill: var(--c-accent-d);
    filter: drop-shadow(0 0 6px rgba(255,181,53,0.8));
}

/* ── Bottom-left label on each panel ───────────────────── */
.spv__label {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 0.6rem 1rem;
    border-radius: 0.6rem;
}
.spv__label-key {
    font-size: 0.52rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c-muted);
}
.spv__label-val {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════
   LATERAL PIN INDICATOR
   Fixed left sidebar that fills when inside a pinned section.
   ═══════════════════════════════════════════════════════════ */
.pin-indicator {
    position: fixed;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.pin-indicator.is-active { opacity: 1; }

.pin-indicator__name {
    font-size: 0.42rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-muted);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    max-height: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pin-indicator__bar {
    width: 2px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    position: relative;
    overflow: visible;
}
.pin-indicator__fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--c-accent-a);
    border-radius: 2px;
    transform-origin: top;
    transform: scaleY(0);
    will-change: transform;
}
.pin-indicator__thumb {
    position: absolute;
    left: 50%;
    top: 0;
    width: 8px;
    height: 8px;
    background: var(--c-accent-a);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px var(--c-accent-a);
    will-change: top;
    transition: top 0s; /* driven by JS */
}
.pin-indicator__pct {
    font-size: 0.48rem;
    letter-spacing: 0.08em;
    color: var(--c-accent-a);
    font-variant-numeric: tabular-nums;
    min-width: 2.6em;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   SECTION 15 — Text Replacement
   ═══════════════════════════════════════════════════════════ */
.demo-txreplace {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 6rem 2rem;
}
.txr-stage {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}
.txr-prefix {
    font-family: var(--f-serif);
    font-size: clamp(2rem, 5.5vw, 4.5rem);
    color: var(--c-muted);
    line-height: 1.1;
    font-style: italic;
}
.txr-slot {
    position: relative;
    height: clamp(3rem, 8vw, 6.5rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    /* no overflow:hidden — clip-path on each word handles clipping */
}
.txr-pill {
    position: absolute;
    left: 50%;
    top: 4px;
    bottom: 4px;
    width: 200px;           /* overridden by JS per word */
    transform: translateX(-50%);
    background: var(--c-accent-a);
    border-radius: 0.5em;
    opacity: 0.12;
    will-change: width;
    pointer-events: none;
}
.txr-reel {
    position: relative;
    z-index: 1;
    /* Stack all words on top of each other */
    display: grid;
    grid-template-areas: 'cell';
}
.txr-word {
    grid-area: cell;
    font-family: var(--f-sans);
    font-size: clamp(2rem, 6.5vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--c-accent-a);
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    white-space: nowrap;
    will-change: clip-path, opacity, transform;
    line-height: 1;
    padding: 0.1em 0.5rem;
}
.txr-word.is-current {
    clip-path: inset(0 0 0% 0);
    opacity: 1;
}
.txr-code {
    margin-top: 1rem;
    max-width: 500px;
    font-size: 0.63rem;
    line-height: 1.7;
    text-align: left;
}

/* ═══════════════════════════════════════════════════════════
   SECTION 16 — Responsive Animation
   ═══════════════════════════════════════════════════════════ */
.demo-respani .demo-section__inner {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 4rem;
    align-items: center;
}
.resp-header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.resp-header h2 {
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.resp-header em {
    font-family: var(--f-serif);
    font-style: italic;
    color: var(--c-accent-b);
}
.resp-bkpt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.resp-bkpt__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-accent-c);
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
    transition: background 0.3s;
}
.resp-bkpt__label {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--c-muted);
    font-variant-numeric: tabular-nums;
}
.resp-desc {
    font-size: 0.9rem;
    color: var(--c-muted);
    line-height: 1.75;
    max-width: 32ch;
}
.resp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    perspective: 900px;
}
.resp-card {
    border-radius: var(--radius);
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    will-change: transform, opacity;
    transform-origin: center;
}
.resp-card--a { border-top: 2px solid var(--c-accent-c); }
.resp-card--b { border-top: 2px solid var(--c-accent-d); }
.resp-card--c { border-top: 2px solid var(--c-accent-a); }
.resp-card__num {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    opacity: 0.2;
}
.resp-card__tag {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-muted);
}
.resp-card p {
    font-size: 0.78rem;
    color: var(--c-muted);
    margin-top: auto;
}

/* ═══════════════════════════════════════════════════════════
   SECTION 17 — Why Smooth Scroll
   ═══════════════════════════════════════════════════════════ */
.demo-why-scroll {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6rem 2rem;
}
.why-layout {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}
/* Left: copy */
.why-copy {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}
.why-title {
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
}
.why-title em {
    font-family: var(--f-serif);
    font-style: italic;
    color: var(--c-accent-c);
}
.why-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}
.why-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.why-item__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-accent-c);
    flex-shrink: 0;
    margin-top: 0.5em;
}
.why-item strong {
    display: block;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    margin-bottom: 0.3rem;
}
.why-item p {
    font-size: 0.82rem;
    color: var(--c-muted);
    line-height: 1.75;
}
/* Right: comparison */
.why-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    align-items: start;
}
.why-col {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.why-col__head {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
    text-align: center;
}
.why-tag {
    font-size: 0.55rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 0.2em 0.7em;
    border-radius: 2em;
    font-weight: 600;
}
.why-tag--warn { background: rgba(255,92,53,0.15); color: var(--c-accent-a); }
.why-tag--ok   { background: rgba(53,255,176,0.12); color: var(--c-accent-c); }
.why-col__sub {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: var(--c-muted);
    text-align: center;
}
.why-col__track {
    position: relative;
    height: 240px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.why-ruler {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.5rem 0;
}
.why-ruler__tick {
    height: 1px;
    background: rgba(255,255,255,0.06);
    width: 100%;
}
.why-ball {
    position: absolute;
    left: 50%;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    /* horizontally centred; vertical driven by JS via gsap.set top */
    transform: translateX(-50%);
    will-change: top;
}
.why-ball--native {
    background: var(--c-accent-a);
    box-shadow: 0 0 16px rgba(255,92,53,0.5);
}
.why-ball--smooth {
    background: var(--c-accent-c);
    box-shadow: 0 0 16px rgba(53,255,176,0.5);
}
.why-col__stat {
    text-align: center;
    font-size: 0.65rem;
    color: var(--c-muted);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}
.why-col__stat code {
    font-size: 0.9em;
}
.why-vs {
    font-size: 0.55rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--c-muted);
    writing-mode: vertical-rl;
    align-self: center;
    margin-top: 3rem;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    body { cursor: auto; }
    .demo-cursor { display: none; }
    .pin-indicator { display: none; }

    .demo-foundation .demo-section__inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .demo-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .parallax-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .parallax-col--fast { display: none; }
    .velocity-hud { display: none; }
    .demo-h-panel__content { padding: 2rem; }
    .demo-footer__inner { flex-direction: column; align-items: flex-start; }
    .morph-arena { grid-template-columns: 1fr; gap: 4rem; }
    .rolling-static { display: none; }
    .morph-blob, .morph-clip { width: 160px; height: 160px; }

    /* Section 18 */
    .storypin-wrap { grid-template-columns: 1fr; grid-template-rows: auto 55vh; height: auto; }
    .storypin-text { padding: 5rem 2rem 2rem 2rem; min-height: 50vh; }
    .storypin-step { left: 2rem; right: 2rem; }
    .storypin-dots { left: 2rem; }
    .sp-title { font-size: clamp(1.8rem, 4vw, 2.8rem); }

    /* Section 15 */
    .txr-prefix { font-size: clamp(1.8rem, 5vw, 3rem); }

    /* Section 16 */
    .demo-respani .demo-section__inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .resp-grid { grid-template-columns: repeat(2, 1fr); }
    .resp-card--c { grid-column: 1 / -1; }

    /* Section 17 */
    .why-layout { grid-template-columns: 1fr; gap: 3rem; }
    .why-comparison { grid-template-columns: 1fr auto 1fr; }
    .why-col__track { height: 180px; }
}

@media (max-width: 580px) {
    .demo-stats-grid { grid-template-columns: 1fr 1fr; }
    .parallax-grid { grid-template-columns: 1fr 1fr; }
    .demo-hero__title { flex-direction: column; gap: 0.15em; }
    .demo-section__badge { font-size: 0.5rem; }
    .scramble-grid { gap: 0.6rem; }
    .scramble-word { font-size: 1.3rem; padding: 0.5rem 1rem; }

    /* Section 16 */
    .resp-grid { grid-template-columns: 1fr; }
    .resp-card--c { grid-column: auto; }

    /* Section 17 */
    .why-comparison { grid-template-columns: 1fr; gap: 2rem; }
    .why-vs { writing-mode: horizontal-tb; text-align: center; margin: 0; }
}

/* ═══════════════════════════════════════════════════════════
   ANIM COMPONENT OVERRIDES — demo context
   These rules adapt animation-components.css classes to match
   the demo page's visual design (dark theme + demo variables).
   ═══════════════════════════════════════════════════════════ */

/* ── 06 · Card Stack ──────────────────────────────────────── */
.demo-stack-wrapper .anim-card-stack {
    display: block; /* block flow required for position:sticky to work correctly */
}

.demo-stack-wrapper .anim-cs__card {
    position:   sticky;
    min-height: 72vh;
    border:     none;
    border-radius: 1.5rem;
    overflow:   hidden;
    will-change: transform, filter;
}

/* Per-card backgrounds match original demo gradients */
.demo-stack-wrapper .anim-cs__card[data-index="0"] {
    top:        5rem;
    background: linear-gradient(160deg, #1a0a00, #2a1500);
    z-index:    1;
}
.demo-stack-wrapper .anim-cs__card[data-index="1"] {
    top:        calc(5rem + 40px);
    background: linear-gradient(160deg, #08001a, #150035);
    z-index:    2;
}
.demo-stack-wrapper .anim-cs__card[data-index="2"] {
    top:        calc(5rem + 80px);
    background: linear-gradient(160deg, #00140a, #002f1e);
    z-index:    3;
}

.demo-stack-wrapper .anim-cs__inner {
    padding: 3rem;
}

.demo-stack-wrapper .anim-cs__title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
}

.demo-stack-wrapper .anim-cs__card[data-index="0"] .anim-cs__title { color: var(--c-accent-a); }
.demo-stack-wrapper .anim-cs__card[data-index="1"] .anim-cs__title { color: var(--c-accent-b); }
.demo-stack-wrapper .anim-cs__card[data-index="2"] .anim-cs__title { color: var(--c-accent-c); }

.demo-stack-wrapper .anim-cs__body {
    color:       var(--c-muted);
    font-size:   1rem;
    line-height: 1.75;
}

.demo-stack-wrapper .anim-cs__tag {
    font-size:      0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-color:   rgba(255,255,255,0.2);
    color:          var(--c-muted);
    margin-bottom:  2rem;
}

/* ── 07 · Marquee ─────────────────────────────────────────── */
.demo-marquee-section .anim-marquee {
    padding: 0.6rem 0;
}
.demo-marquee-section .demo-mq-bot {
    margin-top: 0.5rem;
}

/* ── 08 · Counters ────────────────────────────────────────── */
.demo-stats-grid .anim-counter {
    background:    rgba(255,255,255,0.02);
    border:        1px solid var(--c-border);
    border-radius: 1rem;
    padding:       2rem;
    position:      relative;
    overflow:      hidden;
}

.demo-stats-grid .anim-counter::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--counter-color, var(--c-accent-b)) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
}
.demo-stats-grid .anim-counter:hover { border-color: rgba(255,255,255,0.15); }
.demo-stats-grid .anim-counter:hover::before { opacity: 0.06; }

.demo-stats-grid .anim-counter__num {
    font-size:   clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
}

.demo-stats-grid .anim-counter__suffix {
    font-size:   1.4rem;
    font-weight: 600;
    margin-top:  0.2rem;
    opacity:     0.7;
}

.demo-stats-grid .anim-counter__label {
    font-size:      0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color:          var(--c-muted);
}

.demo-stats-grid .anim-counter__bar-wrap {
    height:     2px;
    background: var(--c-border);
    margin-top: 1.25rem;
}

.demo-stats-grid .anim-counter__bar {
    background: var(--counter-color, var(--c-accent-b));
}

/* ── 15 · Text Replace ────────────────────────────────────── */
.txr-stage .anim-text-replace {
    display:     flex;
    align-items: baseline;
    gap:         0.6rem;
    flex-wrap:   wrap;
    justify-content: center;
}

.txr-stage .anim-tr__prefix {
    font-family: var(--f-serif);
    font-size:   clamp(2rem, 5.5vw, 4.5rem);
    font-weight: 400;
    font-style:  italic;
    white-space: nowrap;
}

.txr-stage .anim-tr__slot {
    position:    relative;
    height:      clamp(3rem, 8vw, 6.5rem);
    display:     flex;
    align-items: center;
}

.txr-stage .anim-tr__reel {
    display:               grid;
    grid-template-areas:   'cell';
    position:              relative;
    z-index:               1;
}

.txr-stage .anim-tr__word {
    grid-area:   cell;
    font-family: var(--f-sans);
    font-size:   clamp(2rem, 5.5vw, 4.5rem);
    font-weight: 700;
    white-space: nowrap;
    color:       var(--c-accent-b);
    padding:     0.1em 0.5rem;
}

.txr-stage .anim-tr__pill {
    position:      absolute;
    left:          50%;
    transform:     translateX(-50%);
    height:        1.4em;
    background:    var(--c-accent-b);
    border-radius: 999px;
    opacity:       0.15;
    pointer-events: none;
}

/* Responsive overrides */
@media (max-width: 768px) {
    .txr-stage .anim-tr__prefix { font-size: clamp(1.8rem, 5vw, 3rem); }
    .txr-stage .anim-tr__word   { font-size: clamp(1.8rem, 5vw, 3rem); }
    .demo-stack-wrapper .anim-cs__card[data-index="1"],
    .demo-stack-wrapper .anim-cs__card[data-index="2"] { top: 5rem; }
    .demo-stats-grid .anim-counter { padding: 1.5rem; }
}

@media (max-width: 580px) {
    .demo-stats-grid .anim-counter { padding: 1.25rem; }
}

/* ═══════════════════════════════════════════════════════════
   LIGHT THEME
   Activated by <html data-theme="light">
   Inspired by the main site: white bg, black text, red accent.
   ═══════════════════════════════════════════════════════════ */

/* ── Token overrides ─────────────────────────────────────── */
[data-theme="light"] {
    --c-bg:       #ffffff;
    --c-surface:  #f3f3f3;
    --c-border:   rgba(0,0,0,0.09);
    --c-text:     #080808;
    --c-muted:    rgba(8,8,8,0.48);
    --c-accent-a: #BC171F;   /* red — main site primary */
    --c-accent-b: #4a2dff;   /* violet */
    --c-accent-c: #00875a;   /* green */
    --c-accent-d: #c47900;   /* amber */
}

/* ── Body / global ─────────────────────────────────────────── */
[data-theme="light"] code {
    color:       var(--c-accent-a);
    background:  rgba(188,23,31,0.07);
}
[data-theme="light"] .demo-code {
    background: rgba(0,0,0,0.03);
    color: var(--c-accent-a);
}

/* ── Custom cursor ─────────────────────────────────────────── */
[data-theme="light"] .demo-cursor__dot {
    background: #000;
}
[data-theme="light"] .demo-cursor__ring {
    border-color: rgba(0,0,0,0.35);
}

/* ── Velocity HUD ──────────────────────────────────────────── */
[data-theme="light"] .velocity-hud {
    background: rgba(243,243,243,0.88);
    border-color: var(--c-border);
}
[data-theme="light"] .velocity-value { color: #000; }
[data-theme="light"] .velocity-bar-wrap { background: rgba(0,0,0,0.08); }

/* ── Nav ────────────────────────────────────────────────────── */
[data-theme="light"] .demo-nav.is-scrolled {
    background: rgba(255,255,255,0.88);
    border-color: var(--c-border);
}
[data-theme="light"] .demo-nav__back:hover { color: #000; }

/* ── Theme toggle button ────────────────────────────────────── */
.demo-nav__theme-toggle {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-muted);
    cursor: none;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.demo-nav__theme-toggle:hover {
    color: var(--c-text);
    border-color: var(--c-text);
    background: rgba(128,128,128,0.08);
}
/* Icon visibility: show sun in dark mode, moon in light mode */
.demo-nav__theme-toggle .icon-sun  { display: none; }
.demo-nav__theme-toggle .icon-moon { display: block; }
[data-theme="light"] .demo-nav__theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .demo-nav__theme-toggle .icon-moon { display: none; }

/* ── Hero ────────────────────────────────────────────────────── */
[data-theme="light"] .demo-hero__grid {
    background-image:
        linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px);
}
[data-theme="light"] .demo-hero__scroll-line {
    background: linear-gradient(to bottom, rgba(8,8,8,0.3), transparent);
}
[data-theme="light"] .orb-demo { opacity: 0.1; }

/* ── Progress bar ───────────────────────────────────────────── */
[data-theme="light"] .demo-progress-bar {
    background: linear-gradient(90deg, var(--c-accent-a), var(--c-accent-b));
}

/* ── Section 02 skew lines ─────────────────────────────────── */
[data-theme="light"] .skew-line__inner { color: rgba(8,8,8,0.12); }
[data-theme="light"] .skew-line:nth-child(3n+1) .skew-line__inner { color: rgba(8,8,8,0.08); }
[data-theme="light"] .skew-line:nth-child(3n+2) .skew-line__inner { color: rgba(8,8,8,0.16); }
[data-theme="light"] .skew-line:nth-child(3n+3) .skew-line__inner { color: rgba(188,23,31,0.2); }

/* ── Section 03 horizontal scroll panels ───────────────────── */
[data-theme="light"] .demo-h-panel--1 { background: linear-gradient(145deg, #f9ede8 0%, #f5d5c8 100%); }
[data-theme="light"] .demo-h-panel--2 { background: linear-gradient(145deg, #e8ecf9 0%, #c8d4f5 100%); }
[data-theme="light"] .demo-h-panel--3 { background: linear-gradient(145deg, #ede8f9 0%, #d4c8f5 100%); }
[data-theme="light"] .demo-h-panel--4 { background: linear-gradient(145deg, #f9f3e8 0%, #f5e4c8 100%); }
[data-theme="light"] .demo-h-dot { background: rgba(0,0,0,0.15); }
[data-theme="light"] .demo-h-dot.is-active { background: #000; }

/* ── Section 04 text reveal ────────────────────────────────── */
[data-theme="light"] .demo-text-reveal {
    background: linear-gradient(180deg, var(--c-bg) 0%, #ede8f4 50%, var(--c-bg) 100%);
}
[data-theme="light"] .reveal-source { color: rgba(0,0,0,0.2); }

/* ── Section 06 card stack ─────────────────────────────────── */
/* Keep dark cards as "dark islands" — intentional contrast */

/* ── Section 08 counters ────────────────────────────────────── */
[data-theme="light"] .demo-stats-grid .anim-counter {
    background: rgba(0,0,0,0.02);
}
[data-theme="light"] .demo-stats-grid .anim-counter:hover {
    border-color: rgba(0,0,0,0.18);
}
[data-theme="light"] .demo-stats-grid .anim-counter__bar-wrap {
    background: rgba(0,0,0,0.07);
}

/* ── Section 09 scramble ────────────────────────────────────── */
[data-theme="light"] .demo-scramble {
    background: linear-gradient(180deg, var(--c-bg) 0%, #f0e8f6 50%, var(--c-bg) 100%);
}

/* ── Section 10 rolling text ────────────────────────────────── */
[data-theme="light"] .demo-rolling {
    background: linear-gradient(180deg, var(--c-bg) 0%, #f5ece8 50%, var(--c-bg) 100%);
}
[data-theme="light"] .rolling-static { color: rgba(0,0,0,0.15); }

/* ── Section 11 char storm ─────────────────────────────────── */
/* charwave-line colors use accent vars — inherits correctly */

/* ── Section 12 bounce CTA ─────────────────────────────────── */
[data-theme="light"] .demo-bounce-section {
    background: linear-gradient(160deg, #f8edf4 0%, #f0e8fc 50%, #f8f0e0 100%);
}
[data-theme="light"] .bounce-line--a { color: rgba(0,0,0,0.07); }

/* ── Section 14 card slider ─────────────────────────────────── */
[data-theme="light"] .demo-islider-section {
    background: linear-gradient(180deg, var(--c-bg) 0%, #eae8f8 100%);
}
[data-theme="light"] .islider-nav {
    background: var(--c-bg);
}
[data-theme="light"] .islider-btn:hover {
    color: #000;
    border-color: rgba(0,0,0,0.3);
}

/* ── Section 18 storypin ────────────────────────────────────── */
[data-theme="light"] .sp-dot { background: rgba(0,0,0,0.15); }
[data-theme="light"] .spv__grid {
    background-image: radial-gradient(circle, rgba(0,0,0,0.06) 1px, transparent 1px);
}
/* Visual panels stay dark — keep as-is for contrast drama */

/* ── Lateral pin indicator ──────────────────────────────────── */
[data-theme="light"] .pin-indicator__bar { background: rgba(0,0,0,0.1); }

/* ── Section 17 why-scroll ──────────────────────────────────── */
[data-theme="light"] .why-col__track { background: rgba(0,0,0,0.02); }
[data-theme="light"] .why-ruler__tick { background: rgba(0,0,0,0.06); }
[data-theme="light"] .why-tag--warn { background: rgba(188,23,31,0.1); }
[data-theme="light"] .why-tag--ok   { background: rgba(0,135,90,0.1); color: var(--c-accent-c); }
[data-theme="light"] .why-ball--native { box-shadow: 0 0 16px rgba(188,23,31,0.4); }
[data-theme="light"] .why-ball--smooth { box-shadow: 0 0 16px rgba(0,135,90,0.4); }

/* ── Footer ─────────────────────────────────────────────────── */
[data-theme="light"] .demo-footer__credits a { color: rgba(0,0,0,0.45); }
[data-theme="light"] .demo-footer__back:hover {
    color: #000;
    border-color: rgba(0,0,0,0.25);
}

/* ── Anim component overrides ───────────────────────────────── */
[data-theme="light"] .demo-stats-grid .anim-counter:hover::before { opacity: 0.04; }
[data-theme="light"] .demo-stack-wrapper .anim-cs__tag { border-color: rgba(0,0,0,0.15); }
