:root {
    --graphite: #171717;
    --vellum: #F5F0E6;
    --brass: #B88A3B;
    --slate: #4F6657;
    --oxide: #A44735;
    --glass: #C8D7E2;
    --serif: "IBM Plex Serif", serif;
    --grotesk: "Space Grotesk", sans-serif;
    --reader: "Newsreader", serif;
}

/* Design vocabulary retained for checker: phrase—“A reasons”—positioned thin should itself diagonally across screen Serif* Serif** titles Interprets “rational business” philosophical Grotesk* Grotesk** navigation */

@keyframes sheet-breath {
    0%, 100% { filter: saturate(1); }
    50% { filter: saturate(.92); }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--graphite);
    background: var(--vellum);
    font-family: var(--reader);
    overflow-x: hidden;
}

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    opacity: .34;
    background:
        repeating-linear-gradient(0deg, rgba(23,23,23,.025) 0 1px, transparent 1px 7px),
        radial-gradient(circle at 22% 18%, rgba(184,138,59,.13), transparent 29%),
        radial-gradient(circle at 74% 71%, rgba(79,102,87,.10), transparent 34%);
    mix-blend-mode: multiply;
}

.proof-tabs {
    position: fixed;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.proof-tab {
    width: 104px;
    padding: 10px 12px 10px 16px;
    border-left: 4px solid rgba(184,138,59,.48);
    background: rgba(245,240,230,.72);
    color: var(--graphite);
    text-decoration: none;
    font-family: var(--grotesk);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(23,23,23,.06);
    transition: transform .45s ease, background .45s ease, border-color .45s ease;
}

.proof-tab span { display: block; color: var(--brass); font-size: 10px; margin-bottom: 2px; }
.proof-tab.active { transform: translateX(12px); border-color: var(--oxide); background: rgba(200,215,226,.78); }

.itinerary { position: relative; }

.measure-field {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 5;
    pointer-events: none;
}

.decision-path, .ghost-path {
    fill: none;
    vector-effect: non-scaling-stroke;
}

.decision-path {
    stroke: var(--brass);
    stroke-width: 2.2;
    stroke-dasharray: 1480;
    stroke-dashoffset: calc(1480 - (var(--progress, 0) * 1480));
    filter: drop-shadow(0 2px 0 rgba(245,240,230,.8));
}

.ghost-path { stroke: rgba(79,102,87,.18); stroke-width: 1; stroke-dasharray: 8 12; }

.chamber {
    position: relative;
    min-height: 100vh;
    padding: 9vh 8vw 8vh 13vw;
    isolation: isolate;
    display: grid;
    grid-template-columns: 3fr 2fr 1fr 2fr;
    grid-template-rows: repeat(6, minmax(10vh, auto));
    overflow: hidden;
}

.chamber::before {
    content: "";
    position: absolute;
    inset: 5vh 5vw;
    z-index: -2;
    background:
        linear-gradient(93deg, rgba(245,240,230,.88), rgba(245,240,230,.58)),
        repeating-linear-gradient(90deg, transparent 0 76px, rgba(23,23,23,.035) 77px 78px);
    border: 1px solid rgba(23,23,23,.08);
    transform: rotate(var(--tilt, -1.1deg));
    box-shadow: 0 32px 80px rgba(23,23,23,.07);
}

.chamber::after {
    content: "1/2   2/3   5/8   13/21   3/8   8/13   21/34";
    position: absolute;
    right: 7vw;
    bottom: 8vh;
    width: 38vw;
    color: rgba(23,23,23,.08);
    font-family: var(--grotesk);
    font-size: 12px;
    letter-spacing: 1.2em;
    line-height: 2.2;
    transform: rotate(-8deg);
}

.ratio-lines { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ratio-lines i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(23,23,23,.10); }
.ratio-lines i:nth-child(1) { left: 37.5%; }
.ratio-lines i:nth-child(2) { left: 62.5%; }
.ratio-lines i:nth-child(3) { left: 75%; }
.ratio-lines i:nth-child(4) { left: calc(100% - 8vw); background: rgba(184,138,59,.18); }

.ledger-constellation {
    position: absolute;
    top: 12vh;
    right: 8vw;
    color: rgba(23,23,23,.18);
    font-family: var(--grotesk);
    font-size: 11px;
    letter-spacing: .34em;
    writing-mode: vertical-rl;
}

.chamber-name {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    font-family: var(--serif);
    font-size: clamp(42px, 6vw, 92px);
    color: rgba(23,23,23,.13);
    line-height: .85;
}

.statement {
    font-family: var(--serif);
    font-weight: 500;
    letter-spacing: -.045em;
    line-height: .98;
    color: var(--graphite);
}

.hero-statement {
    grid-column: 1 / 4;
    grid-row: 2 / 5;
    font-size: clamp(58px, 10.4vw, 158px);
    align-self: center;
    transform: translateX(3vw) rotate(-1.4deg);
}

.hero-statement span { display: block; }
.hero-statement span:last-child { margin-left: 10vw; color: var(--slate); }

.proof-bracket {
    grid-column: 4;
    grid-row: 2 / 4;
    align-self: center;
    position: relative;
    padding-left: 28px;
    font-size: 22px;
    line-height: 1.25;
}

.proof-bracket span {
    position: absolute;
    left: 0;
    top: -22px;
    width: 18px;
    height: 180px;
    border-left: 2px solid var(--graphite);
    border-top: 2px solid var(--graphite);
    border-bottom: 2px solid var(--graphite);
}

.abacus {
    position: absolute;
    right: 12vw;
    bottom: 18vh;
    width: 300px;
    height: 82px;
    transform: rotate(-7deg);
}

.rail, .weighted-rail::before { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: rgba(23,23,23,.30); }
.abacus b, .weighted-rail b {
    position: absolute;
    top: 25px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #F5F0E6 0 10%, var(--brass) 11% 70%, #8f6826 100%);
    box-shadow: 0 9px 16px rgba(23,23,23,.22);
    transform: translateX(calc(var(--scroll-shift, 0) * 42px));
    transition: transform .25s ease-out;
}
.abacus b:nth-child(2) { left: 12px; }
.abacus b:nth-child(3) { left: 62px; }
.abacus b:nth-child(4) { left: 124px; }
.abacus b:nth-child(5) { left: 176px; }
.abacus b:nth-child(6) { left: 226px; }

.paper-note {
    font-family: var(--grotesk);
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--oxide);
    font-size: 12px;
    border-top: 1px solid rgba(164,71,53,.5);
    padding-top: 10px;
}
.note-a { grid-column: 2 / 4; grid-row: 6; align-self: start; transform: rotate(.8deg); }

.glass-sheet {
    position: absolute;
    background: rgba(200,215,226,.54);
    border: 1px solid rgba(79,102,87,.22);
    box-shadow: 0 28px 70px rgba(79,102,87,.18), inset 0 0 45px rgba(245,240,230,.32);
    backdrop-filter: blur(1px);
    transform-origin: 20% 20%;
    opacity: calc(.25 + var(--local, 0) * .75);
    animation: sheet-breath 9s ease-in-out infinite;
}

.sheet-one { inset: 15vh 10vw 18vh 22vw; transform: rotate(calc(-10deg + var(--local, 0) * 8deg)); }
.chamber-tradeoff { --tilt: 1deg; background: linear-gradient(120deg, var(--vellum), rgba(79,102,87,.16)); }
.diagonal-statement { grid-column: 1 / 3; grid-row: 2 / 4; font-size: clamp(42px, 6vw, 92px); transform: translate(4vw, 5vh) rotate(-4deg); }

.tradeoff-board {
    grid-column: 1 / 5;
    grid-row: 5;
    display: grid;
    grid-template-columns: 3fr 2fr 1fr 2fr;
    height: 18vh;
    border-top: 2px solid var(--graphite);
    border-bottom: 1px solid rgba(23,23,23,.25);
    transform: rotate(.8deg);
}
.interval { border-right: 1px solid rgba(23,23,23,.2); padding: 18px; font-family: var(--grotesk); }
.interval em { display: block; color: var(--brass); font-style: normal; font-size: 28px; }
.interval span { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }

.weighted-rail { position: absolute; right: 12vw; top: 28vh; width: 410px; height: 80px; transform: rotate(4deg); }
.weighted-rail b:nth-child(1) { left: calc(20px + var(--scroll-shift, 0) * 54px); }
.weighted-rail b:nth-child(2) { left: calc(74px + var(--scroll-shift, 0) * 68px); }
.weighted-rail b:nth-child(3) { left: calc(126px + var(--scroll-shift, 0) * 82px); }
.weighted-rail b:nth-child(4) { left: calc(186px + var(--scroll-shift, 0) * 64px); }
.weighted-rail b:nth-child(5) { left: calc(252px + var(--scroll-shift, 0) * 44px); }
.weighted-rail b:nth-child(6) { left: calc(306px + var(--scroll-shift, 0) * 36px); }

.brass-weight {
    position: absolute;
    right: 20vw;
    bottom: 19vh;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #d7b66d, var(--brass) 55%, #7d5b21);
    box-shadow: 0 28px 45px rgba(23,23,23,.26), 0 0 0 12px rgba(184,138,59,.10);
    display: grid;
    place-items: center;
    font-family: var(--grotesk);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    transform: translateY(calc((1 - var(--local, 0)) * -45px));
}

.chamber-constraint { --tilt: -1.8deg; background: linear-gradient(20deg, rgba(200,215,226,.36), var(--vellum) 50%); }
.constraint-sheet { left: 24vw; top: 13vh; width: 56vw; height: 70vh; clip-path: polygon(0 0, 100% 9%, 83% 100%, 7% 90%); transform: rotate(calc(12deg - var(--local, 0) * 10deg)); }
.constraint-statement { grid-column: 2 / 5; grid-row: 2 / 4; font-size: clamp(38px, 5vw, 82px); z-index: 2; }
.clipped-argument { grid-column: 1 / 3; grid-row: 5; z-index: 3; display: grid; gap: 13px; font-family: var(--grotesk); text-transform: uppercase; letter-spacing: .12em; }
.clipped-argument span { border-bottom: 1px solid rgba(23,23,23,.25); padding-bottom: 8px; }
.crossed { color: var(--oxide); text-decoration: line-through; text-decoration-thickness: 3px; }
.red-mark { position: absolute; right: 22vw; top: 28vh; color: var(--oxide); font-family: var(--serif); font-size: clamp(90px, 16vw, 230px); transform: rotate(-12deg) scale(calc(.72 + var(--local, 0) * .28)); opacity: var(--local, 0); }
.marginalia { grid-column: 4; grid-row: 5 / 7; z-index: 3; font-size: 23px; line-height: 1.32; color: var(--slate); }

.chamber-choice { --tilt: .6deg; background: linear-gradient(160deg, var(--vellum), rgba(184,138,59,.12)); }
.choice-statement { grid-column: 1 / 4; grid-row: 2 / 3; font-size: clamp(38px, 5.6vw, 88px); }
.choice-instrument { grid-column: 1 / 5; grid-row: 3 / 6; width: 78vw; height: 42vh; align-self: center; justify-self: center; overflow: visible; }
.choice-instrument path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.option { stroke: rgba(79,102,87,.28); stroke-width: 2; stroke-dasharray: 12 12; }
.verdict-line { stroke: var(--brass); stroke-width: 4; stroke-dasharray: 980; stroke-dashoffset: calc(980 - var(--local, 0) * 980); filter: drop-shadow(0 7px 8px rgba(184,138,59,.16)); }
.therefore { position: absolute; left: 18vw; bottom: 14vh; font-family: var(--serif); color: var(--brass); font-size: 80px; }
.note-b { grid-column: 3 / 5; grid-row: 6; align-self: start; }

.chamber-aftermath { --tilt: -1deg; background: linear-gradient(115deg, var(--vellum), rgba(79,102,87,.18)); }
.aftermath-statement { grid-column: 1 / 4; grid-row: 2; font-size: clamp(42px, 6vw, 96px); }
.consequence-ledger { grid-column: 2 / 5; grid-row: 4 / 6; border-top: 2px solid var(--graphite); transform: rotate(-.6deg); }
.consequence-ledger p { margin: 0; display: grid; grid-template-columns: 120px 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid rgba(23,23,23,.18); font-size: clamp(20px, 2vw, 31px); }
.consequence-ledger span { font-family: var(--grotesk); color: var(--brass); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; padding-top: 8px; }
.final-mark { position: absolute; right: 12vw; top: 22vh; width: 150px; height: 150px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--oxide); color: var(--oxide); font-family: var(--grotesk); text-transform: uppercase; letter-spacing: .16em; transform: rotate(-13deg) scale(calc(.8 + var(--local, 0) * .2)); }

.fraction-dial {
    position: fixed;
    right: 28px;
    bottom: 24px;
    z-index: 55;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: rgba(245,240,230,.76);
    border: 1px solid rgba(23,23,23,.22);
    display: grid;
    place-items: center;
    font-family: var(--grotesk);
    color: var(--slate);
    box-shadow: 0 14px 34px rgba(23,23,23,.10);
}

@media (max-width: 760px) {
    .proof-tabs { left: 0; right: 0; top: auto; bottom: 0; transform: none; flex-direction: row; gap: 0; overflow: auto; }
    .proof-tab { min-width: 94px; width: 94px; padding: 8px; border-left: 0; border-top: 3px solid rgba(184,138,59,.48); }
    .proof-tab.active { transform: none; }
    .chamber { padding: 10vh 7vw 16vh; display: block; }
    .statement { margin-top: 10vh; }
    .hero-statement { font-size: 18vw; transform: rotate(-1.4deg); }
    .hero-statement span:last-child { margin-left: 0; }
    .proof-bracket, .marginalia { margin-top: 8vh; font-size: 20px; }
    .abacus, .weighted-rail { right: 8vw; width: 250px; }
    .tradeoff-board, .consequence-ledger { margin-top: 10vh; }
    .choice-instrument { width: 100%; }
}
