:root {
    --bg-deep: #0A0A0A;
    --bg-panel: #141414;
    --bg-blob: #1F1F1F;
    --text-body: #B8B8B8;
    --text-bright: #F0F0F0;
    --accent-pop: #FF2D2D;
    --halftone: #3D3D3D;
    --bg-ink: #0D0D0D;
    --bg-structure: #1A1A1A;
    --font-display: 'Bangers', cursive;
    --font-body: 'Nunito Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

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

html {
    font-size: 16px;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-body);
    font-family: var(--font-body);
    overflow-x: hidden;
    overflow-y: hidden;
    width: 100vw;
    height: 100vh;
}

/* ===================== SCROLL TRACK ===================== */

.scroll-track {
    display: flex;
    width: 800vw;
    height: 100vh;
    will-change: transform;
}

.comic-panel {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    position: relative;
    background-color: var(--bg-panel);
    border-right: 2px solid #2A2A2A;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
}

.comic-panel:last-child {
    border-right: none;
}

.panel-hero {
    background-color: var(--bg-ink);
}

.panel-close {
    background-color: var(--bg-structure);
}

/* ===================== HALFTONE OVERLAY ===================== */

.halftone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, var(--halftone) 1px, transparent 1px);
    background-size: 4px 4px;
    opacity: 0.2;
    pointer-events: none;
    z-index: 1;
}

.halftone-right {
    left: 60%;
    opacity: 0.2;
}

.halftone-dense {
    opacity: 0.3;
}

/* ===================== BLOB UNDERLAYS ===================== */

.blob-underlay {
    position: absolute;
    width: 500px;
    height: 500px;
    background-color: var(--bg-blob);
    border-radius: 42% 58% 63% 37% / 45% 55% 38% 62%;
    filter: blur(40px);
    opacity: 0.6;
    animation: blobMorph 25s ease-in-out infinite;
    z-index: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.blob-hero {
    width: 600px;
    height: 600px;
    border-radius: 55% 45% 38% 62% / 60% 40% 55% 45%;
}

.blob-tall {
    width: 350px;
    height: 650px;
    border-radius: 40% 60% 55% 45% / 30% 70% 40% 60%;
    animation-delay: -5s;
    left: 40%;
}

.blob-wide {
    width: 700px;
    height: 400px;
    border-radius: 38% 62% 50% 50% / 42% 58% 45% 55%;
    animation-delay: -10s;
}

.blob-chan {
    width: 550px;
    height: 450px;
    border-radius: 50% 50% 42% 58% / 55% 45% 50% 50%;
    animation-delay: -15s;
}

.blob-orbit-main {
    width: 450px;
    height: 450px;
    border-radius: 45% 55% 55% 45% / 50% 50% 40% 60%;
    animation-delay: -8s;
}

.blob-satellite {
    position: absolute;
    width: 120px;
    height: 120px;
    background-color: var(--bg-blob);
    border-radius: 50%;
    filter: blur(25px);
    opacity: 0.5;
    z-index: 0;
    animation: orbit 12s linear infinite;
    top: 50%;
    left: 50%;
}

@keyframes orbit {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateX(250px) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg) translateX(250px) rotate(-360deg); }
}

.blob-stats {
    width: 500px;
    height: 500px;
    border-radius: 60% 40% 45% 55% / 38% 62% 50% 50%;
    animation-delay: -12s;
}

.blob-future {
    width: 700px;
    height: 700px;
    border-radius: 50% 50% 45% 55% / 45% 55% 50% 50%;
    animation-delay: -18s;
    opacity: 0.7;
    filter: blur(40px) drop-shadow(0 0 60px rgba(255, 45, 45, 0.15));
}

.blob-end {
    width: 400px;
    height: 400px;
    border-radius: 40% 60% 60% 40% / 45% 55% 55% 45%;
    animation-delay: -20s;
}

@keyframes blobMorph {
    0% { border-radius: 42% 58% 63% 37% / 45% 55% 38% 62%; }
    25% { border-radius: 55% 45% 38% 62% / 60% 40% 55% 45%; }
    50% { border-radius: 38% 62% 50% 50% / 42% 58% 45% 55%; }
    75% { border-radius: 60% 40% 55% 45% / 50% 50% 38% 62%; }
    100% { border-radius: 42% 58% 63% 37% / 45% 55% 38% 62%; }
}

/* ===================== PANEL INNER ===================== */

.panel-inner {
    position: relative;
    z-index: 2;
    max-width: 780px;
    padding: 2rem;
    width: 100%;
}

.panel-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.panel-full {
    max-width: 860px;
}

.panel-split {
    display: flex;
    gap: 3rem;
    align-items: center;
    max-width: 960px;
}

.split-left {
    flex: 0 0 58%;
}

.split-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diagram-congestion {
    width: 100%;
    max-width: 280px;
    height: auto;
}

/* ===================== TYPOGRAPHY ===================== */

.mono-tag {
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.15em;
    color: var(--halftone);
    margin-bottom: 1.5rem;
}

.mono-accent {
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    color: var(--accent-pop);
}

.comic-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7rem);
    color: var(--text-bright);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
}

.hero-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px) scale(0.5);
    animation: letterIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    animation-delay: calc(var(--delay) * 80ms + 200ms);
}

.hero-letter.hero-accent {
    color: var(--accent-pop);
}

.hero-space {
    width: 0.3em;
}

@keyframes letterIn {
    0% { opacity: 0; transform: translateY(40px) scale(0.5); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--text-bright);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.future-title {
    font-size: clamp(2.5rem, 6vw, 5.5rem);
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.65;
    color: var(--text-body);
    margin-bottom: 1.5rem;
    max-width: 60ch;
}

.future-body {
    max-width: 50ch;
    text-align: center;
}

.bubble-text-bright {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.closing-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: var(--text-body);
    max-width: 400px;
}

.card-hint {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--halftone);
    font-size: 0.75rem;
}

/* ===================== SPEECH BUBBLES ===================== */

.speech-bubble {
    background-color: var(--bg-panel);
    border: 2px solid var(--text-bright);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    position: relative;
    margin-bottom: 2rem;
}

.speech-bubble p {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.6;
    color: var(--text-body);
}

.bubble-tail {
    position: absolute;
    bottom: -12px;
    left: 30px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid var(--accent-pop);
}

.tail-right {
    left: auto;
    right: 30px;
}

.bubble-tail-up {
    bottom: auto;
    top: -12px;
    border-top: none;
    border-bottom: 12px solid var(--accent-pop);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
}

.hero-bubble {
    max-width: 520px;
}

.mini-bubble {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
    border-width: 1.5px;
}

.mini-bubble p {
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    color: var(--text-bright);
}

.sidechain-bubbles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

/* ===================== TWO-COL / STAT ROW ===================== */

.stat-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stat-bubble {
    text-align: center;
    padding: 2rem 1.5rem;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-body);
}

/* ===================== CARD FLIP ===================== */

.card-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.data-card {
    width: 200px;
    height: 200px;
    perspective: 800px;
    cursor: pointer;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-front {
    background-color: var(--bg-panel);
    border: 2px solid var(--text-bright);
    overflow: hidden;
}

.card-halftone {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, var(--halftone) 1.5px, transparent 1.5px);
    background-size: 6px 6px;
    opacity: 0.3;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--text-bright);
    letter-spacing: 0.06em;
    position: relative;
    z-index: 1;
}

.card-back {
    background-color: var(--bg-deep);
    border: 2px solid var(--halftone);
    transform: rotateY(180deg);
}

.card-detail {
    font-family: var(--font-body);
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text-body);
    text-align: center;
}

.data-card[data-flipped="true"] .card-front {
    transform: rotateY(180deg);
}

.data-card[data-flipped="true"] .card-back {
    transform: rotateY(0deg);
}

.data-card:hover .card-front {
    border-color: var(--accent-pop);
}

/* ===================== STATE CHANNEL DIAGRAM ===================== */

.channel-diagram {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.diagram-channels {
    width: 100%;
    height: auto;
}

.channel-arc {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.2s ease-out;
}

.panel-channels.in-view .channel-arc {
    stroke-dashoffset: 0;
}

.channel-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 10%;
    margin-top: 0.75rem;
}

.channel-label {
    text-align: center;
}

/* ===================== PROGRESS BAR ===================== */

.progress-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 100;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid var(--halftone);
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
}

.progress-dot.active {
    background-color: var(--accent-pop);
    border-color: var(--accent-pop);
    box-shadow: 0 0 12px var(--accent-pop);
}

.progress-dot.visited {
    background-color: var(--text-body);
    border-color: var(--text-body);
}

/* ===================== PANEL LABEL ===================== */

.panel-label {
    position: fixed;
    top: 2rem;
    left: 2rem;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.06em;
    color: var(--accent-pop);
    z-index: 100;
    transition: opacity 0.3s ease;
}

/* ===================== FADE REVEAL ===================== */

.fade-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered reveal for children */
.fade-reveal:nth-child(2) { transition-delay: 0.08s; }
.fade-reveal:nth-child(3) { transition-delay: 0.16s; }
.fade-reveal:nth-child(4) { transition-delay: 0.24s; }
.fade-reveal:nth-child(5) { transition-delay: 0.32s; }

/* ===================== BUBBLE POP ANIMATION ===================== */

.speech-bubble.bubble-pop {
    animation: bubblePop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bubblePop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 768px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
    }

    .scroll-track {
        flex-direction: column;
        width: 100%;
        height: auto;
    }

    .comic-panel {
        width: 100%;
        height: auto;
        min-height: 100vh;
        border-right: none;
        border-bottom: 2px solid #2A2A2A;
    }

    .panel-split {
        flex-direction: column;
        gap: 1.5rem;
    }

    .split-left {
        flex: none;
    }

    .split-right {
        flex: none;
    }

    .card-row {
        flex-direction: column;
        align-items: center;
    }

    .stat-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sidechain-bubbles {
        grid-template-columns: 1fr;
    }

    .panel-inner {
        padding: 3rem 1.5rem;
    }

    .progress-bar {
        display: none;
    }

    .panel-label {
        display: none;
    }

    .data-card {
        width: 240px;
        height: 180px;
    }

    .blob-satellite {
        display: none;
    }

    .channel-labels {
        padding: 0 2%;
    }

    .diagram-congestion {
        max-width: 220px;
    }

    .fade-reveal {
        opacity: 1;
        transform: none;
    }

    .hero-letter {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

@media (max-width: 480px) {
    .body-text {
        font-size: 0.95rem;
    }

    .speech-bubble {
        padding: 1rem 1.5rem;
    }

    .data-card {
        width: 200px;
        height: 160px;
    }

    .section-title {
        font-size: clamp(1.8rem, 5vw, 3rem);
    }
}
