/* =========================================================
   Turkey Coin — styles
   Look: an old American harvest poster. Barn red is the main colour, mustard
   the accent, near-white and ink the neutrals. Luckiest Guy for headlines,
   Nunito for everything else. Flat colour, thin rules, no glows.
   Motion: the page is a stack of full-screen scenes; each one slides up over
   the last. Playful motion is kept for the opening, the turkey and the table.
   ========================================================= */
:root {
  --red: #9e2f22;
  --red-dark: #7d231a;
  --mustard: #e3a92f;
  --ink: #2a1a12;
  --ink-2: #4b3428;
  --paper: #fbf8f2;
  --paper-2: #f2ece1;
  --white: #fff;
  --muted: #6b5747;
  --rule: rgba(42, 26, 18, .16);
  --olive: #5d6a35;
  --live: #2f8a4c;

  --f-display: "Luckiest Guy", "Arial Black", Impact, sans-serif;
  --f-body: "Nunito", "Trebuchet MS", "Helvetica Neue", Arial, sans-serif;

  --radius: 10px;
  --out: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-body); font-size: 17px; line-height: 1.55; color: var(--ink); background: var(--paper); overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2 { font-family: var(--f-display); font-weight: 400; line-height: 1.02; letter-spacing: .02em; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); }
h3, h4 { font-family: var(--f-body); font-weight: 800; margin: 0; line-height: 1.2; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }

/* ---------- falling leaves ---------- */
.leaves { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 8px; font-weight: 600; font-size: .95rem;
  transition: opacity .2s, transform .2s var(--out); max-width: calc(100% - 32px); text-align: center; word-break: break-word;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .9em 1.4em; border-radius: 6px;
  font: 700 1rem/1 var(--f-body); text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .16s var(--out);
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, .ca-pill:focus-visible, a:focus-visible, .chip:focus-visible, .animal:focus-visible, .dancer:focus-visible, .stepper button:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--red-dark); }
.btn-paper { background: var(--white); color: var(--ink); border-color: var(--ink); }
.btn-paper:hover { background: var(--paper-2); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #000; }
.btn-ink-outline { border-color: rgba(251, 248, 242, .7); color: var(--paper); background: transparent; }
.btn-ink-outline:hover { background: rgba(251, 248, 242, .12); }
.btn-sm { padding: .7em 1.1em; font-size: .9rem; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(20px, calc((100% - 1160px) / 2)); color: var(--paper); transition: background .25s, padding .25s;
}
.nav.scrolled { background: var(--ink); padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 400 1.25rem/1 var(--f-display); }
.brand img { border-radius: 50%; border: 2px solid var(--paper); }
.nav-links { display: flex; gap: 28px; }
.nav-links a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav-links a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.ca-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; cursor: pointer;
  font: 600 .85rem/1 var(--f-body); color: var(--paper); background: transparent; border: 1.5px solid rgba(251, 248, 242, .55);
}
.ca-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mustard); }
.ca-pill.has-ca .dot { background: #59c27a; }

/* =========================================================
   SCENES — a stack of full screens; each slides up over the last
   ========================================================= */
.scene { position: relative; min-height: 100vh; min-height: 100svh; padding: 112px 0 96px; display: flex; flex-direction: column; justify-content: center; }
.scene + .scene { border-radius: 22px 22px 0 0; box-shadow: 0 -14px 40px -18px rgba(20, 10, 4, .55); }
.scene::after { content: ""; position: absolute; inset: 0; background: #120a05; opacity: 0; pointer-events: none; z-index: 5; border-radius: inherit; }
.stacked .scene { position: sticky; }
.stacked .scene::after { opacity: calc(var(--cover, 0) * .55); }
.stacked .scene > .wrap, .stacked .scene > .intro-inner { transform: scale(calc(1 - var(--cover, 0) * .07)); transform-origin: 50% 30%; }
.fine { position: relative; }

.scene-head { margin-bottom: 34px; max-width: 760px; }
.scene-sub { font-size: 1.15rem; margin: 18px 0 0; max-width: 58ch; color: var(--ink-2); }
.scene-sub b { color: var(--red); }

/* content arrives as its scene comes in: it drops into place */
.js .scene [data-anim] { opacity: 0; transform: translateY(-26px) scale(1.04); transition: opacity .7s ease, transform .9s var(--out); }
.js .scene.in [data-anim] { opacity: 1; transform: none; }
.js .scene [data-anim="2"] { transition-delay: .1s; }
.js .scene [data-anim="3"] { transition-delay: .2s; }
.js .scene [data-anim="4"] { transition-delay: .3s; }
.js .scene [data-anim="5"] { transition-delay: .4s; }

/* ---------- 1. opening ---------- */
.intro { color: var(--paper); text-align: center; align-items: center; background: var(--red); overflow: hidden; }
.intro-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; padding: 0 20px; }
.intro-move { display: flex; flex-direction: column; align-items: center; will-change: transform, opacity; }
.intro { padding: 88px 0 72px; }
/* the coin: the turkey picture as a round meme-coin token */
.hero-coin { width: min(250px, 58vw, 23.5vh); aspect-ratio: 1; perspective: 900px; }
@media (max-width: 560px) { .hero-coin { width: min(58vw, 19.5vh); } }
.hero-coin img { display: block; width: 100%; height: 100%; border-radius: 50%; border: 5px solid var(--ink); background: var(--mustard); }
.title { position: relative; font-size: clamp(3.4rem, min(14.5vw, 13.5vh), 9.6rem); line-height: .9; margin-top: 16px; color: var(--paper); text-shadow: .045em .045em 0 var(--ink); }
.title .word { display: block; }
.title .word-2 { color: var(--mustard); }
.title .letter { display: inline-block; }
.tagline { font-size: clamp(1.1rem, 2.2vw, 1.35rem); font-weight: 500; margin: 26px 0 24px; max-width: 34ch; }
.intro-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.countdown { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 22px; }
.countdown-label { margin: 0; font-weight: 600; }
.countdown-units { display: flex; gap: 8px; }
.countdown-units div { min-width: 70px; padding: 10px 8px 8px; border-radius: 8px; text-align: center; border: 1.5px solid rgba(251, 248, 242, .45); }
.countdown-units b { display: block; font: 400 1.9rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.countdown-units span { font-size: .78rem; font-weight: 600; opacity: .85; }
/* "Watch him dance below": a big sticker that pops up and points at the turkey.
   Phones and small screens: across the bottom with an arrow each side. Wide screens: beside the title,
   tilted, with a hand-drawn arrow curving down. */
.scroll-cue { --tilt: -3deg; position: absolute; left: 0; right: 0; bottom: 14px; width: max-content; margin-inline: auto; z-index: 2;
  display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.scroll-cue span { display: block; font: 400 1.22rem/1.05 var(--f-display); letter-spacing: .03em; text-align: center; padding: 11px 16px 8px;
  background: var(--mustard); border: 3px solid var(--ink); border-radius: 10px; transform: rotate(var(--tilt)); transition: background .15s; }
.scroll-cue:hover span { background: var(--paper); }
.scroll-cue svg { display: block; overflow: visible; }
.scroll-cue path { fill: none; stroke: var(--paper); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.scroll-cue .cue-down { width: 22px; height: 38px; }
.scroll-cue .cue-curve { display: none; }
@keyframes cueBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@media (min-width: 1180px) {
  .scroll-cue { --tilt: 5deg; left: calc(50% + 262px); right: auto; top: 29%; bottom: auto; width: auto; margin: 0; flex-direction: column; align-items: flex-start; gap: 6px; }
  .scroll-cue span { width: 8.6em; font-size: 2.05rem; padding: 16px 18px 12px; border-width: 3.5px; border-radius: 14px; }
  .scroll-cue .cue-down { display: none; }
  .scroll-cue .cue-curve { display: block; width: 120px; height: 140px; margin-left: 4px; }
}

/* the opening: it pops out at you, the coin flips in, the letters drop */
.js .intro-move { animation: popOut 1s cubic-bezier(.18, .9, .25, 1.06) both; }
/* scrolling away from the opening: it zooms past you while the next scene slides up */
.stacked .intro > .intro-inner { transform: translateY(calc(var(--cover, 0) * -70px)) scale(calc(1 + var(--cover, 0) * .22)); opacity: calc(1 - var(--cover, 0) * .8); }
@keyframes popOut { from { opacity: 0; transform: scale(.62); } to { opacity: 1; transform: scale(1); } }
/* the coin spins in, then flips over now and then like a tossed coin */
.js .hero-coin img { animation: coinIn 1.3s cubic-bezier(.2, .9, .3, 1) .15s both, coinFlip 7s ease-in-out 4s infinite; }
@keyframes coinIn { from { opacity: 0; transform: scale(.3) rotateY(-540deg); } 45% { opacity: 1; } to { opacity: 1; transform: scale(1) rotateY(0deg); } }
@keyframes coinFlip { 0%, 82% { transform: translateY(0) rotateY(0deg); } 88% { transform: translateY(-14px) rotateY(180deg); } 94%, 100% { transform: translateY(0) rotateY(360deg); } }
.js .title .letter { opacity: 0; }
.js.intro-go .title .letter { animation: drop .8s cubic-bezier(.2, 1.4, .4, 1) forwards; animation-delay: calc(var(--i) * 65ms + 700ms); }
@keyframes drop { from { opacity: 0; transform: translateY(-90%) rotate(-8deg); } 55% { opacity: 1; } to { opacity: 1; transform: none; } }
.js .tagline, .js .intro-cta, .js .countdown { opacity: 0; animation: rise .7s var(--out) forwards; }
.js .tagline { animation-delay: 1.5s; } .js .intro-cta { animation-delay: 1.62s; } .js .countdown { animation-delay: 1.74s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.js .scroll-cue span { animation: cuePop .75s cubic-bezier(.2, 1.6, .4, 1) 2.1s both, cueNudge 3.2s ease-in-out 4.5s infinite; }
.js .cue-down { opacity: 0; animation: rise .5s var(--out) 2.5s forwards, cueBob 1.1s ease-in-out 3s infinite; }
.js .cue-curve path { stroke-dasharray: 260; stroke-dashoffset: 260; animation: cueDraw .7s ease-out 2.6s forwards; }
.js .cue-curve { animation: cueBob 1.4s ease-in-out 3.4s infinite; }
@keyframes cueDraw { to { stroke-dashoffset: 0; } }
@keyframes cuePop { 0% { opacity: 0; transform: translateY(26px) scale(.3) rotate(-14deg); } 55% { opacity: 1; transform: translateY(-6px) scale(1.15) rotate(calc(var(--tilt) + 6deg)); } 100% { opacity: 1; transform: rotate(var(--tilt)); } }
@keyframes cueNudge { 0%, 80%, 100% { transform: rotate(var(--tilt)); } 86% { transform: translateY(-8px) scale(1.08) rotate(calc(var(--tilt) + 5deg)); } 93% { transform: translateY(0) rotate(calc(var(--tilt) - 3deg)); } }

/* ---------- 2. the turkey + the total ---------- */
.raised { background: var(--paper); }
.raised-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.stage { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1; margin-inline: auto; perspective: 1100px; }
.stage-floor { position: absolute; left: 8%; right: 8%; bottom: 3%; height: 13%; border-radius: 50%; background: var(--paper-2); border: 2px solid var(--rule); }
.stage-shadow { position: absolute; left: 24%; right: 24%; bottom: 6.5%; height: 6%; border-radius: 50%; background: rgba(42, 26, 18, .32); }
.dancer { position: absolute; left: 6%; right: 6%; top: 1%; bottom: 7%; padding: 0; border: 0; background: none; cursor: pointer; overflow: visible;
  transform-origin: 50% 100%; transform-style: preserve-3d; will-change: transform; -webkit-tap-highlight-color: transparent; }
.tk { position: absolute; inset: 0; display: block; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.tk-edge { position: absolute; inset: 0; transform-style: preserve-3d; }
.tk-edge img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; }
.tk-edge img.back { filter: brightness(.55); }
.tk-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: translateZ(.6px); }
.tk-light { position: absolute; inset: 0; transform: translateZ(1.2px); pointer-events: none;
  -webkit-mask: url("assets/turkey.webp") center / contain no-repeat; mask: url("assets/turkey.webp") center / contain no-repeat;
  background: radial-gradient(circle at var(--lx, 38%) var(--ly, 26%), rgba(255, 255, 255, .2), transparent 36%),
              radial-gradient(circle at calc(100% - var(--lx, 38%)) calc(120% - var(--ly, 26%)), rgba(40, 12, 0, .14), transparent 50%); }
.tk-foot-l { transform-box: view-box; transform-origin: 288px 897px; }
.tk-foot-r { transform-box: view-box; transform-origin: 707px 893px; }
.tk-mouth { transform-box: view-box; transform-origin: 500px 205px; }
.tk-snood { transform-box: view-box; transform-origin: 545px 180px; }
.tk-pupil { transition: transform .18s ease-out; transform-box: view-box; }
.tk-lid { transform: translateY(-84px); }
.stage-notes { position: absolute; inset: 0; pointer-events: none; }
/* the 3D turkey (turkey3d.js) draws into this canvas; the flat drawing above stays as the fallback */
.tk3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .5s ease; pointer-events: none; }
.stage.is-3d .tk3d { opacity: 1; }
.stage.is-3d .tk, .stage.is-3d .stage-floor, .stage.is-3d .stage-shadow { opacity: 0; transition: opacity .3s ease; }
.stage.is-3d .dancer { inset: 0; cursor: grab; touch-action: pan-y; }
.stage.is-3d .dancer:active { cursor: grabbing; }
.note { position: absolute; font-size: 2rem; color: var(--red); animation: noteUp 2.4s ease-out forwards; }
@keyframes noteUp { 0% { opacity: 0; transform: translate(0, 10px) rotate(0); } 15% { opacity: 1; } 55% { transform: translate(var(--dx1), -50px) rotate(var(--r1)); } 100% { opacity: 0; transform: translate(var(--dx2), -120px) rotate(var(--r2)); } }
.dance-card { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 0; border-top: 2px solid var(--ink); }
.dance-label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); }
.dance-now { flex: 1 1 220px; min-width: 0; }
.dance-now b { display: block; font: 400 clamp(1.25rem, 2.3vw, 1.55rem)/1.15 var(--f-display); color: var(--red); }
.dance-now b.swap { animation: swapIn .3s var(--out); }
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dance-count b { display: block; font: 400 1.5rem/1.15 var(--f-display); font-variant-numeric: tabular-nums; }
.dance-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.meter-card { background: var(--white); border: 1.5px solid var(--rule); border-radius: var(--radius); padding: clamp(20px, 3vw, 34px); }
.meter-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: .85rem; font-weight: 700; color: var(--live); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.live.is-idle { color: var(--muted); }
.live.is-error { color: #a36a12; }
.tag { font-size: .82rem; color: var(--muted); }
.meter-main { position: relative; padding: 18px 0 20px; border-bottom: 1.5px solid var(--rule); }
.meter-kicker { font-weight: 700; margin-bottom: 6px; }
.meter-big { font: 400 clamp(3.2rem, 7.5vw, 5.6rem)/1 var(--f-display); margin: 0; color: var(--red); font-variant-numeric: tabular-nums; }
.meter-sub { margin: 10px 0 0; color: var(--muted); font-size: .95rem; }
.meter-lock { margin: 12px 0 0; font-size: .9rem; font-weight: 600; color: var(--olive); }
.meter-lock[hidden] { display: none; }
.meter-pop { position: absolute; right: 0; top: 14px; font: 400 1.15rem/1 var(--f-display); color: var(--white); background: var(--red); padding: 8px 12px; border-radius: 6px; animation: pop 2.4s ease forwards; }
@keyframes pop { 0% { opacity: 0; transform: translateY(12px); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-18px); } }
.meter-tiles { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-bottom: 1.5px solid var(--rule); }
.tile { padding: 14px 0; }
.tile + .tile { padding-left: 16px; border-left: 1.5px solid var(--rule); }
.tile > span { display: block; font-size: .82rem; color: var(--muted); font-weight: 600; }
.tile b { font: 400 1.3rem/1.3 var(--f-display); font-variant-numeric: tabular-nums; }
.tile-meals b { color: var(--red); }
.trail { padding-top: 14px; }
.trail summary { cursor: pointer; font-weight: 700; font-size: .95rem; }
.trail summary:hover { color: var(--red); }
.trail[open] summary { margin-bottom: 10px; }
.meter-note { margin: 0 0 10px; color: var(--muted); font-size: .92rem; }
.meter-note b { color: var(--ink); }
.trail ol { list-style: none; margin: 0; padding: 0; }
.trail li { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule); }
.trail-n { font: 400 1.05rem/1 var(--f-display); color: var(--red); }
.trail li b { display: block; font-weight: 700; font-size: .95rem; }
.trail li small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.trail-v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trail-link { font-size: .85rem; font-weight: 700; color: var(--red); white-space: nowrap; }
.trail-link.off { color: #b9aa9a; pointer-events: none; text-decoration: none; }
.market { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.market[hidden] { display: none; }
.market span { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.market b { font-weight: 700; font-variant-numeric: tabular-nums; }
.market .up { color: var(--live); } .market .down { color: var(--red); }
.meter-foot { margin: 14px 0 0; font-size: .82rem; color: var(--muted); }

/* ---------- 3. pilgrim PFP maker ---------- */
.maker { background: var(--paper-2); }
.maker-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.stage-frame { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--ink); padding: 10px; }
.stage-frame canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 6px; touch-action: none; cursor: grab; background: #c97a35; }
.stage-frame canvas.dragging { cursor: grabbing; }
.stage-name { position: absolute; left: 22px; top: 22px; margin: 0; background: var(--ink); color: var(--paper); font: 400 .95rem/1 var(--f-display); padding: 8px 12px; border-radius: 6px; pointer-events: none; }
.stage-tools { margin-top: 14px; }
.stage-tools[hidden] { display: none; }
.tools-title { margin: 0 0 8px; font-size: .92rem; color: var(--muted); }
.tools-title b { color: var(--ink); }
.tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.tools-row label { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .92rem; }
.tools-row input[type="range"] { width: 130px; accent-color: var(--red); }

.steps-panel { background: var(--white); border-radius: var(--radius); border: 1.5px solid var(--rule); padding: 20px; display: flex; flex-direction: column; min-height: 100%; }
.stepper { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1.5px solid var(--rule); }
.stepper button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 2px 12px; border: 0; background: none; cursor: pointer;
  font: 700 .95rem/1 var(--f-body); color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color .2s, border-color .2s; }
.stepper button i { font: 400 1rem/1 var(--f-display); font-style: normal; }
.stepper button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }
.stepper button[aria-selected="true"] i { color: var(--red); }
.stepper button.done { color: var(--ink-2); }
.step-viewport { display: grid; flex: 1; overflow: hidden; }
.step { grid-area: 1 / 1; min-width: 0; }
.step[hidden] { display: none; }
.step h3 { font: 400 1.55rem/1.1 var(--f-display); margin-bottom: 8px; }
.step h4 { font-size: .95rem; margin: 18px 0 10px; }
.step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.step-head h3 { margin: 0; }
.step-sub { color: var(--muted); margin: 0 0 4px; }
/* steps slide in from the side they come from and settle quickly */
.step.enter-fwd { animation: stepInFwd .3s var(--out) both; }
.step.enter-back { animation: stepInBack .3s var(--out) both; }
.step.leave-fwd { animation: stepOutFwd .22s ease-in both; pointer-events: none; }
.step.leave-back { animation: stepOutBack .22s ease-in both; pointer-events: none; }
@keyframes stepInFwd { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes stepOutFwd { to { opacity: 0; transform: translateX(-40px); } }
@keyframes stepOutBack { to { opacity: 0; transform: translateX(40px); } }
.step-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1.5px solid var(--rule); }
.step-nav [data-step-next] { margin-left: auto; }
.step-nav [hidden] { display: none; }
.share-actions { display: grid; gap: 10px; margin-top: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 12px; border-radius: 6px; border: 1.5px solid var(--rule); background: var(--white);
  font: 600 .9rem/1 var(--f-body); color: var(--ink); white-space: nowrap; transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip img { width: 34px; height: 16px; object-fit: contain; }
.chip-sm { padding: 6px 10px; font-size: .84rem; }
.search { width: 100%; padding: 10px 12px; border-radius: 6px; border: 1.5px solid var(--rule); font: 500 1rem var(--f-body); background: var(--white); margin-bottom: 12px; }
.search:focus { outline: 3px solid var(--mustard); outline-offset: 1px; }
.animal-grid { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; max-height: 390px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.animal { display: block; padding: 0; border: 3px solid transparent; border-radius: 8px; background: none; cursor: pointer; overflow: hidden; text-align: center; }
.animal:hover .tile-art { filter: brightness(1.06); }
.animal[aria-pressed="true"] { border-color: var(--red); }
.animal-empty { grid-column: 1 / -1; color: var(--muted); margin: 6px 0; }
.tile-art { position: relative; display: block; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 5px; background: #c97a35; }
.tile-art img { width: 100%; height: 100%; object-fit: cover; }
.tile-art .stand-in { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; line-height: 1; padding-top: 18%; }
.tile-art .stand-in::before { content: ""; position: absolute; width: 60%; height: 32%; top: 6%; left: 20%; background: url("assets/pilgrim-hat.svg") center / contain no-repeat; }
.animal .label { display: block; font-size: .76rem; font-weight: 600; color: var(--ink); padding: 5px 2px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 4. the table ---------- */
.table-sec { color: var(--paper); background: var(--ink); }
.table-sec .scene-sub { color: rgba(251, 248, 242, .82); }
.table-sec .scene-sub b { color: var(--mustard); }
.table-stats { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 18px; border-top: 1.5px solid rgba(251, 248, 242, .25); border-bottom: 1.5px solid rgba(251, 248, 242, .25); }
.table-stats div { padding: 14px 28px 14px 0; margin-right: 28px; min-width: 150px; }
.table-stats div + div { padding-left: 28px; border-left: 1.5px solid rgba(251, 248, 242, .25); }
.table-stats b { display: block; font: 400 1.6rem/1.15 var(--f-display); font-variant-numeric: tabular-nums; }
.table-stats div > span { font-size: .85rem; font-weight: 600; color: rgba(251, 248, 242, .7); }
.table-svg { width: 100%; height: auto; overflow: visible; }
.table-svg.tall { max-width: 460px; margin-inline: auto; }
.table-hint { margin: 14px 0 0; font-size: .9rem; color: rgba(251, 248, 242, .62); text-align: center; }
.table-svg .chair { fill: #6b3e22; }
.table-svg .chair-top { fill: #84512d; }
.table-svg .plate { fill: #fffcf6; stroke: #cdbfa8; stroke-width: 2; }
.table-svg .plate-rim { fill: none; stroke: #ebe1cf; stroke-width: 2; }
.table-svg .fork, .table-svg .knife { fill: #b3a794; }
.table-svg .meal { opacity: 0; transform: scale(.2); transform-box: fill-box; transform-origin: center; transition: opacity .35s, transform .45s cubic-bezier(.2, 1.4, .4, 1); }
.table-svg .seat.served .meal { opacity: 1; transform: none; }
.table-svg .seat.just-served .meal { transition-delay: var(--d); }
.table-svg .steam { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 2.2; stroke-linecap: round; opacity: 0; }
.table-svg .seat.just-served .steam { animation: steam 2.4s ease-out var(--d) both; }
@keyframes steam { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-14px); } }
.js .table-sec .seat { opacity: 0; transition: opacity .5s ease; transition-delay: var(--d); }
.js .table-sec.in .seat { opacity: 1; }
.table-svg .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 1.6s ease-in-out infinite alternate; }
@keyframes flicker { 0% { transform: scale(1, 1) rotate(-2deg); } 50% { transform: scale(.92, 1.08) rotate(2deg); } 100% { transform: scale(1.04, .94) rotate(-1deg); } }
.table-svg .glow, .table-svg .table-halo { display: none; }

/* ---------- 5. how the money moves ---------- */
.how { background: var(--white); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); }
.step-card { padding: 22px 22px 6px 0; }
.step-card + .step-card { padding-left: 22px; border-left: 1.5px solid var(--rule); }
.step-n { display: block; font: 400 2.6rem/1 var(--f-display); color: var(--red); margin-bottom: 14px; }
.step-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step-card p { margin: 0; color: var(--ink-2); }

/* ---------- 6. contract ---------- */
.token { background: var(--paper); }
.token .scene-head h2 { color: var(--red); }
.token-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 26px; border-top: 1.5px solid var(--rule); border-bottom: 1.5px solid var(--rule); }
.token-grid div { padding: 14px 16px 14px 0; }
.token-grid div + div { padding-left: 16px; border-left: 1.5px solid var(--rule); }
.token-grid dt { font-size: .82rem; color: var(--muted); font-weight: 600; }
.token-grid dd { margin: 4px 0 0; font: 400 1.2rem/1.3 var(--f-display); }
.ca-box { background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: clamp(22px, 4vw, 36px); }
.ca-label { font-weight: 700; margin-bottom: 6px; }
.ca-value { display: block; font: 400 clamp(1.3rem, 3vw, 2rem)/1.3 var(--f-display); word-break: break-all; margin: 0 0 22px; }
.ca-value.is-address { font: 600 clamp(.9rem, 2vw, 1.25rem)/1.4 ui-monospace, Consolas, monospace; }
.ca-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ca-warn { margin: 18px 0 0; font-size: .92rem; color: rgba(251, 248, 242, .72); }

/* ---------- fine print + footer ---------- */
.fine { padding: 64px 0; background: var(--paper-2); }
.fine-title { font-size: 1.7rem; margin-bottom: 16px; }
.sources { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.sources a { font-weight: 700; color: var(--red); text-underline-offset: 4px; }
.disclaimer { font-size: .9rem; color: var(--muted); max-width: 75ch; }
.footer { background: var(--ink); color: rgba(251, 248, 242, .78); padding: 24px 0; font-size: .92rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center; }
.footer a { color: var(--paper); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .raised-grid, .maker-grid { grid-template-columns: minmax(0, 1fr); }
  .stage { max-width: 400px; }
  .steps, .token-grid { grid-template-columns: repeat(2, 1fr); }
  .step-card:nth-child(3) { padding-left: 0; border-left: 0; }
  .token-grid div:nth-child(3) { padding-left: 0; border-left: 0; }
  .scene { min-height: 0; padding: 96px 0 72px; }
  .intro { min-height: 100vh; min-height: 100svh; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .brand span { font-size: 1.1rem; }
  .countdown-units { width: 100%; }
  .countdown-units div { min-width: 0; flex: 1; padding: 8px 4px 6px; }
  .countdown-units b { font-size: 1.55rem; }
  .meter-tiles { grid-template-columns: 1fr 1fr; }
  .meter-tiles .tile-meals { grid-column: 1 / -1; }
  .meter-tiles .tile:nth-child(2) { padding-left: 0; border-left: 0; }
  .market { grid-template-columns: repeat(2, 1fr); }
  .trail li { grid-template-columns: 22px 1fr; }
  .trail-v, .trail-link { grid-column: 2; }
  .steps, .token-grid { grid-template-columns: 1fr; }
  .step-card + .step-card, .step-card:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1.5px solid var(--rule); }
  .token-grid div + div, .token-grid div:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1.5px solid var(--rule); }
  .stepper button { font-size: .85rem; gap: 5px; }
  .animal-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); max-height: 320px; }
  .tools-row input[type="range"] { width: 100px; }
  .table-stats div { min-width: 0; flex: 1 1 100%; margin-right: 0; padding-right: 0; }
  .table-stats div + div { padding-left: 0; border-left: 0; border-top: 1.5px solid rgba(251, 248, 242, .25); }
  .scene + .scene { border-radius: 16px 16px 0 0; }
}

/* Devices that ask for reduced motion (for example Windows with "Animation effects"
   off) still get the show, just calmer: shorter moves, no overshoot, slower leaves. */
.calm .scene [data-anim] { transform: translateY(-10px); transition-duration: .8s; transition-timing-function: ease; }
.calm .intro-move { animation: popCalm .9s ease both; }
@keyframes popCalm { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
.calm.intro-go .title .letter { animation: dropCalm .6s ease forwards; animation-delay: calc(var(--i) * 55ms + 500ms); }
@keyframes dropCalm { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.calm .hero-coin img { animation: coinCalm 1s ease .15s both, coinFlip 9s ease-in-out 4s infinite; }
.calm .scroll-cue span { animation: cuePop .8s cubic-bezier(.3, 1.3, .5, 1) 1.8s both, cueNudge 4.5s ease-in-out 4.5s infinite; }
@keyframes coinCalm { from { opacity: 0; transform: rotateY(-180deg); } to { opacity: 1; transform: none; } }
.calm .step.enter-fwd, .calm .step.enter-back { animation: stepCalm .3s ease both; }
.calm .step.leave-fwd, .calm .step.leave-back { animation: stepOutCalm .2s ease both; }
@keyframes stepCalm { from { opacity: 0; } to { opacity: 1; } }
@keyframes stepOutCalm { to { opacity: 0; } }

/* ---------- 404 ---------- */
.lost { text-align: center; align-items: center; }
.lost img { margin: 0 auto 6px; }
