@font-face { font-family: 'Anton'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/Anton-normal-400.woff2') format('woff2'); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/Epilogue-normal-400.woff2') format('woff2'); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/Epilogue-normal-600.woff2') format('woff2'); }
@font-face { font-family: 'Epilogue'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/Epilogue-normal-800.woff2') format('woff2'); }
@font-face { font-family: 'Yellowtail'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/Yellowtail-normal-400.woff2') format('woff2'); }

/* ==========================================================================
   Reality Chick: The Handbook of Flight, Ground Edition.
   A two-ink newsprint book of spreads. Ink + one spot yellow.
   Solid yellow fills are for Buy only.
   ========================================================================== */

:root {
  --paper: #f7f5e3;
  --paper2: #ede9cf;
  --ink: #302d17;
  --inkSoft: #625e41;
  --accent: #e9d549;
  --accentDeep: #7d6f12;
  --deep: #393518;
  --night: #18170c;
  --onNight: #f6f4ea;
  --onNightSoft: #cbc8b4;
  --fd: "Anton", "Arial Narrow", Impact, sans-serif;
  --fb: "Epilogue", "Segoe UI", system-ui, sans-serif;
  --fs: "Yellowtail", "Brush Script MT", cursive;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .19 0 0 0 0 .17 0 0 0 0 .09 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
  --rule: rgba(48, 45, 23, .28);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper2);
}
body {
  margin: 0;
  padding-top: 56px;
  background-color: var(--paper2);
  background-image: var(--grain);
  color: var(--ink);
  font: 400 17px/1.55 var(--fb);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px dashed var(--night); outline-offset: 4px; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  padding: 10px 14px; background: var(--night); color: var(--paper); text-decoration: none;
}
.skip:focus { left: 12px; }

/* --------------------------------------------------------------------------
   The opening: a registration mark, then the book grows from that one point
   -------------------------------------------------------------------------- */
.opening { display: none; }
html.js:not(.rm) .opening {
  display: grid; place-items: center;
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  animation: op-out .55s cubic-bezier(.7, 0, .2, 1) 1s forwards;
}
.opening svg { width: 48px; height: 48px; overflow: visible; }
.opening circle, .opening path {
  fill: none; stroke: var(--night); stroke-width: 1.3;
  stroke-dasharray: 90; stroke-dashoffset: 90;
  animation: op-draw .45s ease-out forwards;
}
.opening path { animation-delay: .1s; }
@keyframes op-draw { to { stroke-dashoffset: 0; } }
@keyframes op-out { to { opacity: 0; transform: scale(5); } }

html.js:not(.rm) .spread--title .sheet {
  animation: grow 1.15s cubic-bezier(.7, 0, .2, 1) .35s backwards;
}
@keyframes grow {
  from { clip-path: circle(3px at 50% calc(50vh - 62px)); }
  to { clip-path: circle(150vmax at 50% calc(50vh - 62px)); }
}
html.js:not(.rm) .spread:not(.spread--title) > .sheet { animation: wait 1.4s steps(1) backwards; }
@keyframes wait { from, to { visibility: hidden; } }
html.js:not(.rm) .head,
html.js:not(.rm) .tabs { animation: fade-in .6s ease 1.25s backwards; }
@keyframes fade-in { from { opacity: 0; } }

/* --------------------------------------------------------------------------
   Header: the running head across the table
   -------------------------------------------------------------------------- */
.head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background-color: var(--paper2); background-image: var(--grain);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
html.is-scrolled .head { border-bottom-color: var(--rule); }
.head__brand {
  display: flex; align-items: center; gap: 10px; margin-right: auto;
  color: var(--night); text-decoration: none;
}
.head__brand img { width: 38px; height: 38px; border-radius: 9px; border: 2.5px solid var(--night); }
.head__name { display: none; font: 800 13px/1 var(--fb); letter-spacing: .16em; text-transform: uppercase; }
.head__run { display: none; }
.head__x {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 6px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.head__x:hover { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(24, 23, 12, .18); }
.head__x img { width: 16px; height: 16px; }
.burger {
  display: grid; place-content: center; gap: 4px; flex: none;
  width: 44px; height: 40px; background: var(--night); border: 0; border-radius: 6px; cursor: pointer;
}
.burger i { display: block; width: 18px; height: 2px; background: var(--paper); transition: transform .25s var(--ease), opacity .2s; }
.burger[aria-expanded="true"] i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.burger:focus-visible { outline-color: var(--night); }

@media (min-width: 600px) { .head__name { display: block; } }
@media (min-width: 900px) {
  .head { padding: 0 24px; gap: 12px; }
  .head__brand { margin-right: 0; }
  .head__run {
    display: block; flex: 1; margin: 0; text-align: center;
    font: 600 11px/1 var(--fb); letter-spacing: .26em; text-transform: uppercase; color: var(--inkSoft);
  }
}
@media (min-width: 1024px) {
  .head { padding-right: 64px; }
  .burger { display: none; }
}

/* --------------------------------------------------------------------------
   Learner plates: every Buy button is one (the only solid yellow)
   -------------------------------------------------------------------------- */
.plate {
  display: inline-flex; align-items: center; gap: 12px; flex: none;
  min-height: 62px; padding: 0 22px 0 12px;
  background: var(--accent); color: var(--night);
  border: 5px solid var(--night); border-radius: 14px;
  font: 800 14px/1 var(--fb); letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: 4px 4px 0 var(--night);
  transition: transform .24s var(--ease), box-shadow .24s var(--ease);
}
.plate__l {
  font: 400 34px/1 var(--fd); padding-right: 12px; border-right: 3px solid var(--night);
}
.plate:hover { transform: rotate(-4deg) translate(-2px, -2px); box-shadow: 8px 8px 0 var(--night); }
.plate:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--night); }
.plate:focus-visible { outline: 3px dashed var(--night); outline-offset: 5px; }
.plate--sm {
  min-height: 40px; padding: 0 11px 0 6px; gap: 7px;
  border-width: 3px; border-radius: 9px; font-size: 11.5px; letter-spacing: .08em;
  box-shadow: 2px 2px 0 var(--night);
}
.plate--sm .plate__l { font-size: 22px; padding-right: 7px; border-right-width: 2px; }
.plate--sm:hover { box-shadow: 5px 5px 0 var(--night); }

/* --------------------------------------------------------------------------
   Thumb-index tabs (desktop) / the Contents page (phone)
   -------------------------------------------------------------------------- */
.tabs { display: none; }
.tabs.is-open {
  display: block; position: fixed; z-index: 60; top: 64px; left: 10px; right: 10px;
  max-height: calc(100vh - 80px); overflow: auto; padding: 18px 20px 10px;
  background-color: var(--paper); background-image: var(--grain);
  border: 2px solid var(--night); box-shadow: 8px 8px 0 rgba(24, 23, 12, .22);
}
.tabs__title { margin: 0 0 6px; font: 400 34px/1 var(--fd); text-transform: uppercase; color: var(--night); }
.tabs a {
  display: flex; align-items: baseline; gap: 12px; padding: 13px 0;
  border-bottom: 1px dotted rgba(48, 45, 23, .55); color: var(--ink); text-decoration: none;
}
.tabs a:last-child { border-bottom: 0; }
.tabs a b { width: 34px; font: 400 16px/1 var(--fd); color: var(--night); }
.tabs__short { display: none; }
.tabs__long { flex: 1; font-weight: 600; }
.tabs a i { font: 400 16px/1 var(--fd); font-style: normal; color: var(--inkSoft); }

@media (min-width: 1024px) {
  .tabs {
    display: flex; flex-direction: column; gap: 6px;
    position: fixed; z-index: 40; top: 76px; right: 0; width: 64px;
  }
  .tabs__title, .tabs__long, .tabs a i { display: none; }
  .tabs a {
    flex-direction: column; align-items: center; gap: 8px;
    width: 44px; padding: 11px 0 13px;
    background-color: var(--paper); background-image: var(--grain);
    border: 1px solid rgba(48, 45, 23, .35); border-left: 0; border-radius: 0 9px 9px 0;
    box-shadow: 2px 2px 0 rgba(24, 23, 12, .08);
    transition: transform .25s var(--ease), background-color .25s, color .25s;
  }
  .tabs a:last-child { border-bottom: 1px solid rgba(48, 45, 23, .35); }
  .tabs a b { width: auto; font-size: 13px; transition: color .25s; }
  .tabs__short {
    display: block; writing-mode: vertical-rl;
    font: 700 10px/1 var(--fb); letter-spacing: .14em; text-transform: uppercase;
  }
  .tabs a:hover { transform: translateX(6px); }
  .tabs a.is-current,
  html:not(.is-book) .tabs a.is-active {
    background-color: var(--night); background-image: none; border-color: var(--night);
    color: var(--accent); transform: translateX(12px);
  }
  .tabs a.is-current b,
  html:not(.is-book) .tabs a.is-active b { color: var(--accent); }
  .tabs a:focus-visible { outline-offset: 2px; }
}
@media (min-width: 1024px) and (max-height: 800px) {
  .tabs__short { display: none; }
  .tabs a { padding: 12px 0; }
}

/* --------------------------------------------------------------------------
   The book: spreads, sheets, pages (phone first: a pad of pages)
   -------------------------------------------------------------------------- */
.book { position: relative; overflow-x: clip; }
.spread { position: relative; padding: 10px 10px 0; }
.spread:last-child { padding-bottom: 10px; }
.sheet {
  position: relative;
  background-color: var(--paper); background-image: var(--grain);
  box-shadow: 0 0 0 1px rgba(48, 45, 23, .12), 0 18px 34px -22px rgba(24, 23, 12, .55);
}
.page { position: relative; padding: 16px 18px 48px; }
.page + .page { border-top: 1px solid var(--rule); }

.runhead {
  display: flex; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
  font: 600 10.5px/1.2 var(--fb); letter-spacing: .22em; text-transform: uppercase; color: var(--inkSoft);
}
.folio {
  position: absolute; bottom: 16px;
  font: 400 14px/1 var(--fd); letter-spacing: .08em; color: var(--inkSoft);
}
.folio::before { content: "— "; }
.folio::after { content: " —"; }
.page--verso .folio { left: 18px; }
.page--recto .folio { right: 18px; }

.page__in { position: relative; }
.page__in > :not(.numeral) { position: relative; z-index: 1; }

/* Type */
.eyebrow {
  margin: 0 0 12px;
  font: 600 12px/1.3 var(--fb); letter-spacing: .24em; text-transform: uppercase; color: var(--inkSoft);
}
.h2 {
  margin: 0;
  font: 400 clamp(40px, 11vw, 64px)/.92 var(--fd);
  text-transform: uppercase; letter-spacing: .005em; color: var(--night);
}
.h2--md { font-size: clamp(38px, 10vw, 56px); }
.body { max-width: 44ch; margin: 18px 0 0; }
.dropcap::first-letter {
  float: left; margin: .08em .1em 0 0;
  font: 400 3.6em/.8 var(--fd); color: var(--night);
}

/* The painted sign: Yellowtail lit in yellow on black enamel */
.sign {
  position: relative; display: block; width: fit-content; max-width: 100%;
  margin: 14px 0 0; padding: .08em .55em .2em;
  background: var(--night); color: var(--accent);
  font: 400 1em/1.15 var(--fs); text-transform: none; letter-spacing: 0;
  border-radius: 6px; transform: rotate(-2deg);
  box-shadow: 0 5px 0 -1px rgba(24, 23, 12, .22);
}
.sign::before, .sign::after {
  content: ""; position: absolute; top: 50%; width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%; background: var(--inkSoft);
}
.sign::before { left: .2em; }
.sign::after { right: .2em; }
.sign__t { text-shadow: 0 0 .2em rgba(233, 213, 73, .55), 0 0 .04em rgba(233, 213, 73, .9); }
.split-w { display: inline-block; white-space: nowrap; }
.h2 .sign { font-size: .6em; }

/* Outlined chapter numerals with a misregistered yellow halftone copy */
.numeral {
  position: relative; display: block; width: fit-content; margin: 4px 0 14px; z-index: 0; pointer-events: none;
  font: 400 76px/.8 var(--fd); color: transparent; -webkit-text-stroke: 1.5px var(--night);
}
.numeral::before {
  content: attr(data-n); position: absolute; inset: 0; z-index: -1;
  color: transparent; -webkit-text-stroke: 0;
  background-image: radial-gradient(circle, var(--accent) 0 1.6px, transparent 2.1px);
  background-size: 6px 6px; -webkit-background-clip: text; background-clip: text;
  transform: translate(7px, 6px);
}

/* --------------------------------------------------------------------------
   Spread I: the title page (verso) and the permit page (recto)
   -------------------------------------------------------------------------- */
.cover { padding: 14px 12px 16px; }
.cover .folio { display: none; }
.cover__frame {
  position: relative; display: flex; flex-direction: column;
  border: 9px solid var(--night); border-radius: 22px;
  padding: 10px 14px 10px; background: var(--paper);
}
.cover__kicker {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font: 600 10.5px/1.2 var(--fb); letter-spacing: .2em; text-transform: uppercase; color: var(--inkSoft);
}
.cover__kicker::before, .cover__kicker::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .5; }
.cover__kicker span { text-align: center; }
.cover__h1 { position: relative; z-index: 4; margin: 0; font-weight: 400; }
.h1__a {
  display: block;
  font: 400 clamp(40px, 13.4vw, 60px)/.9 var(--fd);
  text-transform: uppercase; letter-spacing: .005em; color: var(--night);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}
.h1__b {
  display: block; width: auto; max-width: none; z-index: 4;
  margin: 12px -22px -12px; text-align: center;
  font-size: clamp(26px, 8.2vw, 36px);
}
.cover__sky {
  position: relative; z-index: 1; height: 236px; margin: 0 -14px;
  --aurora-bg: #e9d549;
  --aurora-1: #f7f5e3;
  --aurora-2: #ede9cf;
  --aurora-3: #e9d549;
  background:
    radial-gradient(60% 45% at 22% 32%, rgba(247, 245, 227, .9), rgba(247, 245, 227, 0)),
    radial-gradient(45% 40% at 78% 24%, rgba(247, 245, 227, .7), rgba(247, 245, 227, 0)),
    linear-gradient(180deg, var(--accent), #efe17f);
}
.cover__screen {
  position: absolute; inset: -8px; z-index: 1; pointer-events: none;
  background-image:
    radial-gradient(circle, var(--night) 0 .9px, transparent 1.3px),
    radial-gradient(circle, var(--accentDeep) 0 1.2px, transparent 1.7px);
  background-size: 5px 5px, 9px 9px;
  background-position: 0 0, 2px 3px;
  mix-blend-mode: multiply; opacity: .2;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 75%);
  mask-image: linear-gradient(180deg, transparent 0, #000 75%);
}
.cover__ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22%; z-index: 2;
  background: repeating-linear-gradient(-45deg, rgba(48, 45, 23, .26) 0 1px, transparent 1px 7px), var(--paper2);
  border-top: 2px solid var(--night);
}
.cover__veil { display: none; }
.cover__bird {
  position: absolute; z-index: 3; right: -4%; bottom: 4%;
  height: 104%; aspect-ratio: 933 / 1155; transform-origin: 50% 100%;
}
.cover__bird img { width: 100%; height: 100%; object-fit: contain; }
.cover__bird::after {
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: 0; width: 50%; height: 6%;
  background: radial-gradient(closest-side, rgba(24, 23, 12, .38), rgba(24, 23, 12, 0));
}
.cover__cap {
  margin: 10px 0 0; text-align: center;
  font: 600 10px/1.2 var(--fb); letter-spacing: .22em; text-transform: uppercase; color: var(--inkSoft);
}

/* Opening moves inside the cover (motion on only) */
html.js:not(.rm) .cover__h1 { perspective: 800px; }
html.js:not(.rm) .h1__a { transform-origin: 50% 100%; animation: unfold-a .8s var(--ease) .8s backwards; }
html.js:not(.rm) .h1__b { transform-origin: 50% 0; animation: unfold-b .7s var(--ease) 1.05s backwards; }
@keyframes unfold-a { from { transform: rotateX(88deg); opacity: 0; } }
@keyframes unfold-b { from { transform: rotate(-2deg) rotateX(-88deg); opacity: 0; } }
html.js:not(.rm) .h1__b .split-c { animation: lamp .55s linear calc(1.4s + var(--i, 0) * 28ms) backwards; }
@keyframes lamp {
  0% { opacity: .12; text-shadow: none; }
  35% { opacity: 1; }
  50% { opacity: .45; }
  65%, 100% { opacity: 1; }
}
html.js:not(.rm) .cover__veil {
  display: block; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: var(--paper2); animation: veil 1s ease 1.15s forwards;
}
@keyframes veil { to { opacity: 0; visibility: hidden; } }
html.js:not(.rm) .cover__bird img { transform-origin: 50% 100%; animation: hop .75s cubic-bezier(.3, .7, .3, 1) 1.45s backwards; }
@keyframes hop {
  0% { transform: translateY(30px); opacity: 0; }
  45% { transform: translateY(-12px) scale(.97, 1.03); opacity: 1; }
  72% { transform: translateY(0) scale(1.04, .96); }
  100% { transform: none; }
}
/* Pointer lean: the screen drifts back, the chick leans away from you */
html.js:not(.rm) .cover__screen { transform: translate3d(calc(var(--px, 0) * -6px), calc(var(--py, 0) * -4px), 0); }
html.js:not(.rm) .cover__bird { transform: translate3d(calc(var(--px, 0) * 10px), 0, 0) rotate(calc(var(--px, 0) * 1.5deg)); }

/* Permit page */
.permit__body { display: flex; flex-direction: column; gap: 14px; }
.permit__issued { margin: 0; }
.permit__name {
  position: relative; z-index: 0; margin: 0;
  font: 400 clamp(44px, 13vw, 64px)/.9 var(--fd); text-transform: uppercase; color: var(--night);
}
.permit__name::before {
  content: attr(data-echo); position: absolute; inset: 0; z-index: -1;
  color: transparent;
  background-image: radial-gradient(circle, var(--accent) 0 1.5px, transparent 2px);
  background-size: 5px 5px; -webkit-background-clip: text; background-clip: text;
  transform: translate(6px, 6px);
}
.permit__lede { margin: 0; font-size: 18px; line-height: 1.5; max-width: 34ch; }
.permit__act { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.turnlink {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px;
  font: 600 12.5px/1.2 var(--fb); letter-spacing: .16em; text-transform: uppercase;
  transition: text-decoration-thickness .2s;
}
.turnlink:hover { text-decoration-thickness: 3px; }

/* The CA permit form */
.ca {
  position: relative; padding: 12px 14px 14px 28px;
  border: 1.5px dashed var(--ink);
  background: color-mix(in srgb, var(--paper2) 55%, var(--paper));
}
.ca::before {
  content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 9px;
  background: radial-gradient(circle, color-mix(in srgb, var(--ink) 30%, var(--paper2)) 0 2.6px, transparent 3.1px) 0 0 / 9px 13px repeat-y;
}
.ca__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 6px; }
.ca__label { font: 700 11px/1.3 var(--fb); letter-spacing: .18em; text-transform: uppercase; color: var(--ink); }
.ca__form {
  flex: none; padding: 3px 6px; border: 1px solid var(--inkSoft);
  font: 600 9.5px/1 var(--fb); letter-spacing: .2em; text-transform: uppercase; color: var(--inkSoft);
}
.ca__row { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; }
#ca-copy {
  flex: 1; min-width: 0; display: grid; gap: 6px; padding: 8px 6px 8px;
  text-align: left; cursor: pointer;
  background: var(--paper); color: var(--ink);
  border: 0; border-bottom: 1.5px solid var(--ink);
  transition: box-shadow .2s var(--ease), background-color .2s;
}
#ca-copy:hover { box-shadow: inset 0 -3px 0 var(--ink); }
#ca-text {
  font: 600 13px/1.35 var(--fb); font-variant-numeric: tabular-nums; letter-spacing: .02em;
  word-break: break-all; color: var(--night);
}
.ca__tap { font: 700 10px/1 var(--fb); letter-spacing: .22em; text-transform: uppercase; color: var(--inkSoft); }
#ca-copy.is-copied .ca__tap { color: var(--night); }
.ca__stamp {
  position: relative; flex: none; display: grid; place-items: center;
  width: 54px; height: 54px; border-radius: 50%; border: 1.5px dashed var(--inkSoft);
  transition: background-color .2s;
}
.ca__stamp b { font: 400 26px/1 var(--fd); color: transparent; transition: color .2s; }
.ca__stamp i {
  position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%);
  font: 700 8.5px/1 var(--fb); font-style: normal; letter-spacing: .2em; text-transform: uppercase; color: var(--inkSoft);
}
html.ca-copied .ca__stamp { background: var(--night); border: 1.5px solid var(--night); }
html.ca-copied .ca__stamp b { color: var(--accent); }
html.js:not(.rm).ca-copied .ca__stamp { animation: seal .45s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes seal { from { transform: scale(1.5) rotate(-18deg); opacity: 0; } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.chips a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 9px;
  background: var(--paper); color: var(--ink); text-decoration: none;
  border: 1.5px solid var(--ink); border-radius: 4px; box-shadow: 0 2px 0 var(--ink);
  font: 700 11px/1 var(--fb); letter-spacing: .08em; text-transform: uppercase;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.chips a:hover { transform: translateY(2px); box-shadow: 0 0 0 var(--ink), inset 0 2px 4px rgba(24, 23, 12, .18); }
.chips img { width: 16px; height: 16px; }
.colorbar { display: none; }

/* Phone: the title spread is one page: h1, window, Buy, CA, then the rest */
@media (max-width: 899px) {
  .spread--title .sheet { display: flex; flex-direction: column; }
  .spread--title .page--recto,
  .spread--title .permit__body { display: contents; }
  .spread--title .page--recto > .runhead,
  .spread--title .page--recto > .folio { display: none; }
  .spread--title .page--verso { order: 1; }
  .spread--title .permit__act { order: 2; margin: 0 14px; }
  .spread--title .permit__act .plate { flex: 1; justify-content: center; }
  .spread--title .ca { order: 3; margin: 14px 14px 0; }
  .spread--title .permit__issued { order: 4; margin: 26px 14px 6px; padding-top: 18px; border-top: 1px solid var(--rule); }
  .spread--title .permit__name { order: 5; margin: 0 14px; }
  .spread--title .permit__lede { order: 6; margin: 12px 14px 30px; }
}

/* --------------------------------------------------------------------------
   Spread II: ground school. Plates (figures) with a halftone screen.
   -------------------------------------------------------------------------- */
.fig { margin: 0; }
.fig__img {
  position: relative; padding: 7px;
  background: color-mix(in srgb, var(--paper) 65%, #fff);
  box-shadow: 0 0 0 1px var(--night), 0 18px 30px -20px rgba(24, 23, 12, .6);
  transition: transform .35s var(--ease);
}
.fig__img img { width: 100%; height: auto; object-fit: cover; }
.fig__img::after {
  content: ""; position: absolute; inset: 7px; pointer-events: none;
  background-image: radial-gradient(circle, var(--night) 0 .8px, transparent 1.2px);
  background-size: 4px 4px; mix-blend-mode: multiply; opacity: .12;
  transition: opacity .35s;
}
.fig:hover .fig__img { transform: translateY(-4px); }
.fig:hover .fig__img::after { opacity: 0; }
.fig figcaption { margin-top: 12px; font-size: 14px; line-height: 1.45; color: var(--inkSoft); max-width: 52ch; }
.fig figcaption b {
  margin-right: 8px; color: var(--night);
  font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.leader { position: absolute; z-index: 2; left: 67%; top: 11%; height: 15%; width: 1.5px; background: var(--night); }
.leader::after {
  content: ""; position: absolute; bottom: -4px; left: -3.25px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--night);
}
.callout {
  position: absolute; z-index: 3; top: 5%; right: 33%;
  padding: 5px 8px; background: var(--paper); border: 1px solid var(--night);
  font: 700 9.5px/1 var(--fb); letter-spacing: .16em; text-transform: uppercase; color: var(--night);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Spread III: the logbook
   -------------------------------------------------------------------------- */
.log { margin-top: 22px; }
.card {
  position: relative; display: grid; grid-template-columns: 50px 1fr; column-gap: 16px;
  padding: 16px 58px 16px 0; border-top: 1px solid var(--rule);
}
.card:last-child { border-bottom: 1px solid var(--rule); }
.card__num {
  grid-row: 1 / span 2; display: grid; place-items: center;
  width: 46px; height: 46px; border: 2px solid var(--night); border-radius: 50%;
  font: 400 19px/1 var(--fd); color: var(--night);
}
.card h3 {
  margin: 3px 0 4px;
  font: 800 14px/1.25 var(--fb); letter-spacing: .14em; text-transform: uppercase; color: var(--night);
}
.card p { margin: 0; font-size: 15.5px; line-height: 1.5; }
.card::after {
  content: ""; position: absolute; right: 6px; top: 20px; width: 44px; height: 30px;
  border: 2px solid var(--accentDeep); border-radius: 50%;
  outline: 1px solid var(--accentDeep); outline-offset: 3px;
  opacity: .5; transform: rotate(-14deg);
}
.sign--tag { margin: 26px auto 0; font-size: clamp(26px, 7.4vw, 34px); }

/* --------------------------------------------------------------------------
   Spread IV: field figures
   -------------------------------------------------------------------------- */
.numeral--big { font-size: 76px; }
@media (max-width: 899px) {
  .h2 .sign { font-size: .7em; }
}
.plates { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; counter-reset: fig 2; }
.plates figure { margin: 0; display: flex; flex-direction: column; counter-increment: fig; }
.plates figure:first-child { grid-column: 1 / -1; }
.plates img {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; padding: 5px;
  background: color-mix(in srgb, var(--paper) 65%, #fff);
  box-shadow: 0 0 0 1px var(--night), 0 12px 22px -16px rgba(24, 23, 12, .6);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.plates figure:hover img { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 0 0 1px var(--night), 0 18px 26px -16px rgba(24, 23, 12, .6); }
.plates figcaption { margin-top: 8px; font-size: 12px; line-height: 1.4; color: var(--inkSoft); }
.plates figcaption::before {
  content: "Fig. " counter(fig) "\00a0\00a0";
  font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--night);
}

/* --------------------------------------------------------------------------
   Spread V: the exercise (catch them)
   -------------------------------------------------------------------------- */
.rules { margin: 20px 0 0; padding: 0; list-style: none; counter-reset: r; max-width: 30ch; }
.rules li {
  counter-increment: r; display: flex; gap: 12px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px dotted rgba(48, 45, 23, .45); font-weight: 600;
}
.rules li::before { content: counter(r); width: 16px; font: 400 18px/1 var(--fd); color: var(--night); }
.scorebox { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin-top: 22px; }
.score { display: flex; align-items: center; gap: 12px; margin: 0; padding: 6px 14px 6px 6px; border: 2px solid var(--night); }
.score b {
  min-width: 64px; padding: 0 10px; text-align: center; border-right: 2px solid var(--night);
  font: 400 44px/1 var(--fd); color: var(--night);
}
.score span { max-width: 11ch; font: 700 11px/1.3 var(--fb); letter-spacing: .18em; text-transform: uppercase; color: var(--night); }
.btn-ink {
  min-height: 52px; padding: 0 22px; cursor: pointer;
  background: var(--night); color: var(--paper); border: 0;
  font: 800 13px/1 var(--fb); letter-spacing: .18em; text-transform: uppercase;
  box-shadow: 4px 4px 0 rgba(48, 45, 23, .3);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), opacity .2s;
}
.btn-ink:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(48, 45, 23, .3); }
.btn-ink:active { transform: translate(2px, 2px); box-shadow: 0 0 0 rgba(48, 45, 23, .3); }
.btn-ink:disabled { opacity: .45; cursor: default; transform: none; }
html.rm #start, html:not(.has-game) #start { display: none; }
.play-msg { margin: 14px 0 0; font-weight: 600; color: var(--inkSoft); }

.exercise {
  display: flex; flex-direction: column; padding: 12px;
  background: var(--paper); border: 3px solid var(--night);
}
.exercise__head {
  display: flex; justify-content: space-between; margin: 0 0 8px;
  font: 700 11px/1 var(--fb); letter-spacing: .2em; text-transform: uppercase; color: var(--night);
}
.ruler {
  position: relative; height: 12px; margin: 0 0 10px;
  background: repeating-linear-gradient(90deg, var(--night) 0 1px, transparent 1px calc(100% / 15));
  border-bottom: 1.5px solid var(--night);
}
.ruler i {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--night);
  transform-origin: 0 50%; transform: scaleX(var(--left, 1));
}
.exercise__stage { position: relative; height: 360px; overflow: hidden; border: 1px solid rgba(48, 45, 23, .35); }
#catch {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: pan-y; cursor: ew-resize; outline-offset: -4px;
}
.exercise.is-playing #catch { touch-action: none; cursor: none; }
html.rm #catch, html:not(.has-game) #catch { display: none; }
.exercise__still {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--paper2) 0 11%, var(--night) 11% calc(11% + 2px), transparent calc(11% + 2px)),
    radial-gradient(circle, rgba(233, 213, 73, .6) 0 1.3px, transparent 1.7px) 0 0 / 7px 7px,
    var(--paper);
}
html.has-game:not(.rm) .exercise__still { display: none; }
.path { position: absolute; width: 46px; border-left: 2px dashed var(--inkSoft); border-radius: 60% 0 0 40%; }
.path::before {
  content: "L"; position: absolute; top: -14px; left: -16px; display: grid; place-items: center;
  width: 28px; height: 28px; border: 3px solid var(--night); border-radius: 6px; background: var(--paper);
  font: 400 18px/1 var(--fd); color: var(--night); transform: rotate(-12deg);
}
.path--a { left: 24%; top: 14%; height: 52%; }
.path--b { left: 50%; top: 24%; height: 44%; border-radius: 40% 0 0 60%; }
.path--c { left: 74%; top: 10%; height: 34%; }
.still-mat {
  position: absolute; left: 50%; bottom: 11%; width: 30%; height: 18px; transform: translateX(-50%);
  border: 2.5px solid var(--night); border-radius: 7px;
  background: repeating-linear-gradient(45deg, var(--accent) 0 6px, var(--paper) 6px 12px);
}
.still-note {
  position: absolute; left: 0; right: 0; top: 14px; text-align: center;
  font: 700 11px/1 var(--fb); letter-spacing: .2em; text-transform: uppercase; color: var(--night);
}

/* --------------------------------------------------------------------------
   Spread VI: paperwork (how to buy) and the giant plate
   -------------------------------------------------------------------------- */
.form { list-style: none; margin: 24px 0 0; padding: 0; border-top: 2px solid var(--night); max-width: 48ch; }
.form li { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.tick { position: relative; flex: none; width: 24px; height: 24px; margin-top: 2px; border: 2px solid var(--night); }
.tick::after {
  content: ""; position: absolute; left: 6px; top: 1px; width: 7px; height: 13px;
  border: solid var(--night); border-width: 0 3px 3px 0; transform: rotate(45deg) scale(0);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.form li:hover .tick::after { transform: rotate(45deg) scale(1); }
.form li span { font-size: 16px; line-height: 1.5; }
.form b {
  display: block; margin-bottom: 4px;
  font: 400 22px/1 var(--fd); letter-spacing: .02em; text-transform: uppercase; color: var(--night);
}
.form { counter-reset: step; }
.form li { counter-increment: step; }
.form b::before { content: counter(step) ". "; }
.bigbuy__in {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 36px; padding: 30px 0 20px;
}
.plate--giant {
  flex-direction: column; justify-content: center; gap: 6px;
  width: min(72vw, 290px); aspect-ratio: 1; padding: 0;
  border-width: 12px; border-radius: 30px; box-shadow: 10px 10px 0 var(--night);
  transform: rotate(-6deg); white-space: normal;
}
.plate--giant .plate__l { padding: 0; border: 0; font-size: clamp(120px, 38vw, 180px); line-height: .82; }
.plate--giant .plate__txt { font-size: 14px; letter-spacing: .2em; }
.plate--giant:hover { transform: rotate(-2deg) scale(1.03); box-shadow: 14px 14px 0 var(--night); }
.plate--giant:active { transform: rotate(-6deg) translate(4px, 4px); box-shadow: 4px 4px 0 var(--night); }
.bigbuy__note {
  margin: 0; max-width: 30ch; text-align: center;
  font: 700 11px/1.5 var(--fb); letter-spacing: .2em; text-transform: uppercase; color: var(--inkSoft);
}

/* --------------------------------------------------------------------------
   Spread VII: colophon and the back cover (print black)
   -------------------------------------------------------------------------- */
.colophon .h2 { margin-bottom: 18px; }
.disclaimer { max-width: 46ch; margin: 0; font-size: 16px; line-height: 1.6; }
.colophon__links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin: 24px 0 0; }
.textlink {
  color: var(--night); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
  font: 700 12px/1.2 var(--fb); letter-spacing: .16em; text-transform: uppercase;
  transition: text-decoration-thickness .2s;
}
.textlink:hover { text-decoration-thickness: 3px; }
.motion {
  min-height: 40px; padding: 0 14px; cursor: pointer;
  background: transparent; color: var(--night); border: 1.5px solid var(--night);
  font: 700 11px/1 var(--fb); letter-spacing: .16em; text-transform: uppercase;
  transition: background-color .2s, color .2s;
}
.motion:hover { background: var(--night); color: var(--paper); }
.colophon__print { margin: 28px 0 0; font-size: 13px; color: var(--inkSoft); }

.page.backcover { background-color: var(--night); background-image: none; color: var(--onNight); }
.backcover .runhead { color: var(--onNightSoft); border-color: rgba(246, 244, 234, .22); }
.backcover .folio { color: var(--onNightSoft); }
.backcover :focus-visible { outline-color: var(--onNight); }
.backcover__in {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 30px; padding: 40px 0 30px; text-align: center;
}
.backcover__mark {
  display: grid; place-items: center; width: 150px; aspect-ratio: 1;
  border: 10px solid var(--accent); border-radius: 24px; transform: rotate(-8deg);
}
.backcover__mark b { font: 400 100px/1 var(--fd); color: var(--accent); }
.sign--night {
  margin: 0 auto; padding: 0; background: transparent; box-shadow: none;
  font-size: clamp(32px, 9vw, 54px); transform: rotate(-3deg);
}
.sign--night::before, .sign--night::after { display: none; }
.backcover__name {
  margin: 0; font: 700 11px/1.2 var(--fb); letter-spacing: .26em; text-transform: uppercase; color: var(--onNightSoft);
}

/* --------------------------------------------------------------------------
   Two-page layout (900px and up): a real open book on the table
   -------------------------------------------------------------------------- */
@media (min-width: 900px) {
  body { padding-top: 0; }
  .spread { display: flex; min-height: 100vh; padding: 60px 24px 16px; }
  .spread:last-child { padding-bottom: 16px; }
  .sheet {
    flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 76px);
    background: none; box-shadow: none;
  }
  /* crop marks just outside the four corners */
  .sheet::before {
    content: ""; position: absolute; inset: -14px; z-index: 0; pointer-events: none;
    background:
      linear-gradient(var(--inkSoft), var(--inkSoft)) left 0 top 14px / 9px 1px,
      linear-gradient(var(--inkSoft), var(--inkSoft)) left 14px top 0 / 1px 9px,
      linear-gradient(var(--inkSoft), var(--inkSoft)) right 0 top 14px / 9px 1px,
      linear-gradient(var(--inkSoft), var(--inkSoft)) right 14px top 0 / 1px 9px,
      linear-gradient(var(--inkSoft), var(--inkSoft)) left 0 bottom 14px / 9px 1px,
      linear-gradient(var(--inkSoft), var(--inkSoft)) left 14px bottom 0 / 1px 9px,
      linear-gradient(var(--inkSoft), var(--inkSoft)) right 0 bottom 14px / 9px 1px,
      linear-gradient(var(--inkSoft), var(--inkSoft)) right 14px bottom 0 / 1px 9px;
    background-repeat: no-repeat;
  }
  .page {
    display: flex; flex-direction: column; min-width: 0;
    padding: 22px 40px 50px; background-color: var(--paper);
  }
  .page + .page { border-top: 0; }
  .page--verso {
    background-image: var(--grain), linear-gradient(90deg, rgba(48, 45, 23, 0) 78%, rgba(48, 45, 23, .07) 93%, rgba(48, 45, 23, .2));
    box-shadow:
      -4px 4px 0 -1px var(--paper), -4px 4px 0 0 rgba(48, 45, 23, .22),
      -8px 8px 0 -1px var(--paper), -8px 8px 0 0 rgba(48, 45, 23, .18),
      0 30px 40px -28px rgba(24, 23, 12, .6);
  }
  .page--recto {
    background-image: var(--grain), linear-gradient(270deg, rgba(48, 45, 23, 0) 78%, rgba(48, 45, 23, .07) 93%, rgba(48, 45, 23, .2));
    box-shadow:
      4px 4px 0 -1px var(--paper), 4px 4px 0 0 rgba(48, 45, 23, .22),
      8px 8px 0 -1px var(--paper), 8px 8px 0 0 rgba(48, 45, 23, .18),
      0 30px 40px -28px rgba(24, 23, 12, .6);
  }
  .page.backcover { background-image: linear-gradient(270deg, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, .35)); }
  .page--verso .folio { left: 40px; bottom: 18px; }
  .page--recto .folio { right: 40px; bottom: 18px; }
  .page__in { flex: 1; display: flex; flex-direction: column; justify-content: center; }

  .h2 { font-size: clamp(48px, min(5.6vw, 10.2vh), 104px); }
  .h2--md { font-size: clamp(42px, min(4.6vw, 8.6vh), 84px); }
  .numeral { position: absolute; display: inline; margin: 0; right: 0; top: 4px; font-size: min(28vh, 260px); }
  .numeral--big { font-size: min(58vh, 520px); top: -10px; }

  /* title page */
  .cover { padding: 22px 34px 26px; }
  .cover__frame { flex: 1; min-height: 0; border-width: 13px; border-radius: 30px; padding: 16px 24px 12px; }
  .cover__kicker { font-size: 11px; margin-bottom: 14px; }
  .h1__a { font-size: clamp(46px, min(6.4vw, 10.8vh), 116px); }
  .h1__b { margin: 14px -38px -16px; font-size: clamp(28px, min(3.6vw, 6.2vh), 62px); }
  .cover__sky { flex: 1; height: auto; min-height: 170px; margin: 0 -24px; }
  .cover__cap { margin-top: 12px; }

  .permit { padding: 22px 48px 50px; }
  .permit__body { flex: 1; justify-content: center; gap: 20px; max-width: 540px; }
  .permit__name { font-size: clamp(48px, min(5.4vw, 10vh), 100px); }
  .permit__lede { font-size: 19px; }
  .ca { padding: 14px 16px 16px 30px; }
  #ca-text { font-size: 14px; }
  .chips { gap: 8px; }
  .chips a { padding: 0 11px; letter-spacing: .12em; }
  .colorbar { display: flex; position: absolute; left: 48px; bottom: 20px; margin: 0; }
  .colorbar i { width: 18px; height: 10px; border: 1px solid var(--night); margin-right: -1px; }
  .colorbar i:nth-child(1) { background: var(--night); }
  .colorbar i:nth-child(2) { background: color-mix(in srgb, var(--night) 70%, var(--paper)); }
  .colorbar i:nth-child(3) { background: color-mix(in srgb, var(--night) 40%, var(--paper)); }
  .colorbar i:nth-child(4) { background: color-mix(in srgb, var(--night) 10%, var(--paper)); }
  .colorbar i:nth-child(5) { background: var(--accent); }

  /* figures and plates */
  .page--recto > .fig { margin: auto 0; }
  .fig__img img { max-height: calc(100vh - 290px); }
  .page--recto > .fig--wide { margin: auto 0 0; }
  .sign--tag { margin: 30px auto auto; font-size: clamp(30px, min(3vw, 5.4vh), 48px); }
  .callout { font-size: 10px; padding: 6px 9px; }

  .page__in--opener { justify-content: flex-end; padding-bottom: 20px; }
  .plates {
    grid-template-columns: repeat(3, 1fr); gap: 14px 16px;
    width: 100%; max-width: calc(100vh - 290px); margin: auto;
  }
  .plates figure:first-child { grid-column: span 2; grid-row: span 2; }
  .plates figure:first-child img { flex: 1 1 0; min-height: 0; height: 0; aspect-ratio: auto; }
  .plates figcaption { font-size: 11px; line-height: 1.35; }

  .exercise { flex: 1; min-height: 0; margin-bottom: 4px; }
  .exercise__stage { flex: 1; height: auto; min-height: 280px; }

  .page.bigbuy { justify-content: center; }
  .bigbuy__in { flex: 1; }
  .plate--giant { width: min(400px, 70%, calc(100vh - 380px)); min-width: 240px; border-width: 14px; border-radius: 36px; box-shadow: 12px 12px 0 var(--night); }
  .plate--giant .plate__l { font-size: clamp(130px, min(16vw, calc((100vh - 380px) * .55)), 220px); }
  .plate--giant .plate__txt { font-size: 15px; }

  .backcover__in { flex: 1; gap: 36px; }
  .backcover__mark { width: min(220px, 26vh); border-width: 14px; border-radius: 32px; }
  .backcover__mark b { font-size: min(150px, 18vh); }
  .sign--night { font-size: clamp(36px, min(4vw, 7vh), 64px); }
}
@media (min-width: 1024px) {
  .spread { padding-right: 64px; }
}

/* --------------------------------------------------------------------------
   Arrivals outside book mode (phone, tablet): the kit's reveal
   -------------------------------------------------------------------------- */
html.js:not(.rm):not(.is-book) .reveal { transition: opacity .8s ease, transform .8s var(--ease); }
html.js:not(.rm):not(.is-book) .reveal:not(.seen) { opacity: 0; transform: translateY(18px); }
html.js:not(.rm) [data-stagger] > * {
  transition: opacity .6s ease, transform .6s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms + 150ms);
}
html.js:not(.rm):not(.is-book) [data-stagger]:not(.seen) > * { opacity: 0; transform: translateY(14px); }

/* --------------------------------------------------------------------------
   Book mode (desktop, motion on; set by js/site.js): one spread per screen,
   the right-hand page turns over the gutter as you scroll.
   -------------------------------------------------------------------------- */
html.is-book:not(.rm) .spread {
  position: sticky; top: 0; height: 100vh; min-height: 0; padding: 0; display: block;
}
html.is-book:not(.rm) .spread:nth-child(1) { z-index: 17; }
html.is-book:not(.rm) .spread:nth-child(2) { z-index: 16; }
html.is-book:not(.rm) .spread:nth-child(3) { z-index: 15; }
html.is-book:not(.rm) .spread:nth-child(4) { z-index: 14; }
html.is-book:not(.rm) .spread:nth-child(5) { z-index: 13; }
html.is-book:not(.rm) .spread:nth-child(6) { z-index: 12; }
html.is-book:not(.rm) .spread:nth-child(7) { z-index: 11; }
html.is-book:not(.rm) .spread.is-turned { visibility: hidden; }
html.is-book:not(.rm) .sheet {
  position: absolute; inset: 60px 64px 16px 24px; min-height: 0;
  perspective: 2800px;
  transform: translate3d(0, calc(var(--arrive, 0) * -1px), 0);
}
html.is-book:not(.rm) .page { overflow: hidden; min-height: 0; }
html.is-book:not(.rm) .page--verso {
  opacity: clamp(0, calc((.5 - var(--turn, 0)) * 1000), 1);
}
html.is-book:not(.rm) .page--recto {
  z-index: 3; transform-origin: 0 50%;
  transform: translateZ(calc(var(--turn, 0) * (1 - var(--turn, 0)) * 160px)) rotateY(calc(var(--turn, 0) * -180deg));
  opacity: clamp(0, calc((1 - var(--turn, 0)) * 2.4), 1);
}
/* the back of the turning leaf: plain paper, shaded */
html.is-book:not(.rm) .page--recto::before {
  content: ""; position: absolute; inset: 0; z-index: 8; pointer-events: none;
  background-color: var(--paper);
  background-image: var(--grain), linear-gradient(90deg, rgba(24, 23, 12, .22), rgba(24, 23, 12, 0) 45%);
  opacity: clamp(0, calc((var(--turn, 0) - .5) * 1000), 1);
}
/* shadows falling on the next spread while the leaf is in the air */
html.is-book:not(.rm) .page--verso::after {
  content: ""; position: absolute; inset: 0; z-index: 8; pointer-events: none;
  background: var(--night); opacity: clamp(0, calc((1 - var(--in, 1)) * .9), .4);
}
html.is-book:not(.rm) .page--recto::after {
  content: ""; position: absolute; inset: 0; z-index: 9; pointer-events: none;
  background: linear-gradient(90deg, rgba(24, 23, 12, .6), rgba(24, 23, 12, 0) 70%);
  opacity: calc(var(--in, 1) * (1 - var(--in, 1)) * 2.6);
}
/* the page corner lifts when the pointer comes near */
html.is-book:not(.rm) .sheet::after {
  content: ""; position: absolute; right: 0; bottom: 0; z-index: 10; pointer-events: none;
  width: calc(var(--curl, 0) * 92px); height: calc(var(--curl, 0) * 92px);
  background: linear-gradient(to top left, var(--paper2) 0 50%, color-mix(in srgb, var(--paper2) 80%, var(--ink)) 50%, var(--paper) 80%);
  filter: drop-shadow(-3px -3px 4px rgba(24, 23, 12, .25));
  transition: width .2s var(--ease), height .2s var(--ease);
}
html.is-book:not(.rm) .spread--back .sheet::after { display: none; }
html.is-corner body { cursor: pointer; }

/* contents print in once a spread is open */
html.is-book:not(.rm) .spread:not(.spread--title) .ink {
  transition: opacity .7s ease, filter .7s ease, transform .7s var(--ease);
  transition-delay: calc(var(--k, 0) * 70ms + 80ms);
}
html.is-book:not(.rm) .spread:not(.spread--title):not(.is-open) .ink { opacity: 0; filter: blur(3px); transform: translateY(8px); }
html.is-book:not(.rm) .spread:not(.is-open) [data-stagger] > * { opacity: 0; transform: translateY(10px); }
html.is-book:not(.rm) .fig__img img { max-height: calc(100vh - 300px); }

/* --------------------------------------------------------------------------
   Pad mode (phone and short screens, motion on): pages slide over pages
   -------------------------------------------------------------------------- */
html.is-pad:not(.rm) .spread {
  position: sticky; top: calc(var(--stick, 0) * 1px); z-index: 1;
  background-color: var(--paper2); background-image: var(--grain);
  box-shadow: 0 -16px 24px -18px rgba(24, 23, 12, .45);
}
html.is-pad:not(.rm) .spread::after {
  content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: var(--night); opacity: calc(var(--under, 0) * .28);
}

/* --------------------------------------------------------------------------
   CA copied: a rubber stamp lands (drawn by js/site.js)
   -------------------------------------------------------------------------- */
.stamp {
  position: fixed; z-index: 95; pointer-events: none;
  padding: 8px 18px 6px; border: 4px solid var(--night); border-radius: 6px;
  background: radial-gradient(circle, rgba(233, 213, 73, .9) 0 1.6px, transparent 2px) 0 0 / 5px 5px, var(--paper);
  font: 400 34px/1 var(--fd); letter-spacing: .08em; text-transform: uppercase; color: var(--night);
  transform: translate(-50%, -50%) rotate(-10deg);
  animation: stamp-in .22s cubic-bezier(.3, 1.6, .5, 1) both, stamp-out .4s ease 1.2s forwards;
}
@keyframes stamp-in { from { transform: translate(-50%, -50%) rotate(-10deg) scale(1.7); opacity: 0; } }
@keyframes stamp-out { to { opacity: 0; transform: translate(-50%, -64%) rotate(-10deg); } }
.stamp-dot {
  position: fixed; z-index: 94; width: 6px; height: 6px; border-radius: 50%; pointer-events: none;
  background: var(--night); transform: translate(-50%, -50%);
  animation: dot .55s cubic-bezier(.2, .7, .3, 1) forwards;
}
.stamp-dot.is-y { background: var(--accent); box-shadow: 0 0 0 1px var(--night); }
@keyframes dot { to { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(.3); opacity: 0; } }

/* --------------------------------------------------------------------------
   404: one torn-out page
   -------------------------------------------------------------------------- */
.lostpage { padding: 0; }
.lost { min-height: 100vh; display: grid; place-items: center; padding: 24px 12px; }
.lost__page {
  position: relative; width: min(560px, 100%); padding: 18px 22px 54px; text-align: center;
  background-color: var(--paper); background-image: var(--grain);
  box-shadow: -4px 4px 0 -1px var(--paper), -4px 4px 0 0 rgba(48, 45, 23, .22), 0 30px 40px -28px rgba(24, 23, 12, .6);
}
.lost__page img { width: 120px; height: 120px; margin: 26px auto 22px; border-radius: 18px; border: 4px solid var(--night); transform: rotate(-6deg); }
.lost__h1 { margin: 0; font: 400 clamp(42px, 11vw, 72px)/.92 var(--fd); text-transform: uppercase; color: var(--night); }
.lost__h1 em { display: block; width: fit-content; margin: 16px auto 0; font-style: normal; font-size: .62em; }
.lost__home { display: inline-flex; align-items: center; margin-top: 32px; text-decoration: none; }
.lost__page .folio { left: 50%; transform: translateX(-50%); }
