/* Pendrilo — the site as a printed book.
   Two faces only: EB Garamond (the book) and Courier Prime (the manuscript). */

@font-face { font-family: "Garamond"; src: url(fonts/EBGaramond-Variable.woff) format("woff"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Garamond"; src: url(fonts/EBGaramond-Italic-Variable.woff) format("woff"); font-weight: 400 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url(fonts/CourierPrime-Regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url(fonts/CourierPrime-Italic.woff) format("woff"); font-style: italic; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url(fonts/CourierPrime-Bold.woff) format("woff"); font-weight: 700; font-display: swap; }

:root {
  --paper: #f3eee3;
  --paper-2: #e9e1cf;
  --page: #fbf9f3;
  --ink: #1d1a15;
  --ink-2: #4d463b;
  --ink-3: #7c7364;
  --rule: #cdc2ab;
  --proof: #b8291f;      /* proofreader's red pencil */
  --teal: #2a6764;       /* the app's own accent */
  --gold: #94712a;       /* the icon's gold */
  --shadow: 0 1px 1px rgba(40,30,10,.06), 0 10px 30px -12px rgba(40,30,10,.28);
  --serif: "Garamond", "EB Garamond", Garamond, "Times New Roman", serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --measure: 34rem;
  --wrap: 72rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15130f; --paper-2: #1d1a15; --page: #201d17;
    --ink: #ece4d3; --ink-2: #c4b9a5; --ink-3: #938978; --rule: #3c362c;
    --proof: #e46a5c; --teal: #74b6b0; --gold: #d1a85a;
    --shadow: 0 1px 1px rgba(0,0,0,.3), 0 12px 32px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15130f; --paper-2: #1d1a15; --page: #201d17;
  --ink: #ece4d3; --ink-2: #c4b9a5; --ink-3: #938978; --rule: #3c362c;
  --proof: #e46a5c; --teal: #74b6b0; --gold: #d1a85a;
  --shadow: 0 1px 1px rgba(0,0,0,.3), 0 12px 32px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.25rem/1.55 var(--serif);
  font-variant-numeric: oldstyle-nums; font-kerning: normal;
  text-rendering: optimizeLegibility; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--proof); }
:focus-visible { outline: 2px solid var(--proof); outline-offset: 3px; }
b { font-weight: 600; }
.mono { font-family: var(--mono); font-size: .82em; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; }

/* ── Running head ─────────────────────────────────────── */
.runhead {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 3.25rem;
  display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 1.5rem;
  padding: 0 clamp(1rem, 3vw, 2.25rem);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.runhead.is-scrolled { border-bottom-color: var(--rule); }
.runhead__brand { font-size: 1.45rem; text-decoration: none; letter-spacing: .01em; justify-self: start; }
.runhead__title {
  font-variant: small-caps; font-feature-settings: "c2sc", "smcp"; letter-spacing: .14em;
  font-size: 1rem; color: var(--ink-2); white-space: nowrap; transition: opacity .25s;
}
.runhead__nav { justify-self: end; display: flex; gap: 1.2rem; align-items: center; font-size: 1.05rem; }
.runhead__nav a { text-decoration: none; white-space: nowrap; }
.runhead__nav a:hover { text-decoration: underline; }
.runhead__cta { border: 1px solid var(--ink); padding: .12rem .8rem .2rem; border-radius: 2px; }
.runhead__cta:hover { background: var(--ink); color: var(--paper) !important; text-decoration: none !important; }
.runhead__folio { font-variant-numeric: oldstyle-nums; color: var(--ink-3); min-width: 2.2rem; text-align: right; font-size: 1.05rem; font-style: italic; }

/* ── Sheets: each section is a page of the book ───────── */
.sheet { position: relative; max-width: var(--wrap); margin: 0 auto; padding: clamp(4rem, 9vw, 8rem) clamp(1rem, 4vw, 3rem); }
.sheet + .sheet { border-top: 1px solid var(--rule); }
.smallhead {
  font-weight: 400; font-size: 1.15rem; letter-spacing: .2em; text-transform: lowercase;
  font-variant: small-caps; margin: 0 0 2rem;
}
.smallhead i { letter-spacing: .04em; text-transform: none; font-variant: normal; color: var(--ink-3); }
.minihead { font-weight: 400; font-variant: small-caps; text-transform: lowercase; letter-spacing: .16em; font-size: 1.05rem; margin: 0 0 1rem; }
.fineprint { font-size: 1rem; color: var(--ink-3); font-style: italic; }
.fig { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; color: var(--proof); margin-right: .5em; font-style: normal; }

/* Proofreader's margin note */
.proof {
  font-style: italic; color: var(--proof); font-size: 1.05rem; line-height: 1.25;
  max-width: 13rem; transform: rotate(-2.5deg);
  padding-left: 1.4rem; position: relative;
}
.proof::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 1rem; height: 1px; background: var(--proof);
}

/* ── Title page ───────────────────────────────────────── */
.titlepage {
  min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-top: 6rem;
}
.crop { position: absolute; width: 2rem; height: 2rem; pointer-events: none; }
.crop::before, .crop::after { content: ""; position: absolute; background: var(--ink-3); }
.crop::before { width: 100%; height: 1px; } .crop::after { width: 1px; height: 100%; }
.crop--tl { top: 4.25rem; left: .75rem; } .crop--tl::before { top: 1rem; } .crop--tl::after { left: 1rem; }
.crop--tr { top: 4.25rem; right: .75rem; } .crop--tr::before { top: 1rem; } .crop--tr::after { right: 1rem; }
.crop--bl { bottom: 1rem; left: .75rem; } .crop--bl::before { bottom: 1rem; } .crop--bl::after { left: 1rem; }
.crop--br { bottom: 1rem; right: .75rem; } .crop--br::before { bottom: 1rem; } .crop--br::after { right: 1rem; }

.slug { font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 1.75rem; }
.titlepage h1 {
  font-weight: 400; font-size: clamp(3.2rem, 7vw, 6.4rem); line-height: .94; letter-spacing: -.02em;
  margin: 0 0 2rem;
}
.titlepage h1 em { font-style: italic; color: var(--teal); letter-spacing: -.01em; }
.titlepage h1 br + em { display: inline-block; margin-left: clamp(1rem, 3vw, 2.75rem); }
.lede { font-size: clamp(1.25rem, 1.9vw, 1.5rem); line-height: 1.45; max-width: 32rem; margin: 0 0 2rem; color: var(--ink-2); }
.lede b { color: var(--ink); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-size: 1.15rem;
  padding: .55rem 1.35rem .65rem; border-radius: 2px; text-decoration: none; cursor: pointer; border: 1px solid var(--ink);
  transition: transform .15s, background .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--teal); border-color: var(--teal); color: var(--paper); }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { background: var(--paper-2); color: var(--ink); }
.btn--proof { background: var(--proof); border-color: var(--proof); color: #fff; }
.btn--proof:hover { filter: brightness(1.08); color: #fff; }
.titlepage .fineprint { max-width: 28rem; }

/* The galley wipe */
.galley { margin: 0; }
.galley__stage {
  position: relative; aspect-ratio: 5 / 6.4; max-height: 78svh; margin-left: auto;
  background: var(--page); box-shadow: var(--shadow); overflow: hidden; touch-action: pan-y;
  user-select: none; -webkit-user-select: none; cursor: ew-resize;
  container-type: inline-size;
}
.galley__layer { position: absolute; inset: 0; padding: 11cqw 11cqw 8cqw; overflow: hidden; }
.galley__ms {
  font-family: var(--mono); font-size: 2.85cqw; line-height: 2; color: #2b2721;
  background: #fffefb;
}
[data-theme="dark"] .galley__ms, :root:not([data-theme="light"]) .galley__ms { color: #2b2721; }
.galley__ms p { margin: 0; text-indent: 3.5em; }
.ms__head { display: flex; justify-content: flex-end; gap: 1.5em; margin-bottom: 2.5em; font-size: .92em; }

.galley__ms .ms__chap { text-align: center; text-indent: 0; margin: 0 0 1.2em; }
.galley__ms .ms__break { text-align: center; text-indent: 0; }
.galley__ms u { text-decoration-thickness: 1px; text-underline-offset: 2px; }

.galley__book {
  background: #fdfbf6; color: #1c1915;
  font-size: 3.15cqw; line-height: 1.38; text-align: justify; hyphens: auto; -webkit-hyphens: auto;
  font-variant-numeric: oldstyle-nums;
  clip-path: inset(0 0 0 var(--cut, 58%));
  display: flex; flex-direction: column;
  border-left: 0;
}
.galley__book p { margin: 0; text-indent: 1.4em; }
.bk__orn { text-align: center; font-size: 1.6em; color: #4a4339; margin: 1.2em 0 .2em; }
.galley__book .bk__num { text-align: center; text-indent: 0; font-variant: small-caps; text-transform: lowercase; letter-spacing: .22em; font-size: .9em; }
.galley__book .bk__title { text-align: center; text-indent: 0; font-size: 1.7em; font-style: italic; margin: .1em 0 1.6em; }
.galley__book .bk__first { text-indent: 0; }
.drop { float: left; font-size: 3.65em; line-height: .8; padding: .06em .08em 0 0; margin-top: .02em; }
.sc { font-variant: small-caps; text-transform: lowercase; letter-spacing: .06em; }
.galley__book .bk__break { text-align: center; text-indent: 0; margin: .5em 0; color: #4a4339; }
.galley__book .bk__noindent { text-indent: 0; }
.galley__book .bk__folio { margin-top: auto; text-align: center; text-indent: 0; font-size: .85em; color: #5d5548; }
.galley__rule {
  position: absolute; top: 0; bottom: 0; left: var(--cut, 58%); width: 1px; background: var(--proof); pointer-events: none;
}
.galley__grip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--proof); color: #fff;
  display: grid; place-items: center; font-size: 1.2rem; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.galley__range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.galley__range:focus-visible + * , .galley__stage:has(.galley__range:focus-visible) .galley__grip { outline: 3px solid var(--ink); outline-offset: 3px; }
.galley figcaption {
  display: flex; justify-content: space-between; margin-top: .8rem; font-family: var(--mono); font-size: .74rem;
  letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3);
}
.galley .cap-m { color: var(--proof); }

/* ── Copyright page + contents ────────────────────────── */
.verso { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(2rem, 7vw, 7rem); align-items: end; }
.copyright { font-size: .95rem; line-height: 1.45; color: var(--ink-2); max-width: 21rem; align-self: end; }
.copyright p { margin: 0 0 1em; }
.printline { letter-spacing: .3em; font-variant-numeric: lining-nums; color: var(--ink-3); }
.toc__h { font-weight: 400; font-style: italic; font-size: clamp(2.6rem, 5vw, 3.8rem); margin: 0 0 2rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { border-bottom: 1px solid transparent; }
.toc a { display: flex; align-items: baseline; gap: .6rem; padding: .55rem 0; text-decoration: none; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.toc__n { width: 2.2rem; flex: none; font-variant: small-caps; color: var(--ink-3); letter-spacing: .06em; }
.toc li:first-child .toc__t, .toc li:last-child .toc__t { padding-left: 2.8rem; }
.toc__t i { color: var(--ink-3); }
.toc__lead { flex: 1; border-bottom: 2px dotted var(--rule); transform: translateY(-.3em); min-width: 1rem; }
.toc__p { font-variant-numeric: oldstyle-nums; font-style: italic; color: var(--ink-2); }
.toc a:hover .toc__t { color: var(--proof); }
.toc a:hover .toc__lead { border-color: var(--proof); }

/* ── Note ─────────────────────────────────────────────── */
.note { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.note .smallhead { text-align: center; }
.note__body { max-width: var(--measure); position: relative; }
.note__body p { margin: 0 0 1em; text-align: justify; hyphens: auto; -webkit-hyphens: auto; text-indent: 1.5em; }
.note__body p.has-drop { text-indent: 0; }
.note__body .drop { font-size: 4.2em; color: var(--teal); }
.note__body .proof { position: absolute; right: -16rem; top: 1rem; }

/* ── Part pages ───────────────────────────────────────── */
.partpage { min-height: 88svh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.part__label { font-variant: small-caps; text-transform: lowercase; letter-spacing: .3em; font-size: 1.1rem; color: var(--ink-3); margin: 0 0 1rem; }
.part__title { font-weight: 400; font-size: clamp(4.5rem, 15vw, 12rem); line-height: .85; margin: 0 0 2rem; letter-spacing: -.03em; }
.part__title--sm { font-size: clamp(2.8rem, 7vw, 5.2rem); line-height: 1; letter-spacing: -.015em; font-style: italic; }
.part__epi { font-size: 1.3rem; color: var(--ink-2); max-width: 26rem; margin: 0 0 2.5rem; }
.part__epi::before { content: "— "; } .part__epi::after { content: " —"; }
.part__lede { max-width: 38rem; font-size: 1.3rem; color: var(--ink-2); margin: 0; }
.partpage--dark {
  max-width: none; background: #1d1a15; color: #f3eee3; border-top: 0 !important;
  --ink-2: #cfc6b4; --ink-3: #9d9483;
}
:root[data-theme="dark"] .partpage--dark { background: #0b0a07; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .partpage--dark { background: #0b0a07; } }
.partpage--dark + .sheet { border-top: 0; }
.part__free {
  margin: 2.2rem 0 0; font-family: var(--mono); font-size: .9rem; letter-spacing: .08em; text-transform: uppercase;
  color: #e9b8a8; border: 1px solid currentColor; padding: .45rem 1rem; transform: rotate(-1.5deg);
}
.ledger__head .free { display: block; font-variant: normal; text-transform: none; letter-spacing: 0; font-style: italic; color: var(--proof); font-size: .95rem; }

/* ── Plates with thumb-index tabs ─────────────────────── */
.plates { padding-top: clamp(2rem, 5vw, 4rem); }
.plates__frame { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; align-items: stretch; }
.plate { margin: 0; background: var(--page); box-shadow: var(--shadow); padding: clamp(.75rem, 1.6vw, 1.4rem); display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
.plate__img { border: 1px solid var(--rule); background: var(--paper-2); aspect-ratio: 1440 / 834; overflow: hidden; }
.plate__img img { width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: opacity .25s; }
.plate__img img.is-fading { opacity: 0; }
.plate figcaption { display: grid; grid-template-columns: 7rem minmax(0, 1fr); column-gap: 1.5rem; padding: 0 .4rem .4rem; }
.plate__no { grid-row: span 2; margin: .3rem 0 0; font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--proof); }
.plate__title { margin: 0; font-weight: 400; font-style: italic; font-size: 2rem; line-height: 1.1; }
.plate__text { margin: .3rem 0 0; max-width: 44rem; color: var(--ink-2); }

.thumbs { display: flex; flex-direction: column; gap: 3px; padding-top: 1.5rem; }
.thumb {
  font: inherit; font-size: 1rem; text-align: left; cursor: pointer; border: 0;
  background: var(--paper-2); color: var(--ink-2); padding: .55rem 1rem .6rem .9rem;
  border-radius: 0 6px 6px 0; min-width: 7.5rem; position: relative;
  font-variant: small-caps; text-transform: lowercase; letter-spacing: .1em;
  box-shadow: inset 6px 0 6px -6px rgba(0,0,0,.25);
  transition: background .15s, color .15s, transform .15s;
}
.thumb:hover { color: var(--ink); transform: translateX(3px); }
.thumb[aria-selected="true"] { background: var(--teal); color: var(--paper); box-shadow: none; transform: translateX(4px); }
.thumb b { font-weight: 400; font-family: var(--mono); font-size: .72rem; letter-spacing: 0; text-transform: none; opacity: .65; margin-right: .5rem; font-variant: normal; }

/* ── Index ────────────────────────────────────────────── */
.bookindex__intro { max-width: var(--measure); color: var(--ink-2); margin: -1rem 0 2.5rem; font-style: italic; }
.idx { columns: 3 16rem; column-gap: 3rem; column-rule: 1px solid var(--rule); font-size: 1.08rem; line-height: 1.35; }
.idx__group { break-inside: avoid; margin-bottom: 1.1rem; }
.idx__letter { margin: 0 0 .25rem; font-size: 1.5rem; font-weight: 500; color: var(--teal); }
.idx p:not(.idx__letter) { margin: 0 0 .2rem; padding-left: 1.2em; text-indent: -1.2em; }
.idx i { color: var(--ink-3); }

/* ── Spread ───────────────────────────────────────────── */
.spread { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.spread__fig { margin: 0; }
.spread__fig img { box-shadow: var(--shadow); background: #fff; }
.spread__fig figcaption { margin-top: 1rem; font-style: italic; color: var(--ink-2); }
.bignum { font-size: clamp(6rem, 13vw, 11rem); line-height: .8; margin: 0 0 1rem; color: var(--teal); font-variant-numeric: lining-nums; letter-spacing: -.04em; }
.bignum__cap { margin: 0 0 2rem; color: var(--ink-2); font-size: 1.12rem; }

/* ── Specimens ────────────────────────────────────────── */
.specimen__intro { color: var(--ink-2); font-style: italic; margin: -1rem 0 2.5rem; }
.specimen__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); }
.spec { margin: 0; grid-column: span 2; display: flex; flex-direction: column; }
.spec--wide { grid-column: span 3; }
.spec--tall { grid-column: span 3; }
.spec:nth-child(n+6) { grid-column: span 3; }
.zoom { all: unset; cursor: zoom-in; display: block; background: #fff; box-shadow: var(--shadow); overflow: hidden; flex: 1; }
.zoom:focus-visible { outline: 2px solid var(--proof); outline-offset: 3px; }
.zoom img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .4s; }
.spec--tall .zoom { aspect-ratio: 4 / 3; }
.spec--tall .zoom img { object-position: center 20%; }
.zoom:hover img { transform: scale(1.03); }
.spec figcaption { margin-top: .6rem; font-size: 1rem; color: var(--ink-2); }

.lightbox { border: 0; padding: 1rem; background: var(--page); color: var(--ink); max-width: min(96vw, 1400px); max-height: 94vh; box-shadow: var(--shadow); }
.lightbox::backdrop { background: rgba(20,16,10,.72); }
.lightbox img { max-height: 80vh; width: auto; margin: 0 auto; }
.lightbox p { text-align: center; font-style: italic; margin: .6rem 0 0; }
.lightbox__x { position: absolute; top: .2rem; right: .6rem; font: 2rem/1 var(--serif); background: none; border: 0; color: var(--ink); cursor: pointer; }

/* ── Press: calculator + list ─────────────────────────── */
.press { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.press__calc > p { color: var(--ink-2); max-width: var(--measure); }
.calc { margin-top: 1.5rem; background: var(--page); box-shadow: var(--shadow); padding: 1.5rem 1.6rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 2rem; }
.calc__row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) 3.5rem; align-items: center; gap: 1rem; grid-column: 1; }
.calc__lbl { font-variant: small-caps; text-transform: lowercase; letter-spacing: .12em; color: var(--ink-3); font-size: 1rem; }
.calc__val { font-family: var(--mono); font-size: 1rem; text-align: right; }
.calc input[type=range] { width: 100%; accent-color: var(--teal); }
.calc select { font: inherit; font-size: 1.05rem; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); padding: .2rem .5rem; border-radius: 2px; justify-self: start; }
.calc__res { grid-column: 1; display: flex; gap: 2.5rem; margin: .5rem 0 0; }
.calc__res dt { font-variant: small-caps; text-transform: lowercase; letter-spacing: .12em; color: var(--ink-3); font-size: .95rem; }
.calc__res dd { margin: 0; font-size: 2.4rem; line-height: 1.1; font-variant-numeric: lining-nums; color: var(--teal); }
.calc__note { grid-column: 1 / -1; margin: 0; font-size: .95rem; font-style: italic; color: var(--ink-3); }
.bookblock { grid-column: 2; grid-row: 1 / span 3; display: flex; align-items: center; justify-content: center; width: 5rem; }
.bookblock__spine {
  height: 11rem; width: 1.5rem; background: linear-gradient(90deg, #2c2620, #4a3f33 40%, #2c2620);
  border-radius: 2px; box-shadow: 0 6px 14px -6px rgba(0,0,0,.5); display: grid; place-items: center; transition: width .2s;
  overflow: hidden;
}
.bookblock__spine span { writing-mode: vertical-rl; color: #e8d9b2; font-size: .62rem; letter-spacing: .18em; white-space: nowrap; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { padding: .55rem 0 .55rem 2rem; border-bottom: 1px solid var(--rule); position: relative; font-size: 1.12rem; }
.ticks li::before { content: "✓"; position: absolute; left: .2rem; top: .5rem; color: var(--proof); font-size: 1.05rem; transform: rotate(-6deg); }

/* ── Which one: ledger ────────────────────────────────── */
.which { text-align: left; }
.which__lede { max-width: 40rem; font-size: 1.3rem; color: var(--ink-2); margin: 0 0 3rem; }
.ledger { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); max-width: 52rem; }
.ledger__row { display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem 7.5rem; align-items: center; border-bottom: 1px solid var(--rule); padding: .55rem 0; }
.ledger__row:last-child { border-bottom: 0; }
.ledger__head { font-variant: small-caps; text-transform: lowercase; letter-spacing: .14em; color: var(--ink-3); font-size: 1rem; border-bottom: 1px solid var(--ink); }
.ledger__row > span:not(:first-child) { text-align: center; }
.ledger .y { color: var(--teal); font-size: 1.3rem; }
.ledger .n { color: var(--ink-3); }
.ledger__row:hover { background: color-mix(in srgb, var(--paper-2) 60%, transparent); }
.which__pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; max-width: 58rem; margin-top: 2rem; color: var(--ink-2); }
.which__pick p { margin: 0; }

/* ── Maps (Part Three) ────────────────────────────────── */
.partpage--map {
  max-width: none; background: #e7dcc3; border-top: 0 !important;
  background-image: radial-gradient(ellipse at center, transparent 55%, rgba(120,90,40,.12) 100%);
}
:root[data-theme="dark"] .partpage--map { background-color: #1b1811; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .partpage--map { background-color: #1b1811; } }
.partpage--map .part__free { color: var(--proof); }
.partpage--map .part__title { margin-bottom: 2.9rem; } /* room for the p's descender */
.partpage--map + .sheet { border-top: 0; }
.mapfig { margin: 0; }
.mapfig .zoom { background: #fff; }
.mapfig .zoom img { height: auto; object-fit: contain; }
.mapfig figcaption { margin-top: .7rem; font-size: 1rem; font-style: italic; color: var(--ink-2); }
.chartroom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5.5rem); align-items: center; }
.chartroom__fig { max-width: 30rem; justify-self: end; width: 100%; }
.chartroom__side > p:not(.bignum):not(.bignum__cap) { margin: 0 0 1em; max-width: var(--measure); text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.chartroom__side .has-drop .drop { font-size: 4.2em; color: var(--teal); }
.chartroom__side .bignum { margin-top: 2.2rem; }
.chartroom__side .bignum__cap { max-width: 26rem; }
.looks__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.94fr); gap: clamp(1rem, 2.5vw, 2rem); align-items: start; }
.looks__notes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 5rem); margin-top: clamp(2.5rem, 5vw, 4rem); align-items: start; }
.looks__list { margin: 0; }
.looks__list > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.looks__list > div:first-child { border-top: 2px solid var(--ink); }
.looks__list dt { font-style: italic; font-size: 1.35rem; line-height: 1.2; color: var(--teal); }
.looks__list dd { margin: 0; color: var(--ink-2); font-size: 1.1rem; }

/* How the map gets into the book */
.route { list-style: none; margin: 0 0 3rem; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; max-width: 58rem; }
.route li { border-top: 2px solid var(--ink); padding-top: .7rem; color: var(--ink-2); font-size: 1.1rem; line-height: 1.4; position: relative; }
.route li + li::before { content: "→"; position: absolute; left: -1.2rem; top: -.95rem; color: var(--proof); font-size: 1.1rem; background: var(--paper); padding: 0 .1rem; }
.route b { color: var(--ink); font-weight: 500; }
.route__n { display: block; font-style: italic; font-size: 2.2rem; line-height: 1; color: var(--teal); margin-bottom: .3rem; font-variant-numeric: oldstyle-nums; }
.ledger--3 { max-width: 58rem; }
.ledger--3 .ledger__row { grid-template-columns: minmax(0, 1fr) 7rem 7rem 7rem; }

/* ── Audiobook Studio (Part Four) ─────────────────────── */
.partpage--booth {
  max-width: none; background: #1f3533; color: #eef0e8; border-top: 0 !important;
  --ink-2: #c9d3cc; --ink-3: #93a39d;
  background-image: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.28) 100%);
}
:root[data-theme="dark"] .partpage--booth { background-color: #0f1a19; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .partpage--booth { background-color: #0f1a19; } }
.partpage--booth .part__title { font-size: clamp(3.6rem, 11vw, 9rem); }
.partpage--booth .part__free { color: #f0b9a9; }
.partpage--booth + .sheet { border-top: 0; }
.booth__fig { margin: 0; }
.booth__fig img { box-shadow: var(--shadow); border: 1px solid var(--rule); background: #fff; }
.booth__fig figcaption { margin-top: 1rem; font-style: italic; color: var(--ink-2); }
.booth__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 2rem; }
.booth__steps li { border-top: 2px solid var(--ink); padding-top: .8rem; color: var(--ink-2); font-size: 1.12rem; line-height: 1.45; }
.booth__steps h3 { font-weight: 500; font-size: 1.35rem; color: var(--ink); margin: 0 0 .5rem; }
.booth__steps .route__n { margin-bottom: .4rem; }
.booth__keys { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.booth__keys > div > p { color: var(--ink-2); max-width: var(--measure); }
.keys { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); margin: 0; }
.keys > div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.keys > div:last-child { border-bottom: 0; }
.keys dt { font-family: var(--mono); font-size: .95rem; }
.keys dd { margin: 0; color: var(--ink-2); font-size: 1.1rem; }
.acx { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; margin: 3.5rem 0 1rem; border-top: 1px solid var(--rule); padding-top: 2rem; }
.acx p { margin: 0; }
.acx__n { font-size: clamp(2.4rem, 4.6vw, 3.4rem); line-height: 1; color: var(--teal); font-variant-numeric: lining-nums; letter-spacing: -.02em; }
.acx__c { color: var(--ink-2); font-size: 1.05rem; margin-top: .4rem !important; }
@media (max-width: 960px) {
  .booth__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .booth__keys { grid-template-columns: minmax(0, 1fr); }
  .acx { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .booth__steps, .acx { grid-template-columns: minmax(0, 1fr); }
  .keys > div { grid-template-columns: 6.5rem minmax(0, 1fr); }
}

/* ── Cover Wrap (Part Four) ───────────────────────────── */
.partpage--wrap {
  max-width: none; background: #4a1f29; color: #f6ead8; border-top: 0 !important;
  --ink-2: #e2cfc0; --ink-3: #b99a8f;
  background-image: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.25) 100%);
}
:root[data-theme="dark"] .partpage--wrap { background-color: #2a1117; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .partpage--wrap { background-color: #2a1117; } }
.partpage--wrap + .sheet { border-top: 0; }
.partpage--wrap .part__free { color: #f3c98b; }
.part__icon { width: 96px; height: 96px; margin: 0 0 1.5rem; }
@media (min-width: 961px) { .spread:has(.wrap__fig) { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }
.wrap__steps { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 1.1rem; }
.wrap__steps li { border-top: 2px solid var(--ink); padding-top: .6rem; color: var(--ink-2); font-size: 1.08rem; line-height: 1.42; }
.wrap__steps b { color: var(--ink); font-weight: 500; }
.wrap__steps .route__n { font-size: 1.8rem; }

/* ── Panelhouse (Part Five) and Type (Part Six) ───────── */
.partpage--panel {
  max-width: none; background: #1c2246; color: #f4efe2; border-top: 0 !important;
  --ink-2: #d3d2e0; --ink-3: #a09fbd;
  background-image: radial-gradient(circle, rgba(255,255,255,.07) 1.2px, transparent 1.6px), radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.3) 100%);
  background-size: 14px 14px, auto;
}
:root[data-theme="dark"] .partpage--panel { background-color: #10132b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .partpage--panel { background-color: #10132b; } }
.partpage--panel + .sheet { border-top: 0; }
.partpage--panel .part__free { color: #f5d77a; }
.partpage--type {
  max-width: none; background: #eef0ea; border-top: 0 !important;
  background-image: repeating-linear-gradient(transparent 0 2.6rem, rgba(70,110,160,.16) 2.6rem calc(2.6rem + 1px));
}
:root[data-theme="dark"] .partpage--type { background-color: #15191b; background-image: repeating-linear-gradient(transparent 0 2.6rem, rgba(140,170,210,.12) 2.6rem calc(2.6rem + 1px)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .partpage--type { background-color: #15191b; background-image: repeating-linear-gradient(transparent 0 2.6rem, rgba(140,170,210,.12) 2.6rem calc(2.6rem + 1px)); } }
.partpage--type .part__title { margin-bottom: 2.9rem; } /* room for the y's and p's descenders */
.partpage--type + .sheet { border-top: 0; }
.partpage--type .part__free { color: var(--teal); }
.shot__fig { margin: 0; }
.shot__fig img { box-shadow: var(--shadow); border: 1px solid var(--rule); background: #fff; }
.shot__fig figcaption { margin-top: 1rem; font-style: italic; color: var(--ink-2); }
@media (min-width: 961px) { .spread:has(.shot__fig) { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }
@media (max-width: 1100px) { .runhead__nav { gap: .85rem; font-size: 1rem; } }
/* Nine links no longer fit one line below this; the contents page lists every Part. */
@media (max-width: 860px) { .runhead__nav a:not(.runhead__cta) { display: none; } }

/* ── Galley copies ────────────────────────────────────── */
.galleycopy { display: flex; justify-content: center; }
.arc {
  position: relative; width: min(100%, 44rem); background: var(--page); box-shadow: var(--shadow);
  padding: clamp(2rem, 5vw, 4rem); border: 1px solid var(--rule);
  background-image: repeating-linear-gradient(transparent 0 2.1rem, color-mix(in srgb, var(--rule) 30%, transparent) 2.1rem calc(2.1rem + 1px));
}
.arc > p { color: var(--ink-2); max-width: 32rem; }
.stamp {
  position: absolute; top: 1.6rem; right: 1.4rem; transform: rotate(9deg);
  border: 3px double var(--proof); color: var(--proof); padding: .4rem .8rem .5rem; text-align: center;
  font-family: var(--mono); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .95rem; line-height: 1.15;
  opacity: .85; mix-blend-mode: multiply;
}
:root[data-theme="dark"] .stamp { mix-blend-mode: normal; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stamp { mix-blend-mode: normal; } }
.stamp small { display: block; font-size: .65rem; letter-spacing: .2em; margin-top: .2rem; border-top: 1px solid var(--proof); padding-top: .2rem; }
.arc__form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; margin-top: 2rem; }
.field { display: grid; gap: .3rem; }
.field:first-of-type { grid-column: 1 / -1; }
.field span { font-variant: small-caps; text-transform: lowercase; letter-spacing: .12em; color: var(--ink-3); font-size: .95rem; }
.field input, .field select {
  font: inherit; font-size: 1.15rem; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--ink-3); padding: .3rem 0; border-radius: 0; width: 100%;
}
.field select option { background: var(--page); color: var(--ink); }
.field input:focus, .field select:focus { outline: none; border-bottom: 2px solid var(--proof); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.arc__form .btn { grid-column: 1 / -1; justify-self: start; margin-top: .6rem; }
.form__msg { grid-column: 1 / -1; margin: 0; min-height: 1.4em; font-style: italic; }
.form__msg.ok { color: var(--teal); } .form__msg.err { color: var(--proof); }
.arc__form .fineprint { grid-column: 1 / -1; margin: 0; }
.arc__download { margin-top: 1.5rem; }

/* ── Colophon ─────────────────────────────────────────── */
.colophon { text-align: center; padding-bottom: 4rem; }
.colophon p { max-width: 30rem; margin: 0 auto 1rem; color: var(--ink-2); font-size: 1.05rem; }
.colophon__orn { font-size: 2rem; color: var(--ink-3); }
.colophon__links { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.6rem; margin: 2rem 0; font-size: 1.05rem; }
.colophon__c { font-size: .95rem !important; color: var(--ink-3) !important; font-variant-numeric: lining-nums; }

/* ── Reveal on scroll ─────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ── Narrower screens ─────────────────────────────────── */
@media (max-width: 1240px) {
  .runhead__title { display: none; }
  .runhead { grid-template-columns: auto 1fr auto; }
  .note__body .proof { position: static; margin: 1.5rem 0 0 auto; }
}
@media (max-width: 960px) {
  .runhead__title { display: none; }
  .runhead { grid-template-columns: auto 1fr auto; }
  .titlepage { grid-template-columns: minmax(0, 1fr); padding-top: 5.5rem; min-height: 0; }
  .galley__stage { margin: 0 auto; max-height: none; width: min(100%, 30rem); }
  .verso { grid-template-columns: minmax(0, 1fr); }
  .copyright { order: 2; }
  .spread, .press { grid-template-columns: minmax(0, 1fr); }
  .plates__frame { grid-template-columns: minmax(0, 1fr); }
  .thumbs { flex-direction: row; overflow-x: auto; padding: 0 0 .2rem; order: -1; gap: 3px; scrollbar-width: none; }
  .thumbs::-webkit-scrollbar { display: none; }
  .thumb { border-radius: 6px 6px 0 0; min-width: auto; white-space: nowrap; box-shadow: inset 0 -6px 6px -6px rgba(0,0,0,.25); }
  .thumb:hover, .thumb[aria-selected="true"] { transform: translateY(-2px); }
  .specimen__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec, .spec--wide, .spec--tall, .spec:nth-child(n+6) { grid-column: span 1; }
  .spec--wide { grid-column: 1 / -1; }
  .chartroom { grid-template-columns: minmax(0, 1fr); }
  .chartroom__fig { justify-self: center; max-width: 26rem; }
  .looks__notes { grid-template-columns: minmax(0, 1fr); }
  .which__pick { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 1.15rem; }
  .runhead { gap: .8rem; }
  .runhead__nav a:not(.runhead__cta) { display: none; }
  .runhead__folio { display: none; }
  .runhead { grid-template-columns: 1fr auto; }
  .crop { display: none; }
  .titlepage h1 br + em { margin-left: 0; }
  .plate figcaption { grid-template-columns: minmax(0, 1fr); }
  .plate__no { grid-row: auto; }
  .ledger__row { grid-template-columns: minmax(0, 1fr) 4.6rem 4.6rem; font-size: 1.02rem; }
  .ledger__head { font-size: .85rem; letter-spacing: .06em; }
  .ledger--3 .ledger__row { grid-template-columns: minmax(0, 1fr) 3.9rem 3.4rem 3.2rem; font-size: 1rem; }
  .ledger--3 .ledger__head { font-size: .78rem; letter-spacing: .03em; }
  .looks__grid { grid-template-columns: minmax(0, 1fr); }
  .looks__grid .mapfig:first-child { max-width: 22rem; }
  .looks__list > div { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .route { grid-template-columns: minmax(0, 1fr); }
  .route li + li::before { content: none; }
  .which__pick, .arc__form { grid-template-columns: minmax(0, 1fr); }
  .stamp { position: static; display: inline-block; margin-bottom: 1.2rem; transform: rotate(-4deg); }
  .calc { grid-template-columns: minmax(0, 1fr); padding: 1.2rem; }
  .calc__row { grid-template-columns: 3.8rem minmax(0, 1fr) 3rem; gap: .6rem; }
  .bookblock { display: none; }
  .specimen__grid { grid-template-columns: minmax(0, 1fr); }
  .spec--wide { grid-column: auto; }
  .proof { transform: rotate(-1.5deg); }
  .toc li:first-child .toc__t, .toc li:last-child .toc__t { padding-left: 2.8rem; }
}
