:root {
    --archive-black: #11100E;
    --case-paper: #E8DDC6;
    --carbon-gray: #4A4742;
    --oxide-red: #A9362B;
    --bruise-violet: #4B3B63;
    --ledger-green: #68775A;
    --nickel-blue: #7A98A6;
    --paper-shadow: rgba(17, 16, 14, 0.54);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--archive-black);
    color: var(--carbon-gray);
    font-family: "Archivo", sans-serif;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 12%, rgba(122, 152, 166, 0.13), transparent 25%),
        radial-gradient(circle at 85% 35%, rgba(75, 59, 99, 0.22), transparent 28%),
        linear-gradient(120deg, rgba(232, 221, 198, 0.03), transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 8;
    opacity: .3;
    background-image:
        repeating-radial-gradient(circle at 17% 23%, rgba(232, 221, 198, .12) 0 1px, transparent 1px 4px),
        repeating-linear-gradient(9deg, transparent 0 10px, rgba(232, 221, 198, .035) 11px 12px);
    mix-blend-mode: overlay;
}

.case-nav {
    position: fixed;
    top: 24px;
    left: 24px;
    right: 24px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--case-paper);
    font: 700 11px/1 "Roboto Mono", monospace;
    letter-spacing: .12em;
    text-transform: uppercase;
    pointer-events: none;
}

.case-nav a, .nav-title {
    pointer-events: auto;
    color: var(--case-paper);
    text-decoration: none;
    border: 1px solid rgba(232, 221, 198, .24);
    background: rgba(17, 16, 14, .62);
    padding: 9px 11px;
    box-shadow: 0 10px 26px rgba(0,0,0,.26);
}

.nav-title { margin-right: auto; color: var(--nickel-blue); }

.board-strings {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.string-path {
    fill: none;
    stroke: var(--oxide-red);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    filter: drop-shadow(0 5px 3px rgba(0,0,0,.38));
}

.panel {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 100px 7vw;
    isolation: isolate;
}

.panel::after {
    content: attr(data-panel);
    position: absolute;
    right: 5vw;
    bottom: 42px;
    color: rgba(232, 221, 198, .22);
    font: 700 42px/1 "Roboto Mono", monospace;
}

.report-sheet, .appendix-envelope {
    position: relative;
    width: min(860px, 86vw);
    min-height: 560px;
    padding: 70px 70px 56px;
    background:
        linear-gradient(90deg, rgba(74, 71, 66, .07) 0 1px, transparent 1px 38px),
        linear-gradient(var(--case-paper), var(--case-paper));
    box-shadow: 0 38px 70px var(--paper-shadow), 0 0 0 1px rgba(232, 221, 198, .16) inset;
    z-index: 2;
    transform: rotate(var(--tilt, -1.5deg));
    transition: transform .7s cubic-bezier(.2,.8,.2,1), filter .7s ease;
}

.report-sheet::before, .appendix-envelope::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 20%, rgba(74, 71, 66, .16) 0 1px, transparent 2px),
        radial-gradient(circle at 72% 78%, rgba(74, 71, 66, .12) 0 1px, transparent 2px),
        linear-gradient(92deg, transparent 0 74%, rgba(169,54,43,.04) 75% 76%, transparent 77%);
    background-size: 17px 17px, 23px 23px, 100% 100%;
    pointer-events: none;
}

.cover-sheet { --tilt: -4deg; max-width: 780px; min-height: 620px; }
.cover-sheet.opened { --tilt: -1deg; }
.ledger-sheet { --tilt: 2.2deg; margin-left: -18vw; }
.map-sheet { --tilt: -2deg; margin-right: -12vw; width: min(980px, 90vw); }
.contradiction-paper { --tilt: 1deg; margin-left: 8vw; }
.final-sheet { --tilt: -1.2deg; }

.eyebrow, .margin-code, .table-mark, .receipt span, .signature-line {
    font-family: "Roboto Mono", monospace;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.eyebrow {
    margin: 0 0 18px;
    color: var(--oxide-red);
    font-size: 12px;
    font-weight: 700;
}

h1, h2 {
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    color: var(--archive-black);
    margin: 0;
    letter-spacing: -.04em;
}

h1 { font-size: clamp(76px, 14vw, 178px); line-height: .82; }
h2 { font-size: clamp(42px, 6vw, 82px); line-height: .9; max-width: 780px; }

.deck, .conclusion-copy {
    max-width: 590px;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.34;
    color: var(--carbon-gray);
}

.file-button {
    margin-top: 28px;
    border: 2px solid var(--archive-black);
    background: var(--archive-black);
    color: var(--case-paper);
    padding: 15px 20px;
    font: 800 12px/1 "Archivo", sans-serif;
    letter-spacing: .18em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 8px 8px 0 var(--oxide-red);
    transition: transform .25s ease, box-shadow .25s ease;
}

.file-button:hover { transform: translate(4px, 4px); box-shadow: 3px 3px 0 var(--oxide-red); }
.file-button.secondary { background: transparent; color: var(--archive-black); box-shadow: 8px 8px 0 var(--nickel-blue); }

.binder-clip {
    position: absolute;
    top: -34px;
    left: 50%;
    width: 134px;
    height: 72px;
    transform: translateX(-50%);
    border-radius: 14px 14px 7px 7px;
    background: linear-gradient(90deg, #504738, #c4a971 28%, #75613f 70%, #2c251c);
    box-shadow: 0 18px 24px rgba(0,0,0,.35);
}

.binder-clip span { position: absolute; inset: 17px 24px; border: 3px solid rgba(17,16,14,.52); border-bottom: 0; border-radius: 20px 20px 0 0; }
.fold-line { position: absolute; top: 0; bottom: 0; left: 74%; width: 1px; background: rgba(74,71,66,.24); }
.margin-code { position: absolute; top: 26px; right: 24px; color: rgba(74,71,66,.72); font-size: 10px; line-height: 1.8; text-align: right; }

.custody-stamp {
    display: inline-grid;
    place-items: center;
    border: 4px double var(--oxide-red);
    color: var(--oxide-red);
    font: 800 21px/1 "Archivo", sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 18px 22px;
    opacity: .74;
    transform: rotate(-13deg);
    mix-blend-mode: multiply;
}

.preliminary { position: absolute; right: 48px; bottom: 62px; font-size: 34px; }
.custody-stamp.small { font-size: 14px; padding: 12px 16px; margin: 8px; }
.custody-stamp.violet { border-color: var(--bruise-violet); color: var(--bruise-violet); transform: rotate(7deg); }
.custody-stamp.green { border-color: var(--ledger-green); color: var(--ledger-green); transform: rotate(-4deg); }

.corner-note { position: absolute; left: -28px; bottom: 85px; rotate: -90deg; color: var(--ledger-green); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.paper-weight { position: absolute; right: 17vw; top: 22vh; z-index: 3; width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center; color: rgba(232,221,198,.7); background: radial-gradient(circle at 35% 28%, #4A4742, #11100E); box-shadow: 0 25px 35px rgba(0,0,0,.44); font: 700 18px "Roboto Mono", monospace; }
.red-thread { position: absolute; height: 4px; width: 46vw; background: var(--oxide-red); transform: rotate(-26deg); box-shadow: 0 6px 7px rgba(0,0,0,.42); z-index: 4; }
.thread-one { right: -6vw; top: 34vh; transform-origin: right center; scale: 0 1; transition: scale 1.1s cubic-bezier(.2,.8,.2,1); }
.cover-log.threaded .thread-one { scale: 1 1; }
.table-mark { position: absolute; color: rgba(232,221,198,.25); font-size: 11px; left: 6vw; top: 18vh; }

.exhibit-tab { position: absolute; right: -56px; top: 70px; padding: 18px 14px; color: var(--case-paper); font: 800 12px/1 "Archivo", sans-serif; letter-spacing: .14em; writing-mode: vertical-rl; text-orientation: mixed; box-shadow: 10px 12px 20px rgba(0,0,0,.24); }
.green-tab { background: var(--ledger-green); }
.blue-tab { background: var(--nickel-blue); color: var(--archive-black); }
.red-tab { background: var(--oxide-red); }
.violet-tab { background: var(--bruise-violet); }

.custody-grid { margin-top: 40px; border-top: 2px solid rgba(74,71,66,.35); }
.custody-row { display: grid; grid-template-columns: 90px 130px 1fr; gap: 18px; align-items: center; padding: 17px 0; border-bottom: 1px solid rgba(74,71,66,.28); font-size: 16px; }
.custody-row span { font-family: "Roboto Mono", monospace; color: var(--oxide-red); }
.custody-row strong { color: var(--archive-black); text-transform: uppercase; letter-spacing: .1em; }
.custody-row em { color: var(--carbon-gray); }
.stamp-wall { margin-top: 28px; }
.telegram-strip { position: absolute; right: 8vw; bottom: 18vh; width: min(520px, 82vw); background: #d8c7a3; color: var(--archive-black); padding: 22px; box-shadow: 0 24px 48px rgba(0,0,0,.42); transform: rotate(-5deg); font: 700 18px/1.25 "Roboto Mono", monospace; }

.graph-paper { position: relative; margin-top: 36px; min-height: 430px; background-image: linear-gradient(rgba(122,152,166,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(122,152,166,.22) 1px, transparent 1px); background-size: 28px 28px; border: 1px solid rgba(74,71,66,.28); overflow: hidden; }
.pattern-map { position: absolute; inset: 22px; width: calc(100% - 44px); height: calc(100% - 44px); }
.wax-circle { fill: none; stroke: var(--oxide-red); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 900; stroke-dashoffset: 900; }
.signal-line { fill: none; stroke: var(--bruise-violet); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 900; stroke-dashoffset: 900; }
.pins circle { fill: var(--oxide-red); filter: drop-shadow(8px 10px 4px rgba(17,16,14,.25)); }
.in-view .wax-circle, .in-view .signal-line { animation: drawLine 2.6s ease forwards; }
.in-view .delay { animation-delay: .45s; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }

.acetate-overlay { position: absolute; inset: 35px 60px; border: 1px solid rgba(122,152,166,.65); background: rgba(122,152,166,.24); backdrop-filter: blur(1px); transform: rotate(5deg); transition: transform .7s ease, opacity .7s ease; }
.acetate-overlay.lifted { transform: translateY(-70px) rotate(-8deg); opacity: .62; }
.acetate-overlay span { position: absolute; top: 14px; left: 18px; font: 700 11px "Roboto Mono", monospace; color: var(--bruise-violet); letter-spacing: .15em; }
.acetate-overlay i { position: absolute; width: 56px; height: 56px; border: 2px solid var(--nickel-blue); border-radius: 50%; }
.acetate-overlay i:nth-child(2) { left: 18%; top: 35%; }
.acetate-overlay i:nth-child(3) { right: 22%; top: 18%; }
.acetate-overlay i:nth-child(4) { right: 12%; bottom: 24%; }
.fingerprint { position: absolute; left: 12vw; bottom: 18vh; width: 120px; height: 150px; border-radius: 50%; opacity: .22; background: repeating-radial-gradient(ellipse at center, transparent 0 7px, var(--case-paper) 8px 10px); transform: rotate(18deg); }

.typed-note { margin: 32px 0 22px; min-height: 64px; color: var(--archive-black); font: 500 19px/1.45 "Roboto Mono", monospace; border-left: 5px solid var(--oxide-red); padding-left: 18px; }
.redacted-lines p { font-size: 20px; line-height: 1.55; margin: 14px 0; }
.redaction-strip { display: inline-block; vertical-align: middle; width: 230px; height: 24px; background: var(--archive-black); box-shadow: 0 2px 0 rgba(169,54,43,.28); transition: width .7s ease, background .7s ease; }
.redaction-strip.short { width: 150px; }
.redaction-strip.long { width: 310px; }
.redacted-lines.revealed .redaction-strip { width: 18px; background: var(--oxide-red); }
.magnifier-ring { position: absolute; right: 16vw; top: 20vh; width: 170px; height: 170px; border: 8px solid rgba(122,152,166,.7); border-radius: 50%; box-shadow: 0 25px 44px rgba(0,0,0,.38), inset 0 0 28px rgba(232,221,198,.12); }
.magnifier-ring::after { content: ""; position: absolute; width: 96px; height: 10px; background: rgba(122,152,166,.7); right: -70px; bottom: -24px; transform: rotate(42deg); }

.appendix-envelope { width: min(920px, 90vw); min-height: 600px; background: linear-gradient(160deg, #d7c8a9, var(--case-paper)); transform: rotate(2deg); overflow: hidden; }
.envelope-mouth { position: absolute; left: 0; right: 0; top: 0; height: 245px; background: linear-gradient(150deg, rgba(74,71,66,.12), transparent 60%); clip-path: polygon(0 0, 100% 0, 50% 100%); border-bottom: 2px solid rgba(74,71,66,.18); }
.receipt { position: absolute; width: 310px; background: #f2e7d1; padding: 20px; box-shadow: 0 16px 28px rgba(17,16,14,.22); font-size: 18px; line-height: 1.25; border-top: 6px dotted rgba(74,71,66,.32); }
.receipt span { display: block; color: var(--oxide-red); font-size: 11px; margin-bottom: 8px; }
.receipt-one { left: 80px; bottom: 115px; transform: rotate(-8deg); }
.receipt-two { right: 110px; bottom: 150px; transform: rotate(7deg); }
.receipt-three { left: 42%; bottom: 50px; transform: rotate(-1deg); }
.map-pin { position: absolute; right: 95px; top: 210px; width: 30px; height: 30px; background: var(--oxide-red); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: -18px 24px 10px rgba(17,16,14,.24); }
.map-pin::after { content: ""; position: absolute; width: 12px; height: 12px; background: var(--case-paper); border-radius: 50%; left: 9px; top: 9px; }

.final-stamps { margin: 34px 0; }
.signature-line { border-top: 2px solid rgba(74,71,66,.38); padding-top: 18px; color: var(--carbon-gray); font-size: 12px; }

.panel .report-sheet, .panel .appendix-envelope, .telegram-strip, .fingerprint, .magnifier-ring, .paper-weight { opacity: 0; filter: blur(10px); transform: translateY(34px) rotate(var(--tilt, 0deg)); }
.panel.in-view .report-sheet, .panel.in-view .appendix-envelope, .panel.in-view .telegram-strip, .panel.in-view .fingerprint, .panel.in-view .magnifier-ring, .panel.in-view .paper-weight { opacity: 1; filter: blur(0); transform: translateY(0) rotate(var(--tilt, 0deg)); transition: opacity .8s ease, filter .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.panel.in-view .telegram-strip { transition-delay: .22s; }
.panel.in-view .paper-weight { transition-delay: .38s; }

@media (max-width: 760px) {
    .case-nav { top: 12px; left: 12px; right: 12px; gap: 5px; }
    .case-nav a { padding: 8px 7px; }
    .nav-title { display: none; }
    .panel { padding: 84px 20px; }
    .report-sheet, .appendix-envelope { width: 100%; min-height: 560px; padding: 56px 28px 42px; }
    .preliminary { right: 24px; bottom: 36px; font-size: 21px; }
    .ledger-sheet, .map-sheet, .contradiction-paper { margin: 0; }
    .custody-row { grid-template-columns: 1fr; gap: 6px; }
    .telegram-strip { position: relative; right: auto; bottom: auto; margin-top: -40px; }
    .exhibit-tab { right: -12px; }
    .graph-paper { min-height: 360px; }
    .receipt { width: 245px; }
    .receipt-one { left: 20px; }
    .receipt-two { right: 18px; }
    .receipt-three { left: 80px; }
}
