/* ————————————————————————————————————————————————
   FORMA · A FIELD GUIDE TO THE WILD CRAFTS
   Handcraft-sketchbook direction: manila paper, graphite ink,
   one vermillion stamp red, typewritten labels, specimen plates.
   ———————————————————————————————————————————————— */

/* Fonts (self-hosted, SIL OFL — records in asset-sources.json) */
@font-face {
  font-family: 'Fraunces';
  src: url('/artifacts/forma-frontend--v1--s4-whacky--glm-5.3--best-web-design--2026-09-20T15-14-35-229Z/assets/fonts/fraunces-latin.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/artifacts/forma-frontend--v1--s4-whacky--glm-5.3--best-web-design--2026-09-20T15-14-35-229Z/assets/fonts/fraunces-italic-latin.woff2') format('woff2');
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('/artifacts/forma-frontend--v1--s4-whacky--glm-5.3--best-web-design--2026-09-20T15-14-35-229Z/assets/fonts/courier-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Courier Prime';
  src: url('/artifacts/forma-frontend--v1--s4-whacky--glm-5.3--best-web-design--2026-09-20T15-14-35-229Z/assets/fonts/courier-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ————— Tokens ————— */
:root {
  --paper: #F3EEE2;        /* manila field-paper */
  --paper-deep: #EAE3D1;   /* pressed-paper tint for hovers & wells */
  --surface: #FBF7EB;      /* plate / mat surface */
  --ink: #2A241C;          /* graphite-brown ink */
  --muted: #6E6353;        /* pencil notes */
  --accent: #BE3A1D;       /* vermillion stamp red */
  --accent-deep: #9A2F15;  /* pressed stamp */
  --marker: #F2C94C;       /* highlighter — collected marks only */
  --bone: #F6F1E4;         /* lightest paper, dark-band text */
  --red-lift: #E06A47;     /* vermillion lifted for dark ground */
  --input-hover: #FFFDF3;  /* input field, hovered */

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-mono: 'Courier Prime', 'Courier New', ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rule: 2px solid var(--ink);
  --rule-soft: 1px solid rgba(42, 36, 28, 0.35);
}

/* ————— Reset & base ————— */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  overflow-x: clip;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, figure, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; }
::selection { background: var(--marker); color: var(--ink); }

/* Paper grain — barely there, fixed, never interactive */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ————— Focus policy: outline kept in BOTH states ————— */
:focus { outline: 2px dashed var(--ink); outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fieldnote :focus, .fieldnote :focus-visible { outline-color: var(--red-lift); }

/* ————— Utilities ————— */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 12px 18px;
  background: var(--ink); color: var(--bone);
  font-family: var(--font-mono); font-size: 13px; text-decoration: none;
  transform: translateY(-64px);
}
.skip-link:focus { transform: none; }
.wrap {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 56px);
}

/* ————————————————— Spine (vertical edge, desktop) ————————————————— */
.spine {
  position: fixed;
  inset: 0 auto 0 0;
  width: 64px;
  z-index: 40;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 20px 0 24px;
  background: var(--ink);
  color: var(--bone);
}
.spine-star { font-size: 18px; color: var(--red-lift); }
.spine-text {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}
@media (min-width: 960px) {
  .spine { display: flex; }
  .page { margin-left: 64px; }
}

/* ————————————————— Cover ————————————————— */
.cover {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 40px) clamp(20px, 4vw, 56px) 72px;
  background-image:
    linear-gradient(rgba(42, 36, 28, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 36, 28, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}
.edition {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  max-width: 1240px;
  margin-inline: auto;
  width: 100%;
  padding-bottom: 14px;
  border-bottom: var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: rise 0.5s var(--ease) both;
}
.edition::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  border-bottom: 1px solid var(--ink);
}
.edition-mid { color: var(--accent); }

.cover-inner {
  width: 100%;
  max-width: 1240px;
  margin-block: auto;
  padding-block: clamp(32px, 5vh, 64px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 4vw, 72px);
  align-items: center;
}
.cover-title { display: grid; gap: clamp(16px, 2vw, 24px); }
.kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  animation: rise 0.55s var(--ease) 0.08s both;
}
.big {
  display: block;
  font-size: clamp(56px, 9.5vw, 168px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-variation-settings: 'WONK' 1, 'SOFT' 0;
  animation: rise 0.6s var(--ease) 0.14s both;
}
.big em { font-style: italic; color: var(--accent); }
.lede {
  max-width: 46ch;
  margin-top: clamp(20px, 2.5vw, 32px);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  animation: rise 0.6s var(--ease) 0.2s both;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 28px;
  margin-top: clamp(28px, 3vw, 44px);
  animation: rise 0.6s var(--ease) 0.26s both;
}
.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 26px;
  background: var(--accent);
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.cta-primary:active { transform: scale(0.97); }
.cta-text {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  padding-block: 10px;
  transition: color 0.18s var(--ease);
}

/* Frontispiece */
.cover-fig { position: relative; }
.frontis {
  position: relative;
  margin: 0;
  transform: rotate(1.4deg);
  transition: transform 0.3s var(--ease);
  animation: drop-in 0.7s var(--ease) 0.25s both;
}
.frontis img {
  width: 100%;
  aspect-ratio: 1400 / 933;
  object-fit: cover;
  border: 12px solid var(--surface);
  outline: 2px solid var(--ink);
  box-shadow: 0 28px 44px -28px rgba(42, 36, 28, 0.5);
  background: var(--paper-deep);
}
/* masking tape — device #1 (used here and nowhere else as tape) */
.frontis::before, .frontis::after {
  content: "";
  position: absolute;
  top: -16px;
  width: 92px; height: 30px;
  background: rgba(236, 224, 197, 0.85);
  box-shadow: 0 1px 2px rgba(42, 36, 28, 0.18);
  z-index: 2;
}
.frontis::before { left: 6%; transform: rotate(-5deg); }
.frontis::after { right: 6%; transform: rotate(4deg); }
.figcap {
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: right;
}

/* Vermillion seal — the guide's living stamp */
.seal {
  position: absolute;
  top: -48px; left: -48px;
  width: clamp(108px, 10vw, 148px);
  height: auto;
  color: var(--accent);
  animation: seal-pop 0.45s var(--ease) 0.55s both, seal-wobble 7s ease-in-out 1.4s infinite alternate;
}
.seal-round {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.17em;
  fill: var(--accent);
}
.seal-no {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 30px;
  font-weight: 900;
  fill: var(--accent);
  text-anchor: middle;
}
.seal-star { font-size: 15px; fill: var(--accent); text-anchor: middle; }

/* Hand-drawn arrow across the fold */
.fold-arrow {
  position: absolute;
  right: 7%;
  bottom: -20px;
  width: clamp(150px, 16vw, 220px);
  height: auto;
  color: var(--ink);
  pointer-events: none;
}
.arrow-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 240;
  stroke-dashoffset: 0;
  animation: draw 1.1s var(--ease) 0.6s both;
}
.arrow-head {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: rise 0.4s var(--ease) 1.5s both;
}

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes drop-in { from { opacity: 0; transform: rotate(4deg) translateY(22px); } to { opacity: 1; transform: rotate(1.4deg); } }
@keyframes draw { from { stroke-dashoffset: 240; } to { stroke-dashoffset: 0; } }
@keyframes seal-pop { from { opacity: 0; transform: scale(0.6) rotate(-18deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes seal-wobble { from { transform: rotate(-3.5deg); } to { transform: rotate(2.5deg); } }
@keyframes stamp-in { from { opacity: 0; transform: rotate(-16deg) scale(1.7); } to { opacity: 0.92; transform: rotate(-8deg) scale(1); } }

/* ————————————————— How to use this guide ————————————————— */
.howto {
  padding-block: clamp(48px, 6vw, 72px) clamp(56px, 7vw, 88px);
}
.howto-title {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: clamp(28px, 3.5vw, 44px);
}
.howto-steps {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 1fr;
  border-top: var(--rule);
}
.step {
  display: flex;
  gap: 18px;
  padding: 28px 28px 6px 0;
  border-right: var(--rule-soft);
}
.step:last-child { border-right: none; }
.step + .step { padding-left: 28px; }
.step-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.2s var(--ease);
}
.step-text h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.step-text p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 34ch;
}
.step-text strong { font-weight: 700; color: var(--ink); }

/* ————————————————— The Plates ————————————————— */
.plates {
  padding-block: clamp(64px, 8vw, 112px) clamp(72px, 9vw, 128px);
  background: var(--paper-deep);
  border-top: var(--rule);
  border-bottom: var(--rule);
}
.plates-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: clamp(24px, 3vw, 40px);
}
.plates-title {
  font-size: clamp(38px, 4.5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.plates-note {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Field kit — the toolbar */
.fieldkit {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 0.9fr) auto;
  gap: 18px 24px;
  align-items: end;
  padding: clamp(18px, 2.2vw, 26px);
  background: var(--surface);
  border: var(--rule);
  box-shadow: 5px 5px 0 var(--ink);
}
.kit-field { display: grid; gap: 8px; }
.kit-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.kit-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--bone);
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.kit-input::placeholder { color: var(--muted); opacity: 1; }
select.kit-input {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1 l6 6 l6 -6' fill='none' stroke='%232A241C' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.kit-toggle {
  display: grid;
  gap: 4px;
  justify-items: start;
  min-height: 48px;
  padding: 10px 16px;
  border: 2px dashed var(--ink);
  background: var(--paper);
  text-align: left;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.kit-toggle:active { transform: scale(0.97); }
.kit-toggle-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.kit-toggle-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.kit-toggle[aria-pressed="true"] {
  background: var(--ink);
  border-style: solid;
  color: var(--bone);
}
.kit-toggle[aria-pressed="true"] .kit-toggle-count { color: var(--marker); }
.kit-count {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 2px;
}

/* Plate rows — the specimen ledger */
.plate-list { border-top: var(--rule); }
.plate {
  position: relative;
  display: grid;
  grid-template-columns: 84px 232px 1fr 172px;
  grid-template-areas: "num photo body side";
  gap: clamp(20px, 2.4vw, 32px);
  padding: clamp(28px, 3vw, 40px) 8px;
  border-bottom: var(--rule);
  background: var(--paper-deep);
  transition: background-color 0.2s var(--ease);
  cursor: pointer;
}
.plate:nth-child(even) {
  grid-template-columns: 84px 1fr 232px 172px;
  grid-template-areas: "num body photo side";
}
.plate[hidden] { display: none; } /* author display:grid would override the hidden attribute */
.plate:focus-within { background: var(--surface); }
.plate:has(.open-entry:focus-visible) {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}
.plate-num { grid-area: num; }
.plate-num .pl {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.plate-num .n {
  display: block;
  font-size: clamp(40px, 3.6vw, 56px);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.2s var(--ease);
}
.plate-photo { grid-area: photo; }
.plate-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 8px solid var(--surface);
  outline: 1.5px solid var(--ink);
  background: var(--paper);
}
.plate-body { grid-area: body; display: grid; gap: 8px; align-content: start; }
.plate-binomial {
  font-style: italic;
  font-size: 14.5px;
  color: var(--muted);
}
.plate-title {
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.plate.is-collected .plate-title {
  background: linear-gradient(transparent 58%, var(--marker) 58%);
}
.plate-desc {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 54ch;
}
.plate-data {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 10px 28px;
  margin-top: 6px;
  font-family: var(--font-mono);
}
.plate-data dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.plate-data dd { font-size: 14px; font-weight: 400; }
.plate-actions { grid-area: side; align-self: center; justify-self: end; }

/* The open-entry control — stretched across the whole plate */
.open-entry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.open-entry:active { transform: scale(0.97); }
.open-entry .arr { transition: transform 0.2s var(--ease); }
.open-entry::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Collected stamp — the signature (device #2: stamps as state) */
.stamp {
  position: absolute;
  top: 22px;
  right: 14px;
  z-index: 2;
  padding: 7px 11px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  background: rgba(251, 247, 235, 0.78);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-16deg) scale(1.7);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.24s var(--ease), opacity 0.24s var(--ease), visibility 0.24s;
}
.plate.is-collected .stamp {
  visibility: visible;
  opacity: 0.92;
  transform: rotate(-8deg) scale(1);
}

/* Empty state — an empty drawer */
.empty {
  margin-top: 28px;
  padding: clamp(40px, 6vw, 72px) 24px;
  border: 2px dashed var(--ink);
  background: var(--surface);
  text-align: center;
}
.empty-title {
  font-size: clamp(26px, 3vw, 36px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.empty-text {
  max-width: 52ch;
  margin-inline: auto;
  color: var(--muted);
  margin-bottom: 24px;
}
.empty-reset {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 22px;
  background: var(--accent);
  color: var(--bone);
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--ink);
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.empty-reset:active { transform: scale(0.97); }

/* ————————————————— Note from the field (dark band) ————————————————— */
.fieldnote {
  background: var(--ink);
  color: var(--bone);
  padding-block: clamp(72px, 9vw, 120px);
}
.fn-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
}
.fn-kicker {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red-lift);
  margin-bottom: 18px;
}
.fn-quote {
  font-size: clamp(34px, 4.2vw, 58px);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: clamp(28px, 3vw, 40px);
}
.fn-facts { display: grid; }
.fn-facts li {
  display: flex;
  gap: 14px;
  padding: 14px 2px;
  border-top: 1px solid rgba(246, 241, 228, 0.25);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(246, 241, 228, 0.92);
}
.fn-facts li::before { content: "✳"; color: var(--red-lift); flex: none; }
.fn-fig {
  position: relative;
  max-width: 420px;
  justify-self: center;
  transform: rotate(-1.2deg);
  animation: sway 8s ease-in-out infinite alternate;
}
.fn-fig img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border: 10px solid var(--surface);
  outline: 2px solid rgba(246, 241, 228, 0.4);
  box-shadow: 0 30px 50px -26px rgba(0, 0, 0, 0.8);
}
/* the pin — device #3 */
.fn-fig::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  width: 22px; height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.35), 0 3px 5px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.fn-fig figcaption {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(246, 241, 228, 0.7);
  text-align: center;
}
@keyframes sway { from { transform: rotate(-1.2deg); } to { transform: rotate(0.9deg); } }

/* ————————————————— Colophon ————————————————— */
.colophon {
  background: var(--paper);
  padding-block: clamp(64px, 8vw, 112px) clamp(48px, 5vw, 72px);
}
.colo-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(32px, 5vw, 88px);
  align-items: start;
  border-top: var(--rule);
  padding-top: clamp(40px, 5vw, 64px);
}
.colo-mark {
  font-size: clamp(64px, 7vw, 120px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.04em;
  line-height: 0.9;
  font-variation-settings: 'WONK' 1;
}
.colo-star { color: var(--accent); display: inline-block; transition: transform 0.3s var(--ease); }
.colo-text { display: grid; gap: 14px; max-width: 62ch; padding-top: 8px; }
.colo-text p { font-size: 16px; line-height: 1.65; }
.colo-credits { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.colo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 8px;
}
.colo-link {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  padding-block: 8px;
  transition: color 0.18s var(--ease);
}
.fin {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  border: 2px solid var(--accent);
  padding: 6px 10px;
  transform: rotate(-3deg);
}

/* ————————————————— Specimen entry (dialog) ————————————————— */
body:has(dialog[open]) { overflow: hidden; }
.entry {
  width: min(880px, calc(100% - 40px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
  box-shadow: 10px 10px 0 rgba(42, 36, 28, 0.35);
}
.entry::backdrop {
  background: rgba(42, 36, 28, 0.55);
}
.entry-sheet { padding: clamp(20px, 4vw, 44px); }
.entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  padding-bottom: 16px;
  border-bottom: var(--rule);
  margin-bottom: clamp(20px, 3vw, 32px);
}
.entry-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.entry-kicker span { color: var(--accent); }
.entry-close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.entry-close:active { transform: scale(0.97); }

/* Photo with archival corner mounts (device #4) */
.entry-fig {
  position: relative;
  margin-bottom: clamp(24px, 3vw, 36px);
}
.entry-photo { position: relative; padding: 10px; background: var(--surface); outline: 1.5px solid var(--ink); }
.entry-photo img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--paper-deep);
}
.entry-photo::before, .entry-photo::after {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid var(--ink);
  z-index: 2;
}
.entry-photo::before { top: -7px; left: -7px; border-right: none; border-bottom: none; }
.entry-photo::after { bottom: -7px; right: -7px; border-left: none; border-top: none; }
.entry-fig figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}
.entry-stamp {
  position: absolute;
  top: 16px;
  right: 2px;
  z-index: 3;
  padding: 8px 12px;
  border: 2.5px solid var(--accent);
  border-radius: 3px;
  background: rgba(251, 247, 235, 0.8);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-9deg);
  animation: stamp-in 0.24s var(--ease) both;
  pointer-events: none;
}
.entry:not(.is-saved) .entry-stamp { display: none; }

.entry-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(28px, 4vw, 52px);
  align-items: start;
}
.entry-title {
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 10px;
}
.entry-binomial { font-style: italic; color: var(--muted); margin-bottom: 18px; }
.entry-body { font-size: 17.5px; line-height: 1.65; max-width: 56ch; }
.entry-data {
  display: grid;
  margin-bottom: 24px;
  border-top: var(--rule-soft);
}
.entry-data div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 2px;
  border-bottom: 1px dotted rgba(42, 36, 28, 0.4);
}
.entry-data dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.entry-data dd { font-size: 14.5px; text-align: right; }
.save-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  padding: 14px 20px;
  background: var(--accent);
  color: var(--bone);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  transition: background-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.save-btn:active { transform: scale(0.97); }
.save-btn[aria-pressed="true"] { background: var(--ink); }
.save-btn[aria-pressed="true"] .save-glyph { color: var(--marker); }
.save-glyph { font-size: 18px; }
.save-note {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ————————————————— Responsive ————————————————— */
@media (max-width: 920px) {
  .cover-inner { grid-template-columns: 1fr; gap: 44px; }
  .cover-fig { max-width: 560px; }
  .fn-inner { grid-template-columns: 1fr; }
  .fn-fig { max-width: 340px; }
  .fn-quote br { display: none; }
  /* plates: two-column intermediate ledger */
  .plate,
  .plate:nth-child(even) {
    grid-template-columns: 56px 188px 1fr;
    grid-template-areas:
      "num photo body"
      "num photo side";
  }
  .plate-num .n { font-size: 36px; }
  .plate-photo img { aspect-ratio: 1 / 1; }
  .plate-actions { justify-self: start; align-self: start; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .howto-steps { grid-template-columns: 1fr; }
  .step { border-right: none; border-bottom: var(--rule-soft); padding: 24px 0 20px; }
  .step + .step { padding-left: 0; }
  .fieldkit { grid-template-columns: 1fr; }
  .kit-toggle { justify-content: space-between; }
  .plate,
  .plate:nth-child(even) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "num"
      "photo"
      "body"
      "side";
  }
  .plate-photo img { aspect-ratio: 16 / 10; }
  .plate-actions { justify-self: start; }
  .open-entry { padding-inline: 22px; }
  .stamp { position: static; margin-left: auto; align-self: center; }
  .plate-num { display: flex; align-items: baseline; gap: 10px; }
  .plate-num .n { font-size: 40px; }
  .colo-grid { grid-template-columns: 1fr; }
  .entry { width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none; border: none; margin: 0; }
  .entry-sheet { padding: 20px; }
  .entry-grid { grid-template-columns: 1fr; }
  .seal { top: -34px; left: -14px; }
  .fold-arrow { right: 18px; bottom: -14px; }
}
@media (max-width: 480px) {
  .edition { font-size: 11px; }
  .kit-toggle-count { display: inline-flex; gap: 4px; }
  .plate-data { grid-template-columns: repeat(2, minmax(0, auto)); }
  .fn-quote { font-size: 34px; }
}

/* ————————————————— Hover states (fine pointers only) ————————————————— */
@media (hover: hover) and (pointer: fine) {
  .cta-primary:hover {
    background: var(--accent-deep);
    transform: translateY(-2px);
    box-shadow: 6px 6px 0 var(--ink);
  }
  .cta-text:hover { color: var(--accent); }
  .frontis:hover { transform: rotate(0.4deg); }
  .seal:hover { animation: none; transform: scale(1.05) rotate(4deg); }
  .step:hover .step-num { transform: translateY(-3px) rotate(-4deg); }
  .kit-input:hover { background: var(--input-hover); }
  .kit-toggle:hover { border-color: var(--accent); color: var(--accent); }
  .kit-toggle[aria-pressed="true"]:hover { color: var(--marker); border-color: var(--marker); }
  .plate:hover { background: var(--surface); }
  .plate:hover .plate-num .n { color: var(--accent); }
  .plate:hover .plate-desc { color: var(--ink); }
  .open-entry:hover { background: var(--ink); color: var(--bone); }
  .open-entry:hover .arr { transform: translateX(4px); }
  .empty-reset:hover { background: var(--accent-deep); }
  .entry-close:hover { background: var(--ink); color: var(--bone); }
  .save-btn:hover { background: var(--accent-deep); }
  .save-btn[aria-pressed="true"]:hover { background: #4A4238; }
  .colo-link:hover { color: var(--accent); }
  .colo-mark:hover .colo-star { transform: rotate(90deg) scale(1.15); }
}

/* ————————————————— Reduced motion ————————————————— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .seal { animation: none; }
  .fn-fig { animation: none; }
}
