:root {
  --paper: #f5efe4;
  --paper-2: #ece3d3;
  --ink: #23180f;
  --ink-2: #5e4d3d;
  --muted: #8a7764;
  --accent: #b5442c;          /* library-card red */
  --forest: #2f5d3a;          /* forest green: the month in the headline */
  --accent-ink: #fff8ef;
  --brass: #d6ad5c;
  --brass-dark: #8f6a26;
  --line: rgba(35, 24, 15, 0.12);
  --card: #fffaf2;

  --wood-light: #9a6a42;
  --wood: #6e4527;
  --wood-dark: #3f2614;
  --back: #2a1a0f;

  --book-h: clamp(230px, 18vw, 268px);
  --gap: clamp(30px, 3vw, 44px);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  /* SPL's brand face is Futura PT (licensed to spl.org); Jost is the free Futura-modelled match */
  --spl: "futura-pt", "Jost", Futura, "Trebuchet MS", sans-serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17110c;
    --paper-2: #211811;
    --ink: #f3e9da;
    --ink-2: #cdbba5;
    --muted: #9c8a76;
    --line: rgba(243, 233, 218, 0.12);
    --card: #221911;
    --back: #1a0f08;
    --forest: #8cc49a;
  }
}
:root[data-theme="dark"] {
  --paper: #17110c; --paper-2: #211811; --ink: #f3e9da; --ink-2: #cdbba5;
  --muted: #9c8a76; --line: rgba(243, 233, 218, 0.12); --card: #221911; --back: #1a0f08;
  --forest: #8cc49a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---------- pencil-sketch backdrop (Seattle Central Library) ---------- */
body { position: relative; overflow-x: hidden; }
.sketch {
  position: absolute; z-index: 0; top: 0; right: 0;
  width: min(64%, 1120px); height: 330px;
  pointer-events: none;
  background: url("library-sketch.webp") center 34% / cover no-repeat;
  mix-blend-mode: multiply;           /* graphite sits *on* the paper */
  opacity: .85;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%), linear-gradient(to right, transparent 0, #000 35%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, #000 45%, transparent 100%), linear-gradient(to right, transparent 0, #000 35%);
  mask-composite: intersect;
}
@media (max-width: 900px) {
  .sketch { width: 100%; height: 260px; opacity: .3; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sketch { filter: invert(1) sepia(.25); mix-blend-mode: screen; opacity: .45; }
}
:root[data-theme="dark"] .sketch { filter: invert(1) sepia(.25); mix-blend-mode: screen; opacity: .45; }
.masthead, main, .foot { position: relative; z-index: 1; }

/* ---------- masthead: one compact horizontal band ---------- */
.masthead { padding: 36px 0 20px; }
.head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px 40px; }
.head-text { min-width: 0; }
@media (max-width: 900px) { .head { grid-template-columns: 1fr; } }
.eyebrow {
  margin: 0 0 8px; font: 600 12.5px var(--spl); letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 8px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
h1 {
  font: 600 clamp(28px, 3.4vw, 42px)/1.08 var(--spl);
  letter-spacing: -0.005em; margin: 0;
}
h1 em { font-style: italic; font-weight: 500; color: var(--forest); }
.lede { color: var(--ink-2); font: 400 16.5px/1.45 var(--spl); margin: 6px 0 0; max-width: 64ch; }
.masthead h1, .lede, .eyebrow { text-shadow: 0 0 14px var(--paper), 0 0 4px var(--paper); }
.stats {
  display: flex; gap: 0; margin: 0;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px;
}
.stats div { padding: 0 16px; border-left: 1px solid var(--line); }
.stats div:first-child { border-left: 0; }
.stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.stats dd { margin: 2px 0 0; font: 600 18px/1.15 var(--serif); white-space: nowrap; }

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 8px; position: relative; }
.left-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.seg a {
  text-decoration: none; display: inline-block;
  border: 0; background: none; color: var(--ink-2); font: 500 13px var(--sans); padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.seg a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  font: 500 14px var(--sans); padding: 8px 14px; border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { opacity: .55; margin-left: 4px; font-variant-numeric: tabular-nums; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 14px; min-width: 240px; }
.search svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { border: 0; background: transparent; color: var(--ink); font: 15px var(--sans); padding: 9px 0; outline: none; width: 100%; }

/* ---------- floating stage ---------- */
.stage { position: relative; padding: 28px 0 8px; }
.row {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end;
  gap: clamp(28px, 3.5vw, 44px) var(--gap); margin: 0 0 clamp(28px, 3.5vw, 44px);
}
.item {
  position: relative; display: flex; flex-direction: column; align-items: center; flex: none; margin: 0;
  /* quick fade-in; capped so covers further down never sit invisible while you scroll */
  animation: appear .6s both cubic-bezier(.2,.8,.2,1);
  animation-delay: calc(min(var(--i), 12) * 45ms);
}
@keyframes appear { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.bob { position: relative; }
/* Covers sit still. A book floats only while it's selected: hovered, focused, or the one last opened. */
.item:hover .bob, .item:has(:focus-visible) .bob, .item.selected .bob { animation: bob 3.6s ease-in-out infinite; }
.item:hover .ground, .item:has(:focus-visible) .ground, .item.selected .ground { opacity: 1; animation: ground 3.6s ease-in-out infinite; }
.item.selected .book { transform: translateY(-10px) scale(1.03); }

/* Quick Look trigger: small eye badge on the cover's top-right corner */
.peek {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 28px; height: 28px; padding: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(28, 18, 10, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  opacity: .78; transition: opacity .2s, transform .2s, background .2s;
}
.peek svg { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; }
.item:hover .peek { opacity: 1; }
.peek:hover, .peek:focus-visible { background: var(--accent); transform: scale(1.12); opacity: 1; }
.peek:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* the badge rides along when the cover lifts */
.item:hover .peek { transform: translateY(-14px); }
.item:hover .peek:hover { transform: translateY(-14px) scale(1.12); }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(calc(var(--tilt) * 1deg)); }
  50%      { transform: translateY(-12px) rotate(calc(var(--tilt) * -1deg)); }
}
.ground { /* soft contact shadow that tightens as the book rises */
  width: 86%; height: 12px; margin-top: 10px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40, 22, 8, .38), rgba(40, 22, 8, 0));
  opacity: 0; transition: opacity .3s;
}
@keyframes ground { 50% { transform: scaleX(.78); opacity: .55; } }

/* ---------- a book ---------- */
.book {
  position: relative; display: block; border: 0; padding: 0; margin: 0; background: none; cursor: pointer;
  height: var(--book-h);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.book img, .book .fallback {
  display: block; height: 100%; width: auto; border-radius: 2px 4px 4px 2px;
  box-shadow:
    0 1px 1px rgba(0,0,0,.18),
    0 14px 24px -10px rgba(40, 22, 8, .45),
    0 34px 50px -26px rgba(40, 22, 8, .55);
  transition: box-shadow .45s;
}
.book::after { /* spine crease + glossy highlight so covers read as real books */
  content: ""; position: absolute; inset: 0; border-radius: 2px 4px 4px 2px; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.26) 0, rgba(255,255,255,.18) 2.2%, rgba(0,0,0,.1) 4%, transparent 7%),
    linear-gradient(115deg, rgba(255,255,255,.16), transparent 38%);
}
.item:hover .book, .book:focus-visible { transform: translateY(-14px) scale(1.04); }
.item:hover .book img { box-shadow: 0 1px 1px rgba(0,0,0,.18), 0 24px 34px -12px rgba(40,22,8,.5), 0 50px 70px -30px rgba(40,22,8,.6); }

.book:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 4px; }
.book .fallback {
  aspect-ratio: 2 / 3; padding: 18px 14px; display: flex; flex-direction: column; justify-content: space-between;
  color: #fff8ec; text-align: left; font-family: var(--serif);
}
.fallback b { font-size: 19px; line-height: 1.12; font-weight: 600; }
.fallback i { font-style: normal; font-size: 12px; font-family: var(--sans); letter-spacing: .06em; text-transform: uppercase; opacity: .8; }

.plate {
  margin-top: 6px; display: inline-flex; gap: 6px; align-items: baseline; white-space: nowrap;
  font: 600 17px/1 var(--serif); color: var(--ink);
}
.plate .chg { font: 600 11px/1 var(--sans); letter-spacing: .04em; }
.plate .up { color: #2f7a3b; }
.plate .down { color: var(--accent); }
.plate .new { color: #fff; background: var(--accent); padding: 3px 5px; border-radius: 3px; letter-spacing: .08em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .plate .up { color: #7fcf8a; } }

/* ---------- Quick Look hover panel ---------- */
.ql {
  position: fixed; z-index: 40; left: 0; top: 0; width: 380px; pointer-events: none;
  border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--card) 84%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 24px 60px -12px rgba(30, 16, 4, .45), 0 4px 14px rgba(30, 16, 4, .14);
  opacity: 0; transform: scale(.94); visibility: hidden;
  transition: opacity .16s ease, transform .2s cubic-bezier(.2,.8,.2,1), visibility 0s linear .2s, left .18s cubic-bezier(.2,.8,.2,1), top .18s cubic-bezier(.2,.8,.2,1);
}
.ql[data-side="right"] { transform-origin: left center; }
.ql[data-side="left"] { transform-origin: right center; }
.ql.on { opacity: 1; transform: scale(1); visibility: visible; transition-delay: 0s; }
.ql-bar {
  position: relative; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  background: color-mix(in srgb, var(--paper-2) 70%, transparent); border-bottom: 1px solid var(--line);
}
.ql-bar i { width: 10px; height: 10px; border-radius: 50%; background: #e0574a; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.2); }
.ql-bar i:nth-child(2) { background: #e6b13f; }
.ql-bar i:nth-child(3) { background: #5fb453; }
.ql-bar span {
  position: absolute; left: 0; right: 0; text-align: center; font: 600 12px var(--sans); color: var(--ink-2);
  letter-spacing: .02em; pointer-events: none;
}
.ql-body { display: grid; grid-template-columns: 104px 1fr; gap: 16px; padding: 16px; }
.ql-cover img, .ql-cover .fallback {
  display: block; width: 100%; height: auto; border-radius: 2px 3px 3px 2px;
  box-shadow: 0 10px 18px -8px rgba(30,16,4,.55);
}
.ql-cover .fallback { aspect-ratio: 2/3; padding: 10px 8px; }
.ql-cover .fallback b { font-size: 13px; }
.ql-info { min-width: 0; }
.ql h3 { margin: 0; font: 700 19px/1.15 var(--serif); }
.ql-author { margin: 3px 0 0; color: var(--ink-2); font-size: 13px; }
.ql-meta { margin: 8px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--ink-2); }
.ql-meta .tag { font-size: 11px; padding: 2px 8px; }
.ql-meta .up { color: #2f7a3b; font-weight: 600; }
.ql-meta .down { color: var(--accent); font-weight: 600; }
.ql-meta .new { color: var(--accent); font-weight: 700; }
.ql-desc {
  margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
.ql-desc:empty { display: none; }
.ql-hint { margin: 10px 0 0; font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .ql { transition: opacity .1s; transform: none; } }

.stage[aria-busy="true"] { opacity: .45; transition: opacity .2s; }
.stats dd { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- newsletter ---------- */
.newsletter {
  margin: 48px 0 0; padding: 32px; border-radius: 14px; background: var(--card); border: 1px solid var(--line);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center;
}
.newsletter h2 { font: 700 30px/1.1 var(--serif); margin: 0 0 8px; }
.newsletter p { margin: 0; color: var(--ink-2); }
#subscribe { display: flex; flex-wrap: wrap; gap: 10px; }
#subscribe input[type="email"] {
  flex: 1 1 220px; font: 16px var(--sans); padding: 13px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
#subscribe button, .btn {
  font: 600 15px var(--sans); padding: 13px 20px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-block;
}
#subscribe button:hover, .btn:hover { filter: brightness(1.08); }
.form-msg { flex-basis: 100%; font-size: 14px; min-height: 1.2em; }
.hp { position: absolute; left: -9999px; }

.foot { padding: 36px 24px 56px; color: var(--muted); font-size: 13px; }
.foot p { margin: 4px 0; }

/* ---------- text list + about (the crawlable reference) ---------- */
.reference { margin: 48px 0 0; display: grid; gap: 28px; }
.reference h2 { font: 700 24px/1.15 var(--serif); margin: 0 0 4px; }
.list-note { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.ranked { margin: 0; padding: 0 0 0 2.2em; columns: 4 220px; column-gap: 32px; font-size: 13.5px; line-height: 1.35; }
.ranked li { break-inside: avoid; padding: 2px 0 6px; color: var(--muted); }
.ranked li::marker { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.ranked a { color: var(--ink); font-weight: 600; text-decoration: none; }
.ranked a:hover { text-decoration: underline; }
.ranked .by { color: var(--ink-2); }
.ranked .meta { display: block; font-size: 12px; }
.ranked .chg { margin-left: 6px; font-weight: 600; }
.ranked .up { color: #2f7a3b; } .ranked .down { color: var(--accent); } .ranked .new { color: var(--forest); text-transform: uppercase; font-size: 10.5px; letter-spacing: .06em; }
.about { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; }
.faq { margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 28px; }
.faq dt { font: 600 15px/1.3 var(--serif); }
.faq dd { margin: 4px 0 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }

/* ---------- book page ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--ink-2); }
.bookpage { margin: 8px 0 0; padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.bookpage .detail-grid { padding: 0; }
.bookpage .detail-desc { max-height: none; overflow: visible; }
.bookpage .detail-desc p { margin: 0 0 10px; }
.ranks { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.ranks a { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 13px; text-decoration: none; }
.ranks a b { font-variant-numeric: tabular-nums; }
.neighbors { display: flex; justify-content: space-between; gap: 12px; margin: 16px 0 0; font-size: 14px; }
.neighbors a { color: var(--ink-2); text-decoration: none; max-width: 48%; }
.neighbors a:hover { color: var(--ink); }

/* ---------- detail dialog ---------- */
dialog {
  border: 0; padding: 0; border-radius: 16px; width: min(920px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  background: var(--card); color: var(--ink); box-shadow: 0 40px 100px rgba(0,0,0,.5);
}
dialog::backdrop { background: rgba(20, 12, 6, .7); backdrop-filter: blur(4px); }
dialog[open] { animation: pop .3s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 30px; line-height: 1; color: var(--muted); cursor: pointer; z-index: 2; }
.detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 32px; padding: 32px; }
.detail-cover {
  align-self: start; border-radius: 10px; padding: 22px; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 20%, rgba(255,205,140,.18), transparent 70%), var(--back);
}
.detail-cover img, .detail-cover .fallback { width: 100%; height: auto; border-radius: 2px 4px 4px 2px; box-shadow: 8px 14px 24px -6px rgba(0,0,0,.7); display: block; }
.detail-rank { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.detail-info h2 { font: 800 clamp(28px, 4vw, 40px)/1.05 var(--serif); margin: 0; letter-spacing: -.01em; }
.detail-sub { margin: 6px 0 0; font: italic 400 18px/1.3 var(--serif); color: var(--ink-2); }
.detail-sub:empty { display: none; }
.detail-author { margin: 10px 0 0; font-size: 17px; color: var(--ink-2); }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; }
.tag { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.tag.genre { background: var(--ink); color: var(--paper); font-weight: 600; }
.detail-stats { margin: 20px 0 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.big { font: 700 28px/1 var(--serif); }
.big small { font: 500 14px var(--sans); color: var(--muted); margin-left: 6px; }
.fmt { display: grid; grid-template-columns: 70px 1fr 50px; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.bar { height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.fmt span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.detail-desc { margin: 16px 0 0; color: var(--ink-2); font-size: 15px; white-space: pre-line; max-height: 11.5em; overflow: auto; }
.detail-desc:empty { display: none; }
.detail-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.detail-nav { display: flex; justify-content: space-between; padding: 0 32px 24px; }
.detail-nav button { border: 1px solid var(--line); background: none; color: var(--ink-2); font: 500 14px var(--sans); padding: 8px 14px; border-radius: 8px; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  :root { --book-h: 190px; --gap: 24px; }
  .newsletter { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --book-h: 134px; --gap: 12px; }
  .wrap { padding: 0 16px; }
  .masthead { padding-top: 24px; }
  .stats { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; padding: 8px 0; }
  .stats div { padding: 0 10px; min-width: 0; }
  .stats dd { max-width: none; }
  .stats dd { font-size: 16px; }
  .stage { padding-top: 24px; }
  .ground { margin-top: 6px; height: 8px; }
  .plate { font-size: 15px; }
  .search { min-width: 0; flex: 1 1 100%; }
  .detail-grid { grid-template-columns: 1fr; padding: 24px 20px; gap: 20px; }
  .detail-cover { max-width: 220px; justify-self: center; }
  .detail-nav { padding: 0 20px 20px; }
  .newsletter { padding: 22px; }
  .ql { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .item, .bob, .ground, dialog[open] { animation: none; } .book { transition: none; }
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
@media (max-width: 640px) { .bookpage { padding: 18px; } }
@media (max-width: 640px) {
  .ranked { columns: 2; column-gap: 28px; font-size: 12.5px; padding-left: 1.9em; }
  .ranked .meta { font-size: 11px; }
  .reference h2 { font-size: 21px; }
}

/* Phones: a tight three-column grid of equal tiles, so there are no ragged gaps between covers. */
@media (max-width: 640px) {
  #shelves { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; padding-top: 16px; }
  #shelves .row { display: contents; }
  .item { min-width: 0; }
  .bob { width: 100%; }
  .book { width: 100%; height: auto; aspect-ratio: 2 / 3; background: var(--paper-2); border-radius: 2px 4px 4px 2px; }
  .book img, .book .fallback { width: 100%; height: 100%; object-fit: cover; }
  .book .fallback { font-size: 11px; }
  .plate { font-size: 13px; }
  .ground { display: none; }
}
