:root {
    --bg-primary: #1c1a17;
    --bg-warm: #252219;
    --text-display: #d4c9a8;
    --text-body: #a8a088;
    --accent-sage: #7a9e7e;
    --accent-rose: #b08f8a;
    --floating-color: #c4b996;
    --bg-shift: 0;
}

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-body);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

#noise-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: overlay;
    opacity: 0.08;
}

#chapter-indicator {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 100;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-sage);
    display: flex;
    align-items: center;
    gap: 2px;
}

#chapter-numeral {
    transition: opacity 0.4s ease;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: var(--accent-sage);
    animation: blink 1s step-end infinite;
}

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

#floating-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-element {
    position: absolute;
    background-color: var(--floating-color);
    will-change: transform;
}

.floating-circle {
    border-radius: 50%;
}

.floating-line {
    width: 1px;
}

.floating-square {
    /* no border-radius */
}

section {
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin-left: calc(50vw - 360px);
}

#chapter-3 {
    max-width: 720px;
    margin-left: calc(50vw - 400px);
}

#chapter-4 {
    max-width: 480px;
    margin-left: calc(50vw - 280px);
    background-color: var(--bg-warm);
}

#chapter-5 {
    max-width: 100vw;
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem;
}

.chapter-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-sage);
    margin-bottom: 2rem;
}

h1, h2 {
    font-family: 'Recursive', sans-serif;
    font-variation-settings: 'MONO' 0.7, 'CASL' 0.4, 'wght' 700;
    font-size: clamp(2rem, 5.5vw, 4.5rem);
    color: var(--text-display);
    line-height: 1.2;
    transition: font-variation-settings 1.2s ease;
}

h1.active, h2.active {
    font-variation-settings: 'MONO' 0.5, 'CASL' 0.6, 'wght' 800;
}

h1.inactive, h2.inactive {
    font-variation-settings: 'MONO' 1.0, 'CASL' 0.0, 'wght' 300;
}

#hero-title {
    display: inline;
}

#hero-cursor {
    vertical-align: middle;
}

#chapter-1 {
    position: relative;
}

.hero-float {
    animation: floatUp 15s ease-in-out infinite alternate;
}

@keyframes floatUp {
    from { transform: translateY(0); }
    to { transform: translateY(-60px); }
}

/* Evidence section */
.evidence-block p {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.evidence-block p.visible {
    opacity: 1;
    transform: translateY(0);
}

.evidence-block p:nth-child(2) { margin-left: 20px; }
.evidence-block p:nth-child(4) { margin-left: -10px; }
.evidence-block p:nth-child(6) { margin-left: 15px; }
.evidence-block p:nth-child(8) { margin-left: -20px; }

.evidence-divider {
    border: none;
    height: 1px;
    background-color: var(--accent-rose);
    opacity: 0.4;
    margin: 1.5rem 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
}

.evidence-divider.visible {
    transform: scaleX(1);
}

/* Testimony section */
.testimony-block blockquote {
    border-left: 3px solid var(--accent-sage);
    padding-left: 1.5rem;
    margin-bottom: 2rem;
    animation: borderPulse 6s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% { border-left-color: var(--accent-sage); }
    50% { border-left-color: var(--accent-rose); }
}

/* Deliberation section */
.deliberation-block p {
    font-size: clamp(0.85rem, 1vw, 1rem);
    letter-spacing: 0.03em;
    margin-bottom: 1.5rem;
    color: var(--text-body);
}

/* Verdict section */
#verdict-text {
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    max-width: 800px;
}

#chapter-5.final-state {
    opacity: 0.9;
}

@media (max-width: 768px) {
    section {
        margin-left: 1rem;
        margin-right: 1rem;
        max-width: calc(100vw - 2rem);
    }

    #chapter-3 {
        margin-left: 1rem;
        max-width: calc(100vw - 2rem);
    }

    #chapter-4 {
        margin-left: 1rem;
        max-width: calc(100vw - 2rem);
    }

    #chapter-5 {
        margin-left: 0;
        padding: 2rem;
    }
}
