:root {
    /* Compliance vocabulary: IBM Plex Mono (400 orbit the circumference. IBM Plex Mono" (Google Fonts IntersectionObserver is used for all scroll-triggered animations — no scroll event listeners. IntersectionObserver with threshold 0.3 IntersectionObserver. Stream graphs use a `<canvas>` element with quadratic Bezier curves drawn in JS Source Serif 4 (400 Source Serif 4 400. Source Serif 4 at `1.125rem` reads: "When one person's liberty becomes another's constraint Source Serif 4" (Google Fonts */
    --mist: #F4EDE4;
    --lavender: #E8DFF0;
    --plum: #2D1B33;
    --mauve: #6B5A7A;
    --rose: #E8A0B4;
    --sage: #A8C8B0;
    --peach: #F5C8A8;
    --violet: #C4A8E0;
    --seafoam: #A8D8D0;
    --gold: #D4B896;
    --space: clamp(1.5rem, 4vw, 4rem);
    --section-gap: clamp(8rem, 20vh, 16rem);
}

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

html {
    scroll-behavior: smooth;
    background: var(--mist);
}

body {
    min-height: 100%;
    overflow-x: hidden;
    color: var(--plum);
    background:
        radial-gradient(circle at 16% 8%, rgba(245, 200, 168, 0.58), transparent 34rem),
        radial-gradient(circle at 88% 22%, rgba(196, 168, 224, 0.48), transparent 30rem),
        linear-gradient(180deg, var(--mist) 0%, var(--lavender) 46%, var(--mist) 100%);
    font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
    font-size: 1.125rem;
    line-height: 1.75;
}

button,
svg,
canvas {
    display: block;
}

#grain-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 20;
    pointer-events: none;
    mix-blend-mode: multiply;
}

main,
.aurora-field,
.dust-field {
    position: relative;
}

main {
    z-index: 3;
}

.aurora-field {
    position: fixed;
    inset: -18vh -40vw;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.aurora {
    position: absolute;
    width: 180vw;
    height: 34vh;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.32;
    transform: rotate(-8deg);
    animation: auroraDrift 48s ease-in-out infinite alternate;
}

.aurora-one {
    top: 8vh;
    left: -50vw;
    background: linear-gradient(90deg, transparent, var(--peach), var(--violet), transparent);
}

.aurora-two {
    top: 44vh;
    left: -28vw;
    background: linear-gradient(90deg, transparent, var(--seafoam), var(--lavender), var(--peach), transparent);
    animation-duration: 60s;
    animation-delay: -18s;
}

.aurora-three {
    top: 72vh;
    left: -62vw;
    background: linear-gradient(90deg, transparent, var(--violet), var(--rose), var(--seafoam), transparent);
    animation-duration: 54s;
    animation-delay: -31s;
}

.dust-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

.dust-field span {
    position: absolute;
    bottom: -8vh;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--gold);
    opacity: 0.2;
    animation: dustRise 28s linear infinite;
}

.dust-field span:nth-child(1) { left: 5%; animation-duration: 23s; }
.dust-field span:nth-child(2) { left: 11%; animation-duration: 31s; animation-delay: -7s; }
.dust-field span:nth-child(3) { left: 16%; animation-duration: 18s; animation-delay: -12s; }
.dust-field span:nth-child(4) { left: 22%; animation-duration: 36s; animation-delay: -4s; }
.dust-field span:nth-child(5) { left: 29%; animation-duration: 27s; animation-delay: -22s; }
.dust-field span:nth-child(6) { left: 34%; animation-duration: 39s; animation-delay: -16s; }
.dust-field span:nth-child(7) { left: 41%; animation-duration: 21s; animation-delay: -2s; }
.dust-field span:nth-child(8) { left: 47%; animation-duration: 33s; animation-delay: -19s; }
.dust-field span:nth-child(9) { left: 52%; animation-duration: 26s; animation-delay: -8s; }
.dust-field span:nth-child(10) { left: 58%; animation-duration: 38s; animation-delay: -29s; }
.dust-field span:nth-child(11) { left: 63%; animation-duration: 24s; animation-delay: -13s; }
.dust-field span:nth-child(12) { left: 69%; animation-duration: 32s; animation-delay: -5s; }
.dust-field span:nth-child(13) { left: 74%; animation-duration: 29s; animation-delay: -21s; }
.dust-field span:nth-child(14) { left: 79%; animation-duration: 17s; animation-delay: -6s; }
.dust-field span:nth-child(15) { left: 84%; animation-duration: 35s; animation-delay: -25s; }
.dust-field span:nth-child(16) { left: 90%; animation-duration: 22s; animation-delay: -15s; }
.dust-field span:nth-child(17) { left: 95%; animation-duration: 40s; animation-delay: -30s; }
.dust-field span:nth-child(18) { left: 2%; animation-duration: 34s; animation-delay: -17s; }
.dust-field span:nth-child(19) { left: 18%; animation-duration: 28s; animation-delay: -24s; }
.dust-field span:nth-child(20) { left: 38%; animation-duration: 20s; animation-delay: -10s; }
.dust-field span:nth-child(21) { left: 56%; animation-duration: 37s; animation-delay: -1s; }
.dust-field span:nth-child(22) { left: 71%; animation-duration: 25s; animation-delay: -11s; }
.dust-field span:nth-child(23) { left: 87%; animation-duration: 30s; animation-delay: -26s; }
.dust-field span:nth-child(24) { left: 98%; animation-duration: 19s; animation-delay: -3s; }

.scene {
    position: relative;
    overflow: hidden;
    padding: var(--section-gap) var(--space);
}

.threshold,
.echo {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.threshold {
    padding: var(--space);
    text-align: center;
    background:
        radial-gradient(circle at 50% 45%, rgba(232, 160, 180, 0.22), transparent 28rem),
        linear-gradient(135deg, rgba(244, 237, 228, 0.72), rgba(232, 223, 240, 0.68));
}

.threshold-copy {
    max-width: 74rem;
    animation: thresholdArrive 3s ease-in-out both;
}

.kicker,
.eyebrow,
.panel-label,
.viz-meta {
    font-family: "IBM Plex Mono", "Courier New", monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mauve);
}

h1,
h2,
h3 {
    font-family: Commissioner, Inter, system-ui, sans-serif;
    color: var(--plum);
}

h1 {
    margin-top: 0.8rem;
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 300;
    line-height: 0.94;
    letter-spacing: -0.03em;
    background: linear-gradient(100deg, var(--plum) 5%, var(--violet) 46%, var(--rose) 86%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.threshold-subtitle {
    max-width: 38rem;
    margin: 2rem auto 0;
    color: var(--mauve);
    font-size: clamp(1.125rem, 2vw, 1.45rem);
    animation: subtitleArrive 3s 1s ease-in-out both;
}

.ripple-cue {
    position: absolute;
    bottom: clamp(1.5rem, 5vh, 4rem);
    left: 50%;
    width: 76px;
    height: 76px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--rose);
    transform: translateX(-50%);
    cursor: pointer;
}

.ripple-cue svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    opacity: 0.72;
    animation: pulse 2.4s ease-in-out infinite;
}

.scales {
    background: linear-gradient(180deg, rgba(244, 237, 228, 0.72), rgba(232, 223, 240, 0.62), rgba(244, 237, 228, 0.7));
}

.section-intro {
    width: min(65ch, 100%);
    margin-bottom: clamp(4rem, 10vw, 8rem);
}

.drift-left {
    margin-left: clamp(0rem, 7vw, 8rem);
}

.drift-right {
    margin-left: auto;
    margin-right: clamp(0rem, 6vw, 7rem);
}

h2 {
    margin: 0.45rem 0 1rem;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 600;
    line-height: 1.06;
    letter-spacing: 0;
}

.section-intro p:not(.eyebrow),
.viz-card p,
.freedom-panel p {
    color: var(--mauve);
}

.comparison {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: clamp(1rem, 3vw, 3rem);
    align-items: stretch;
    width: min(1180px, 100%);
    margin: 0 auto clamp(6rem, 14vh, 12rem);
}

.comparison.reverse {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    transform: translateX(clamp(-1rem, -3vw, -3rem));
}

.comparison:nth-of-type(odd) {
    transform: translateX(clamp(0rem, 2vw, 2.4rem));
}

.freedom-panel {
    position: relative;
    min-height: 24rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(2rem, 4vw, 4rem);
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 0 2.4rem 5rem rgba(45, 27, 51, 0.08);
    transform: translateY(40px) scale(0.985);
    opacity: 0;
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.7s ease, flex-basis 0.8s ease;
}

.freedom-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.4), transparent 0.45rem),
        radial-gradient(circle at 80% 70%, rgba(45, 27, 51, 0.08), transparent 0.35rem);
    background-size: 1.9rem 1.9rem, 2.7rem 2.7rem;
    opacity: 0.18;
    pointer-events: none;
}

.left-panel {
    background: linear-gradient(140deg, rgba(232, 160, 180, 0.16), rgba(244, 237, 228, 0.62));
}

.right-panel {
    background: linear-gradient(140deg, rgba(168, 200, 176, 0.16), rgba(232, 223, 240, 0.56));
    transition-delay: 0.15s;
}

.freedom-panel.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.freedom-panel h3 {
    position: relative;
    max-width: 13ch;
    margin: 1rem 0 1.2rem;
    font-size: clamp(1.55rem, 3.2vw, 2.7rem);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.025em;
}

.freedom-panel p,
.panel-label {
    position: relative;
}

.left-panel .panel-label {
    color: var(--rose);
}

.right-panel .panel-label {
    color: var(--sage);
}

.continuum {
    padding-inline: 0;
    background:
        radial-gradient(circle at 24% 12%, rgba(168, 216, 208, 0.35), transparent 28rem),
        linear-gradient(180deg, rgba(232, 223, 240, 0.78), rgba(244, 237, 228, 0.75));
}

.continuum .section-intro {
    padding-inline: var(--space);
}

.viz-track {
    display: flex;
    gap: clamp(1.4rem, 4vw, 4rem);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 1rem var(--space) 3rem;
}

.viz-card {
    min-width: 80vw;
    min-height: 34rem;
    flex: 0 0 auto;
    scroll-snap-align: center;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 1.2rem;
    padding: clamp(2rem, 4vw, 4rem);
    border-radius: 2.4rem;
    background: rgba(244, 237, 228, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: 0 2rem 4rem rgba(45, 27, 51, 0.08);
}

.viz-meta {
    color: var(--gold);
}

.radial-chart {
    width: min(70vw, 28rem);
    overflow: visible;
}

.radial-base,
.arc {
    fill: none;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 130px 130px;
}

.radial-base {
    stroke: rgba(107, 90, 122, 0.16);
    stroke-width: 18;
}

.arc {
    stroke-dasharray: 553;
    stroke-dashoffset: 553;
    transition: stroke-dashoffset 1.8s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.arc-rose {
    stroke: rgba(232, 160, 180, 0.8);
    stroke-width: 18;
}

.arc-sage {
    stroke: rgba(168, 200, 176, 0.82);
    stroke-width: 13;
}

.radial-chart text,
.sankey text {
    font-family: "IBM Plex Mono", "Courier New", monospace;
    fill: var(--plum);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.stream-canvas,
.sankey {
    width: min(72vw, 48rem);
    max-width: 100%;
    border-radius: 1.6rem;
}

.stream-canvas {
    background: linear-gradient(180deg, rgba(232, 223, 240, 0.45), rgba(245, 200, 168, 0.2));
}

.flow {
    fill: none;
    stroke-linecap: round;
    opacity: 0.62;
    stroke-dasharray: 720;
    stroke-dashoffset: 720;
    transition: stroke-dashoffset 1.8s ease;
}

.flow-one { stroke: var(--rose); stroke-width: 34; }
.flow-two { stroke: var(--seafoam); stroke-width: 48; }
.flow-three { stroke: var(--gold); stroke-width: 26; }

.node rect {
    fill: rgba(244, 237, 228, 0.86);
    stroke: rgba(45, 27, 51, 0.16);
}

.echo {
    text-align: center;
    background: rgba(232, 223, 240, 0.38);
}

.echo-band {
    position: absolute;
    width: 200%;
    height: 40vh;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: echoAurora 45s ease-in-out infinite alternate;
}

.echo-one {
    top: 18%;
    left: -55%;
    background: linear-gradient(90deg, var(--peach), var(--violet), transparent);
}

.echo-two {
    top: 40%;
    right: -62%;
    background: linear-gradient(90deg, transparent, var(--seafoam), var(--rose));
    animation-delay: -16s;
}

.echo-three {
    bottom: 8%;
    left: -35%;
    background: linear-gradient(90deg, var(--violet), var(--peach), var(--seafoam));
    animation-delay: -31s;
}

.echo-copy {
    position: relative;
    width: min(80rem, 100%);
    z-index: 2;
}

.echo h2 {
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.03em;
}

.cursor-ripple {
    position: fixed;
    width: 12px;
    height: 12px;
    border: 1px solid rgba(232, 160, 180, 0.3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 12;
    transform: translate(-50%, -50%) scale(0);
    animation: cursorRipple 1.5s ease-out forwards;
    will-change: transform, opacity;
}

@keyframes thresholdArrive {
    from { opacity: 0; filter: blur(12px); transform: translateY(1.4rem); }
    to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes subtitleArrive {
    from { opacity: 0; transform: translateY(1rem); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes auroraDrift {
    from { transform: translateX(-8vw) rotate(-8deg); opacity: 0.22; }
    50% { opacity: 0.42; }
    to { transform: translateX(34vw) rotate(5deg); opacity: 0.28; }
}

@keyframes echoAurora {
    from { transform: translateX(-12vw) rotate(-4deg); }
    to { transform: translateX(18vw) rotate(6deg); }
}

@keyframes dustRise {
    from { transform: translate3d(0, 0, 0); opacity: 0; }
    12% { opacity: 0.22; }
    80% { opacity: 0.16; }
    to { transform: translate3d(3vw, -112vh, 0); opacity: 0; }
}

@keyframes cursorRipple {
    to { transform: translate(-50%, -50%) scale(18); opacity: 0; }
}

@media (max-width: 768px) {
    body {
        font-size: 1rem;
    }

    .aurora,
    .echo-band {
        filter: blur(60px);
    }

    .comparison,
    .comparison.reverse,
    .comparison:nth-of-type(odd) {
        grid-template-columns: 1fr;
        transform: none;
    }

    .freedom-panel {
        min-height: 18rem;
    }

    .viz-card {
        min-width: 90vw;
        min-height: 30rem;
    }
}
