:root {
  /* Design typography tokens: IBM Plex Sans Condensed* for grounded explanatory copy; Roboto Condensed* for section headings. */
  --soil: #2D2118;
  --kraft: #E8D0A8;
  --clay: #B85A2A;
  --moss: #4D6B3C;
  --mustard: #D7A729;
  --rose: #C98272;
  --teal: #3E7F78;
  --display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --condensed: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  --hand: "Patrick Hand", "Comic Sans MS", cursive;
  --body: "IBM Plex Sans Condensed", "Roboto Condensed", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--soil);
  background:
    radial-gradient(circle at 20% 15%, #C98272 0%, #E8D0A8 34%, #3E7F78 100%);
  font-family: var(--body);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(45,33,24,.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(45,33,24,.035) 1px, transparent 1px),
    radial-gradient(circle at 13% 24%, rgba(45,33,24,.12) 0 1px, transparent 2px),
    radial-gradient(circle at 71% 62%, rgba(184,90,42,.13) 0 1px, transparent 3px);
  background-size: 68px 68px, 68px 68px, 31px 31px, 47px 47px;
  mix-blend-mode: multiply;
  opacity: .35;
  z-index: 20;
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(105deg, rgba(45,33,24,.045) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(14deg, rgba(255,255,255,.08) 0 2px, transparent 2px 17px);
  opacity: .45;
  z-index: 19;
}

.graphite-smudge {
  position: fixed;
  width: 280px;
  height: 180px;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0) rotate(-12deg);
  background: radial-gradient(ellipse, rgba(45,33,24,.18), rgba(45,33,24,.08) 35%, transparent 70%);
  filter: blur(12px);
  pointer-events: none;
  opacity: .55;
  z-index: 4;
}

.ledger {
  position: relative;
  z-index: 2;
  margin-left: clamp(88px, 11vw, 160px);
}

.chapter {
  position: relative;
  min-height: 100vh;
  padding: clamp(34px, 5vw, 72px) clamp(26px, 6vw, 86px);
  overflow: hidden;
  isolation: isolate;
}

.ledger-margin {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: clamp(88px, 11vw, 160px);
  z-index: 6;
  border-right: 4px solid rgba(45,33,24,.5);
  background:
    linear-gradient(180deg, rgba(232,208,168,.94), rgba(215,167,41,.23), rgba(232,208,168,.88)),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(45,33,24,.08) 39px 40px);
  box-shadow: inset -10px 0 0 rgba(184,90,42,.08);
}

.ruler {
  position: absolute;
  left: 18%;
  top: 4vh;
  width: 58%;
  height: 92vh;
  border-left: 3px solid var(--soil);
  opacity: .62;
}

.ruler span {
  display: block;
  height: 11.5%;
  border-top: 3px solid var(--mustard);
}

.slip {
  position: absolute;
  left: 18%;
  right: 10%;
  padding: 9px 7px;
  background: rgba(232,208,168,.86);
  border: 2px solid var(--soil);
  box-shadow: 5px 6px 0 rgba(45,33,24,.16);
  font-family: var(--hand);
  font-size: clamp(15px, 1.5vw, 22px);
  line-height: .95;
  transform: rotate(-4deg);
}

.slip-one { top: 16%; }
.slip-two { top: 39%; transform: rotate(5deg); color: var(--clay); }
.slip-three { top: 62%; transform: rotate(-7deg); color: var(--moss); }

.proof-dot, .proof-diamond, .proof-paddle {
  position: absolute;
  border: 3px solid var(--soil);
  opacity: .8;
}

.proof-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  left: 48%;
  bottom: 22%;
  box-shadow: 0 0 0 9px rgba(184,90,42,.22);
}

.proof-diamond {
  width: 36px;
  height: 36px;
  left: 23%;
  bottom: 10%;
  transform: rotate(45deg);
  background: rgba(77,107,60,.24);
}

.proof-paddle {
  width: 36px;
  height: 48px;
  right: 9%;
  top: 72%;
  background: rgba(215,167,41,.34);
  clip-path: polygon(15% 0, 85% 0, 100% 70%, 50% 100%, 0 70%);
}

.f-stroke {
  position: absolute;
  background: linear-gradient(90deg, transparent, var(--mustard), var(--clay), transparent);
  height: 11px;
  opacity: .84;
  filter: url(#none);
  border-radius: 40% 55% 38% 62%;
  transform: rotate(-1.4deg);
}

.f-top { left: 2vw; right: 8vw; top: 28vh; }
.f-middle { left: 2vw; width: 55vw; top: 58vh; transform: rotate(1deg); }
.f-left {
  width: 10px;
  height: 76vh;
  left: 2vw;
  top: 16vh;
  background: linear-gradient(180deg, var(--soil), var(--mustard), transparent);
}

.hero-copy { max-width: 850px; position: relative; z-index: 2; }
.chapter-label {
  margin: 0 0 8px;
  color: var(--clay);
  font-family: var(--condensed);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  transform: rotate(-.5deg);
}

h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  line-height: .84;
  text-transform: uppercase;
  color: var(--soil);
}

h1 {
  font-size: clamp(78px, 16vw, 230px);
  letter-spacing: -.035em;
  text-shadow: 5px 6px 0 rgba(184,90,42,.14), -2px 0 rgba(62,127,120,.16);
}

h2 { font-size: clamp(58px, 9vw, 136px); max-width: 840px; }

.gradient-underline {
  width: min(72vw, 900px);
  height: 18px;
  margin: 14px 0 22px;
  background: linear-gradient(135deg, #B85A2A 0%, #D7A729 42%, #4D6B3C 100%);
  border-radius: 55% 40% 60% 45%;
  transform: rotate(-1deg);
  box-shadow: 0 7px 0 rgba(45,33,24,.08);
}

.deck, .chapter-copy p:not(.chapter-label) {
  max-width: 560px;
  font-size: clamp(20px, 2.1vw, 32px);
  line-height: 1.08;
  font-weight: 500;
}

.offer-mark {
  position: absolute;
  left: 7vw;
  bottom: 10vh;
  width: min(48vw, 520px);
  z-index: 3;
  transform: rotate(-4deg);
}

.offer-number, .ghost {
  display: block;
  font-family: var(--display);
  font-size: clamp(88px, 14vw, 210px);
  line-height: .72;
}

.offer-number { position: relative; z-index: 2; color: var(--clay); }
.ghost { position: absolute; inset: 0 auto auto 0; color: rgba(184,90,42,.28); z-index: 1; opacity: 0; }
.ghost-a { transform: translate(-11px, 3px); }
.ghost-b { transform: translate(13px, -4px); }
.offer-mark small {
  font-family: var(--hand);
  font-size: 32px;
  color: var(--soil);
}

.circle-sketch {
  position: absolute;
  left: -8%;
  top: -28%;
  width: 82%;
  height: 118%;
  border: 7px solid var(--clay);
  border-radius: 52% 48% 55% 45%;
  transform: rotate(9deg);
  opacity: .75;
}

.bucket-scene {
  position: absolute;
  right: 4vw;
  top: 19vh;
  width: min(38vw, 460px);
  margin: 0;
  opacity: .93;
}

.drawn {
  fill: none;
  stroke: var(--soil);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 13 7 3 5;
}

.bucket-fill { fill: url(#bucketWash); opacity: .28; stroke-width: 4; }
.crack { stroke: var(--clay); }
.falling-tag { transform-origin: 200px 270px; }

.shake .falling-tag, .shake .offer-mark, .rejecting {
  animation: shakeError .42s cubic-bezier(.36,.07,.19,.97) both;
}

.shake .ghost { animation: ghostFlash .48s both; }

@keyframes shakeError {
  10%, 90% { transform: translateX(-3px) rotate(-2deg); }
  20%, 80% { transform: translateX(7px) rotate(2deg); }
  30%, 50%, 70% { transform: translateX(-12px) rotate(-3deg); }
  40%, 60% { transform: translateX(12px) rotate(3deg); }
}

@keyframes ghostFlash {
  0% { opacity: 0; }
  25% { opacity: .7; }
  100% { opacity: 0; transform: translate(24px, -8px); }
}

.notes-chapter {
  background: linear-gradient(180deg, rgba(232,208,168,.26), rgba(184,90,42,.12));
}

.chapter-copy { position: relative; z-index: 2; padding-top: 9vh; }
.chapter-copy.narrow { max-width: 780px; }

.note-trail {
  position: absolute;
  left: 5vw;
  top: 38vh;
  display: grid;
  gap: 18px;
}

.hand-note {
  width: max-content;
  padding: 8px 18px;
  font-family: var(--hand);
  font-size: clamp(28px, 3.4vw, 54px);
  color: var(--soil);
  background: rgba(232,208,168,.55);
  border-bottom: 4px solid var(--mustard);
  transform: rotate(-3deg);
}
.hand-note:nth-child(2) { transform: translateX(66px) rotate(3deg); color: var(--clay); }
.hand-note:nth-child(3) { transform: translateX(22px) rotate(-1deg); color: var(--moss); }
.hand-note.stamped {
  color: var(--clay);
  border: 5px solid var(--clay);
  border-radius: 50%;
  padding: 18px 28px;
  transform: translateX(124px) rotate(12deg);
}

.shaky-tag {
  position: absolute;
  right: 10vw;
  bottom: 18vh;
  padding: 24px 42px;
  font-family: var(--display);
  font-size: clamp(76px, 12vw, 172px);
  line-height: .8;
  color: var(--clay);
  border: 6px solid var(--soil);
  background: rgba(232,208,168,.72);
  box-shadow: 13px 15px 0 rgba(184,90,42,.18);
  transform: rotate(6deg);
  cursor: grab;
}

.evidence-chapter {
  background: radial-gradient(circle at 75% 25%, rgba(62,127,120,.26), transparent 32%), linear-gradient(180deg, rgba(215,167,41,.1), rgba(232,208,168,.24));
}

.scrap-table {
  position: absolute;
  right: 6vw;
  top: 18vh;
  width: min(54vw, 720px);
  min-height: 58vh;
  border-top: 9px solid var(--soil);
  border-bottom: 7px solid var(--mustard);
  transform: rotate(-1deg);
}

.scrap {
  position: absolute;
  font-family: var(--condensed);
  font-size: clamp(26px, 3vw, 48px);
  text-transform: uppercase;
  border: 4px solid var(--soil);
  color: var(--soil);
  background: rgba(232,208,168,.78);
  box-shadow: 10px 10px 0 rgba(45,33,24,.1);
  opacity: 0;
  transform: translateX(-130px) rotate(-8deg);
  transition: transform .8s ease, opacity .8s ease;
}

.scrap-table.active .scrap { opacity: 1; transform: translateX(0) rotate(var(--r, -2deg)); }
.strip { padding: 14px 22px; min-width: 280px; }
.wide { left: 2%; top: 9%; --r: -2deg; }
.scrap.triangle {
  right: 18%;
  top: 3%;
  width: 150px;
  height: 130px;
  display: grid;
  place-items: center;
  background: rgba(184,90,42,.24);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  --r: 8deg;
}
.strip:nth-of-type(3) { left: 10%; top: 33%; --r: 2deg; transition-delay: .12s; }
.diamond {
  right: 10%;
  top: 42%;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  background: rgba(77,107,60,.3);
  transform-origin: center;
  --r: 45deg;
  transition-delay: .24s;
}
.rose { left: 22%; bottom: 18%; --r: -4deg; background: rgba(201,130,114,.28); transition-delay: .34s; }

.counter-line {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 2%;
  padding: 12px 20px;
  font-family: var(--condensed);
  font-size: clamp(30px, 4vw, 62px);
  text-transform: uppercase;
  border-top: 6px dashed var(--soil);
  color: var(--moss);
}
.counter-line b { font-family: var(--display); font-size: 1.4em; color: var(--soil); }

.tape-dev {
  position: absolute;
  left: 6vw;
  bottom: 8vh;
  width: min(46vw, 560px);
  fill: none;
  stroke: var(--teal);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 20 9 4 7;
}
.tape-dev text {
  fill: var(--soil);
  stroke: none;
  font-family: var(--hand);
  font-size: 80px;
}

.floor-chapter {
  background: linear-gradient(135deg, rgba(184,90,42,.20) 0%, rgba(215,167,41,.32) 42%, rgba(77,107,60,.36) 100%);
}

.floor-line {
  position: absolute;
  left: 3vw;
  right: 6vw;
  top: 64vh;
  height: 16px;
  background: var(--moss);
  border-radius: 40%;
  box-shadow: 0 11px 0 rgba(45,33,24,.1);
  transform: rotate(-.7deg);
}

.resolved-tag {
  position: absolute;
  right: 9vw;
  top: 25vh;
  min-width: min(44vw, 520px);
  padding: 30px 42px 34px;
  background: linear-gradient(135deg, #B85A2A 0%, #D7A729 42%, #4D6B3C 100%);
  border: 7px solid var(--soil);
  clip-path: polygon(9% 0, 100% 0, 92% 100%, 0 88%, 0 21%);
  box-shadow: 18px 20px 0 rgba(45,33,24,.14);
  transform: rotate(3deg);
}
.resolved-tag span {
  display: block;
  font-family: var(--hand);
  font-size: clamp(30px, 3vw, 50px);
}
.resolved-tag strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(92px, 12vw, 184px);
  line-height: .75;
}

.market-sign {
  position: absolute;
  left: 8vw;
  bottom: 8vh;
  display: grid;
  gap: 6px;
  padding: 24px 46px;
  border: 6px solid var(--soil);
  background: rgba(232,208,168,.65);
  font-family: var(--display);
  font-size: clamp(54px, 7vw, 112px);
  line-height: .85;
  transform: rotate(-5deg);
}
.crossed { color: var(--clay); text-decoration: line-through; text-decoration-thickness: 8px; }

@media (max-width: 850px) {
  .ledger { margin-left: 72px; }
  .ledger-margin { width: 72px; }
  .slip { font-size: 13px; left: 8%; right: 8%; padding: 7px 3px; }
  .chapter { padding: 30px 22px; }
  .bucket-scene { position: relative; right: auto; top: auto; width: 82vw; margin: 20px 0 0 auto; }
  .offer-mark, .shaky-tag, .scrap-table, .resolved-tag, .market-sign { position: relative; left: auto; right: auto; top: auto; bottom: auto; margin-top: 34px; }
  .scrap-table { width: 88vw; min-height: 620px; }
  .note-trail { position: relative; left: auto; top: auto; margin-top: 30px; }
  .tape-dev { position: relative; left: auto; bottom: auto; width: 84vw; margin-top: 26px; }
}
