/* Open Margins: a Victorian literary magazine. The frame (wrapper, running head,
   rules, contents) carries the period; the reading column stays plain book
   type. Old Standard TT throughout, black ink, a buff wrapper, no colour
   accent. Square corners and hairlines everywhere. */

@font-face {
  font-family: "Old Standard";
  src: url("fonts/old-standard-tt-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Old Standard";
  src: url("fonts/old-standard-tt-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Old Standard";
  src: url("fonts/old-standard-tt-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
/* The dagger lives in the latin-ext file; load it for that glyph only. */
@font-face {
  font-family: "Old Standard";
  src: url("fonts/old-standard-tt-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+2020;
}
@font-face {
  font-family: "Old Standard";
  src: url("fonts/old-standard-tt-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
  unicode-range: U+2020;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

/* ----- Theme ----- */
:root {
  --ground: #f3f2ee;      /* newsprint: neutral, not cream */
  --wrapper: #d6c69f;     /* the magazine's buff wrapper */
  --wrapper-ink: #1c1913;
  --ink: #1c1a17;
  --muted: #5d584e;
  --hair: #1c1a17;        /* rules are printed in ink */
  --faint: #c9c4b8;
  --mark: #e6dcc2;        /* highlight: a wash of wrapper buff */
  --shadow: rgba(28, 26, 23, .16);
  --page-edge: #efe6d1;
  --page-leaf: #d7cab0;
  --wrapper-buff: var(--wrapper);
  --newsprint: var(--ground);
  --buff-wash: var(--mark);
  --faint-rule: var(--faint);
  --muted-ink: var(--muted);
  --frame: "Old Standard", "Old Standard TT", "Century Schoolbook", "New Century Schoolbook", Georgia, serif;
  --font: var(--frame);
  --scale: 1;
  --measure: 36em;
  color-scheme: light;
}
/* Dark is a lamplit umber, not black. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #2b2823;
    --wrapper: #4a3f2b;
    --wrapper-ink: #efe6d1;
    --ink: #e7e1d4;
    --muted: #b2a995;
    --hair: #cfc6b2;
    --faint: #57514a;
    --mark: #4a4232;
    --shadow: rgba(0, 0, 0, .4);
    --page-edge: #cdc2aa;
    --page-leaf: #aba087;
    --wrapper-buff: var(--wrapper);
    --newsprint: var(--ground);
    --buff-wash: var(--mark);
    --faint-rule: var(--faint);
    --muted-ink: var(--muted);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #2b2823;
  --wrapper: #4a3f2b;
  --wrapper-ink: #efe6d1;
  --ink: #e7e1d4;
  --muted: #b2a995;
  --hair: #cfc6b2;
  --faint: #57514a;
  --mark: #4a4232;
  --shadow: rgba(0, 0, 0, .4);
  --page-edge: #cdc2aa;
  --page-leaf: #aba087;
  --wrapper-buff: var(--wrapper);
  --newsprint: var(--ground);
  --buff-wash: var(--mark);
  --faint-rule: var(--faint);
  --muted-ink: var(--muted);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 3.5rem;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--frame);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-kerning: normal;
}
::selection { background: var(--wrapper); color: var(--wrapper-ink); }
a { color: inherit; text-decoration-color: var(--faint); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.bar :focus-visible { outline-color: var(--wrapper-ink); }
h1, h2, h3 { font-weight: 700; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Thick-thin rule: the periodical's border between wrapper and page. */
.rule-double { height: 5px; border-top: 3px solid var(--hair); border-bottom: 1px solid var(--hair); }

/* ----- Running head (every page) ----- */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--wrapper);
  color: var(--wrapper-ink);
}
.bar-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.25rem;
  padding: .45rem 16px .4rem;
  font-size: .85rem;
  line-height: 1.3;
}
.bar .rule-double { border-color: var(--wrapper-ink); }
.bar-title {
  font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; font-size: .9rem;
}
.running { letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.running a { text-decoration: none; }
.running a:hover { text-decoration: underline; }
.running .sep { margin: 0 .5em; opacity: .55; }
.bar-spacer { flex: 1; }
.layers { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem 1rem; }
.layers label { cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; }
/* Each layer toggle is its printer's mark in a square box: filled when the
   layer shows, hollow with the name struck through when it is off. */
.layers input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.layers .ref {
  display: inline-grid; place-items: center;
  width: 1.15rem; height: 1.15rem;
  border: 1px solid var(--wrapper-ink);
  font-weight: 700; font-size: .85rem; line-height: 1;
  background: var(--wrapper-ink); color: var(--wrapper);
}
.layers label:has(input:not(:checked)) .ref { background: none; color: var(--wrapper-ink); }
.layers label:has(input:not(:checked)) .name { text-decoration: line-through; opacity: .6; }
.layers label:has(input:focus-visible) .ref { outline: 1px solid var(--wrapper-ink); outline-offset: 2px; }
.bar-button,
.settings > summary {
  font: inherit; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: inherit; background: none;
  border: 1px solid currentColor; border-radius: 0;
  padding: .15rem .55rem; cursor: pointer; line-height: 1.4;
}
.bar-button:hover, .settings > summary:hover { background: var(--wrapper-ink); color: var(--wrapper); }
.bar-button:focus-visible, .settings > summary:focus-visible { outline: 1px solid var(--wrapper-ink); outline-offset: 2px; }

/* ----- Settings (a printed card, not an app panel) ----- */
.settings { position: relative; }
.settings > summary { list-style: none; }
.settings > summary::-webkit-details-marker { display: none; }
.settings[open] > summary { background: var(--wrapper-ink); color: var(--wrapper); }
.settings-panel {
  position: absolute; right: 0; top: calc(100% + .6rem); z-index: 30;
  width: 18rem; max-width: calc(100vw - 2rem);
  padding: .9rem 1rem .9rem;
  background: var(--ground); color: var(--ink);
  border: 1px solid var(--hair);
  box-shadow: 0 10px 30px var(--shadow);
  font-size: .95rem; text-transform: none; letter-spacing: 0;
}
.settings-panel .row { margin: 0 0 .85rem; }
.settings-panel .label { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.settings-panel output { font-size: .85rem; color: var(--muted); }
.settings-panel .label output { text-transform: none; letter-spacing: 0; font-style: italic; }
.seg { display: flex; border: 1px solid var(--hair); }
.seg label { flex: 1; text-align: center; cursor: pointer; padding: .3rem .5rem; }
.seg label + label { border-left: 1px solid var(--hair); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ink); color: var(--ground); }
.seg label:has(input:focus-visible) { outline: 1px solid var(--ink); outline-offset: 2px; }
.settings-panel select {
  width: 100%; font: inherit; color: inherit; border: 1px solid var(--hair); border-radius: 0;
  padding: .25rem 1.8rem .25rem .5rem;
  -webkit-appearance: none; appearance: none;
  /* a small drawn caret: two hairlines */
  background:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%, var(--ink) calc(50% + 1px), transparent calc(50% + 1px)) right .85rem center / 6px 6px no-repeat,
    linear-gradient(-45deg, transparent 50%, var(--ink) 50%, var(--ink) calc(50% + 1px), transparent calc(50% + 1px)) right .5rem center / 6px 6px no-repeat,
    var(--ground);
}
.stepper { display: flex; align-items: center; gap: .6rem; }
.stepper button { font: inherit; color: inherit; background: none; border: 1px solid var(--hair); border-radius: 0; width: 2.6rem; cursor: pointer; }
.stepper button:hover:not(:disabled) { background: var(--ink); color: var(--ground); }
.stepper button:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper output { min-width: 3rem; text-align: center; color: var(--ink); }
.settings-panel input[type=range] { width: 100%; margin: .4rem 0 .2rem; -webkit-appearance: none; appearance: none; background: none; height: 14px; }
.settings-panel input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--hair); }
.settings-panel input[type=range]::-moz-range-track { height: 1px; background: var(--hair); }
.settings-panel input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -6px; background: var(--ink); border: 0; border-radius: 0; }
.settings-panel input[type=range]::-moz-range-thumb { width: 12px; height: 12px; background: var(--ink); border: 0; border-radius: 0; }
.settings-panel input[type=range]:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.settings-panel .hint { color: var(--muted); font-size: .85rem; line-height: 1.4; margin: .35rem 0 0; font-style: italic; }
.settings-panel [data-prefs-reset] { font: inherit; font-size: .85rem; color: var(--muted); background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-color: var(--faint); cursor: pointer; }

/* ----- Logo: the overlapping O-and-M monogram, drawn in the current text colour ----- */
.logo {
  display: inline-block; width: 1em; height: 1em; flex: none;
  background: currentColor;
  -webkit-mask: url("brand/mark.svg") center / contain no-repeat;
          mask: url("brand/mark.svg") center / contain no-repeat;
}
.bar-title { display: inline-flex; align-items: center; gap: .45rem; }
.bar-title .logo { width: 1.45rem; height: 1.45rem; }

/* ----- Home: the library's opening spread ----- */
/* Class names here are deliberately specific: some extensions inject global
   CSS for generic names (Curius ships PDF.js's ".spread { white-space:
   nowrap }"), which broke this layout. */
/* A frontispiece faces a title page across one gutter. Buff appears only as
   the mount of each plate, so nothing butts against the page edge. */
.home-top { max-width: 72rem; margin: 0 auto; padding: .9rem 24px 0; text-align: right; }
.text-button {
  font: inherit; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; padding: .2rem 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: .3em;
}
.text-button:hover { color: var(--ink); text-decoration-color: currentColor; }

.home-spread {
  box-sizing: border-box; width: 100%; max-width: 72rem; margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem) 24px clamp(3rem, 6vw, 5rem);
  display: flex; align-items: center; justify-content: center;
}
.plate { margin: 0; }
.plate-mount {
  display: block;
  background: var(--wrapper);
  padding: clamp(12px, 1.8vw, 24px);
  box-shadow: 0 18px 40px -22px var(--shadow);
}
.plate-mount img { display: block; width: 100%; height: auto; border: 1px solid var(--wrapper-ink); }
.plate figcaption { font-size: .88rem; color: var(--muted); margin-top: .7rem; line-height: 1.4; }
.plate-no { font-variant: small-caps; letter-spacing: .06em; color: var(--ink); margin-right: .25em; }

.plate-front {
  /* Width follows the viewport height so the tall painting fits on screen:
     image ratio 520:968, plus the mount's padding. */
  flex: 0 0 auto; width: min(40%, calc(min(72vh, 780px) * .537 + 48px));
  margin-right: clamp(1.5rem, 4vw, 3.5rem); text-align: center;
}
.title-page {
  flex: 1 1 0; min-width: 0; max-width: 38rem;
  border-left: 1px solid var(--faint);
  padding: 1rem 0 1rem clamp(1.5rem, 5vw, 4.5rem);
  text-align: center;
}
.logo-title { width: 4.25rem; height: 4.25rem; color: var(--ink); }
.wordmark {
  font-size: clamp(2.6rem, 9vw, 4.6rem);
  letter-spacing: .16em; margin-right: -.16em; /* recentre tracked caps */
  text-transform: uppercase; line-height: 1; margin-top: .9rem;
}
.title-page .subtitle { font-style: italic; font-size: 1.2rem; margin: .7rem 0 1.4rem; }
.title-page .rule-double { max-width: 22rem; margin: 0 auto; }
.title-page .lede { width: 100%; max-width: 30rem; margin: 1.6rem auto 0; font-size: 1.12rem; line-height: 1.6; text-align: left; }
.contents-head {
  font-size: .8rem; letter-spacing: .24em; text-transform: uppercase;
  margin: 2.4rem 0 .7rem;
}
.primary-action {
  display: inline-block; margin-top: 1.6rem;
  padding: .6rem 1.4rem .55rem;
  border: 1px solid var(--ink); background: var(--ink); color: var(--ground);
  font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  transition: background .18s cubic-bezier(.16, 1, .3, 1), color .18s cubic-bezier(.16, 1, .3, 1);
}
.primary-action em { text-transform: none; letter-spacing: .02em; font-size: 1.15em; }
.primary-action:hover { background: transparent; color: var(--ink); }
.imprint { margin: 1.4rem 0 0; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Folios share the spread's 72rem measure: a text column beside a plate
   or pull quote, alternating sides down the page. */
.folio {
  box-sizing: border-box; max-width: 72rem; margin: 0 auto; padding: 0 24px 3.5rem;
  display: grid; grid-template-columns: minmax(0, 1fr) min(40%, 27rem);
  grid-template-areas: "head aside" "body aside"; grid-template-rows: auto 1fr;
  column-gap: clamp(2rem, 5vw, 4.5rem);
}
.folio-alt { grid-template-columns: min(40%, 27rem) minmax(0, 1fr); grid-template-areas: "aside head" "aside body"; }
.folio::before {
  content: ""; grid-column: 1 / -1; grid-row: 1; align-self: start;
  border-top: 1px solid var(--hair); margin-top: 0;
}
.folio h2 {
  grid-area: head;
  font-size: .82rem; letter-spacing: .22em; text-transform: uppercase;
  margin: 0 0 1.1rem; padding-top: 2.4rem;
}
.folio-body { grid-area: body; max-width: 38rem; }
.folio-alt .folio-body { justify-self: end; }
.folio-body p { margin: 0 0 .9rem; line-height: 1.6; }
.folio-plate { grid-area: aside; margin: 2.4rem 0 0; text-align: center; }
.folio-plate .plate-mount { padding: clamp(12px, 1.4vw, 18px); }
.folio-quote {
  grid-area: aside; align-self: center; margin: 2.4rem 0 0; padding: 1.4rem 0 0;
  border-top: 3px double var(--ink);
}
.folio-quote p {
  margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.3; font-style: italic;
}
.folio-quote em { font-style: normal; }

/* Reading statistics: three large figures across the spread's full width. */
.folio-figures { display: block; }
.folio-figures::before { display: block; }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem clamp(1.5rem, 4vw, 3.5rem); }
.figure { border-top: 3px double var(--ink); padding-top: .9rem; }
.figure-num { margin: 0 0 .4rem; font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.1; white-space: nowrap; font-variant-numeric: lining-nums; }
.figure-num .arrow { color: var(--muted); font-size: .7em; vertical-align: .12em; margin: 0 .1em; }
.figure-what { margin: 0; line-height: 1.5; }
.figures-source { margin: 1.4rem 0 0; font-size: .82rem; color: var(--muted); line-height: 1.5; max-width: 60rem; }
@media (max-width: 760px) { .figures { grid-template-columns: 1fr; } }

.colophon {
  box-sizing: border-box; max-width: 72rem; margin: 1rem auto 0; padding: 1.4rem 24px 3rem;
  color: var(--muted); font-size: .86rem; text-align: center;
}
.colophon .rule-double { margin-bottom: 1.4rem; }
.colophon .logo { width: 1.6rem; height: 1.6rem; color: var(--ink); margin-bottom: .6rem; }
.colophon p { margin: 0 auto .5rem; max-width: 46rem; }

@media (max-width: 860px) {
  .home-spread { flex-direction: column; gap: 2rem; }
  .title-page { order: -1; flex: none; width: 100%; border-left: 0; padding: 0; }
  .plate-front { width: min(100%, calc(62vh * .537 + 48px)); margin: 0 auto; }
}
@media (max-width: 600px) {
  .book-line { flex-wrap: wrap; row-gap: 0; }
  .book-line .leader { display: none; }
  .book-line .author { flex-basis: 100%; }
}
@media (max-width: 760px) {
  .folio, .folio-alt { grid-template-columns: 1fr; grid-template-areas: "head" "aside" "body"; grid-template-rows: auto; }
  .folio-alt .folio-body { justify-self: start; }
  .folio-plate { max-width: 260px; margin: .5rem auto 1.5rem; }
  .folio-quote { margin: 0 0 1.5rem; }
}

/* ----- Covers: a 3D cloth-bound volume, one --cloth colour per book ----- */
/* Sized in em: set font-size on the cover to scale the whole binding. */
.cover {
  --gilt: #d2b36e;
  --depth: 1.8em;
  --overhang: .12em;
  position: relative; display: block; flex: none;
  width: 10em; height: 15em;
  color: var(--gilt); text-decoration: none; text-align: center;
  transform-style: preserve-3d;
}
.cover::before {
  content: ""; position: absolute; left: -4%; right: -4%; bottom: 0;
  height: calc(var(--depth) + 1.4em);
  transform: translateY(calc(50% + .25em)) rotateX(90deg);
  background: radial-gradient(ellipse at center, var(--shadow) 0%, transparent 72%);
  pointer-events: none;
}
.cover-face {
  position: absolute;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.cover-front {
  inset: 0; padding: .75em;
  background:
    linear-gradient(rgba(0, 0, 0, calc(var(--a, 0) * .16)), rgba(0, 0, 0, calc(var(--a, 0) * .16))),
    linear-gradient(90deg, rgba(0, 0, 0, .28) 0, rgba(0, 0, 0, 0) .55em,
                    rgba(255, 255, 255, .07) .65em, rgba(255, 255, 255, 0) .9em),
    var(--cloth, #2f3b33);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
  transform: translateZ(calc(var(--depth) * .5));
}
.cover-back {
  inset: 0; padding: .75em;
  background:
    linear-gradient(rgba(0, 0, 0, calc(var(--a, 0) * .16)), rgba(0, 0, 0, calc(var(--a, 0) * .16))),
    linear-gradient(270deg, rgba(0, 0, 0, .28) 0, rgba(0, 0, 0, 0) .55em,
                    rgba(255, 255, 255, .06) .65em, rgba(255, 255, 255, 0) .9em),
    var(--cloth, #2f3b33);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28);
  transform: rotateY(180deg) translateZ(calc(var(--depth) * .5));
}
.cover-back::after {
  content: ""; display: block; width: 100%; height: 100%;
  border: .15em double rgba(210, 179, 110, .35);
}
.cover-back-inner {
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, calc(.12 + var(--a, 0) * .16)), rgba(0, 0, 0, calc(.12 + var(--a, 0) * .16))),
    var(--cloth, #2f3b33);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35);
  transform: translateZ(calc(var(--depth) * -.5));
}
.cover-spine {
  top: 0; left: calc(var(--depth) * -.5);
  width: var(--depth); height: 100%; padding: .6em 0;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background:
    linear-gradient(rgba(0, 0, 0, calc(var(--a, 0) * .16)), rgba(0, 0, 0, calc(var(--a, 0) * .16))),
    linear-gradient(90deg, rgba(0, 0, 0, .34) 0, rgba(0, 0, 0, 0) 20%, rgba(255, 255, 255, .1) 36%, rgba(255, 255, 255, 0) 54%, rgba(0, 0, 0, .26) 100%),
    var(--cloth, #2f3b33);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28);
  transform: rotateY(-90deg);
  overflow: hidden;
}
.cover-spine-title, .cover-spine-author {
  writing-mode: vertical-rl; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cover-spine-title {
  font-weight: 700; font-size: .58em; letter-spacing: .05em; text-transform: uppercase;
  flex: 1; margin: .55em 0; max-height: 100%; line-height: 1;
}
.cover-spine-author { font-style: italic; font-size: .5em; flex: none; margin-bottom: .15em; opacity: .9; }
.cover-pages {
  top: var(--overhang);
  left: calc(100% - var(--overhang) - var(--depth) * .5);
  width: var(--depth);
  height: calc(100% - var(--overhang) * 2);
  background:
    linear-gradient(rgba(0, 0, 0, calc(var(--a, 0) * .16)), rgba(0, 0, 0, calc(var(--a, 0) * .16))),
    linear-gradient(90deg, rgba(0, 0, 0, .28) 0, rgba(0, 0, 0, .06) 20%, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, .06) 82%, rgba(0, 0, 0, .24) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .2) 0, rgba(0, 0, 0, 0) 6%, rgba(0, 0, 0, 0) 93%, rgba(0, 0, 0, .22) 100%),
    repeating-linear-gradient(90deg, var(--page-edge) 0 .12em, var(--page-leaf) .12em .18em);
  transform: rotateY(90deg);
}
.cover-top {
  top: calc(var(--overhang) - var(--depth) * .5);
  left: 0;
  width: calc(100% - var(--overhang));
  height: var(--depth);
  background:
    linear-gradient(rgba(0, 0, 0, calc(var(--a, 0) * .16)), rgba(0, 0, 0, calc(var(--a, 0) * .16))),
    linear-gradient(90deg, rgba(0, 0, 0, .18) 0, rgba(0, 0, 0, 0) 6%, rgba(0, 0, 0, 0) 90%, rgba(0, 0, 0, .15) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .2) 0, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0) 80%, rgba(0, 0, 0, .24) 100%),
    repeating-linear-gradient(0deg, var(--page-edge) 0 .12em, var(--page-leaf) .12em .18em);
  transform: rotateX(90deg);
}
.cover-bottom {
  top: calc(100% - var(--overhang) - var(--depth) * .5);
  left: 0;
  width: calc(100% - var(--overhang));
  height: var(--depth);
  background:
    linear-gradient(rgba(0, 0, 0, calc(.14 + var(--a, 0) * .16)), rgba(0, 0, 0, calc(.14 + var(--a, 0) * .16))),
    linear-gradient(90deg, rgba(0, 0, 0, .25) 0, rgba(0, 0, 0, 0) 6%, rgba(0, 0, 0, 0) 90%, rgba(0, 0, 0, .22) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .25) 0, rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0) 82%, rgba(0, 0, 0, .25) 100%),
    repeating-linear-gradient(0deg, var(--page-edge) 0 .12em, var(--page-leaf) .12em .18em);
  transform: rotateX(-90deg);
}
.cover-frame {
  display: flex; flex-direction: column; align-items: center; height: 100%;
  padding: 1.4em .7em 1em; margin-left: .35em;
  border: .2em double var(--gilt);
}
.cover-title {
  font-weight: 700; font-size: 1.45em; line-height: 1.1;
  letter-spacing: .14em; margin-right: -.14em; text-transform: uppercase;
}
.cover-title.xlong { font-size: .86em; letter-spacing: .05em; margin-right: -.05em; line-height: 1.35; }
.cover-title.long { font-size: 1.05em; letter-spacing: .08em; margin-right: -.08em; line-height: 1.25; }
.cover-rule { width: 3.2em; margin: .9em 0 .7em; border-top: .2em double var(--gilt); }
.cover-sub { font-size: .62em; letter-spacing: .24em; text-transform: uppercase; }
.cover-author { margin-top: auto; font-style: italic; font-size: .9em; line-height: 1.2; }
.cover .logo { width: 1.3em; height: 1.3em; margin-top: .8em; opacity: .9; }
a.cover { transition: transform .28s cubic-bezier(.16, 1, .3, 1); }


/* ----- Title page (book) ----- */
.page { max-width: 40rem; margin: 0 auto; padding: 0 16px 4rem; }
.book-frontispiece { text-align: center; margin: 2.4rem 0 0; }
.book-frontispiece .plate-mount { max-width: 100%; }
.book-frontispiece figcaption { max-width: 32rem; margin-left: auto; margin-right: auto; }
.title-block { text-align: center; padding: 3rem 0 2rem; }
.title-block.with-cover {
  display: flex; align-items: center; gap: 2.2rem; text-align: left; padding-bottom: 1rem;
  perspective: 1000px; perspective-origin: 20% -20%;
}
.title-block.with-cover .cover {
  font-size: 15px; transform: rotateY(-20deg);
  transition: transform .3s cubic-bezier(.16, 1, .3, 1);
}
.title-block.with-cover .cover:hover { transform: rotateY(-6deg) translateY(-4px); }
.title-block .blurb { margin: 1.2rem 0 0; font-size: 1.1rem; line-height: 1.55; }
@media (max-width: 600px) {
  .title-block.with-cover { flex-direction: column; text-align: center; gap: 1.6rem; perspective-origin: 50% -10%; }
  .title-block.with-cover .cover { font-size: 13px; }
}
.title-block h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); letter-spacing: .08em; text-transform: uppercase; line-height: 1.05; }
.title-block .by { margin: .8rem 0 0; letter-spacing: .12em; text-transform: uppercase; font-size: .85rem; }
.title-block .by em { text-transform: none; letter-spacing: 0; font-size: 1.05rem; }

.page h2 {
  font-size: .82rem; letter-spacing: .2em; text-transform: uppercase; text-align: center;
  margin: 3rem 0 1rem; padding-bottom: .5rem;
}
.page h2::after { content: ""; display: block; width: 3rem; margin: .5rem auto 0; border-top: 1px solid var(--hair); }
.page p { margin: 0 0 .9rem; }
.page .lede { font-size: 1.15rem; line-height: 1.55; margin-top: 2.4rem; }
.runin { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .82em; margin-right: .35em; }

/* Contents with dotted leaders */
.contents { list-style: none; padding: 0; margin: 0; }
.contents li { display: flex; align-items: baseline; gap: .5rem; padding: .3rem 0; }
.contents .line { display: flex; align-items: baseline; gap: .5rem; width: 100%; }
.contents .leader { flex: 1; border-bottom: 1px dotted var(--muted); transform: translateY(-.3em); min-width: 1.5rem; }
.contents .what a { text-decoration: none; }
.contents .what a:hover, .contents .what a:focus-visible { text-decoration: underline; }
.contents .num { flex: none; width: 3.2rem; text-align: right; padding-right: .7rem; letter-spacing: .04em; }
.contents .status { font-style: italic; color: var(--muted); white-space: nowrap; }
.contents-book li { padding: .55rem 0; flex-direction: column; gap: .15rem; }
.contents-book .title { font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.contents-book .meta { display: block; font-style: italic; color: var(--muted); font-size: .95rem; }
.contents-book .title { text-decoration: none; }
.contents-book .title:hover, .contents-book .title:focus-visible { text-decoration: underline; }

.foot { color: var(--muted); font-size: .88rem; margin-top: 3.5rem; padding-top: .6rem; border-top: 1px solid var(--hair); text-align: center; }

/* Sources page */
.sources .source-list, .sources .cites { list-style: none; padding: 0; margin: 0 0 1rem; }
.sources .source-list li { margin: 0 0 .7rem; }
.sources a { overflow-wrap: anywhere; }
.work { margin: 0 0 1.6rem; }
.work h3 { font-size: 1.05rem; margin: 0; }
.work h3 a { text-decoration: none; }
.work h3 a:hover { text-decoration: underline; }
.work .count { font-weight: 400; font-style: italic; color: var(--muted); font-size: .9rem; margin-left: .3rem; }
.work .about { margin: .15rem 0 .3rem; color: var(--muted); }
.sources details summary { cursor: pointer; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sources details summary:hover, .sources details summary:focus-visible { color: var(--ink); }
.sources details[open] summary { margin-bottom: .6rem; }
.sources .cites li { font-size: .9rem; line-height: 1.45; padding: .3rem 0; border-top: 1px solid var(--faint); }
.sources .where { font-variant: small-caps; letter-spacing: .04em; }

/* ----- Chapter reader ----- */
.reader { position: relative; padding: 2.6rem 16px 4rem; }
.column {
  position: relative; z-index: 1;
  width: min(100%, var(--measure));
  margin: 0 auto;
  font-family: var(--font);
  font-size: calc(1.2rem * var(--scale));
  line-height: 1.62;
}
.chapter-head { text-align: center; margin-bottom: 2rem; font-family: var(--frame); }
.chapter-head h1 { font-size: 1.05em; letter-spacing: .24em; text-transform: uppercase; margin-right: -.24em; }
.chapter-head .rule-short { width: 4.5rem; margin: .9rem auto 0; height: 4px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
/* Book-style paragraphs: indented, no gap; a two-line initial opens the chapter. */
#text p { margin: 0; text-indent: 1.5em; }
#text p:first-child { text-indent: 0; }
#text p:first-child::first-letter {
  float: left; font-family: var(--frame); font-weight: 700;
  font-size: 3.2em; line-height: .8; margin: .07em .04em 0 0;
}
/* Period practice: the rest of the opening line in spaced capitals, so the
   initial reads as part of its word. */
#text p:first-child::first-line { text-transform: uppercase; font-size: .8em; letter-spacing: .05em; }
/* Justified and hyphenated like book type, where lines are long enough. */
@media (min-width: 701px) {
  #text p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
}
/* A quotation set off from the narrative (e.g. Stein's lines of Goethe):
   indented as a block, a size smaller, line breaks kept. */
#text p.extract { margin: .7em 0 .7em 2.5em; text-indent: 0; text-align: left; font-size: .9em; line-height: 1.55; }
#text p.extract:first-child::first-letter { font-size: inherit; float: none; line-height: inherit; padding: 0; margin: 0; font-weight: inherit; }
#text p.extract:first-child::first-line { text-transform: none; font-size: inherit; letter-spacing: normal; }
@media (max-width: 600px) { #text p.extract { margin-left: 1.2em; } }
/* Verse books: every stanza keeps its line breaks, at full size. */
.verse #text p.extract { margin: .9em 0 .9em .6em; font-size: 1em; line-height: 1.6; }
.verse #text p:not(.extract) { margin-top: 2.4em; margin-bottom: .5em; text-indent: 0; font-size: 1.05em; }
@media (max-width: 600px) { .verse #text p.extract { margin-left: .2em; } }
#text .status { text-indent: 0; color: var(--muted); font-style: italic; }

.anchor {
  cursor: pointer;
  hyphens: manual; -webkit-hyphens: manual; /* never split an annotated phrase */
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--muted);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
}
.anchor:hover, .anchor.hover, .anchor:focus-visible { text-decoration-style: solid; text-decoration-color: var(--ink); }
.anchor:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.anchor.active { background: var(--mark); text-decoration-style: solid; text-decoration-color: var(--ink); }

/* Notes are set like a scholarly apparatus: mark, lemma], gloss. */
.note { font-family: var(--font); font-size: calc(.95rem * var(--scale)); line-height: 1.4; text-indent: 0; }
.note .ref { font-family: var(--frame); font-weight: 700; margin-right: .3em; }
.note .term { font-style: italic; }
.note .term::after { content: "]"; font-style: normal; margin: 0 .3em 0 .05em; }
.note .layer-name { display: none; }
.note .source { display: block; color: var(--muted); font-size: .88em; margin-top: .2rem; overflow-wrap: anywhere; }

/* Panels: all of one side's notes, opened by moving into that margin. */
.panel {
  position: absolute; top: 0; z-index: 2;
  opacity: 0; pointer-events: none; visibility: hidden;
  background: var(--ground);
  transition: opacity .2s cubic-bezier(.16, 1, .3, 1), transform .2s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .2s;
}
.panel-left { transform: translateX(-8px); }
.panel-right { transform: translateX(8px); }
.panel.open {
  opacity: 1; pointer-events: auto; visibility: visible; transform: none;
  transition: opacity .2s cubic-bezier(.16, 1, .3, 1), transform .2s cubic-bezier(.16, 1, .3, 1);
}
.panel .note { position: absolute; left: .5rem; right: .5rem; cursor: pointer; padding: .05rem .25rem; font-size: calc(.88rem * var(--scale)); line-height: 1.28; }
.panel .note .source { display: none; }
.panel .note.active .source { display: block; }
.panel .note.hover, .panel .note.active { background: var(--mark); }
.panel .note.offscreen { visibility: hidden; }
/* The open margin is an overview: each note shows the lines that fit (set
   in reader.js by trimming the gloss to whole words). Hovering or pinning a
   note shows it whole, over its neighbours. */
.gloss-short { display: none; }
.panel .note.clamped:not(.active):not(.hover) .gloss { display: none; }
.panel .note.clamped:not(.active):not(.hover) .gloss-short { display: inline; }
.panel .note.hover, .panel .note.active { z-index: 2; box-shadow: 0 6px 18px var(--shadow); }

/* A single note beside its anchor, on hover or click */
.focus-note {
  position: absolute; z-index: 3;
  padding: .05rem .25rem;
  background: var(--ground);
  opacity: 0; visibility: hidden; transform: translateY(3px);
  transition: opacity .16s cubic-bezier(.16, 1, .3, 1), transform .16s cubic-bezier(.16, 1, .3, 1), visibility 0s linear .16s;
}
.focus-note.shown {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .16s cubic-bezier(.16, 1, .3, 1), transform .16s cubic-bezier(.16, 1, .3, 1);
}
.focus-note .source { display: none; }
.focus-note.pinned .source { display: block; }
.focus-note.pinned { background: var(--mark); box-shadow: 0 6px 18px var(--shadow); }
.focus-note:hover { background: var(--mark); }

/* When both panels don't fit, an open panel slides the text aside. */
.column, .ticks { transform: translateX(var(--shift, 0)); transition: transform .24s cubic-bezier(.16, 1, .3, 1); }

/* Margin reference marks: one per annotated line, by layer */
.ticks { position: absolute; top: 0; width: 2.4rem; z-index: 1; font-family: var(--frame); transition: opacity .2s cubic-bezier(.16, 1, .3, 1); }
.ticks-left:has(~ .panel-left.open), .panel-right.open ~ .ticks-right { opacity: 0; pointer-events: none; }
.tick {
  position: absolute; left: 0; right: 0; white-space: nowrap;
  font-size: 1rem; letter-spacing: .08em;
  color: var(--muted);
}
.ticks-left .tick { text-align: right; }
.ticks-right .tick { text-align: left; }
.tick.hover, .tick.active { color: var(--ink); font-weight: 700; }

/* Phone notes: a footnote under the paragraph, with a footnote rule */
.inline-note { margin: .6em 0 .8em; padding-top: .45rem; position: relative; }
.inline-note::before { content: ""; position: absolute; top: 0; left: 0; width: 4em; border-top: 1px solid var(--hair); }

body.inline-mode .panel,
body.inline-mode .ticks { display: none; }

/* Hidden layers */
body.hide-vocab    .anchor[data-layer="vocab"],
body.hide-allusion .anchor[data-layer="allusion"],
body.hide-history  .anchor[data-layer="history"],
body.hide-place    .anchor[data-layer="place"] { text-decoration: none; cursor: auto; background: none; }
body.hide-vocab    :is(.note, .tick)[data-layer="vocab"],
body.hide-allusion :is(.note, .tick)[data-layer="allusion"],
body.hide-history  :is(.note, .tick)[data-layer="history"],
body.hide-place    :is(.note, .tick)[data-layer="place"] { display: none; }

.chapnav {
  font-family: var(--frame);
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem;
  margin-top: 3rem; padding-top: .6rem;
  border-top: 1px solid var(--hair);
  font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
}
.chapnav a { text-decoration: none; }
.chapnav .next { text-align: right; }
.chapnav .dir { display: block; color: var(--muted); letter-spacing: .14em; }
.chapnav a:hover, .chapnav a:focus-visible { text-decoration: underline; }

@media (max-width: 700px) {
  .bar-inner { gap: .3rem .9rem; }
  .layers { order: 10; width: 100%; }
  .running .chapter-crumb { display: none; }
  .reader { padding-top: 1.8rem; }
}

/* Long contents lists run in columns on wide screens. */
#toc { columns: 3 11rem; column-gap: 2rem; }
#toc li { break-inside: avoid; }

/* ----- Search: the book page (inline) and a menu in the chapter bar ----- */
.search-form { display: flex; gap: .5rem; align-items: stretch; }
.search-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--ground); border: 1px solid var(--hair); border-radius: 0; padding: .35rem .55rem;
}
.search-form input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-form input:focus-visible { outline: 1px solid var(--ink); outline-offset: 1px; }
.search-form .bar-button { font-size: .72rem; }
.search-hint { margin: .45rem 0 .2rem; font-size: .82rem; font-style: italic; color: var(--muted); }
.search-meta { margin: .8rem 0 .4rem; font-size: .85rem; color: var(--muted); }
.search-list { list-style: none; margin: 0; padding: 0; }
.search-list li { border-top: 1px solid var(--hair); }
.search-list a { display: block; padding: .55rem 0; color: inherit; text-decoration: none; }
.search-list a:hover .snip, .search-list a:focus-visible .snip { text-decoration: underline; text-decoration-color: var(--faint); }
.search-list .where { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .15rem; }
.search-list .here { letter-spacing: .04em; text-transform: none; font-style: italic; margin-left: .3rem; }
.search-list .snip { display: block; font-size: .92rem; line-height: 1.45; }
.search-list .note-hit .snip { font-style: italic; }
.search-list mark, mark.search-hit { background: var(--mark); color: inherit; padding: 0 .05em; }
.search-more { margin-top: .6rem; }
.search-panel { width: 30rem; max-height: min(70vh, 40rem); overflow-y: auto; overscroll-behavior: contain; }
#book-search { margin: 0 0 2.2rem; }
#text p.search-target { animation: search-flash 2.4s ease-out; }
@keyframes search-flash { from { background: var(--mark); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { #text p.search-target { animation: none; } }

/* ----- Type through: type a chapter out to learn the writer's diction ----- */
a.bar-button { text-decoration: none; display: inline-block; }
.type-page { max-width: 42rem; padding-top: 2.6rem; }
.type-page .chapter-head { margin-bottom: 1.4rem; font-size: 1.2rem; }
.type-intro { color: var(--muted); font-style: italic; font-size: .95rem; line-height: 1.5; text-align: center; margin: 0 auto 1.4rem; max-width: 36rem; }
.type-stats {
  position: sticky; top: 2.6rem; z-index: 5;
  display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; align-items: center; justify-content: center;
  padding: .5rem 0; margin-bottom: 1.6rem;
  background: var(--ground); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  font-size: .8rem; letter-spacing: .06em; color: var(--muted);
}
.type-stats b { color: var(--ink); font-size: 1rem; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.type-stats .bar-button { font-size: .68rem; }
.type-text { font-family: var(--font); font-size: calc(1.25rem * var(--scale)); line-height: 1.75; cursor: text; outline: none; }
.type-text p { margin: 0 0 .2em; text-indent: 1.5em; color: var(--muted); opacity: .6; }
.type-text p:first-child { text-indent: 0; }
.type-text p.done { color: var(--ink); opacity: .9; }
.type-text p.current { color: var(--muted); opacity: 1; }
.type-text p.current .typed { color: var(--ink); }
.type-text p.extract { margin: .7em 0 .7em 2.5em; text-indent: 0; font-size: .9em; }
.type-text .caret { background: var(--mark); color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.type-text .caret-end { color: var(--muted); padding: 0 .2em; margin-left: .15em; font-size: .8em; }
body:not(.type-focus) .type-text .caret { box-shadow: inset 0 -2px 0 var(--faint); }
.type-text .caret.miss { animation: type-miss .35s ease-out; }
@keyframes type-miss { from { background: #c0392b; color: #fff; } to { background: var(--mark); color: var(--ink); } }
.type-text .status { text-indent: 0; font-style: italic; }
.type-text .type-finished { text-indent: 0; text-align: center; opacity: 1; color: var(--ink); margin-top: 2rem; font-style: italic; }
/* The textarea only catches keys; it is kept on screen (so phones show a
   keyboard) but invisible. */
.type-input { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; resize: none; font-size: 16px; }
@media (max-width: 600px) { .type-text p.extract { margin-left: 1.2em; } .type-stats { top: 0; position: static; } }
@media (prefers-reduced-motion: reduce) { .type-text .caret.miss { animation: none; outline: 2px solid #c0392b; } }
.type-pointer { text-align: center; color: var(--muted); font-size: .92rem; margin-top: 1.6rem; }

.verse #text p:first-child::first-letter { font-size: inherit; float: none; line-height: inherit; padding: 0; margin: 0; font-weight: inherit; }
.verse #text p:first-child::first-line { text-transform: none; font-size: inherit; letter-spacing: normal; }
#text p.extract:first-child::first-letter { font-size: inherit; float: none; line-height: inherit; padding: 0; margin: 0; font-weight: inherit; }
#text p.extract:first-child::first-line { text-transform: none; font-size: inherit; letter-spacing: normal; }

/* ----- Home: a shelf of spines ----- */
.shelf {
  --gilt: #d2b36e;
  list-style: none; margin: 0 auto; padding: 1.6rem 1rem 0; max-width: 30rem;
  display: flex; align-items: flex-end; justify-content: safe center; gap: 3px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; font-size: 13px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.shelf::-webkit-scrollbar { display: none; }
.spine-item { flex: none; scroll-snap-align: start; padding-top: .8em; }
.spine {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  width: var(--w); height: var(--h); padding: .55em 0; box-sizing: border-box;
  background:
    linear-gradient(90deg, rgba(0,0,0,.3) 0, rgba(0,0,0,0) 18%, rgba(255,255,255,.08) 34%, rgba(255,255,255,0) 52%, rgba(0,0,0,.22) 100%),
    var(--cloth);
  color: var(--gilt); text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), 0 10px 14px -12px var(--shadow);
  transform-origin: 50% 100%;
  transition: transform .22s cubic-bezier(.16, 1, .3, 1), box-shadow .22s;
}
.spine-band { width: 78%; border-top: .18em double var(--gilt); flex: none; }
.spine-title, .spine-author { writing-mode: vertical-rl; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spine-title { font-weight: 700; font-size: .86em; letter-spacing: .05em; text-transform: uppercase; flex: 1; margin: .7em 0; max-height: 100%; line-height: 1; }
.spine-author { font-style: italic; font-size: .8em; flex: none; margin-bottom: .2em; opacity: .9; }
.spine:hover, .spine:focus-visible { transform: translateY(-.9em) rotate(-2deg); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25), 0 18px 18px -14px var(--shadow); outline: none; }
.spine:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.shelf-board {
  max-width: 30rem; height: .9rem; margin: 0 auto;
  background: linear-gradient(var(--wrapper), color-mix(in srgb, var(--wrapper) 70%, #000));
  box-shadow: 0 8px 12px -8px var(--shadow);
}
.shelf-links { margin: 1rem 0 0; font-size: .92rem; font-style: italic; }
.shelf-links a { color: var(--ink); text-underline-offset: .25em; text-decoration-color: var(--muted); }

/* ----- Library page ----- */
.page-wide { max-width: 64rem; }
.lib-head { text-align: center; margin: 2.2rem 0 1.8rem; }
.lib-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: .14em; text-transform: uppercase; margin: 0; }
.lib-head .by { font-style: italic; color: var(--muted); margin: .6rem 0 1.2rem; }
.lib-filters { display: inline-flex; gap: .4rem; }
.lib-filter {
  font: inherit; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .35rem .9rem; background: none; color: var(--ink); border: 1px solid var(--faint); cursor: pointer;
}
.lib-filter:hover { border-color: var(--ink); }
.lib-filter[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.lib-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 2.4rem 1.2rem;
}
.lib-link {
  display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: var(--ink);
  perspective: 900px; perspective-origin: 50% -25%;
}
.lib-link .cover {
  font-size: 14px; transform: translateX(-.2em) rotateY(-24deg);
  transition: transform .28s cubic-bezier(.16, 1, .3, 1);
}
.lib-link:hover .cover, .lib-link:focus-visible .cover { transform: translateX(-.1em) translateY(-6px) rotateY(-8deg) scale(1.03); }
.lib-name { margin-top: 1rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .9rem; }
.lib-by { font-style: italic; margin-top: .15rem; }
.lib-meta { margin-top: .35rem; font-size: .8rem; color: var(--muted); letter-spacing: .04em; }
.lib-foot { text-align: center; margin: 3rem 0 0; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .spine, .lib-link .cover, .title-block.with-cover .cover { transition: none; } }

/* ----- Home: coverflow ----- */
.flow { max-width: 72rem; margin: 0 auto; padding: 1rem 24px 3.5rem; text-align: center; border-top: 1px solid var(--faint); }
.flow-head { font-size: .8rem; letter-spacing: .24em; text-transform: uppercase; margin: 2rem 0 0; }
.flow-stage { position: relative; }
.flow-track {
  list-style: none; margin: 0; padding: 2.2rem 0 2.1rem;
  display: flex; align-items: center; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain;
  perspective: 56em; perspective-origin: 50% 0%;
  padding-inline: calc(50% - 6em); font-size: 18px;
}
.flow-track::-webkit-scrollbar { display: none; }
.flow-track:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.flow-item {
  flex: none; scroll-snap-align: center; width: 12em; display: flex; justify-content: center;
  margin-inline: -1.6em;
  --a: 0; --tx: 0em; --tz: 0em; --r: 0deg; --sc: 1; --z: 40;
  transform-style: preserve-3d;
  transform: translateX(var(--tx)) translateZ(var(--tz)) rotateY(var(--r)) scale(var(--sc));
  z-index: var(--z);
}
.flow-item:first-child { margin-left: 0; }
.flow-item:last-child { margin-right: 0; }
.flow-cover { width: 10em; height: 15em; font-size: 18px; }
.flow-item:not(.is-center) .flow-cover { cursor: pointer; }
.flow-item:not(.is-center) .flow-cover:hover { transform: translateY(-4px); }
.flow-item.is-center .flow-cover:hover,
.flow-item.is-center .flow-cover:focus-visible { transform: translateY(-6px) rotateY(-16deg); }
.flow-caption { min-height: 6.6rem; max-width: 30rem; margin: .4rem auto 0; display: flex; flex-direction: column; gap: .25rem; }
.flow-title { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.flow-title:hover { text-decoration: underline; text-underline-offset: .25em; }
.flow-by { font-style: italic; }
.flow-blurb { color: var(--muted); font-size: .95rem; line-height: 1.5; }
.flow-arrow {
  position: absolute; top: 40%; transform: translateY(-50%); z-index: 50;
  font: inherit; font-size: 1.3rem; width: 2.6rem; height: 2.6rem; border-radius: 0;
  border: 1px solid var(--faint); background: var(--ground); color: var(--ink); cursor: pointer;
}
.flow-arrow:hover { border-color: var(--ink); }
.flow-arrow:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; border-color: var(--ink); }
.flow-prev { left: 0; } .flow-next { right: 0; }
@media (max-width: 700px) { .flow-arrow { display: none; } .flow-track { font-size: 15px; } .flow-cover { font-size: 15px; } }
@media (prefers-reduced-motion: reduce) {
  .flow-item { transform: none; --a: 0; }
  .panel, .focus-note, .column, .ticks, a.cover, .primary-action, .spine, .lib-link .cover, .title-block.with-cover .cover { transition: none; }
}

/* ----- Covers: printed plate over a title band ----- */
.cover-frame.plate {
  position: absolute; inset: 0; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column;
  align-items: stretch; background: var(--paper, var(--wrapper)); overflow: hidden;
}
.cover-frame.plate::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(rgba(0,0,0,calc(var(--a,0) * .16)), rgba(0,0,0,calc(var(--a,0) * .16))),
    linear-gradient(90deg, rgba(0,0,0,.34) 0, rgba(0,0,0,0) .5em, rgba(255,255,255,.12) .62em, rgba(255,255,255,0) .9em);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.28);
}
.cover-frame.plate .cover-art { flex: none; display: block; width: 100%; height: 11.2em; margin: 0; }
.cover-frame.plate .cover-art svg { display: block; width: 100%; height: 100%; }
.plate-band { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; padding: .3em .8em .35em; color: var(--ink2, var(--ink)); border-top: .14em solid var(--ink2, var(--hair)); }
.plate-band .cover-title { color: var(--ink2, var(--ink)); font-size: .92em; letter-spacing: .06em; margin: 0; line-height: 1.12; }
.plate-band .cover-title.long, .plate-band .cover-title.xlong { font-size: .78em; letter-spacing: .04em; }
.plate-by { margin-top: .35em; font-size: .46em; letter-spacing: .1em; white-space: nowrap; text-transform: uppercase; opacity: .8; }
