/* The Goose Is Loose: one stylesheet. The page is an open pop-up book on a sky blue desk.
   Layout system: one container (the book on the home page, a 1180 px sheet inside), spacing 8/16/24/32/48/64/96,
   one section head (kicker + Fraunces title), one card (paper on paper, 1 px ink hairline at 14%, radius 14). */
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-latin-full-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("/fonts/nunito-sans-latin-full-normal.woff2") format("woff2"); font-weight: 200 1000; font-stretch: 75% 125%; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #FBF6EA; --paper-2: #F3EBD8; --paper-3: #E9DEC4;
  --sky: #8EC5E8; --sky-2: #BFE0F3;
  --straw: #E6C15A; --gold: #D4A017; --gold-ink: #8A6410;
  --beak: #F08A24; --beak-ink: #A4540B;
  --ink: #1E2A3A; --ink-2: #4A5566; --line: rgba(30, 42, 58, .16);
  --cream: #F6EBC8;
  --display: "Fraunces", Georgia, serif;
  --text: "Nunito Sans", system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, monospace;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sky); color: var(--ink); font: 18px/1.55 var(--text); font-variant-numeric: tabular-nums; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 1em; letter-spacing: 0; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--beak); outline-offset: 3px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 1.4em; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 800; font-size: 18px; line-height: 1; text-decoration: none; cursor: pointer;
  transition: transform .12s ease-out, background-color .15s, box-shadow .15s; box-shadow: 0 3px 0 rgba(30, 42, 58, .35); }
.btn:hover { background: #2B3A50; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(30, 42, 58, .35); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; }
.btn.ghost:hover { background: rgba(30, 42, 58, .06); }
.btn.gold { background: var(--gold); border-color: var(--gold-ink); color: var(--ink); box-shadow: 0 3px 0 var(--gold-ink); }
.btn[aria-disabled="true"], .btn:disabled { background: var(--paper-3); border-color: var(--paper-3); color: var(--ink-2); box-shadow: none; cursor: not-allowed; transform: none; }
.textlink { font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--gold); }
.textlink:hover { text-decoration-color: var(--ink); }

/* hint bubble for disabled controls (flip + shift in js/app.js) */
.tip { position: fixed; z-index: 60; max-width: 300px; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 16px; line-height: 1.4; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

/* ---------- links block (the colophon) ---------- */
.colophon { display: grid; gap: 12px; }
.colophon::before { content: ""; height: 1.5px; background: var(--line); margin-bottom: 4px; }
.colophon .marks { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.colophon .pub { font-family: var(--display); font-style: italic; font-size: 17px; color: var(--ink-2); margin-right: 2px; padding: 12px 16px 12px 0; }
.mark { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 1.2em; border-radius: 999px; border: 1.5px solid var(--line); background: rgba(255,255,255,.55);
  font-weight: 800; font-size: 16px; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s; }
.mark img { width: 22px; height: 22px; border-radius: 5px; }
.mark:hover { background: #fff; border-color: var(--ink); }
.mark[aria-disabled="true"] { opacity: .62; cursor: not-allowed; }
.mark[aria-disabled="true"]:hover { background: rgba(255,255,255,.55); border-color: var(--line); }
.isbn { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 8px 8px 8px 18px; min-height: 52px; border-radius: 12px; background: rgba(255,255,255,.6); border: 1.5px solid var(--line); }
.isbn .k { font-weight: 800; font-size: 16px; letter-spacing: .06em; color: var(--ink-2); flex: none; }
.isbn .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.isbn .v.wait { font-family: var(--text); font-style: italic; color: var(--ink-2); white-space: normal; line-height: 1.25; padding: 8px 0; }
.isbn .copy { flex: none; min-height: 40px; padding: 0 1.1em; border-radius: 9px; border: 0; background: var(--ink); color: var(--paper); font-weight: 800; font-size: 16px; cursor: pointer; }
.isbn .copy[aria-disabled="true"] { background: var(--paper-3); color: var(--ink-2); cursor: not-allowed; }
.isbn .copy.done { background: #2F6B3A; }

/* ---------- rehearsal badge ---------- */
[data-badge] { display: inline-block; padding: 6px 4px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; border: 2px solid var(--gold-ink); color: var(--gold-ink);
  background: rgba(251, 246, 234, .92); font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .04em; transform: rotate(-3deg); }
.badge::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }

/* ---------- nav: chapter words ---------- */
.chapters { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.chapters a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: 17px; text-decoration: none; color: var(--ink-2); }
.chapters a:hover { color: var(--ink); background: rgba(30, 42, 58, .06); }
.chapters a[aria-current="page"] { color: var(--ink); background: var(--straw); }
.menu-btn { display: none; }
.drawer { position: fixed; inset: 0; z-index: 70; background: rgba(30, 42, 58, .4); display: none; }
.drawer.open { display: block; }
.drawer nav { position: absolute; right: 0; top: 0; bottom: 0; width: min(320px, 86vw); background: var(--paper); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.drawer .chapters { flex-direction: column; }
.drawer .chapters a { font-size: 20px; min-height: 52px; }

/* =========================================================
   HOME: the open book
   ========================================================= */
.desk { min-height: 100vh; display: grid; place-items: start center; }
.book { position: relative; width: min(100%, 177.7vh); aspect-ratio: 1672 / 941; container-type: inline-size; background: url("/img/book.webp") center / 100% 100% no-repeat; }
.leftpage { position: absolute; left: 6.2%; top: 6.6%; width: 40.6%; height: 85.6%; display: flex; flex-direction: column; padding: 1.4cqw 1.6cqw 1.2cqw; }
.leftpage .chapters { margin-left: 0; }
.name { font-family: var(--display); font-weight: 800; font-variation-settings: "SOFT" 60, "opsz" 144; font-size: clamp(56px, 6.5cqw, 132px); line-height: .9; letter-spacing: -.02em; margin: auto 0 0; }
.headline { font-family: var(--display); font-weight: 650; font-variation-settings: "SOFT" 40, "opsz" 72; font-size: clamp(26px, 2.25cqw, 44px); line-height: 1.12; margin: 1.3cqw 0 0; }
.headline em { font-style: normal; color: var(--gold-ink); }
.headline .sub { display: block; color: var(--ink-2); font-weight: 560; }
.lede { font-size: clamp(17px, 1.24cqw, 21px); line-height: 1.5; margin: 1.1cqw 0 0; max-width: 34em; }
.lede b { font-weight: 900; }
.actions { display: flex; align-items: center; gap: 24px; margin: 1.5cqw 0 auto; flex-wrap: wrap; }
.leftpage .colophon { margin-top: 1.3cqw; }

/* the right page: positions in % of the book picture (measured off book.webp: the straw patch is x 58.3-75.9%, y 46.4-58.1%) */
.scene { position: absolute; inset: 0; pointer-events: none; }
.scene > * { pointer-events: auto; }
.goose { position: absolute; left: 58.2%; width: 17.8%; top: 24.2%; aspect-ratio: 720 / 793; }
.goose img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .12s; filter: drop-shadow(0 .4cqw .3cqw rgba(30, 42, 58, .22)); }
.goose img.on { opacity: 1; }
.goose img.stand { left: 12%; width: 76%; height: auto; top: -26%; }
.pile { position: absolute; left: 77.2%; top: 44%; width: 15.5%; height: 15%; }
.pile img { position: absolute; width: 17%; filter: drop-shadow(0 .25cqw .2cqw rgba(30, 42, 58, .25)); transition: transform .9s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
.drops { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.kernel { position: absolute; width: 1.1%; will-change: transform; }
.flake { position: absolute; width: .55%; aspect-ratio: 1 / 1.6; background: linear-gradient(135deg, #F6D77A, var(--gold) 55%, #8A6410); border-radius: 1px; will-change: transform; }
.stamp { position: absolute; left: 52.6%; top: 8.6%; }
.pull { position: absolute; left: 92.4%; top: 27%; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: 0 12px 12px 0; border: 0;
  background: var(--paper); box-shadow: 2px 3px 0 rgba(30, 42, 58, .2); font-weight: 900; font-size: 17px; cursor: pointer; white-space: nowrap; transition: transform .2s ease-out; }
.pull:hover { transform: translateX(4px); }
.pull[aria-pressed="true"] { transform: translateX(14px); background: var(--straw); }
.peek { position: absolute; left: 53.2%; top: 18.5%; width: 21%; padding: 14px 18px; border-radius: 12px; background: var(--paper); box-shadow: 0 6px 20px rgba(30, 42, 58, .18); font-size: 16px; line-height: 1.4; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; }
.peek.on { opacity: 1; transform: none; }
.peek b { display: block; font-family: var(--display); font-size: clamp(22px, 1.9cqw, 34px); line-height: 1.1; }

/* the printed label: taken from the example's candy label, as one dark plate pasted on the page */
.label { position: absolute; left: 53.6%; top: 62.4%; width: 40.4%; height: 27.8%; background: var(--ink); color: var(--cream); border-radius: 10px; padding: 1.5cqw 1.6cqw 1.2cqw; display: grid;
  grid-template-columns: 1.15fr 1fr; grid-template-rows: auto 1fr auto; column-gap: 1.6cqw; box-shadow: 0 .5cqw 1.2cqw rgba(30, 42, 58, .35); }
.label::before, .label::after { content: ""; position: absolute; left: 1.2cqw; right: 1.2cqw; height: 4px; border-top: 1.5px solid rgba(246, 235, 200, .7); border-bottom: 1.5px solid rgba(246, 235, 200, .7); }
.label::before { top: .55cqw; } .label::after { bottom: .55cqw; }
.label .lines { grid-row: 1 / 3; align-self: center; list-style: none; margin: 0; padding: 0; font-size: clamp(16px, 1.08cqw, 20px); line-height: 1.38; font-weight: 700; min-width: 0; }
.label .lines li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.label .lines li::before { content: "> "; color: var(--straw); }
.label .lines li.new { color: #fff; opacity: 1; }
.label .lines li.gold { color: var(--straw); opacity: 1; }
.label .big { grid-column: 2; align-self: end; font-stretch: 125%; font-weight: 900; font-size: clamp(34px, 3.4cqw, 66px); line-height: 1.2; letter-spacing: -.01em; }
.label .big small { display: block; font-stretch: 100%; font-weight: 700; font-size: clamp(16px, .98cqw, 19px); letter-spacing: 0; opacity: .85; margin-top: .3cqw; }
.label .bar { grid-column: 2; align-self: start; margin-top: .55cqw; }
.label .bar .t { font-weight: 800; font-size: clamp(16px, .98cqw, 19px); }
.label .bar .track { position: relative; height: 1.15cqw; min-height: 14px; border: 2px solid var(--cream); border-radius: 3px; overflow: hidden; margin-top: .25cqw; }
.label .bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--straw); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.label .bar .glint { position: absolute; top: 0; bottom: 0; width: 30%; left: -40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent); }
.label .foot { grid-column: 1 / 3; font-size: 16px; line-height: 1.3; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: .2cqw; }
.label .foot .mono { color: var(--straw); }
.label .src { position: absolute; right: 0; top: 100%; margin-top: .5cqw; font-size: 16px; line-height: 1.3; color: var(--ink); background: rgba(251, 246, 234, .94); padding: 10px 16px; border-radius: 6px; }

/* ---------- below the book: sheets ---------- */
.sheet { width: min(1180px, calc(100% - 32px)); margin: 0 auto var(--s6); background: var(--paper); border-radius: 18px; padding: var(--s6) var(--s6) var(--s5); box-shadow: 0 10px 0 rgba(30, 42, 58, .08); }
.home .sheet:first-of-type { margin-top: var(--s5); }
.head { display: grid; gap: 6px; margin-bottom: var(--s4); }
.kicker { font-weight: 900; font-size: 16px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
.title { font-family: var(--display); font-weight: 750; font-variation-settings: "SOFT" 50, "opsz" 96; font-size: clamp(34px, 4vw, 56px); line-height: 1.04; margin: 0; letter-spacing: -.01em; }
.head p { margin: 4px 0 0; color: var(--ink-2); max-width: 46em; }
.cards { display: grid; gap: var(--s3); }
.card { background: var(--paper-2); border-radius: var(--radius); padding: var(--s3); border: 1px solid var(--line); min-width: 0; }

/* latest eggs row */
.eggrow { grid-template-columns: repeat(4, 1fr); }
.eggcard { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; }
.eggcard img { width: 64px; height: auto; }
.eggcard .n { font-family: var(--display); font-weight: 750; font-size: 30px; line-height: 1; }
.eggcard .meta { font-size: 16px; color: var(--ink-2); line-height: 1.4; }
.eggcard .who { font-size: 16px; }
.status { display: inline-block; padding: 9px 18px; line-height: 1.3; border-radius: 999px; font-weight: 800; font-size: 16px; }
.status.collected { background: #DCEBD5; color: #2F5A2A; }
.status.waiting { background: #FBE2C6; color: var(--beak-ink); }

/* how an egg is laid: four steps */
.steps { grid-template-columns: repeat(4, 1fr); counter-reset: s; }
.step { display: grid; gap: 8px; align-content: start; }
.step .num { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; color: var(--gold); }
.step h3 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.15; }
.step p { margin: 0; font-size: 17px; }
.formula { margin-top: var(--s3); padding: 14px 20px; border-radius: 12px; background: var(--ink); color: var(--cream); font-size: 17px; }
.formula b { color: var(--straw); }

/* ---------- inner pages ---------- */
.inner .sheet { margin-top: var(--s4); }
.runhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: -24px 0 var(--s4); padding-bottom: 14px; border-bottom: 1.5px solid var(--line); }
.runhead .home { padding: 12px 0; display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-weight: 750; font-size: 22px; }
.runhead .home img { width: 40px; height: 40px; border-radius: 8px; }
.pagehead { display: grid; grid-template-columns: 1fr minmax(240px, 400px); gap: var(--s4); align-items: center; margin-bottom: var(--s4); }
.pagehead .art { width: 100%; height: auto; max-height: 300px; object-fit: contain; mix-blend-mode: multiply; border-radius: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-bottom: var(--s4); }
.stat .v { font-family: var(--display); font-weight: 750; font-size: clamp(30px, 3vw, 44px); line-height: 1.05; }
.stat .k { font-size: 16px; font-weight: 700; color: var(--ink-2); }
.note { font-size: 16px; color: var(--ink-2); margin: 10px 0 0; }

table.ledger { width: 100%; border-collapse: collapse; font-size: 17px; }
.ledger th { text-align: left; font-weight: 900; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 12px 18px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.ledger td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ledger td.num, .ledger th.num { text-align: right; }
.ledger tr.me td { background: #FFF4CF; }
.addr { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.addr button { min-height: 36px; padding: 8px 16px; line-height: 1; border-radius: 7px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; font-size: 16px; cursor: pointer; }
.addr button:hover { border-color: var(--ink); }
.addr .full { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 4px; }
.tablewrap { overflow-x: auto; }
.egg-ico { width: 34px; height: auto; display: inline-block; vertical-align: middle; margin-right: 8px; }

.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 800; font-size: 16px; }
.field input, .field select { min-height: 52px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font: inherit; font-size: 18px; color: var(--ink); min-width: 0; width: 100%; }
.field input:focus { border-color: var(--ink); outline: none; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row .field { flex: 1 1 260px; }
.msg { min-height: 1.5em; font-size: 16px; font-weight: 700; margin: 0; }
.msg.err { color: var(--beak-ink); }
.msg.ok { color: #2F5A2A; }

.proof { display: grid; gap: 12px; counter-reset: p; }
.proof li { list-style: none; display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 18px; background: var(--paper-2); border-radius: 12px; border: 1px solid var(--line); }
.proof li::before { counter-increment: p; content: counter(p); font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--gold); line-height: 1; }
.proof .k { font-weight: 800; }
.proof .val { word-break: break-all; }
.proof .ok { color: #2F5A2A; font-weight: 900; }

.docs h2 { font-family: var(--display); font-weight: 750; font-size: clamp(28px, 3vw, 38px); margin: var(--s5) 0 var(--s2); line-height: 1.1; }
.docs p, .docs li { max-width: 46em; }
.docs .toc { columns: 2; padding-left: 1.2em; }

dialog.feed { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(30, 42, 58, .35); }
dialog.feed::backdrop { background: rgba(30, 42, 58, .45); }
dialog.feed .in { padding: var(--s4); display: grid; gap: 16px; }
dialog.feed h2 { margin: 0; font-family: var(--display); font-size: 34px; line-height: 1.1; }
dialog.feed .calc { padding: 14px 18px; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); font-size: 17px; }
dialog.feed .calc b { font-weight: 900; }
dialog.feed .formula { margin: 0; font-size: 16px; }
dialog.feed .close { position: absolute; right: 14px; top: 14px; min-height: 44px; min-width: 44px; border-radius: 50%; border: 0; background: var(--paper-2); font-weight: 900; font-size: 20px; cursor: pointer; }

.lost { text-align: center; display: grid; justify-items: center; gap: var(--s2); }
.lost img { width: min(520px, 90%); }

/* ---------- smaller screens: one page of the book ---------- */
@media (max-width: 1099px) {
  body { font-size: 17px; }
  .desk { display: block; }
  .book { width: 100%; aspect-ratio: auto; background: var(--paper); container-type: normal; display: flex; flex-direction: column; }
  .leftpage { position: static; width: auto; height: auto; padding: 16px 20px 28px; display: contents; }
  .leftpage > .top { order: 0; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 0; }
  .leftpage .chapters { display: none; }
  .menu-btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--ink); background: transparent; font-weight: 900; cursor: pointer; }
  .name { order: 1; font-size: clamp(44px, 13vw, 64px); margin: 12px 20px 0; }
  .headline { order: 2; font-size: clamp(24px, 6.4vw, 32px); margin: 10px 20px 0; }
  .scene { order: 3; position: relative; inset: auto; margin: 18px 0 0; aspect-ratio: 1086 / 1448; background: url("/img/book-tall.webp") center / 100% 100% no-repeat; container-type: inline-size; }
  /* tall picture: the straw patch is x 15.1-52.7%, y 55.5-65.8% */
  .goose { left: 10%; width: 49%; top: 32.2%; }
  .pile { left: 58%; top: 50%; width: 36%; height: 14%; }
  .kernel { width: 3%; } .flake { width: 1.4%; }
  .stamp { left: 6%; top: 4.5%; }
  .pull { left: auto; right: 0; top: auto; bottom: 3%; border-radius: 12px 0 0 12px; }
  .pull[aria-pressed="true"] { transform: translateX(-10px); }
  .peek { left: 6%; top: 14%; width: 60%; }
  .label { position: relative; order: 4; left: auto; top: auto; width: auto; height: auto; margin: 0; border-radius: 0; padding: 30px 20px 30px; grid-template-columns: 1fr; row-gap: 10px; }
  .label .lines { grid-row: auto; font-size: 16px; }
  .label .big, .label .bar, .label .foot { grid-column: 1; }
  .label .big { font-size: 46px; }
  .label .bar .track { height: 16px; }
  .label .foot { white-space: normal; }
  .label .src { position: static; margin: 4px 0 0; display: inline-block; justify-self: start; }
  .lede { order: 5; margin: 20px 20px 0; font-size: 17px; }
  .actions { order: 6; margin: 20px; gap: 20px; }
  .leftpage .colophon { order: 7; margin: 0 20px 28px; }
  .sheet { padding: var(--s4) 20px; border-radius: 14px; }
  .eggrow { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .pagehead { grid-template-columns: 1fr; }
  .pagehead .art { max-height: 220px; order: -1; }
  .runhead .chapters { display: none; }
  .runhead { margin-top: 0; }
}
@media (max-width: 640px) {
  .eggrow, .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 12px; }
  .docs .toc { columns: 1; }
  .ledger .hide-s { display: none; }
  .sheet { width: calc(100% - 16px); }
  .isbn { flex-wrap: wrap; }
  .isbn .v { flex-basis: 100%; order: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* tablets: the standing page keeps a book's size, not the window's */
@media (min-width: 641px) and (max-width: 1099px) {
  .scene { width: min(100%, 620px); margin: 18px auto 0; border-radius: 6px; overflow: hidden; }
  .label { width: min(100% - 40px, 620px); margin: 16px auto 0; border-radius: 10px; }
  .name, .headline, .lede, .actions, .leftpage .colophon { width: min(100% - 40px, 760px); margin-left: auto; margin-right: auto; }
}
.lost img { max-height: 46vh; width: auto; }
/* phones: a ledger row becomes a small card, no sideways scroll inside the page */
@media (max-width: 640px) {
  .tablewrap { overflow: visible; }
  table.ledger, .ledger tbody { display: block; }
  .ledger thead { display: none; }
  .ledger tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .ledger td { padding: 0; border: 0; }
  .ledger td.num { text-align: left; }
  .ledger tr.me { background: #FFF4CF; padding-left: 18px; padding-right: 18px; }
  .ledger tr.me td { background: none; }
}
@media (max-width: 640px) { .ledger td[data-k]::before { content: attr(data-k) ": "; font-weight: 800; color: var(--ink-2); } }

/* =========================================================
   REVISION 2 (operator's notes, 2026-11-16)
   ========================================================= */
/* page turns between chapters (cross-document view transitions; off with reduced motion) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: turn-out .5s cubic-bezier(.4, 0, .2, 1) both; transform-origin: 0 50%; }
::view-transition-new(root) { animation: turn-in .5s cubic-bezier(.2, .8, .2, 1) both; transform-origin: 100% 50%; }
@keyframes turn-out { to { transform: perspective(1600px) rotateY(-28deg) translateX(-6%); opacity: 0; } }
@keyframes turn-in { from { transform: perspective(1600px) rotateY(18deg) translateX(4%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }

/* home: the left page fits the window: tighter rhythm, every size in the book's own units */
.name { margin-top: 1.6cqw; font-size: clamp(52px, 5.9cqw, 120px); }
.headline { margin-top: 1cqw; font-size: clamp(24px, 2.05cqw, 40px); }
.lede { margin-top: .9cqw; font-size: clamp(16px, 1.16cqw, 20px); }
.actions { margin: 1.2cqw 0 auto; }
.leftpage .colophon { margin-top: 1cqw; }
.colophon .marks { flex-wrap: nowrap; gap: 8px; }
.colophon .pub { white-space: nowrap; }
.mark { padding: 0 1em; white-space: nowrap; }
.isbn .v.wait { white-space: nowrap; overflow: hidden; text-overflow: clip; padding: 0; }

/* the label: nothing cut: lines wrap, the source line lives inside the label */
.label { top: 60.6%; height: 31.2%; grid-template-columns: 1.35fr 1fr; grid-template-rows: 1fr auto auto; row-gap: .5cqw; }
.label .lines { grid-row: 1 / 2; align-self: start; font-size: clamp(16px, 1cqw, 19px); line-height: 1.3; }
.label .lines li { white-space: normal; overflow: visible; margin-bottom: .25cqw; }
.label .big { grid-column: 2; grid-row: 1; align-self: start; }
.label .bar { grid-column: 2; grid-row: 2; }
.label .bar .track { background: rgba(246, 235, 200, .14); }
.label .bar .fill { min-width: 6px; }
.label .foot { grid-column: 1 / 3; grid-row: 3; white-space: normal; overflow: visible; }
.label .src { position: static; grid-column: 1; grid-row: 2; align-self: end; margin: 0; padding: 0; background: none; color: var(--straw); font-size: 16px; line-height: 1.3; }

/* the next-page tab replaces the pull tab */
.nextpage { position: absolute; left: 91.2%; top: 26%; display: flex; align-items: center; min-height: 48px; padding: 12px 20px; border-radius: 0 12px 12px 0; background: var(--paper);
  box-shadow: 2px 3px 0 rgba(30, 42, 58, .2); font-weight: 900; font-size: 17px; text-decoration: none; white-space: nowrap; transition: transform .2s ease-out, background-color .15s; }
.nextpage:hover { transform: translateX(6px); background: var(--straw); }
.nextpage:active { transform: translateX(2px); }

/* the winner's paper tag over the pile */
.wintag { position: absolute; left: 68%; top: 33%; z-index: 3; padding: 12px 18px; border-radius: 12px; background: var(--paper); box-shadow: 0 6px 20px rgba(30, 42, 58, .22); font-size: 16px; line-height: 1.35; white-space: nowrap;
  opacity: 0; transform: translateY(8px) rotate(-2deg); transition: opacity .25s, transform .25s; pointer-events: none; }
.wintag.on { opacity: 1; transform: rotate(-2deg); pointer-events: auto; }
.wintag b { font-family: var(--display); font-size: 20px; }
.wintag a { font-weight: 800; }
.sand { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FBE7A1, var(--gold) 60%, #8A6410); will-change: transform; }
.goose.wobble { animation: wobble .9s ease-in-out; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 50% { transform: rotate(2.5deg); } 75% { transform: rotate(-1.5deg); } }

/* egg cards: number small on top, sum big */
.eggcard .n { font-family: var(--text); font-weight: 800; font-size: 16px; color: var(--ink-2); letter-spacing: .04em; }
.eggcard .sum { font-family: var(--display); font-weight: 750; font-size: 32px; line-height: 1.05; }

/* waiting eggs glow softly */
@keyframes glow { 0%, 100% { filter: drop-shadow(0 0 0 rgba(240, 138, 36, 0)); } 50% { filter: drop-shadow(0 0 10px rgba(240, 138, 36, .75)); } }
img.glow, .pile img[data-wait="1"] { animation: glow 2.4s ease-in-out infinite; }

/* ---------- inner pages: leaves of the same book ---------- */
body.inner { background: var(--sky); }
.leaf { width: min(1180px, calc(100% - 32px)); margin: 24px auto 48px; padding: 56px 72px 40px; border-style: solid; border-color: transparent; border-width: 40px 60px 70px;
  border-image: url("/img/page.webp") 40 60 70 fill / 40px 60px 70px round; position: relative; }
.leaf .runhead { margin: -10px 0 24px; padding-bottom: 12px; border-bottom: 1.5px solid var(--line); display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; }
.leaf .runhead [data-nav] { justify-self: center; }
.leaf .runhead .chapter { font-family: var(--display); font-style: italic; font-size: 17px; color: var(--ink-2); white-space: nowrap; }
.leaf .pagehead { grid-template-columns: 1fr 240px; gap: 32px; margin-bottom: 24px; }
.leaf .pagehead .art { max-height: 190px; mix-blend-mode: multiply; }
.leaf .pagehead .title { font-size: clamp(32px, 3.4vw, 48px); }
.leaf .pagehead p { font-size: 17px; }
h2.sub { font-family: var(--display); font-weight: 750; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; margin: 40px 0 12px; }
.turns { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 40px; padding-top: 16px; border-top: 1.5px solid var(--line); }
.turn { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 22px; border-radius: 999px; background: rgba(255, 255, 255, .55); border: 1.5px solid var(--line); font-weight: 900; text-decoration: none; transition: background-color .15s, border-color .15s, transform .12s; }
.turn:hover { background: var(--straw); border-color: var(--ink); }
.turn:active { transform: translateY(2px); }
.folio { font-family: var(--display); font-style: italic; color: var(--ink-2); }

/* Feeders: trust counter, the ribbon */
.trust { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; padding: 20px 28px; border-radius: 16px; background: #E3F0DA; border: 1.5px solid #9CC48C; margin-bottom: 8px; }
.trust .zero { font-family: var(--display); font-weight: 800; font-size: clamp(64px, 7vw, 96px); line-height: 1; color: #2F6B3A; }
.trust .zero.bad { color: var(--beak-ink); }
.trust p { margin: 0; font-size: 18px; }
.trust p b { display: block; font-size: 20px; }
.ribbon-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.ribbon-head .sub { margin-bottom: 4px; }
.ribbon-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: end; margin: 8px 0 24px; }
.peckgoose { width: 96px; height: auto; }
.ribbon { display: flex; height: 44px; border-radius: 10px; overflow: hidden; background: rgba(30, 42, 58, .08); border: 1.5px solid var(--line); }
.ribbon .seg { height: 100%; flex: 0 0 auto; transition: width .8s cubic-bezier(.2, .8, .2, 1), filter .15s; border-right: 2px solid var(--paper); cursor: pointer; }
.ribbon .seg:last-child { border-right: 0; }
.ribbon .seg.hl, .ribbon .seg.me { box-shadow: inset 0 0 0 3px var(--ink); filter: brightness(1.12); }
.ledger tr.hl td { background: #FFF4CF; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 10px; vertical-align: -1px; }

/* Eggs: the tray and the opened egg */
.tray-wrap { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; margin-top: 8px; }
.tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 14px; padding: 22px; border-radius: 18px; background: #EBD9B3; box-shadow: inset 0 3px 10px rgba(120, 80, 20, .25); }
.tray button { display: grid; justify-items: center; gap: 6px; padding: 12px 16px; border: 0; border-radius: 50% 50% 14px 14px; background: rgba(251, 246, 234, .6); cursor: pointer; transition: transform .15s, background-color .15s; }
.tray button:hover { transform: translateY(-3px); background: var(--paper); }
.tray button:active { transform: translateY(0); }
.tray button[aria-pressed="true"] { background: var(--straw); }
.tray img { width: 52px; height: auto; }
.tray .tn { font-weight: 900; font-size: 16px; }
.opened { position: sticky; top: 24px; min-height: 360px; padding: 24px; border-radius: 16px; background: var(--paper); border: 1.5px solid var(--line); display: grid; gap: 10px; align-content: start; }
.opened .crack { width: 200px; margin: 0 auto; }
.opened .sum { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1; }
.opened dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 16px; }
.opened dt { font-weight: 800; color: var(--ink-2); }
.opened dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.crackin { animation: crackin .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes crackin { 0% { transform: scale(.6) rotate(-8deg); opacity: 0; } 60% { transform: scale(1.08) rotate(3deg); opacity: 1; } 100% { transform: none; } }

/* Mine: the chance, the collect */
.chance { display: grid; grid-template-columns: auto 1fr; gap: 6px 24px; align-items: center; margin: 16px 0 12px; }
.chance .v { font-family: var(--display); font-weight: 800; font-size: clamp(56px, 7vw, 92px); line-height: 1; color: var(--gold-ink); }
.chance .k { font-size: 18px; font-weight: 800; }
.chance .k span { display: block; font-weight: 600; color: var(--ink-2); font-size: 17px; }
.connect { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.connect .hint { font-size: 16px; font-weight: 700; color: var(--ink-2); }
.collectfx.on { position: relative; min-height: 220px; margin-top: 24px; padding: 24px; border-radius: 16px; background: var(--ink); color: var(--cream); display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center; overflow: hidden; }
.collectfx img { width: 170px; }
.collectfx .split { display: grid; gap: 10px; font-size: 18px; }
.collectfx .bar2 { display: flex; height: 22px; border-radius: 6px; overflow: hidden; border: 2px solid var(--cream); }
.collectfx .bar2 i { display: block; height: 100%; width: 0; }
.collectfx .bar2 .you { background: var(--straw); transition: width 1s ease-out; }
.collectfx .bar2 .proj { background: var(--sky); transition: width 1s ease-out .4s; }
.collectfx .dust { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--straw); }

/* Docs: sticky contents left, sections as pages */
.docs { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.toc-wrap { position: sticky; top: 24px; }
.docs .toc { columns: 1; list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.docs .toc a { display: block; padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 800; }
.docs .toc a:hover, .docs .toc a.on { background: var(--straw); }
.docpages { display: grid; gap: 24px; }
.docpage { position: relative; padding: 32px 36px; border-radius: 14px; background: rgba(255, 255, 255, .5); border: 1.5px solid var(--line); box-shadow: 0 3px 0 rgba(30, 42, 58, .06); scroll-margin-top: 24px; }
.docpage h2 { margin-top: 0 !important; padding-right: 48px; }
.docpage .folio { position: absolute; right: 24px; top: 20px; }

@media (max-width: 1099px) {
  .nextpage { left: auto; right: 0; top: auto; bottom: 3%; border-radius: 12px 0 0 12px; }
  .label { grid-template-columns: 1fr; grid-template-rows: auto; }
  .label .lines, .label .big, .label .bar, .label .foot, .label .src { grid-column: 1; grid-row: auto; }
  .wintag { left: 30%; top: 22%; }
  .leaf { width: calc(100% - 8px); padding: 28px 12px 24px; border-width: 22px 26px 36px; border-image: url("/img/page.webp") 40 60 70 fill / 22px 26px 36px round; margin: 8px auto 24px; }
  .leaf .runhead { grid-template-columns: 1fr auto auto; }
  .leaf .runhead .chapter, .leaf .runhead [data-nav] { display: none; }
  .leaf .pagehead { grid-template-columns: 1fr; }
  .leaf .pagehead .art { max-height: 140px; order: -1; justify-self: start; width: auto; }
  .tray-wrap { grid-template-columns: 1fr; }
  .opened { position: static; min-height: 0; }
  .docs { grid-template-columns: 1fr; }
  .toc-wrap { position: static; }
  .docpage { padding: 24px 20px; }
  .collectfx.on { grid-template-columns: 1fr; }
  .turns { flex-wrap: wrap; }
  .turns .folio { display: none; }
}
@media (max-width: 640px) {
  .trust { grid-template-columns: 1fr; gap: 8px; }
  .chance { grid-template-columns: 1fr; }
  .ribbon-row { grid-template-columns: 64px 1fr; }
  .peckgoose { width: 64px; }
  .colophon .marks { flex-wrap: wrap; }
  .isbn .v.wait { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { img.glow, .pile img[data-wait="1"] { animation: none; } }

/* revision 2b: the first screen fits every desktop window (measured by tools/_goosefit.mjs at 1280x640 to 2560x1300) */
.label { top: 58.4%; height: 33.6%; grid-template-columns: 1.5fr 1fr; padding: 1.3cqw 1.5cqw 1.1cqw; }
.label .lines li { margin-bottom: .2cqw; }
.leftpage { padding: 1.1cqw 1.5cqw 1cqw; }
.colophon { gap: 8px; }
.colophon::before { margin-bottom: 2px; }
@media (min-width: 1100px) and (max-height: 740px), (min-width: 1100px) and (max-width: 1300px) {
  .headline .sub { display: none; }
  .name { margin-top: .8cqw; font-size: clamp(46px, 5.3cqw, 120px); }
  .headline { margin-top: .7cqw; font-size: clamp(22px, 1.95cqw, 40px); }
  .lede { margin-top: .6cqw; line-height: 1.42; }
  .actions { margin-top: .9cqw; }
  .leftpage .colophon { margin-top: .6cqw; }
  .mark { min-height: 44px; }
  .isbn { min-height: 48px; padding: 6px 6px 6px 16px; }
  .btn { min-height: 48px; }
  .chapters a { min-height: 40px; padding: 8px 16px; }
}
.label .big > span { white-space: nowrap; }
.label .big.ticket > span { font-size: .62em; }
.nextpage { left: 88.6%; }
.actions { margin-bottom: 0; }
.name { margin-top: auto; }
.leftpage .colophon { margin-top: auto; }
.leaf { border-image: url("/img/page.webp") 40 60 70 fill / 40px 60px 70px stretch; }
@media (max-width: 1099px) {
  .leaf { border: 0; border-image: none; background: #F6E0C2; border-radius: 14px; box-shadow: 0 0 0 6px #D9A73A, 0 8px 0 6px rgba(30, 42, 58, .12); width: calc(100% - 28px); margin: 14px auto 24px; padding: 20px 18px 24px; }
  .leaf .runhead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
  .leaf .runhead .home { font-size: 19px; white-space: nowrap; padding: 6px 0; }
  .leaf .runhead .home img { width: 34px; height: 34px; }
  .leaf .runhead .menu-btn { margin-left: auto; }
  .leaf .runhead [data-badge] { order: 5; }
}
@media (min-width: 1100px) {
  .leaf .runhead { grid-template-columns: auto 1fr auto; grid-template-areas: "ch ch ch" "home nav badge"; row-gap: 6px; }
  .leaf .runhead .chapter { grid-area: ch; justify-self: center; font-size: 17px; }
  .leaf .runhead .home { grid-area: home; }
  .leaf .runhead [data-nav] { grid-area: nav; }
  .leaf .runhead [data-badge] { grid-area: badge; }
  .leaf .runhead .chapters { flex-wrap: nowrap; }
}
.ribbon-head .sub { margin-bottom: 0; }
.ribbon-head .note { margin: 0; }
.ribbon-wrap .sub { margin-top: 28px; }
.btn.ghost[aria-disabled="true"] { background: transparent; border: 2px dashed var(--ink-2); color: var(--ink); box-shadow: none; }
.btn.ghost[aria-disabled="true"]:hover { background: rgba(30, 42, 58, .05); }
.leaf .pagehead .art { -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 62%, transparent 100%); border-radius: 0; }
.opened .crack { width: 160px; }
.wintag { padding: 14px 24px; }
.label { padding-top: 1.6cqw; }
@media (min-width: 1100px) and (max-height: 860px), (min-width: 1100px) and (max-width: 1530px) { .chapters a { padding: 8px 18px; } }
/* phones and tablets, last word: the label keeps its own padding, the tab stays on the page, one 32 px gutter */
@media (max-width: 1099px) {
  .label { padding: 30px 32px 30px; }
  .nextpage { left: auto; right: 0; }
  .name, .headline, .lede { margin-left: 32px; margin-right: 32px; }
  .actions { margin-left: 32px; margin-right: 32px; }
  .leftpage .colophon { margin-left: 32px; margin-right: 32px; }
  .leftpage > .top { padding-left: 32px; padding-right: 20px; }
}
@media (min-width: 641px) and (max-width: 1099px) {
  .name, .headline, .lede, .actions, .leftpage .colophon { margin-left: auto; margin-right: auto; }
}
@media (max-width: 1099px) { .sheet { padding: 32px; } }
@media (max-width: 400px) { .sheet { padding: 32px 30px; } .title { font-size: 28px; } .step .num { font-size: 30px; } .step h3 { font-size: 22px; } }
@media (min-width: 1100px) { .label { padding-top: 1.9cqw; } }
.leaf .runhead { padding-top: 10px; }
.addr button { padding: 10px 18px; min-height: 40px; }
.trust { padding: 24px 32px; }
.trust .zero { line-height: 1.15; }
.opened { padding: 28px 32px; }
.docs .toc a { padding: 10px 18px; }
@media (max-width: 1099px) {
  .leaf { padding: 24px 28px 28px; }
  .leaf .pagehead .title { font-size: 28px; }
  .docpage { padding: 24px 28px; }
  .docpage h2 { font-size: 26px; }
  .stat .v { font-size: 28px; }
}
@media (max-width: 640px) {
  .ledger tr { padding: 14px 18px; }
}
.btn { padding-top: 12px; padding-bottom: 12px; }
@media (max-width: 640px) { .leaf .runhead { padding-right: 18px; } .leaf .runhead .home { font-size: 17px; } }
@media (max-width: 640px) { .ledger tr { grid-template-columns: 1fr 1fr; } .ledger td:first-child { grid-column: 1 / -1; } .ledger td.num { white-space: nowrap; } }
@media (max-width: 640px) { .ledger tr { grid-template-columns: 1fr; gap: 4px; } .ledger td.num { white-space: normal; } }
.opened dd .addr { flex-wrap: wrap; white-space: normal; }
