/* SQUIRT — A Field Guide to Backyard Bandits */

:root {
  --cloth: #2d4a34;
  --cloth-deep: #203626;
  --cloth-line: #3c5c44;
  --paper: #f5e8d6;
  --paper-shade: #e6d5b8;
  --paper-edge: #d8c4a2;
  --ink: #0f3624;
  --ink-body: #283a2e;
  --ink-soft: #4a5a4d;
  --slate: #2c4863;
  --rufous: #ad4b28;
  --rufous-deep: #933d20;
  --mustard: #e3ad45;
  --mustard-pale: #f8e7c4;
  --mustard-line: #dcbd6a;
  --sage: #9aae78;
  --sky: #74a3cc;
  --desk: #b99773;
  --desk-deep: #9b7853;
  --cream: #f6f1e2;
  --rule: rgba(45, 74, 52, 0.55);

  --font-serif: "Manuale", Georgia, serif;
  --font-hand: "Caveat", "Bradley Hand", cursive;
  --font-mark: "Fredoka", "Arial Rounded MT Bold", sans-serif;

  /* one comp pixel of the 1536x1024 spread, fitted so the whole first spread shows */
  --u: min(calc(100vw / 1536), calc(100svh / 1024));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--cloth-line) var(--cloth-deep);
}

body {
  margin: 0;
  background: url("../assets/plates/cloth.webp") repeat var(--cloth);
  background-size: 344px auto;
  color: var(--ink-body);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--mustard);
  color: var(--ink);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: 2px solid var(--mustard);
  outline-offset: 3px;
  border-radius: 4px;
}

.hand {
  font-family: var(--font-hand);
  font-weight: 500;
  color: var(--slate);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Masthead ─────────────────────────────────────────── */

.masthead {
  position: relative;
  z-index: 5;
  height: calc(100 * var(--u));
  display: flex;
  align-items: center;
  padding: 0 calc(99 * var(--u)) 0 calc(90 * var(--u));
  background: url("../assets/plates/cloth.webp") repeat var(--cloth);
  background-size: 344px auto;
  color: var(--cream);
}

.wordmark {
  position: relative;
  display: inline-flex;
  margin-top: calc(22 * var(--u));
  font-family: var(--font-mark);
  font-weight: 700;
  font-size: calc(57 * var(--u));
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--cream);
  text-decoration: none;
}

.wordmark svg {
  position: absolute;
  left: 59%;
  top: -0.48em;
  width: 0.6em;
  height: 0.44em;
  transform: translateX(-50%);
}

.masthead-rule {
  width: 1px;
  height: calc(62 * var(--u));
  margin: 0 calc(34 * var(--u)) 0 calc(30 * var(--u));
  background: rgba(246, 241, 226, 0.55);
}

.guide-title {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  margin: 0;
  text-align: center;
  font-weight: 700;
}

.guide-title .sprig {
  width: calc(26 * var(--u));
  height: calc(38 * var(--u));
  margin-top: calc(18 * var(--u));
  color: #e6d6a2;
}

.guide-title .sprig--flip {
  transform: scaleX(-1);
}

.guide-title small {
  display: block;
  font-size: calc(15 * var(--u));
  font-weight: 600;
  letter-spacing: 0.3em;
  line-height: 1;
  margin-bottom: calc(6 * var(--u));
}

.guide-title span {
  display: block;
  font-size: calc(40 * var(--u));
  line-height: 1;
  letter-spacing: 0.012em;
}

.masthead-nav {
  display: flex;
  gap: calc(35 * var(--u));
  margin-left: auto;
  margin-right: calc(45 * var(--u));
}

.masthead-nav a {
  position: relative;
  font-size: calc(18 * var(--u));
  font-weight: 500;
  color: var(--cream);
  text-decoration: none;
  padding: calc(6 * var(--u)) 0;
}

.masthead-nav a::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: calc(-4 * var(--u));
  height: calc(3 * var(--u));
  border-radius: 2px;
  background: var(--mustard);
  transform: scaleX(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.masthead-nav a[aria-current="true"]::after,
.masthead-nav a:hover::after {
  transform: scaleX(1);
}

.btn-waitlist {
  display: inline-flex;
  align-items: center;
  height: calc(40 * var(--u));
  padding: 0 calc(24 * var(--u));
  border-radius: 999px;
  background: var(--rufous);
  color: var(--cream);
  font-size: calc(17 * var(--u));
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(20, 35, 25, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-waitlist:hover {
  background: var(--rufous-deep);
  transform: translateY(-1px);
}

/* ── The open book ────────────────────────────────────── */

.spread {
  position: relative;
  height: calc(924 * var(--u));
  width: calc(1536 * var(--u));
  margin: 0 auto;
}

.spread::after {
  /* the desk the guide lies on */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(26 * var(--u));
  background: url("../assets/plates/desk.webp") repeat-x left top / auto 100% var(--desk);
  z-index: 0;
}

.book {
  display: grid;
  grid-template-columns: calc(748 * var(--u)) calc(724 * var(--u));
  z-index: 1;
  filter: drop-shadow(0 calc(8 * var(--u)) calc(10 * var(--u)) rgba(10, 20, 12, 0.35));
}

.spread .book {
  position: absolute;
  left: calc(20 * var(--u));
  top: calc(3 * var(--u));
  width: calc(1472 * var(--u));
  height: calc(866 * var(--u));
}

.book::before {
  /* the hard cover, showing past the pages */
  content: "";
  position: absolute;
  inset: calc(-3 * var(--u)) calc(-24 * var(--u)) calc(-30 * var(--u)) calc(-16 * var(--u));
  border-radius: calc(16 * var(--u));
  background: linear-gradient(rgba(10, 20, 12, 0.18), rgba(10, 20, 12, 0.18)), url("../assets/plates/cloth.webp") repeat #274430;
  background-size: auto, 344px auto;
  box-shadow:
    inset 0 0 0 calc(2 * var(--u)) rgba(255, 255, 255, 0.04),
    inset 0 calc(-6 * var(--u)) calc(10 * var(--u)) rgba(0, 0, 0, 0.25);
  z-index: -1;
}

.page {
  position: relative;
  background: url("../assets/plates/paper.webp") repeat var(--paper);
  background-size: calc(920 * var(--u)) auto;
}

.page--left {
  border-radius: calc(10 * var(--u)) 0 0 calc(10 * var(--u));
  box-shadow:
    inset calc(-40 * var(--u)) 0 calc(36 * var(--u)) calc(-30 * var(--u)) rgba(92, 70, 40, 0.35),
    inset calc(18 * var(--u)) 0 calc(60 * var(--u)) calc(-20 * var(--u)) rgba(150, 110, 60, 0.18),
    inset 0 calc(-20 * var(--u)) calc(60 * var(--u)) calc(-24 * var(--u)) rgba(150, 110, 60, 0.2);
}

.page--right {
  border-radius: 0 calc(10 * var(--u)) calc(10 * var(--u)) 0;
  box-shadow:
    inset calc(40 * var(--u)) 0 calc(36 * var(--u)) calc(-30 * var(--u)) rgba(92, 70, 40, 0.35),
    inset calc(-18 * var(--u)) 0 calc(60 * var(--u)) calc(-20 * var(--u)) rgba(150, 110, 60, 0.18),
    inset 0 calc(-20 * var(--u)) calc(60 * var(--u)) calc(-24 * var(--u)) rgba(150, 110, 60, 0.2);
}

/* stacked page edges along the fore-edge of each page */
.page--left::before,
.page--right::before {
  content: "";
  position: absolute;
  top: calc(6 * var(--u));
  bottom: calc(6 * var(--u));
  width: calc(12 * var(--u));
  background: repeating-linear-gradient(90deg, var(--paper-edge) 0 1px, var(--paper) 1px calc(3 * var(--u)));
}

.page--left::before {
  left: calc(-8 * var(--u));
  border-radius: calc(8 * var(--u)) 0 0 calc(8 * var(--u));
}

.page--right::before {
  right: calc(-8 * var(--u));
  border-radius: 0 calc(8 * var(--u)) calc(8 * var(--u)) 0;
}

.sprig {
  display: block;
  color: var(--mustard);
}

/* ── Left page: the key ───────────────────────────────── */

.key-title {
  position: absolute;
  left: calc(60 * var(--u));
  top: calc(26 * var(--u));
  margin: 0;
  font-size: calc(53 * var(--u));
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.key-sub {
  position: absolute;
  left: calc(62 * var(--u));
  top: calc(88 * var(--u));
  margin: 0;
  font-size: calc(30 * var(--u));
  line-height: 1.1;
}

.key-sprig {
  position: absolute;
  left: calc(282 * var(--u));
  top: calc(130 * var(--u));
  width: calc(38 * var(--u));
  height: calc(30 * var(--u));
}

.key {
  position: absolute;
  left: calc(52 * var(--u));
  top: calc(181 * var(--u));
  width: calc(455 * var(--u));
  margin: 0;
  padding: 0;
  list-style: none;
}

.key li + li {
  margin-top: calc(18 * var(--u));
}

.couplet {
  position: relative;
  display: grid;
  grid-template-columns: calc(60 * var(--u)) 1fr calc(1 * var(--u)) calc(104 * var(--u)) calc(22 * var(--u));
  align-items: center;
  width: 100%;
  min-height: calc(96 * var(--u));
  padding: calc(12 * var(--u)) calc(12 * var(--u)) calc(12 * var(--u)) calc(26 * var(--u));
  border: calc(1.5 * var(--u)) solid rgba(58, 78, 68, 0.45);
  border-radius: calc(7 * var(--u));
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.couplet:hover {
  background: rgba(248, 231, 196, 0.55);
  border-color: var(--mustard-line);
}

.couplet[aria-pressed="true"] {
  background: var(--mustard-pale);
  border-color: var(--mustard-line);
}

.couplet .num {
  font-size: calc(28 * var(--u));
  font-weight: 700;
}

.couplet .clue {
  font-size: calc(28 * var(--u));
  font-weight: 500;
  line-height: 1.1;
  padding-right: calc(10 * var(--u));
}

.couplet .divider {
  align-self: stretch;
  margin: calc(4 * var(--u)) 0;
  background: rgba(58, 78, 68, 0.35);
}

.couplet .lead {
  padding-left: calc(18 * var(--u));
  font-family: var(--font-hand);
  font-size: calc(23 * var(--u));
  font-weight: 500;
  line-height: 1.05;
  color: var(--slate);
}

.couplet .chev {
  width: calc(12 * var(--u));
  height: calc(20 * var(--u));
  color: var(--ink);
  justify-self: end;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.couplet:hover .chev {
  transform: translateX(calc(3 * var(--u)));
}

.couplet .leaf {
  position: absolute;
  left: calc(8 * var(--u));
  top: 50%;
  width: calc(20 * var(--u));
  height: calc(24 * var(--u));
  margin-top: calc(-12 * var(--u));
  color: var(--cloth);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.couplet[aria-pressed="true"] .leaf {
  opacity: 1;
}

.couplet[aria-pressed="true"] .num {
  margin-left: calc(10 * var(--u));
}


/* the watch: feeder in the viewfinder */

.watch {
  position: absolute;
  left: calc(441 * var(--u));
  top: calc(146 * var(--u));
  width: calc(307 * var(--u));
  height: calc(530 * var(--u));
  margin: 0;
}

.watch .plate-img {
  position: absolute;
  left: calc(72 * var(--u));
  top: calc(56 * var(--u));
  width: calc(226 * var(--u));
  height: calc(400 * var(--u));
  object-fit: contain;
}

.viewfinder {
  position: absolute;
  left: calc(89 * var(--u));
  top: calc(51 * var(--u));
  width: calc(192 * var(--u));
  height: calc(410 * var(--u));
  color: #2a3a2e;
  transition: inset 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.viewfinder i {
  position: absolute;
  width: calc(26 * var(--u));
  height: calc(26 * var(--u));
  border: 0 solid currentColor;
}

.viewfinder i:nth-child(1) { left: 0; top: 0; border-width: calc(2 * var(--u)) 0 0 calc(2 * var(--u)); }
.viewfinder i:nth-child(2) { right: 0; top: 0; border-width: calc(2 * var(--u)) calc(2 * var(--u)) 0 0; }
.viewfinder i:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 calc(2 * var(--u)) calc(2 * var(--u)); }
.viewfinder i:nth-child(4) { right: 0; bottom: 0; border-width: 0 calc(2 * var(--u)) calc(2 * var(--u)) 0; }

.watch.is-scanning .viewfinder {
  animation: focus 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes focus {
  0% { transform: scale(1.12); opacity: 0.4; }
  60% { transform: scale(0.97); opacity: 1; }
  100% { transform: scale(1); }
}

.note {
  position: absolute;
  margin: 0;
  font-family: var(--font-hand);
  font-weight: 500;
  font-size: calc(22 * var(--u));
  line-height: 1.05;
  color: var(--slate);
}

.note svg {
  position: absolute;
  width: calc(26 * var(--u));
  height: calc(34 * var(--u));
  color: var(--slate);
}

.note--feeder { left: calc(144 * var(--u)); top: calc(6 * var(--u)); }
.note--feeder svg { left: calc(20 * var(--u)); top: calc(28 * var(--u)); }
.note--viewfinder { left: calc(134 * var(--u)); top: calc(474 * var(--u)); text-align: center; transform: rotate(-3deg); }
.note--viewfinder svg { left: calc(58 * var(--u)); top: calc(-34 * var(--u)); transform: scaleY(-1); }

/* ── Right page: the plate ────────────────────────────── */

.tagline {
  position: absolute;
  left: calc(80 * var(--u));
  right: calc(20 * var(--u));
  top: calc(20 * var(--u));
  margin: 0;
  text-align: center;
  font-size: calc(55 * var(--u));
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.tagline-sprig {
  position: absolute;
  left: calc(338 * var(--u));
  top: calc(146 * var(--u));
  width: calc(40 * var(--u));
  height: calc(28 * var(--u));
}

.plate {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
}

.plate > * {
  pointer-events: auto;
}

.plate-art {
  position: absolute;
  left: 0;
  top: calc(204 * var(--u));
  width: calc(614 * var(--u));
  height: calc(512 * var(--u));
}

.plate-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.plate-art img[data-visitor="earl"] {
  left: 2%;
  top: 4%;
  width: 74%;
  height: 92%;
  object-fit: contain;
}

.plate-art img[data-visitor="bird"] {
  left: 0;
  top: 2%;
  width: 78%;
  height: 100%;
  object-fit: cover;
}

.plate-art img[hidden] {
  display: block;
  opacity: 0;
  transform: translateY(calc(10 * var(--u)));
  pointer-events: none;
}

.plate[data-verdict="rattle"] .plate-art img.is-current {
  animation: rattle 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) 0.25s both;
}

.plate[data-verdict="welcome"] .plate-art img.is-current {
  animation: hop 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes hop {
  0% { transform: translateY(0); }
  35% { transform: translateY(calc(-14 * var(--u))); }
  60% { transform: translateY(0); }
  78% { transform: translateY(calc(-5 * var(--u))); }
  100% { transform: translateY(0); }
}

.caption .verdict b {
  display: inline-block;
}

.plate[data-verdict] .caption .verdict b {
  animation: stamp 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

@keyframes stamp {
  0% { transform: scale(1.6) rotate(-6deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes rattle {
  10%, 90% { transform: translateX(-1px) rotate(-0.4deg); }
  20%, 80% { transform: translateX(3px) rotate(0.6deg); }
  30%, 50%, 70% { transform: translateX(-5px) rotate(-0.8deg); }
  40%, 60% { transform: translateX(5px) rotate(0.8deg); }
}

.callout {
  position: absolute;
  margin: 0;
  font-family: var(--font-hand);
  font-weight: 500;
  font-size: calc(22 * var(--u));
  line-height: 1.05;
  color: var(--slate);
  transition: opacity 0.3s ease;
}

.callout svg {
  position: absolute;
  width: calc(28 * var(--u));
  height: calc(36 * var(--u));
}

.callout[data-slot="a"] { left: calc(47 * var(--u)); top: calc(176 * var(--u)); }
.callout[data-slot="a"] svg { left: calc(58 * var(--u)); top: calc(24 * var(--u)); }
.callout[data-slot="b"] { left: calc(372 * var(--u)); top: calc(222 * var(--u)); width: calc(68 * var(--u)); }
.callout[data-slot="b"] svg { left: calc(-18 * var(--u)); top: calc(66 * var(--u)); transform: scaleX(-1); }

.caption {
  position: absolute;
  left: calc(479 * var(--u));
  top: calc(180 * var(--u));
  width: calc(210 * var(--u));
  padding-left: calc(18 * var(--u));
  border-left: 1px solid var(--rule);
  color: var(--ink);
}

.caption .plate-name {
  display: block;
  font-size: calc(32 * var(--u));
  font-weight: 700;
  line-height: 1.12;
}

.caption .latin {
  display: block;
  font-style: italic;
  font-size: calc(23 * var(--u));
  line-height: 1.2;
  color: var(--ink-body);
  padding-bottom: calc(14 * var(--u));
  border-bottom: 1px solid var(--rule);
}

.caption .verdict {
  display: block;
  font-style: italic;
  font-size: calc(22 * var(--u));
  padding: calc(12 * var(--u)) 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-body);
}

.caption .verdict b {
  font-weight: 600;
}

.caption .aside {
  display: block;
  margin-top: calc(14 * var(--u));
  font-family: var(--font-hand);
  font-size: calc(24 * var(--u));
  line-height: 1.1;
  color: var(--slate);
}

/* ── Thumb-index tabs ─────────────────────────────────── */

.thumb-tabs {
  position: fixed;
  left: calc(50% + 694 * var(--u));
  top: calc(138 * var(--u));
  width: calc(72 * var(--u));
  display: flex;
  flex-direction: column;
  gap: calc(6 * var(--u));
  z-index: 2;
}

.thumb-tabs a,
.tab-flight {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(6 * var(--u));
  height: calc(124 * var(--u));
  padding: 0 calc(4 * var(--u)) 0 calc(10 * var(--u));
  border-radius: 0 calc(12 * var(--u)) calc(12 * var(--u)) 0;
  font-size: calc(13 * var(--u));
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  color: #1c2a1f;
  box-shadow: inset calc(6 * var(--u)) 0 calc(6 * var(--u)) calc(-4 * var(--u)) rgba(60, 40, 20, 0.3), 0 1px 2px rgba(20, 30, 20, 0.25);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.thumb-tabs a:first-child { height: calc(112 * var(--u)); }
.thumb-tabs a:hover,
.thumb-tabs a[aria-current="true"] { transform: translateX(calc(8 * var(--u))); }
.thumb-tabs svg,
.tab-flight svg { width: calc(22 * var(--u)); height: calc(22 * var(--u)); flex: none; }
.tab--home { background: #efe2c6; }
.tab--residents { background: var(--mustard); }
.tab--notes { background: var(--sage); }
.tab--wanted { background: var(--sky); }
.tab--next { background: #e07f55; }

/* ── Field notes strip ────────────────────────────────── */

.field-strip {
  position: absolute;
  left: calc(25 * var(--u));
  right: calc(34 * var(--u));
  top: calc(722 * var(--u));
  height: calc(126 * var(--u));
  display: grid;
  grid-template-columns: calc(412 * var(--u)) calc(261 * var(--u)) calc(235 * var(--u)) calc(244 * var(--u)) 1fr;
  border-top: calc(1.5 * var(--u)) solid var(--cloth);
  z-index: 1;
}

.field-strip h2 {
  display: flex;
  align-items: center;
  gap: calc(18 * var(--u));
  margin: 0;
  padding: calc(8 * var(--u)) 0 0 calc(27 * var(--u));
  align-self: start;
  font-size: calc(39 * var(--u));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.field-strip h2 .leaf {
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
  color: var(--cloth);
  flex: none;
}

.strip-title {
  position: relative;
  white-space: nowrap;
}

.strip-when {
  align-self: flex-end;
  margin: 0 0 calc(4 * var(--u)) calc(-6 * var(--u));
  font-size: calc(28 * var(--u));
  font-weight: 600;
  white-space: nowrap;
}

.field-strip h2 .underline {
  position: absolute;
  left: 0;
  bottom: calc(-14 * var(--u));
  width: calc(170 * var(--u));
  height: calc(10 * var(--u));
  color: var(--cloth);
}

.tally {
  position: relative;
  display: grid;
  grid-template-columns: calc(56 * var(--u)) 1fr;
  grid-template-rows: auto auto;
  column-gap: calc(14 * var(--u));
  align-content: start;
  padding: calc(12 * var(--u)) 0 0 calc(30 * var(--u));
  border-left: 1px solid var(--rule);
  margin-top: calc(14 * var(--u));
  height: calc(106 * var(--u));
}

.tally img {
  grid-row: 1 / span 2;
  width: calc(58 * var(--u));
  height: calc(58 * var(--u));
  object-fit: contain;
}

.tally .what {
  font-size: calc(18 * var(--u));
  font-weight: 500;
  line-height: 1.15;
  color: var(--slate);
}

.tally .what em {
  display: block;
  font-size: calc(17 * var(--u));
}

.tally .marks {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: calc(6 * var(--u));
  margin-top: calc(6 * var(--u));
  height: calc(36 * var(--u));
}

.tally .marks svg {
  height: calc(34 * var(--u));
  width: auto;
}

.tally .marks svg path {
  stroke-linecap: round;
}

.tally .count {
  font-family: var(--font-hand);
  font-size: calc(30 * var(--u));
  font-weight: 600;
  line-height: 1;
}

.tally--squirrels { color: var(--rufous); }
.tally--birds { color: var(--slate); }
.tally--rattles { color: #86600f; }
.tally--days { color: var(--ink-soft); }

.spec-list {
  display: none;
}

/* folios */
.book--flow .page[data-folio]::after {
  content: attr(data-folio);
  position: absolute;
  bottom: calc(22 * var(--u));
  font-style: italic;
  font-size: max(14px, calc(16 * var(--u)));
  color: var(--ink-soft);
}

.book--flow .page--left[data-folio]::after {
  left: calc(62 * var(--u));
}

.book--flow .page--right[data-folio]::after {
  right: calc(96 * var(--u));
}

/* ── Flow spreads (the rest of the guide) ─────────────── */

.folio {
  position: relative;
  width: calc(1536 * var(--u));
  margin: calc(56 * var(--u)) auto 0;
  scroll-margin-top: calc(24 * var(--u));
}

.book--flow {
  position: relative;
  margin-left: calc(20 * var(--u));
  width: calc(1472 * var(--u));
}

.book--flow .page {
  padding: calc(64 * var(--u)) calc(64 * var(--u)) calc(72 * var(--u)) calc(62 * var(--u));
  font-size: max(17px, calc(19 * var(--u)));
}

.book--flow .page--right {
  padding-right: calc(96 * var(--u));
}

.page-title {
  margin: 0;
  font-size: calc(53 * var(--u));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: balance;
}

.page-sub {
  margin: calc(4 * var(--u)) 0 calc(36 * var(--u));
  font-size: calc(30 * var(--u));
  line-height: 1.1;
}

.book--flow p {
  margin: 0 0 1em;
  max-width: 62ch;
}

.book--flow h3 {
  margin: 0 0 calc(6 * var(--u));
  font-size: calc(26 * var(--u));
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

/* residents */

.entry {
  display: grid;
  grid-template-columns: calc(210 * var(--u)) 1fr;
  gap: calc(22 * var(--u));
  align-items: center;
  padding: calc(18 * var(--u)) 0;
  border-top: 1px solid var(--rule);
}

.entry:last-child {
  border-bottom: 1px solid var(--rule);
}

.entry-art {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.entry-text p {
  margin: 0 0 0.35em;
  font-size: max(16px, calc(18 * var(--u)));
  line-height: 1.45;
}

.entry-text b {
  font-weight: 600;
  color: var(--ink);
}


.entry h3 i {
  font-weight: 400;
}

.entry q {
  font-style: italic;
  quotes: "\201C" "\201D";
}

.range-map {
  position: relative;
  margin: 0 calc(-16 * var(--u)) calc(28 * var(--u));
}

.range-map img {
  width: 100%;
}

.zone {
  position: absolute;
  border: calc(2 * var(--u)) dashed var(--slate);
  border-radius: calc(6 * var(--u));
  opacity: 0.8;
}

.zone--armed {
  border-color: var(--rufous);
  border-style: solid;
  opacity: 1;
}

.map-label {
  position: absolute;
  font-family: var(--font-hand);
  font-weight: 600;
  font-size: calc(24 * var(--u));
  line-height: 1;
  color: var(--slate);
  white-space: nowrap;
  padding: 1px 6px 2px;
  border-radius: 3px;
  background: rgba(245, 232, 214, 0.82);
}

.map-label em {
  font-style: normal;
  font-weight: 500;
  font-size: 0.85em;
  color: var(--rufous-deep);
}

/* field notes */

.method {
  list-style: none;
  margin: 0;
  padding: 0;
}

.method li {
  position: relative;
  padding: 0 0 calc(20 * var(--u)) calc(58 * var(--u));
}

.method .step {
  position: absolute;
  left: 0;
  top: calc(-10 * var(--u));
  width: calc(42 * var(--u));
  font-size: calc(48 * var(--u));
  font-weight: 600;
  line-height: 1;
  color: var(--rufous);
  text-align: center;
}

.method p {
  margin: 0;
  font-size: max(16px, calc(18 * var(--u)));
  line-height: 1.5;
}

.method b {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.diary {
  display: flex;
  align-items: center;
  gap: calc(18 * var(--u));
  margin: calc(8 * var(--u)) 0 0 calc(40 * var(--u));
}

.diary img {
  width: calc(150 * var(--u));
}

.diary figcaption {
  font-size: calc(28 * var(--u));
  line-height: 1.1;
  max-width: 14ch;
}

.calls {
  margin: 0 0 calc(24 * var(--u));
}

.calls-legend {
  display: flex;
  gap: calc(22 * var(--u));
  margin-bottom: calc(8 * var(--u));
  font-size: max(15px, calc(17 * var(--u)));
  color: var(--ink-body);
}

.calls-legend span {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot--bird { background: #3f73a8; }
.dot--squirrel { background: #c0562f; }

.calls-plot {
  position: relative;
}

.calls-plot svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font-serif);
}

.calls-tip {
  position: absolute;
  z-index: 3;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--cloth);
  color: var(--cream);
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  box-shadow: 0 4px 14px rgba(20, 30, 20, 0.25);
}

.calls-caption {
  margin-top: calc(10 * var(--u));
  font-size: max(15px, calc(16 * var(--u)));
  font-style: italic;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 60ch;
}

.specimens {
  display: flex;
  gap: calc(18 * var(--u));
  margin: 0 0 calc(26 * var(--u));
  min-height: calc(10 * var(--u));
}

.specimen {
  position: relative;
  margin: 0;
  padding: calc(8 * var(--u)) calc(8 * var(--u)) calc(6 * var(--u));
  background: #fbf6ec;
  box-shadow: 0 2px 6px rgba(60, 40, 20, 0.22);
  transform: rotate(var(--tilt, -1.5deg));
}

.specimen::before {
  /* tape */
  content: "";
  position: absolute;
  left: 50%;
  top: calc(-10 * var(--u));
  width: calc(56 * var(--u));
  height: calc(20 * var(--u));
  margin-left: calc(-28 * var(--u));
  background: rgba(227, 173, 69, 0.55);
  transform: rotate(-4deg);
}

.specimen img {
  width: calc(118 * var(--u));
  height: calc(118 * var(--u));
  object-fit: cover;
  background: #ddd;
}

.specimen figcaption {
  margin-top: calc(4 * var(--u));
  font-family: var(--font-hand);
  font-size: calc(21 * var(--u));
  line-height: 1;
  color: var(--slate);
  text-align: center;
}

.see-also {
  font-size: max(16px, calc(18 * var(--u)));
}

.see-also b {
  font-weight: 600;
  color: var(--ink);
}

.see-also a {
  color: var(--rufous-deep);
  text-decoration-color: rgba(154, 65, 34, 0.4);
}

.see-also a:hover {
  text-decoration-color: currentColor;
}

/* next edition */

.spec-plate {
  position: relative;
  width: calc(470 * var(--u));
  margin: calc(28 * var(--u)) auto 0;
}

.spec-plate img {
  width: 100%;
}

.leaders {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.leaders path {
  fill: none;
  stroke: var(--slate);
  stroke-width: 1.3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.callout-label {
  position: absolute;
  font-family: var(--font-hand);
  font-size: calc(24 * var(--u));
  font-weight: 500;
  line-height: 1.02;
  color: var(--slate);
  white-space: nowrap;
  transform: translateX(-60%);
}

.callout-label[style*="left: 7"],
.callout-label[style*="left: 8"] {
  transform: none;
}

.next {
  text-align: center;
}

.next p {
  margin-left: auto;
  margin-right: auto;
  max-width: 46ch;
}

.next-title {
  margin: calc(34 * var(--u)) 0 0;
  font-size: calc(60 * var(--u));
  font-weight: 700;
  line-height: 1.05;
  color: var(--ink);
}

.next-sub {
  margin: calc(6 * var(--u)) auto 0 !important;
  font-size: calc(34 * var(--u));
  font-style: italic;
  font-weight: 500;
  color: var(--slate);
}

.next-sprig {
  width: calc(40 * var(--u));
  height: calc(28 * var(--u));
  margin: calc(14 * var(--u)) auto calc(22 * var(--u));
}

.stamp {
  display: inline-block;
  margin: calc(10 * var(--u)) 0 calc(26 * var(--u));
  padding: calc(8 * var(--u)) calc(22 * var(--u));
  border: calc(4 * var(--u)) solid var(--rufous);
  border-radius: calc(8 * var(--u));
  color: var(--rufous);
  font-size: calc(46 * var(--u));
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  transform: rotate(-6deg);
  opacity: 0.88;
  mix-blend-mode: multiply;
}

.waitlist {
  display: grid;
  gap: calc(10 * var(--u));
  max-width: calc(440 * var(--u));
  margin: 0 auto calc(26 * var(--u));
  text-align: left;
}

.waitlist-row {
  display: grid;
  gap: calc(10 * var(--u));
}

.waitlist .field {
  display: grid;
  gap: calc(6 * var(--u));
}

.waitlist label {
  font-family: var(--font-hand);
  font-size: calc(24 * var(--u));
  line-height: 1;
  color: var(--slate);
}

.waitlist input,
.waitlist select {
  width: 100%;
  min-height: 48px;
  padding: 0 calc(16 * var(--u));
  border: 1.5px solid rgba(44, 72, 99, 0.55);
  border-radius: calc(8 * var(--u));
  background: rgba(255, 252, 244, 0.7);
  color: var(--ink);
  font: inherit;
  font-size: max(16px, calc(18 * var(--u)));
}

.waitlist select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: calc(44 * var(--u));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%232c4863' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right calc(16 * var(--u)) center;
  background-size: 12px 8px;
  cursor: pointer;
}

.waitlist input::placeholder {
  color: #7b867c;
}

.waitlist input:focus,
.waitlist select:focus {
  outline: 2px solid var(--mustard);
  outline-offset: 1px;
  border-color: var(--slate);
}

.waitlist input[aria-invalid="true"] {
  border-color: var(--rufous);
}

.waitlist .ts-box:empty { display: none; }
.waitlist .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.waitlist button {
  min-height: 52px;
  margin-top: calc(8 * var(--u));
  border: 0;
  border-radius: 999px;
  background: var(--rufous);
  color: var(--cream);
  font: inherit;
  font-size: max(17px, calc(20 * var(--u)));
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(20, 35, 25, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}

.waitlist button:hover {
  background: var(--rufous-deep);
  transform: translateY(-1px);
}

.waitlist button:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.waitlist-msg {
  min-height: 1.4em;
  margin: 0 !important;
  font-family: var(--font-hand);
  font-size: calc(26 * var(--u));
  line-height: 1.1;
  color: var(--cloth);
  text-align: center;
}

.waitlist-msg[data-state="error"] {
  color: var(--rufous-deep);
}

.waitlist.is-done .waitlist-row,
.waitlist.is-done label,
.waitlist.is-done input,
.waitlist.is-done select,
.waitlist.is-done button {
  display: none;
}

.indie {
  font-size: max(15px, calc(16 * var(--u)));
  font-style: italic;
  color: var(--ink-soft);
}

/* note and recording */

.letter {
  margin-top: calc(28 * var(--u));
  font-size: max(18px, calc(21 * var(--u)));
  line-height: 1.6;
}

.letter p:first-child {
  font-size: 1.25em;
  font-weight: 600;
  color: var(--ink);
}

.signature {
  margin-top: calc(18 * var(--u)) !important;
  font-size: calc(54 * var(--u));
  line-height: 1;
  transform: rotate(-4deg);
  transform-origin: left center;
}

.recording {
  margin: 0 0 calc(26 * var(--u));
  padding: calc(12 * var(--u)) calc(12 * var(--u)) calc(10 * var(--u));
  background: #fbf6ec;
  box-shadow: 0 3px 10px rgba(60, 40, 20, 0.22);
  transform: rotate(0.6deg);
}

.recording video {
  display: block;
  width: 100%;
  height: auto;
  background: #1b2a1f;
}

.recording figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: calc(8 * var(--u));
  font-weight: 600;
  color: var(--ink);
}

.recording figcaption .hand {
  font-size: 1.3em;
}

.ballad {
  display: flex;
  align-items: center;
  gap: calc(16 * var(--u));
  width: 100%;
  padding: calc(14 * var(--u)) calc(18 * var(--u));
  border: 1.5px solid rgba(44, 72, 99, 0.45);
  border-radius: calc(10 * var(--u));
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ballad:hover {
  background: rgba(248, 231, 196, 0.6);
}

.ballad svg {
  flex: none;
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  padding: calc(8 * var(--u));
  border-radius: 50%;
  background: var(--rufous);
  color: var(--cream);
}

.ballad.playing svg {
  background: var(--cloth);
}

.ballad > span:not(.hand) {
  flex: 1;
  font-weight: 600;
}

.ballad em {
  display: block;
  font-weight: 400;
  color: var(--ink-soft);
}

.ballad .hand {
  font-size: calc(28 * var(--u));
}

/* back cover */

.back-cover {
  display: grid;
  justify-items: center;
  gap: calc(14 * var(--u));
  margin-top: calc(80 * var(--u));
  padding: calc(64 * var(--u)) 24px calc(56 * var(--u));
  background: linear-gradient(rgba(10, 20, 12, 0.3), rgba(10, 20, 12, 0.3)), url("../assets/plates/cloth.webp") repeat var(--cloth-deep);
  background-size: auto, 344px auto;
  color: var(--cream);
  text-align: center;
}

.back-cover .wordmark {
  font-size: calc(64 * var(--u));
}

.back-tag {
  margin: 0;
  font-size: max(20px, calc(28 * var(--u)));
  font-weight: 600;
}

.back-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
}

.back-links a {
  color: var(--cream);
  text-decoration-color: rgba(246, 241, 226, 0.4);
}

.back-links a:hover {
  text-decoration-color: var(--mustard);
}

.back-colophon {
  margin: calc(8 * var(--u)) 0 0;
  font-size: 15px;
  color: rgba(246, 241, 226, 0.72);
}

.back-colophon a {
  color: inherit;
  text-underline-offset: 0.18em;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ── Phones and small tablets: one page at a time ─────── */

@media (max-width: 900px) {
  :root {
    --u: calc(100vw / 760);
  }

  body {
    padding-bottom: 72px;
  }

  .masthead {
    height: auto;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 16px 16px 14px;
  }

  .wordmark {
    font-size: 34px;
  }

  .masthead-rule,
  .guide-title .sprig,
  .masthead-nav {
    display: none;
  }

  .guide-title {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .guide-title small {
    font-size: 11px;
    margin-bottom: 3px;
  }

  .guide-title span {
    font-size: 22px;
  }

  .btn-waitlist {
    margin-left: auto;
    height: 40px;
    padding: 0 16px;
    font-size: 15px;
  }

  .spread,
  .folio {
    width: auto;
    height: auto;
    margin: 18px 12px 0;
  }

  .spread::after,
  .page--left::before,
  .page--right::before {
    display: none;
  }

  .spread .book,
  .book--flow {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    height: auto;
    margin: 0;
  }

  .book {
    grid-template-columns: 1fr;
  }

  .book::before {
    inset: -5px -6px -12px -6px;
    border-radius: 14px;
  }

  .page--left,
  .page--right {
    border-radius: 0;
    box-shadow: inset 0 -18px 30px -24px rgba(150, 110, 60, 0.25);
  }

  .page--left {
    border-radius: 10px 10px 0 0;
  }

  .book--flow .page--right,
  .field-strip {
    border-radius: 0 0 10px 10px;
  }

  .page--right {
    border-top: 1px dashed rgba(92, 70, 40, 0.25);
  }

  /* hero pages fall into reading order */
  .spread .page {
    padding: 26px 18px 22px;
  }

  .key-title,
  .key-sub,
  .key,
  .tagline,
  .plate,
  .caption {
    position: static;
  }

  .key-title {
    font-size: 32px;
  }

  .key-sub {
    margin-top: 2px;
    font-size: 23px;
  }

  .key-sprig,
  .callout,
  .note {
    display: none;
  }

  .spread .page--left {
    position: relative;
  }

  .key-title,
  .key-sub {
    padding-right: 96px;
  }

  .watch {
    position: absolute;
    right: 14px;
    top: 16px;
    left: auto;
    width: 84px;
    height: 132px;
  }

  .watch .plate-img {
    left: 8px;
    top: 6px;
    width: 68px;
    height: 120px;
  }

  .viewfinder {
    left: 0;
    top: 0;
    width: 84px;
    height: 132px;
  }

  .viewfinder i {
    width: 14px;
    height: 14px;
    border-width: 0;
  }

  .viewfinder i:nth-child(1) { border-width: 2px 0 0 2px; }
  .viewfinder i:nth-child(2) { border-width: 2px 2px 0 0; }
  .viewfinder i:nth-child(3) { border-width: 0 0 2px 2px; }
  .viewfinder i:nth-child(4) { border-width: 0 2px 2px 0; }

  .key {
    width: 100%;
    margin-top: 18px;
  }

  .key li + li {
    margin-top: 10px;
  }

  .couplet {
    grid-template-columns: 38px 1fr 1px 96px 14px;
    min-height: 70px;
    padding: 10px 10px 10px 14px;
    border-width: 1.5px;
    border-radius: 8px;
  }

  .couplet .num,
  .couplet .clue {
    font-size: 19px;
  }

  .couplet .lead {
    padding-left: 12px;
    font-size: 18px;
  }

  .couplet .chev {
    width: 9px;
    height: 15px;
  }

  .couplet .leaf {
    display: none;
  }

  .couplet[aria-pressed="true"] .num {
    margin-left: 0;
  }

  .tagline {
    font-size: 34px;
  }

  .tagline-sprig {
    position: static;
    width: 34px;
    height: 24px;
    margin: 8px auto 4px;
  }

  .plate-art {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 614 / 512;
  }

  .plate-art img[data-visitor="gary"] {
    object-fit: contain;
  }

  .plate-art img[data-visitor="earl"],
  .plate-art img[data-visitor="bird"] {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }

  .caption {
    width: auto;
    margin-top: 6px;
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .caption .plate-name {
    display: inline;
    font-size: 26px;
  }

  .caption .latin {
    font-size: 19px;
    padding-bottom: 10px;
  }

  .caption .verdict {
    font-size: 19px;
    padding: 8px 0;
  }

  .caption .aside {
    font-size: 22px;
  }

  .field-strip {
    position: static;
    grid-template-columns: 1fr 1fr;
    height: auto;
    padding: 0 18px 14px;
    border-top: 1px dashed rgba(92, 70, 40, 0.25);
    background: url("../assets/plates/paper.webp") repeat var(--paper);
    background-size: 460px auto;
  }

  .field-strip h2 {
    grid-column: 1 / -1;
    padding: 16px 0 10px;
    font-size: 26px;
  }

  .field-strip h2 .leaf {
    width: 24px;
    height: 24px;
  }

  .field-strip h2 .underline {
    display: none;
  }

  .strip-when {
    font-size: 20px;
  }

  .tally {
    grid-template-columns: 40px 1fr;
    column-gap: 10px;
    height: auto;
    margin: 0;
    padding: 10px 0;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .tally img {
    width: 40px;
    height: 40px;
  }

  .tally .what {
    font-size: 15px;
  }

  .tally .what em {
    font-size: 14px;
  }

  .tally .marks {
    height: 26px;
    gap: 6px;
  }

  .tally .marks svg {
    height: 24px;
  }

  .tally .count {
    font-size: 22px;
  }

  /* thumb index becomes a bottom bar */
  .thumb-tabs {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    flex-direction: row;
    gap: 0;
    padding: 0 6px;
    background: var(--cloth-deep);
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.25);
  }

  .thumb-tabs a,
  .thumb-tabs a:first-child {
    flex: 1;
    height: 60px;
    gap: 3px;
    padding: 6px 2px 8px;
    border-radius: 10px 10px 0 0;
    font-size: 12px;
    box-shadow: none;
    transform: translateY(6px);
  }

  .thumb-tabs a:hover,
  .thumb-tabs a[aria-current="true"] {
    transform: translateY(0);
  }

  .thumb-tabs svg {
    width: 18px;
    height: 18px;
  }

  /* flow pages */
  .book--flow .page,
  .book--flow .page--right {
    padding: 28px 18px 32px;
    font-size: 17px;
  }

  .page-title {
    font-size: 31px;
  }

  .page-sub {
    margin-bottom: 20px;
    font-size: 22px;
  }

  .book--flow h3 {
    font-size: 20px;
  }

  .entry {
    grid-template-columns: 92px 1fr;
    gap: 14px;
    align-items: start;
  }

  .entry-text p,
  .method p,
  .see-also {
    font-size: 16px;
  }

  .range-map {
    margin: 0 -6px 18px;
  }

  .map-label {
    font-size: 15px;
  }

  .method li {
    padding-left: 38px;
  }

  .method .step {
    width: 28px;
    font-size: 34px;
  }

  .diary {
    margin-left: 0;
  }

  .diary img {
    width: 96px;
  }

  .diary figcaption {
    font-size: 21px;
  }

  .calls-caption {
    font-size: 15px;
  }

  .specimens {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 14px;
    justify-items: center;
  }

  .specimen img {
    width: 128px;
    height: 128px;
  }

  .specimen::before {
    top: -8px;
    width: 44px;
    height: 16px;
    margin-left: -22px;
  }

  .specimen figcaption {
    font-size: 18px;
  }

  .spec-plate {
    width: 72%;
  }

  .leaders,
  .callout-label {
    display: none;
  }

  .spec-list {
    display: block;
    margin: 14px 0 0;
    padding-left: 22px;
    font-size: 21px;
    line-height: 1.15;
  }

  .spec-list li + li {
    margin-top: 6px;
  }

  .next-title {
    margin-top: 6px;
    font-size: 36px;
  }

  .next-sub {
    font-size: 23px;
  }

  .stamp {
    font-size: 30px;
    border-width: 3px;
  }

  .waitlist {
    max-width: none;
  }

  .waitlist-row {
  display: grid;
  gap: calc(10 * var(--u));
}

.waitlist .field {
  display: grid;
  gap: calc(6 * var(--u));
}

.waitlist label {
    font-size: 20px;
  }

  .waitlist-msg {
    font-size: 21px;
  }

  .letter {
    margin-top: 16px;
    font-size: 17px;
  }

  .signature {
    font-size: 42px;
  }

  .ballad .hand {
    font-size: 20px;
  }

  .back-cover {
    margin-top: 40px;
  }

  .back-cover .wordmark {
    font-size: 42px;
  }

  .book--flow .page[data-folio]::after {
    bottom: 10px;
  }


  .book--flow .page--left[data-folio]::after {
    left: 18px;
  }

  .book--flow .page--right[data-folio]::after {
    right: 18px;
  }
}


/* ── Most Wanted ─────────────────────────────────────── */

.wanted-lede {
  margin-bottom: calc(18 * var(--u)) !important;
}

.ledger {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 calc(24 * var(--u));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.ledger > div {
  padding: calc(10 * var(--u)) calc(12 * var(--u)) calc(12 * var(--u));
}

.ledger > div + div {
  border-left: 1px solid var(--rule);
}

.ledger dt {
  font-family: var(--font-hand);
  font-size: calc(21 * var(--u));
  font-weight: 600;
  line-height: 1.1;
  color: var(--slate);
}

.ledger dd {
  margin: calc(2 * var(--u)) 0 0;
  font-size: calc(34 * var(--u));
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.poster {
  position: relative;
  width: calc(400 * var(--u));
  margin: calc(6 * var(--u)) auto 0;
  padding: calc(14 * var(--u)) calc(14 * var(--u)) calc(12 * var(--u));
  background: #fbf6ec;
  box-shadow: 0 calc(4 * var(--u)) calc(14 * var(--u)) rgba(60, 40, 20, 0.28);
  transform: rotate(-1.2deg);
}

.poster::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(-12 * var(--u));
  width: calc(84 * var(--u));
  height: calc(24 * var(--u));
  margin-left: calc(-42 * var(--u));
  background: rgba(227, 173, 69, 0.55);
  transform: rotate(-3deg);
}

.poster img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #2a3a2e;
}

.poster figcaption {
  display: grid;
  gap: calc(2 * var(--u));
  margin-top: calc(10 * var(--u));
  font-size: max(14px, calc(17 * var(--u)));
  line-height: 1.3;
  color: var(--ink-body);
}

.poster figcaption b {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--ink);
}

.poster figcaption .hand {
  font-size: calc(26 * var(--u));
  line-height: 1;
}

.poster-stamp {
  position: absolute;
  right: calc(-18 * var(--u));
  top: calc(26 * var(--u));
  z-index: 1;
  margin: 0;
  padding: calc(4 * var(--u)) calc(14 * var(--u));
  font-size: calc(30 * var(--u));
  background: rgba(251, 246, 236, 0.35);
  transform: rotate(8deg);
}

.poster.is-pinning {
  animation: pin 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pin {
  0% { transform: rotate(-3deg) scale(1.04) translateY(calc(-8 * var(--u))); opacity: 0.4; }
  100% { transform: rotate(-1.2deg); opacity: 1; }
}

.lineup-title {
  margin: 0;
  font-size: calc(46 * var(--u)) !important;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.lineup {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(18 * var(--u)) calc(16 * var(--u));
  margin-bottom: calc(22 * var(--u));
}

.suspect {
  display: grid;
  gap: calc(4 * var(--u));
  padding: calc(6 * var(--u)) calc(6 * var(--u)) calc(5 * var(--u));
  border: 0;
  background: #fbf6ec;
  box-shadow: 0 2px 6px rgba(60, 40, 20, 0.22);
  transform: rotate(var(--tilt, -1deg));
  font: inherit;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.suspect:hover {
  transform: rotate(0deg) translateY(calc(-3 * var(--u)));
  box-shadow: 0 6px 14px rgba(60, 40, 20, 0.28);
}

.suspect[aria-pressed="true"] {
  outline: calc(3 * var(--u)) solid var(--mustard);
  outline-offset: calc(2 * var(--u));
}

.suspect img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #2a3a2e;
}

.suspect-cap {
  font-family: var(--font-hand);
  font-size: calc(19 * var(--u));
  font-weight: 600;
  line-height: 1;
  color: var(--slate);
}

.lineup-empty {
  grid-column: 1 / -1;
  font-size: calc(24 * var(--u));
}

.by-day {
  margin: 0 0 calc(12 * var(--u));
}

.by-day-plot svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--font-serif);
}

.by-day figcaption {
  margin-top: calc(4 * var(--u));
  font-size: max(13px, calc(15 * var(--u)));
  font-style: italic;
  color: var(--ink-soft);
}

.book-mode #most-wanted .page-sub {
  margin-bottom: calc(16 * var(--u));
}

.book-mode .wanted-lede {
  font-size: max(14px, calc(17 * var(--u)));
}

.book-mode .poster {
  width: calc(380 * var(--u));
}

/* ── Book mode: one spread at a time, pages turn sideways ──
   Set on <html> by a script when the screen is desktop-sized. Phones, and anyone
   without scripts, keep the vertical guide above. */

.book-mode {
  --u: min(calc(100vw / 1536), calc(100svh / 1024));
  overflow: hidden;
}

.book-mode body {
  height: 100svh;
  overflow: hidden;
  padding-bottom: 0;
}

.book-mode main {
  position: relative;
  width: calc(1536 * var(--u));
  height: calc(924 * var(--u));
  margin: 0 auto;
  perspective: calc(3200 * var(--u));
}

.book-mode .spread,
.book-mode .folio {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  visibility: hidden;
}

.book-mode main:not(:has(.is-open)) > .spread {
  visibility: visible;
}

.book-mode .is-under {
  visibility: visible;
  z-index: 1;
}

.book-mode .is-open {
  visibility: visible;
  z-index: 2;
}

.book-mode .folio::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(26 * var(--u));
  background: url("../assets/plates/desk.webp") repeat-x left top / auto 100% var(--desk);
  z-index: 0;
}

.book-mode .book--flow {
  position: absolute;
  left: calc(20 * var(--u));
  top: calc(3 * var(--u));
  width: calc(1472 * var(--u));
  height: calc(866 * var(--u));
  margin: 0;
}

.book-mode .book--flow .page {
  overflow: hidden;
  padding: calc(48 * var(--u)) calc(56 * var(--u)) calc(56 * var(--u)) calc(60 * var(--u));
  font-size: max(14px, calc(17 * var(--u)));
}

.book-mode .book--flow .page--right {
  padding-right: calc(92 * var(--u));
}

.book-mode .back-cover {
  display: none;
}

.book-mode .page-title {
  font-size: calc(46 * var(--u));
}

.book-mode .page-sub {
  margin-bottom: calc(22 * var(--u));
  font-size: calc(27 * var(--u));
}

.book-mode .book--flow p {
  line-height: 1.5;
}

.book-mode .book--flow h3 {
  font-size: calc(22 * var(--u));
}

/* residents */
.book-mode .entry {
  grid-template-columns: calc(176 * var(--u)) 1fr;
  gap: calc(20 * var(--u));
  padding: calc(16 * var(--u)) 0;
}

.book-mode .entry-text p {
  font-size: max(14px, calc(17.5 * var(--u)));
  line-height: 1.42;
}

.book-mode .entry h3 {
  font-size: calc(25 * var(--u));
}

.book-mode .range-map {
  width: 96%;
  margin: 0 0 calc(14 * var(--u));
}

.book-mode #residents .page--right p {
  font-size: max(13.5px, calc(17 * var(--u)));
  line-height: 1.45;
}

/* field notes */
.book-mode .method li {
  padding-bottom: calc(5 * var(--u));
}

.book-mode .method .step {
  font-size: calc(40 * var(--u));
}

.book-mode .method p {
  font-size: max(13.5px, calc(16 * var(--u)));
  line-height: 1.4;
}

.book-mode #field-notes .page-sub {
  line-height: 1.05;
  margin-bottom: calc(14 * var(--u));
}

.book-mode .diary {
  margin-top: calc(4 * var(--u));
}

.book-mode .diary img {
  width: calc(76 * var(--u));
}

.book-mode .diary {
  margin-top: 0;
}

.book-mode .diary figcaption {
  font-size: calc(24 * var(--u));
}

.book-mode .calls {
  margin-bottom: calc(14 * var(--u));
}

.book-mode .calls-plot svg {
  width: 78%;
}

.book-mode .calls-legend {
  margin-bottom: calc(4 * var(--u));
  font-size: max(13px, calc(15 * var(--u)));
}

.book-mode .calls-caption {
  font-size: max(12.5px, calc(14.5 * var(--u)));
  line-height: 1.4;
}

.book-mode .specimens {
  gap: calc(14 * var(--u));
  margin-bottom: calc(14 * var(--u));
}

.book-mode .specimen img {
  width: calc(82 * var(--u));
  height: calc(82 * var(--u));
}

.book-mode .specimen figcaption {
  font-size: calc(19 * var(--u));
}

.book-mode .see-also {
  font-size: max(13.5px, calc(16 * var(--u)));
}

/* next edition */
.book-mode .spec-plate {
  width: calc(430 * var(--u));
  margin-top: calc(16 * var(--u));
}

.book-mode .next-title {
  margin-top: calc(12 * var(--u));
  font-size: calc(52 * var(--u));
}

.book-mode .next .next-sub {
  font-size: calc(29 * var(--u));
}

.book-mode h1[tabindex="-1"]:focus,
.book-mode h2[tabindex="-1"]:focus {
  outline: none;
}

.book-mode .next-sprig {
  margin: calc(8 * var(--u)) auto calc(14 * var(--u));
}

.book-mode .next p {
  font-size: max(14px, calc(17 * var(--u)));
}

.book-mode .stamp {
  margin: calc(2 * var(--u)) 0 calc(16 * var(--u));
  font-size: calc(38 * var(--u));
}

.book-mode .waitlist {
  gap: calc(6 * var(--u));
  margin-bottom: 0;
}

.book-mode .waitlist-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(12 * var(--u));
}

.book-mode .waitlist input,
.book-mode .waitlist select {
  min-height: max(36px, calc(46 * var(--u)));
}

.book-mode .waitlist button {
  min-height: max(38px, calc(50 * var(--u)));
  margin-top: calc(10 * var(--u));
}

/* note and recording */
.book-mode .letter {
  margin-top: calc(18 * var(--u));
  font-size: max(14.5px, calc(18.5 * var(--u)));
}

.book-mode .signature {
  font-size: calc(48 * var(--u));
}

/* the endpapers and back board, only in book mode */
.endpapers {
  display: none;
}

.book-mode .endpapers {
  display: block;
}

.endpaper {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: calc(18 * var(--u));
  text-align: center;
}

.endpaper .sprig {
  width: calc(60 * var(--u));
  height: calc(42 * var(--u));
}

.endpaper p {
  margin: 0;
  max-width: 30ch;
  font-style: italic;
  font-size: max(14px, calc(18 * var(--u)));
  color: var(--ink-soft);
}

.book-mode .endpapers .page--right.board {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: calc(20 * var(--u));
  background: linear-gradient(rgba(10, 20, 12, 0.22), rgba(10, 20, 12, 0.22)), url("../assets/plates/cloth.webp") repeat var(--cloth-deep);
  background-size: auto, 344px auto;
  box-shadow: inset calc(30 * var(--u)) 0 calc(30 * var(--u)) calc(-24 * var(--u)) rgba(0, 0, 0, 0.35);
  color: #f6f1e2;
  text-align: center;
}

.book-mode .endpapers .page--right.board::before {
  display: none;
}

.board .wordmark {
  font-size: calc(80 * var(--u));
}

.board .back-tag {
  font-size: calc(30 * var(--u));
}

.board .back-links a {
  font-size: max(15px, calc(19 * var(--u)));
}

.board .back-colophon {
  font-size: max(13px, calc(15 * var(--u)));
}

/* page corners: the way to turn */
.corner {
  display: none;
}

.book-mode .corner {
  display: block;
  position: absolute;
  bottom: 0;
  z-index: 4;
  width: calc(64 * var(--u));
  height: calc(64 * var(--u));
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.book-mode .corner--next {
  right: 0;
  border-bottom-right-radius: calc(10 * var(--u));
}

.book-mode .corner--prev {
  left: 0;
  border-bottom-left-radius: calc(10 * var(--u));
}

.corner::before,
.corner::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: calc(26 * var(--u));
  height: calc(26 * var(--u));
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1), height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* the paper uncovered beneath the fold */
.corner::before {
  background: #dcc7a4;
}

/* the folded flap, the back of the page catching the light */
.corner::after {
  background: linear-gradient(var(--fold-dir), #f7ecd9, #e4d1b1);
  filter: drop-shadow(calc(-2 * var(--u)) calc(-2 * var(--u)) calc(3 * var(--u)) rgba(60, 40, 20, 0.3));
}

.corner--next::before,
.corner--next::after {
  right: 0;
}

.corner--next::before {
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.corner--next::after {
  --fold-dir: 135deg;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.corner--prev::before,
.corner--prev::after {
  left: 0;
}

.corner--prev::before {
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.corner--prev::after {
  --fold-dir: 225deg;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.corner:hover::before,
.corner:hover::after,
.corner:focus-visible::before,
.corner:focus-visible::after,
.corner.is-peeking::before,
.corner.is-peeking::after {
  width: calc(54 * var(--u));
  height: calc(54 * var(--u));
}

.corner:focus-visible {
  outline-offset: -4px;
}

/* the turning leaf */
.leaf-turn {
  position: absolute;
  z-index: 5;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  pointer-events: none;
}

.leaf-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Safari only hides a face's back when the face has its own 3D transform */
.leaf-face--front {
  transform: rotateY(0deg) translateZ(0.1px);
}

.leaf-face--back {
  transform: rotateY(180deg) translateZ(0.1px);
}

.leaf-face > .book {
  position: absolute;
  top: 0;
  filter: none;
}

.leaf-face > .book::before {
  display: none;
}

.leaf-shade {
  position: absolute;
  top: 0;
  bottom: 0;
  opacity: 0;
  pointer-events: none;
}

.under-shadow {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}

/* phones: Most Wanted at readable sizes (after the spread's own rules so these win) */
@media (max-width: 900px) {
  .ledger dt {
    font-size: 17px;
  }

  .ledger dd {
    font-size: 24px;
  }

  .poster {
    width: 88%;
  }

  .poster figcaption .hand {
    font-size: 22px;
  }

  .poster-stamp {
    right: -8px;
    font-size: 22px;
  }

  .lineup-title {
    font-size: 26px !important;
  }

  .lineup {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 14px;
  }

  .ledger > div {
    padding: 8px 8px 10px;
  }

  .poster {
    padding: 10px 10px 10px;
  }

  .poster figcaption {
    font-size: 15px;
  }

  .suspect-cap {
    font-size: 17px;
  }

  .wanted-lede {
    font-size: 17px;
  }

  .suspect:nth-child(n + 7) {
    display: none;
  }

  .by-day figcaption {
    font-size: 14px;
  }
}

/* ── Book mode tabs ──────────────────────────────────────
   Each tab belongs to its section's right-hand page. Tabs for sections still ahead stick out of
   the right edge, tabs already turned past sit on the left, and a tab turns over with its page.
   The tab on the page you are looking at lies on top of it. The rest sit on pages underneath,
   so only the part past the edge shows. */

.book-mode {
  --u: min(calc(100vw / 1640), calc(100svh / 1024));
}

.book-mode main {
  width: calc(1640 * var(--u));
  z-index: 1;
  pointer-events: none;
}

.book-mode main .book {
  pointer-events: auto;
}

.book-mode .spread .book,
.book-mode .book--flow {
  left: calc(84 * var(--u));
}

.book-mode .thumb-tabs {
  position: static;
  display: block;
  width: auto;
}

.book-mode .thumb-tabs a,
.tab-flight {
  width: calc(90 * var(--u));
  font-size: calc(14.5 * var(--u));
}

/* the cover shows only a sliver past the fore-edges, so the tabs underneath read in full */
.book-mode .book::before {
  inset: calc(-3 * var(--u)) calc(-8 * var(--u)) calc(-30 * var(--u)) calc(-8 * var(--u));
}

.book-mode .thumb-tabs a {
  position: fixed;
  z-index: 0;
  top: var(--tab-top);
  height: var(--tab-h);
}

.book-mode .thumb-tabs a:nth-child(1) { --tab-top: calc(135 * var(--u)); --tab-h: calc(100 * var(--u)); }
.book-mode .thumb-tabs a:nth-child(2) { --tab-top: calc(241 * var(--u)); --tab-h: calc(118 * var(--u)); }
.book-mode .thumb-tabs a:nth-child(3) { --tab-top: calc(365 * var(--u)); --tab-h: calc(118 * var(--u)); }
.book-mode .thumb-tabs a:nth-child(4) { --tab-top: calc(489 * var(--u)); --tab-h: calc(118 * var(--u)); }
.book-mode .thumb-tabs a:nth-child(5) { --tab-top: calc(613 * var(--u)); --tab-h: calc(118 * var(--u)); }

.book-mode .thumb-tabs a:not([data-side="left"]) {
  left: calc(50% + 722 * var(--u));
}

.book-mode .thumb-tabs a[data-side="left"] {
  left: calc(50% - 812 * var(--u));
}

.book-mode .thumb-tabs a:not([data-side="left"]),
.tab-flight[data-side="right"] {
  padding: 0 calc(4 * var(--u)) 0 calc(24 * var(--u));
  border-radius: 0 calc(12 * var(--u)) calc(12 * var(--u)) 0;
  box-shadow: inset calc(6 * var(--u)) 0 calc(6 * var(--u)) calc(-4 * var(--u)) rgba(60, 40, 20, 0.3), 0 1px 2px rgba(20, 30, 20, 0.25);
}

.book-mode .thumb-tabs a[data-side="left"],
.tab-flight[data-side="left"] {
  padding: 0 calc(24 * var(--u)) 0 calc(4 * var(--u));
  border-radius: calc(12 * var(--u)) 0 0 calc(12 * var(--u));
  box-shadow: inset calc(-6 * var(--u)) 0 calc(6 * var(--u)) calc(-4 * var(--u)) rgba(60, 40, 20, 0.3), 0 1px 2px rgba(20, 30, 20, 0.25);
}

.book-mode .thumb-tabs a.on-page {
  z-index: 2;
}

.book-mode .thumb-tabs a[data-side="left"]:hover {
  transform: translateX(calc(-8 * var(--u)));
}

.book-mode .thumb-tabs a.in-flight {
  visibility: hidden;
  transition: none;
}

.tab-flight {
  position: absolute;
  margin: 0;
  pointer-events: none;
  transition: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ── Book mode on shorter screens ────────────────────────
   Laptops at 125% display scaling give the browser about 700 to 740 px of height.
   The text keeps its readable minimum, so the densest pages trim their extras. */
@media (max-height: 760px) {
  .book-mode .book--flow .page {
    padding-top: calc(40 * var(--u));
    padding-bottom: calc(44 * var(--u));
  }

  .book-mode .page-sub {
    margin-bottom: calc(14 * var(--u));
  }

  /* residents */
  .book-mode .entry {
    grid-template-columns: calc(150 * var(--u)) 1fr;
    padding: calc(10 * var(--u)) 0;
  }

  .book-mode .entry-text p {
    font-size: max(13px, calc(17.5 * var(--u)));
    line-height: 1.38;
  }

  .book-mode .range-map {
    width: 84%;
    margin-bottom: calc(10 * var(--u));
  }

  .book-mode #residents .page--right p {
    font-size: max(13px, calc(17 * var(--u)));
    line-height: 1.4;
    margin-bottom: 0.7em;
  }

  /* field notes */
  .book-mode .diary {
    display: none;
  }

  .book-mode .method p {
    font-size: max(13px, calc(16 * var(--u)));
    line-height: 1.38;
  }

  .book-mode .method li {
    padding-bottom: calc(4 * var(--u));
  }

  .book-mode .calls-caption,
  .book-mode .see-also {
    font-size: max(12.5px, calc(15 * var(--u)));
  }

  /* next edition */
  .book-mode .next p {
    font-size: max(13px, calc(17 * var(--u)));
    line-height: 1.42;
  }

  .book-mode .next-sprig {
    margin: calc(4 * var(--u)) auto calc(8 * var(--u));
  }

  .book-mode .stamp {
    margin: 0 0 calc(10 * var(--u));
  }

  .book-mode .waitlist input,
  .book-mode .waitlist select {
    min-height: max(32px, calc(44 * var(--u)));
  }

  .book-mode .waitlist button {
    min-height: max(34px, calc(48 * var(--u)));
    margin-top: calc(6 * var(--u));
  }
}
