:root {
    --pink: #FF6FB1;
    --paper: #FFF8EA;
    --ink: #11131A;
    --blue: #2A5CFF;
    --receipt: #F5E8C7;
    --teal: #1B8A7A;
    --acid: #B8FF2C;
    --gray: #7D8491;
    --red-string: #e13b3b;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    color: var(--paper);
    font-family: "Newsreader", serif;
    background:
        radial-gradient(circle at 14% 9%, rgba(42, 92, 255, .18), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(255, 111, 177, .16), transparent 24%),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255,255,255,.018) 1px, transparent 1px),
        #11131A;
    background-size: auto, auto, 47px 47px, 47px 47px, auto;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .24;
    z-index: 30;
    background-image:
        repeating-linear-gradient(105deg, rgba(245,232,199,.05) 0 1px, transparent 1px 7px),
        radial-gradient(circle, rgba(255,248,234,.09) 0 1px, transparent 1px);
    background-size: 100% 100%, 11px 11px;
    mix-blend-mode: screen;
}

.atlas { position: relative; }

.case-room {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(8, minmax(72px, 1fr));
    padding: clamp(24px, 4vw, 58px);
    isolation: isolate;
    overflow: hidden;
    border-bottom: 1px dashed rgba(245, 232, 199, .22);
}

.case-room::before {
    content: attr(data-room-name);
    position: absolute;
    top: 19px;
    left: 26px;
    font-family: "IBM Plex Mono", monospace;
    color: rgba(245,232,199,.35);
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
}

h1, h2 {
    font-family: "Rubik Glitch", system-ui;
    font-weight: 400;
    margin: 0;
    line-height: .86;
}

h3, p { margin-top: 0; }

p {
    font-size: clamp(18px, 1.65vw, 25px);
    line-height: 1.18;
}

.mono, .note-number, .glyph-index, .label-gun-strip, .receipt-lines, small {
    font-family: "IBM Plex Mono", monospace;
}

.glyph-index {
    position: fixed;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.glyph-index a {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    text-decoration: none;
    color: var(--ink);
    background: var(--receipt);
    border: 2px solid var(--ink);
    box-shadow: 4px 4px 0 var(--blue);
    transform: rotate(var(--turn, -3deg));
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.glyph-index a:nth-child(even) { --turn: 4deg; box-shadow: 4px 4px 0 var(--pink); }
.glyph-index a.active, .glyph-index a:hover { background: var(--acid); transform: rotate(0) scale(1.16); }

.barcode-rain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: .12;
    background: repeating-linear-gradient(90deg, transparent 0 19px, var(--gray) 19px 21px, transparent 21px 27px, var(--gray) 27px 32px);
    mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
    animation: barcodeFall 18s linear infinite;
}

@keyframes barcodeFall { from { transform: translateY(-48px); } to { transform: translateY(48px); } }

.misregistered-title {
    grid-column: 2 / 9;
    grid-row: 2 / 4;
    position: relative;
    z-index: 5;
    transform: rotate(-2deg);
}

.misregistered-title h1 {
    font-size: clamp(72px, 15vw, 210px);
    color: var(--paper);
    text-shadow: -5px 0 var(--blue), 5px 3px var(--pink), 0 8px rgba(0,0,0,.65);
    letter-spacing: -.05em;
}

.misregistered-title .shadow-copy {
    position: absolute;
    left: 15px;
    top: -15px;
    font-family: "Rubik Glitch", system-ui;
    font-size: clamp(72px, 15vw, 210px);
    color: transparent;
    -webkit-text-stroke: 1px var(--acid);
    opacity: .45;
}

.misregistered-title small {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--ink);
    color: var(--acid);
    border: 1px solid var(--gray);
}

.paper-slip, .torn-card, .layered-paper, .definition-box, .rumor-entry, .gap-index-board {
    background: var(--receipt);
    color: var(--ink);
    border: 2px solid rgba(17,19,26,.92);
    box-shadow: 13px 16px 0 rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,248,234,.58);
    position: relative;
}

.paper-slip::before, .torn-card::before, .layered-paper::before, .definition-box::before, .gap-index-board::before {
    content: "";
    position: absolute;
    width: 78px;
    height: 24px;
    top: -14px;
    left: 24px;
    background: rgba(255,248,234,.55);
    border: 1px solid rgba(125,132,145,.45);
    transform: rotate(-7deg);
}

.paper-slip::after, .torn-card::after, .layered-paper::after {
    content: "";
    position: absolute;
    inset: auto 0 -10px 0;
    height: 15px;
    background: linear-gradient(135deg, transparent 0 12px, var(--receipt) 12px 24px, transparent 24px 36px);
    background-size: 36px 15px;
}

.value-slip {
    grid-column: 1 / 5;
    grid-row: 5 / 7;
    padding: 24px;
    color: var(--blue);
    background: rgba(245,232,199,.88);
    transform: rotate(-8deg);
    z-index: 4;
}

.value-slip strong, .price-sticker span, .cost-stain strong, mark, .gap-equation span {
    font-family: "Archivo Black", sans-serif;
    letter-spacing: -.03em;
}

.value-slip strong { font-size: clamp(36px, 5vw, 82px); display: block; }

.drift { animation: driftIn 1.7s cubic-bezier(.2, .9, .16, 1) both, paperFloat 5s ease-in-out 1.8s infinite; }

@keyframes driftIn { from { opacity: 0; transform: translate(-80px, 60px) rotate(-18deg); } to { opacity: 1; transform: translate(0,0) rotate(-8deg); } }
@keyframes paperFloat { 50% { translate: 0 -10px; } }

.price-sticker {
    grid-column: 7 / 11;
    grid-row: 4 / 6;
    align-self: center;
    justify-self: center;
    width: clamp(180px, 24vw, 330px);
    aspect-ratio: 1.55;
    border: 0;
    cursor: pointer;
    color: var(--ink);
    background: var(--pink);
    clip-path: polygon(9% 0, 100% 8%, 91% 100%, 0 88%);
    box-shadow: 0 15px 0 rgba(0,0,0,.42);
    z-index: 9;
    transform-origin: 20% 95%;
}

.price-sticker span { display: block; font-size: clamp(42px, 7vw, 92px); }
.price-sticker em { font-family: "IBM Plex Mono", monospace; font-size: 24px; font-style: normal; }
.slam-stamp { animation: labelSlam .8s cubic-bezier(.18, 1.35, .35, 1) .7s both; }
@keyframes labelSlam { 0% { opacity: 0; transform: translateY(-200px) rotate(24deg) scale(1.8); } 72% { transform: translateY(8px) rotate(-4deg) scale(.94); } 100% { opacity: 1; transform: translateY(0) rotate(4deg) scale(1); } }
.price-sticker.peeled { transform: rotate(-18deg) translate(-35px, -28px); filter: drop-shadow(22px 26px 0 rgba(0,0,0,.32)); }

.cost-stain {
    grid-column: 7 / 11;
    grid-row: 5 / 7;
    padding: 38px 30px 22px;
    background: rgba(245,232,199,.42);
    color: rgba(245,232,199,.9);
    border-radius: 46% 38% 44% 51%;
    border: 1px dashed var(--gray);
    opacity: .18;
    transform: rotate(5deg) scale(.92);
    z-index: 3;
    transition: opacity .45s ease, transform .45s ease;
}
.cost-stain.revealed { opacity: 1; transform: rotate(2deg) scale(1); }
.cost-stain strong { color: var(--receipt); font-size: 48px; }

.entry-definition {
    grid-column: 8 / 12;
    grid-row: 2 / 5;
    padding: 28px;
    transform: rotate(3deg);
    z-index: 6;
}

.entry-definition h2, .pawn-ticket h2, .receipt-head h2, .rumor-entry h2, .gap-index-board h2 {
    font-size: clamp(45px, 6vw, 98px);
    margin: 10px 0 16px;
}

.note-number {
    color: var(--blue);
    font-weight: 700;
    background: var(--acid);
    padding: 3px 8px;
}

.inspect-button, .stamp-button, .open-footnote {
    font-family: "IBM Plex Mono", monospace;
    color: var(--ink);
    background: var(--acid);
    border: 2px solid var(--ink);
    box-shadow: 5px 5px 0 var(--blue);
    padding: 13px 17px;
    text-transform: uppercase;
    cursor: pointer;
    transform: rotate(-2deg);
}

.inspect-button:active, .stamp-button:active, .open-footnote:active { transform: rotate(2deg) translate(4px, 4px); box-shadow: 1px 1px 0 var(--blue); }

.wiki-bracket {
    position: absolute;
    font-family: "IBM Plex Mono", monospace;
    color: rgba(42,92,255,.28);
    font-size: 21vw;
    font-weight: 700;
    z-index: 0;
}
.wiki-bracket.left { left: -4vw; bottom: 0; }
.wiki-bracket.right { right: 2vw; top: 7vh; }

.red-string { position: absolute; height: 2px; background: var(--red-string); transform-origin: left center; z-index: 2; box-shadow: 0 0 8px rgba(225,59,59,.55); }
.s-one { width: 52vw; left: 10vw; top: 67vh; transform: rotate(-24deg); }
.s-two { width: 46vw; right: 12vw; top: 27vh; transform: rotate(18deg); }
.pin { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--teal); box-shadow: 0 3px 0 rgba(0,0,0,.7), inset -3px -2px 0 rgba(0,0,0,.25); z-index: 10; }
.p-one { left: 9.7vw; top: 66vh; } .p-two { right: 13vw; top: 26vh; background: var(--pink); }

.asking-room { background: linear-gradient(148deg, rgba(27,138,122,.2), transparent 34%), #11131A; }
.clue-path { position: absolute; inset: 0; z-index: 0; }
.clue-path path { fill: none; stroke: var(--blue); stroke-width: 4; stroke-dasharray: 14 11; filter: drop-shadow(0 0 7px rgba(42,92,255,.65)); animation: dashPath 9s linear infinite; }
@keyframes dashPath { to { stroke-dashoffset: -220; } }

.pawn-ticket { grid-column: 2 / 7; grid-row: 2 / 6; padding: 32px; transform: rotate(-3deg); z-index: 3; }
mark { background: var(--pink); color: var(--ink); font-size: clamp(48px, 8vw, 120px); line-height: .8; padding: 0 10px; }
.label-gun-strip { grid-column: 7 / 13; grid-row: 2 / 3; display: flex; flex-wrap: wrap; align-content: start; gap: 8px; transform: rotate(6deg); z-index: 4; }
.label-gun-strip span { background: var(--pink); color: var(--ink); padding: 8px 13px; font-weight: 700; border: 2px solid var(--ink); box-shadow: 3px 3px 0 rgba(0,0,0,.55); }
.jitter { animation: numberJitter .45s steps(2) infinite; }
@keyframes numberJitter { 50% { transform: translate(-2px, 2px) rotate(-2deg); filter: hue-rotate(30deg); } }
.definition-box { grid-column: 8 / 11; grid-row: 4 / 7; padding: 24px; z-index: 4; }
.tilted-a { transform: rotate(8deg); }
.speech-scrap { position: absolute; max-width: 290px; padding: 17px; background: var(--paper); color: var(--blue); border: 2px solid var(--blue); font-family: "Newsreader", serif; font-size: 24px; box-shadow: 8px 10px 0 rgba(0,0,0,.38); z-index: 4; }
.speech-scrap.one { left: 7vw; bottom: 8vh; transform: rotate(8deg); }
.speech-scrap.two { right: 11vw; bottom: 11vh; transform: rotate(-11deg); color: var(--teal); border-color: var(--teal); }
.stamp-button { grid-column: 8 / 10; grid-row: 7; align-self: center; z-index: 8; background: var(--pink); box-shadow: 5px 5px 0 var(--acid); }

.carry-room { background: radial-gradient(circle at 70% 45%, rgba(255,111,177,.16), transparent 30%), #11131A; }
.receipt-accordion { grid-column: 2 / 6; grid-row: 2 / 8; background: var(--paper); color: var(--ink); box-shadow: 12px 12px 0 rgba(0,0,0,.55); transform: rotate(2deg); overflow: hidden; z-index: 4; }
.receipt-head { padding: 26px; background: var(--receipt); border-bottom: 2px dashed var(--gray); }
.receipt-lines { max-height: 180px; transition: max-height .7s cubic-bezier(.2,.8,.2,1); background: repeating-linear-gradient(0deg, var(--paper) 0 31px, rgba(125,132,145,.18) 31px 32px); }
.receipt-accordion.unfolded .receipt-lines { max-height: 520px; }
.receipt-lines p { display: flex; justify-content: space-between; margin: 0; padding: 18px 24px; font-size: 20px; border-bottom: 1px dotted var(--gray); }
.peel-window { grid-column: 7 / 12; grid-row: 3 / 7; position: relative; min-height: 330px; transform: rotate(-4deg); z-index: 5; }
.pink-cover, .residue-copy { position: absolute; inset: 0; padding: 34px; border: 2px solid var(--ink); }
.pink-cover { background: var(--pink); color: var(--ink); display: grid; place-items: center; font-family: "Archivo Black", sans-serif; font-size: clamp(60px, 10vw, 150px); clip-path: polygon(0 0, 100% 8%, 90% 100%, 5% 92%); transition: transform .7s cubic-bezier(.2,.9,.12,1), clip-path .7s; transform-origin: 3% 97%; z-index: 2; box-shadow: 0 18px 0 rgba(0,0,0,.4); }
.peel-window.peeled .pink-cover, .peel-window:hover .pink-cover { transform: rotate(-22deg) translate(-42px, -34px); clip-path: polygon(0 0, 100% 8%, 65% 72%, 5% 92%); }
.residue-copy { background: rgba(245,232,199,.72); color: var(--ink); box-shadow: inset 0 0 0 8px rgba(125,132,145,.13), 15px 18px 0 rgba(0,0,0,.4); }
.fee-cloud { grid-column: 1 / 13; grid-row: 7 / 9; z-index: 3; }
.fee-cloud span { display: inline-block; margin: 8px; padding: 9px 14px; background: rgba(245,232,199,.22); color: var(--receipt); border: 1px dashed var(--gray); font-family: "IBM Plex Mono", monospace; transform: rotate(var(--r, 3deg)); }
.fee-cloud span:nth-child(2n) { --r: -7deg; color: var(--acid); }

.rumor-room { background: linear-gradient(90deg, rgba(42,92,255,.12), transparent 40%, rgba(27,138,122,.18)), #11131A; }
.barcode-decoder { grid-column: 1 / 7; grid-row: 2 / 7; display: flex; gap: clamp(5px, 1vw, 13px); align-items: stretch; min-height: 420px; position: relative; padding: 18px; background: var(--paper); transform: rotate(-2deg); box-shadow: 12px 14px 0 rgba(0,0,0,.55); z-index: 3; }
.barcode-decoder span { flex: 1; background: var(--ink); transform-origin: bottom; animation: scanBars 2.6s ease-in-out infinite; }
.barcode-decoder span:nth-child(2n) { flex: .45; animation-delay: .15s; }
.barcode-decoder span:nth-child(3n) { flex: .22; background: var(--gray); animation-delay: .3s; }
.barcode-decoder::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 18%; background: rgba(184,255,44,.36); mix-blend-mode: multiply; animation: scanWipe 3.2s linear infinite; }
@keyframes scanBars { 50% { transform: scaleY(.72); } }
@keyframes scanWipe { to { top: 82%; } }
.barcode-decoder p { position: absolute; left: 24px; right: 24px; bottom: 20px; background: var(--acid); color: var(--ink); padding: 10px; font-family: "IBM Plex Mono", monospace; font-size: 17px; }
.rumor-entry { grid-column: 7 / 12; grid-row: 2 / 5; padding: 30px; transform: rotate(4deg); z-index: 5; }
.synonym-swarm { grid-column: 7 / 13; grid-row: 5 / 8; position: relative; z-index: 8; }
.synonym-swarm button { position: absolute; font-family: "Newsreader", serif; font-size: clamp(22px, 3vw, 44px); padding: 8px 14px; background: var(--receipt); color: var(--ink); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--blue); cursor: pointer; transition: transform .25s ease, background .2s ease; }
.synonym-swarm button:nth-child(1) { left: 0; top: 10%; transform: rotate(-9deg); }
.synonym-swarm button:nth-child(2) { left: 42%; top: 0; transform: rotate(6deg); }
.synonym-swarm button:nth-child(3) { left: 18%; top: 39%; transform: rotate(12deg); }
.synonym-swarm button:nth-child(4) { right: 6%; top: 42%; transform: rotate(-6deg); }
.synonym-swarm button:nth-child(5) { left: 36%; bottom: 5%; transform: rotate(3deg); }
.synonym-swarm button.argue { background: var(--pink); transform: rotate(0) scale(1.18); z-index: 9; }
.carbon-ghost { position: absolute; left: 11vw; bottom: 8vh; max-width: 520px; color: rgba(245,232,199,.22); font-size: clamp(36px, 6vw, 90px); line-height: .82; transform: rotate(5deg); }

.gap-room { background: radial-gradient(circle at 50% 58%, rgba(184,255,44,.18), transparent 34%), #11131A; }
.gap-index-board { grid-column: 2 / 10; grid-row: 2 / 6; padding: 36px; transform: rotate(-2deg); z-index: 4; }
.gap-equation { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: clamp(32px, 7vw, 104px); line-height: .9; }
.gap-equation b { color: var(--ink); font-family: "Rubik Glitch", system-ui; }
.blue-word { color: var(--blue); } .pink-word { color: var(--pink); text-shadow: 2px 2px 0 var(--ink); } .beige-word { color: var(--gray); }
.footnote-crawl { grid-column: 8 / 12; grid-row: 5 / 8; list-style: none; padding: 22px; margin: 0; background: rgba(17,19,26,.88); border: 1px solid var(--gray); color: var(--receipt); font-family: "IBM Plex Mono", monospace; transform: rotate(5deg); z-index: 7; }
.footnote-crawl li { margin: 14px 0; transform: translateX(-18px); opacity: .45; transition: transform .3s, opacity .3s, color .3s; }
.footnote-crawl.open li { transform: translateX(0); opacity: 1; color: var(--acid); }
.open-footnote { grid-column: 3 / 5; grid-row: 7; align-self: center; z-index: 8; }

.cursor-stamp { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; color: var(--pink); border: 4px solid var(--pink); font-family: "Archivo Black", sans-serif; font-size: 38px; padding: 5px 10px; opacity: 0; transform: translate(-50%, -50%) rotate(-18deg) scale(1.6); transition: opacity .2s ease; mix-blend-mode: screen; }
.cursor-stamp.show { opacity: .9; animation: stampPulse .42s ease both; }
@keyframes stampPulse { from { transform: translate(-50%, -50%) rotate(-18deg) scale(2.1); } to { transform: translate(-50%, -50%) rotate(-11deg) scale(1); } }

.stamped::after { content: attr(data-stamp-text); position: absolute; color: var(--pink); border: 4px solid var(--pink); font-family: "Archivo Black", sans-serif; font-size: 48px; padding: 5px 13px; right: 12%; top: 16%; transform: rotate(-17deg); z-index: 20; }

@media (max-width: 820px) {
    .case-room { display: block; padding: 70px 20px 48px; min-height: auto; }
    .misregistered-title, .value-slip, .entry-definition, .pawn-ticket, .definition-box, .receipt-accordion, .peel-window, .rumor-entry, .gap-index-board, .footnote-crawl { margin: 24px 0; }
    .misregistered-title, .value-slip, .entry-definition, .pawn-ticket, .definition-box, .receipt-accordion, .peel-window, .rumor-entry, .gap-index-board, .footnote-crawl { transform: rotate(0); }
    .price-sticker { margin: 20px auto; display: block; }
    .speech-scrap, .carbon-ghost { position: relative; left: auto !important; right: auto !important; bottom: auto !important; margin: 18px 0; }
    .synonym-swarm { min-height: 310px; }
    .glyph-index { right: 8px; }
}
