/* Beer's Bookshelf: shared styles for all pages. */

:root {
  --paper: #f5f1e8;
  --paper-2: #ede7da;
  --paper-3: #e4dccb;
  --card: #fbf9f4;
  --ink: #1f1b16;
  --ink-2: #5a5247;
  --ink-3: #6f675b;
  --rule: #d8cfbd;
  --accent: #963a27;
  --accent-soft: rgba(150, 58, 39, .09);
  --gold: #a9823f;
  --ledge: #c9b999;
  --ledge-top: #e3d6bb;
  --ledge-shadow: rgba(60, 40, 15, .16);
  --page: #fbf8f1;
  --page-edge: #e8e0cf;
  --overlay: rgba(24, 19, 12, .62);
  --shadow-lg: 0 30px 80px -20px rgba(40, 25, 10, .45), 0 10px 30px -10px rgba(40, 25, 10, .3);
  --good: #3f6b4a;
  --bad: #9a3324;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --row: 262px;
  --sc: 1;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14120e; --paper-2: #1c1914; --paper-3: #26221b; --card: #1d1a15;
    --ink: #efe8da; --ink-2: #bdb3a2; --ink-3: #9a917f; --rule: #37312a;
    --accent: #e0896a; --accent-soft: rgba(224, 137, 106, .12); --gold: #d1ab6a;
    --ledge: #4a3e30; --ledge-top: #5e4f3d; --ledge-shadow: rgba(0, 0, 0, .5);
    --page: #f3eee2; --page-edge: #d9d0bd; --overlay: rgba(5, 4, 2, .74);
    --good: #86b894; --bad: #e0896a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14120e; --paper-2: #1c1914; --paper-3: #26221b; --card: #1d1a15;
  --ink: #efe8da; --ink-2: #bdb3a2; --ink-3: #9a917f; --rule: #37312a;
  --accent: #e0896a; --accent-soft: rgba(224, 137, 106, .12); --gold: #d1ab6a;
  --ledge: #4a3e30; --ledge-top: #5e4f3d; --ledge-shadow: rgba(0, 0, 0, .5);
  --page: #f3eee2; --page-edge: #d9d0bd; --overlay: rgba(5, 4, 2, .74);
  --good: #86b894; --bad: #e0896a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar .wrap { display: flex; align-items: center; gap: 20px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { width: 22px; height: 22px; flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  padding: 7px 12px; border-radius: 999px; transition: background .2s, color .2s;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--paper-3); }
.theme-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.theme-btn:hover { color: var(--ink); background: var(--paper-2); }
.theme-btn svg { width: 16px; height: 16px; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 34px; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(44px, 8vw, 92px);
  line-height: .95; letter-spacing: -.035em; margin: 0;
  font-variation-settings: "SOFT" 50, "opsz" 144;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub { font-family: var(--serif); font-size: clamp(17px, 2.2vw, 21px); color: var(--ink-2); margin: 18px 0 0; max-width: 640px; font-weight: 300; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px 36px; margin-top: 30px; }
.hero-stat b { display: block; font-family: var(--serif); font-size: 32px; font-weight: 500; line-height: 1.05; letter-spacing: -.02em; }
.hero-stat span { font-size: 12.5px; color: var(--ink-3); }

/* ---------- section headings ---------- */
.section { padding: 26px 0 10px; }
.section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -.02em; margin: 0; }
.section-head .meta { color: var(--ink-3); font-size: 13px; }
.section-head .more { margin-left: auto; font-size: 13px; color: var(--ink-2); }

/* ---------- toolbar ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 8px 0 26px;
}
.search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 999px; padding: 0 14px; height: 38px;
}
.search svg { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 14px; }
.select-wrap { position: relative; }
.select-wrap select, .seg {
  height: 38px; border: 1px solid var(--rule); background: var(--card); border-radius: 999px; font-size: 13.5px;
}
.select-wrap select { appearance: none; padding: 0 32px 0 14px; cursor: pointer; }
.select-wrap::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); pointer-events: none;
}
.seg { display: inline-flex; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; border-radius: 999px; padding: 0 12px; font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.count-note { font-size: 13px; color: var(--ink-3); margin-left: auto; }

/* ---------- shelves ---------- */
.group { margin-bottom: 40px; }
.group-head { display: flex; align-items: baseline; gap: 14px; margin: 0 0 12px; flex-wrap: wrap; }
.group-head h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; letter-spacing: -.02em; margin: 0; }
.group-head .meta { font-size: 12.5px; color: var(--ink-3); }
.shelf {
  display: flex; flex-wrap: wrap; align-content: flex-start; column-gap: 3px;
  padding: 0 14px;
  background:
    repeating-linear-gradient(to bottom,
      transparent 0 var(--row),
      var(--ledge-top) var(--row) calc(var(--row) + 2px),
      var(--ledge) calc(var(--row) + 2px) calc(var(--row) + 11px),
      var(--ledge-shadow) calc(var(--row) + 11px) calc(var(--row) + 12px),
      transparent calc(var(--row) + 20px) calc(var(--row) + 36px));
  border-radius: 2px;
}
.slot { height: var(--row); margin-bottom: 36px; display: flex; align-items: flex-end; }
.slot.gap { width: 18px; }

.spine {
  --wpx: 40px; --hf: .85;
  position: relative; width: calc(var(--wpx) * var(--sc)); height: calc(var(--row) * var(--hf));
  border: 0; padding: 12px 0 10px; cursor: pointer;
  background-color: var(--bg);
  background-image: linear-gradient(90deg, rgba(0,0,0,.26) 0, rgba(255,255,255,.1) 14%, rgba(255,255,255,.02) 42%, rgba(0,0,0,.05) 70%, rgba(0,0,0,.28) 100%);
  color: var(--fg);
  border-radius: 2px 3px 2px 1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 -2px 0 rgba(0,0,0,.18), 1px 0 0 rgba(0,0,0,.15);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transform-origin: 50% 100%;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, filter .35s;
  overflow: hidden;
}
.spine:hover, .spine:focus-visible {
  transform: translateY(-12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 14px 18px -10px rgba(0,0,0,.45);
  z-index: 2;
}
.spine .t {
  writing-mode: vertical-rl; flex: 1 1 auto; min-height: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--serif); font-weight: 600; font-size: calc(var(--fs, 14px) * var(--sc)); letter-spacing: .01em; line-height: 1;
}
.spine .a {
  writing-mode: vertical-rl; flex: none; max-height: 40%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 9px; letter-spacing: .1em; text-transform: uppercase; opacity: .78; font-weight: 600; line-height: 1;
}
.spine.two .t { white-space: normal; text-overflow: clip; line-height: 1.14; text-align: start; }
.spine .orn { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); opacity: .9; }
/* variants */
.spine.v1::before, .spine.v1::after {
  content: ""; position: absolute; left: 0; right: 0; height: 7px; border-top: 1px solid var(--acc); border-bottom: 1px solid var(--acc); opacity: .85;
}
.spine.v1::before { top: 9px; }
.spine.v1::after { bottom: 9px; }
.spine.v1 { padding-top: 26px; padding-bottom: 24px; }
.spine.v2 .t { background: rgba(0,0,0,.2); padding: 8px 4px; border: 1px solid color-mix(in srgb, var(--acc) 70%, transparent); flex: 0 1 auto; margin: auto 0; }
.spine.v3 { padding-top: 0; }
.spine.v3::before { content: ""; display: block; flex: none; width: 100%; height: 16%; background: var(--acc); opacity: .92; box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.spine.v3 .t { text-transform: uppercase; letter-spacing: .09em; font-size: calc((var(--fs, 14px) - 2px) * var(--sc)); }
.spine.upper .t { text-transform: uppercase; letter-spacing: .08em; font-size: calc((var(--fs, 14px) - 2px) * var(--sc)); }
.spine .dnf {
  flex: none; font-size: 8.5px; letter-spacing: .1em; font-weight: 700; writing-mode: vertical-rl;
  padding: 3px 1px; border: 1px solid currentColor; border-radius: 2px; opacity: .8;
}
/* to-read shelf: pale unread paperbacks */
.spine.unread {
  --bg: #ebe3d1; --fg: #2a241c;
  background-image: linear-gradient(90deg, rgba(0,0,0,.1) 0, rgba(255,255,255,.4) 16%, rgba(255,255,255,0) 50%, rgba(0,0,0,.1) 100%);
}
.spine.unread::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 12px; background: var(--acc); }
.spine.unread { padding-top: 22px; }

/* face-out books */
.faceout {
  position: relative; border: 0; padding: 0; background: none; cursor: pointer;
  width: 158px; height: 236px; margin: 0 8px;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.faceout:hover, .faceout:focus-visible { transform: translateY(-10px) rotate(-1deg); }
.faceout .cover { width: 100%; height: 100%; box-shadow: 0 16px 20px -12px rgba(0,0,0,.55), 0 2px 4px rgba(0,0,0,.2); }

/* covers (real image on top of a designed fallback) */
.cover {
  position: relative; overflow: hidden; border-radius: 2px 5px 5px 2px;
  background: var(--bg); color: var(--fg); container-type: inline-size;
}
.cover::after { /* spine crease + sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.28) 0, rgba(255,255,255,.18) 2.5%, rgba(255,255,255,0) 6%, rgba(0,0,0,0) 94%, rgba(0,0,0,.14) 100%);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .design {
  position: absolute; inset: 7%; border: 1px solid var(--acc); display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 10% 8%; gap: 8%;
}
.cover .design::before { content: ""; width: 20%; height: 1px; background: var(--acc); }
.cover .design .ct { font-family: var(--serif); font-weight: 500; font-size: clamp(12px, 11cqi, 30px); line-height: 1.08; letter-spacing: -.01em; }
.cover .design .ca { font-size: clamp(8px, 5.4cqi, 13px); letter-spacing: .16em; text-transform: uppercase; opacity: .85; }

.caption { text-align: center; margin-top: 10px; max-width: 170px; }
.caption b { display: block; font-family: var(--serif); font-weight: 500; font-size: 14.5px; line-height: 1.25; }
.caption span { font-size: 12px; color: var(--ink-3); }

/* nightstand */
.nightstand { display: flex; flex-wrap: wrap; gap: 26px 30px; padding: 6px 14px 0; }
.nightstand .item { display: flex; flex-direction: column; align-items: center; }
.nightstand .faceout { margin: 0; }
.progress-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 6px; vertical-align: 1px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.ledge-line { height: 11px; margin: 0 0 30px; background: linear-gradient(to bottom, var(--ledge-top) 0 2px, var(--ledge) 2px 100%); box-shadow: 0 8px 14px -8px var(--ledge-shadow); border-radius: 1px; }

/* hover tag */
.tip {
  position: fixed; z-index: 40; pointer-events: none; opacity: 0; transform: translate(-50%, -100%) translateY(-4px);
  background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.35;
  max-width: 280px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); transition: opacity .15s;
}
.tip.on { opacity: 1; }
.tip b { font-family: var(--serif); font-weight: 500; font-size: 14px; display: block; }
.tip .r { color: var(--gold); font-weight: 600; }
:root[data-theme="dark"] .tip .r { color: #8a6424; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tip .r { color: #8a6424; } }


/* favourite quotes */
.quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.quote {
  margin: 0; padding: 26px 26px 20px 30px; background: var(--card); border: 1px solid var(--rule); border-radius: 4px;
  position: relative; display: flex; flex-direction: column; gap: 18px;
}
.quote::before {
  content: "\201C"; position: absolute; left: 12px; top: 2px; font-family: var(--serif); font-size: 64px; line-height: 1;
  color: var(--accent); opacity: .28;
}
.quote blockquote {
  margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 20px; line-height: 1.45;
  color: var(--ink); white-space: pre-line; overflow-wrap: anywhere;
}
.quote figcaption { margin-top: auto; border-top: 1px solid var(--rule); padding-top: 14px; }
.quote-src {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
  text-align: left; color: inherit; font: inherit;
}
.quote-cover { width: 30px; flex: none; }
.quote-cover .cover { width: 30px; height: 45px; box-shadow: 0 3px 8px -4px rgba(0,0,0,.5); }
.quote-cover .cover .design { display: none; }
.quote-who { display: flex; flex-direction: column; min-width: 0; }
.quote-who b { font-family: var(--serif); font-weight: 500; font-size: 15px; }
.quote-who small { font-size: 12.5px; color: var(--ink-3); }
.quote-src:hover .quote-who b { color: var(--accent); }

.empty { padding: 50px 0; text-align: center; color: var(--ink-3); font-family: var(--serif); font-style: italic; font-size: 18px; }

/* ---------- the open book ---------- */
.reader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; visibility: hidden; }
.reader.show { visibility: visible; }
.reader-bg { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .45s; }
.reader.show .reader-bg { opacity: 1; }
.reader-close, .reader-nav {
  position: absolute; z-index: 3; border: 0; cursor: pointer; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff;
  transition: background .2s, opacity .3s; opacity: 0;
}
.reader.open .reader-close, .reader.open .reader-nav { opacity: 1; }
.reader-close:hover, .reader-nav:hover { background: rgba(255,255,255,.24); }
.reader-close { top: 18px; right: 18px; }
.reader-nav.prev { left: 18px; top: 50%; margin-top: -22px; }
.reader-nav.next { right: 18px; top: 50%; margin-top: -22px; }
.reader svg { width: 18px; height: 18px; }

.spread {
  --pw: min(372px, 42vw, calc((100vh - 110px) / 1.45));
  --ph: calc(var(--pw) * 1.45);
  position: relative; z-index: 2; width: calc(var(--pw) * 2); height: var(--ph);
  perspective: 2400px;
  transform: translateX(calc(var(--pw) * -.5)) translateY(30px) scale(.94); opacity: 0;
  transition: transform 1s cubic-bezier(.3,.75,.2,1), opacity .45s;
}
.reader.show .spread { opacity: 1; transform: translateX(calc(var(--pw) * -.5)) translateY(0) scale(1); }
.reader.open .spread { transform: translateX(0) translateY(0) scale(1); }

.page {
  position: absolute; top: 0; width: var(--pw); height: var(--ph);
  background: var(--page); color: #231e17;
  overflow: hidden;
}
.page-right {
  left: var(--pw); border-radius: 2px 6px 6px 2px;
  box-shadow: var(--shadow-lg), inset 18px 0 24px -18px rgba(60,40,10,.35), inset -1px 0 0 var(--page-edge);
}
.page-inner { height: 100%; overflow-y: auto; padding: 34px 34px 30px 38px; scrollbar-width: thin; }
.flap {
  position: absolute; left: var(--pw); top: 0; width: var(--pw); height: var(--ph);
  transform-origin: left center; transform-style: preserve-3d; z-index: 2;
  transition: transform 1.05s cubic-bezier(.45,.05,.2,1);
}
.reader.open .flap { transform: rotateY(-180deg); }
.flap-front, .flap-back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flap-front .cover { width: 100%; height: 100%; box-shadow: var(--shadow-lg); }
.flap-back {
  transform: rotateY(180deg); background: var(--page); color: #231e17; border-radius: 6px 2px 2px 6px;
  box-shadow: var(--shadow-lg), inset -18px 0 24px -18px rgba(60,40,10,.35), inset 1px 0 0 var(--page-edge);
  overflow: hidden;
}
.flap-back .page-inner { padding: 34px 38px 30px 34px; }

.rd-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #7a6f5f; display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.rd-eyebrow i { width: 9px; height: 9px; border-radius: 2px; background: var(--bg); display: inline-block; }
.rd-title { font-family: var(--serif); font-weight: 500; font-size: clamp(22px, calc(var(--pw) * .085), 32px); line-height: 1.08; letter-spacing: -.02em; margin: 0; }
.rd-sub { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: #6b6153; margin: 8px 0 0; }
.rd-author { font-family: var(--serif); font-style: italic; font-size: 17px; color: #4a4237; margin: 10px 0 0; }
.rd-meta { margin: 26px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 13px; }
.rd-meta dt { color: #7a6f5f; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; padding-top: 2px; }
.rd-meta dd { margin: 0; color: #2b251d; }
.rd-mini-cover { width: 64px; margin-top: 26px; }
.rd-mini-cover .cover { width: 64px; height: 96px; box-shadow: 0 6px 12px -6px rgba(0,0,0,.5); }
.rd-rule { border: 0; height: 1px; background: #e2d9c7; margin: 22px 0; }
.rd-rating { display: flex; align-items: baseline; gap: 6px; }
.rd-rating b { font-family: var(--serif); font-weight: 400; font-size: calc(var(--pw) * .21); line-height: .9; letter-spacing: -.04em; color: #1f1a14; }
.rd-rating span { font-family: var(--serif); font-size: 20px; color: #8a7f6d; }
.rd-bar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; margin: 14px 0 10px; }
.rd-bar i { height: 5px; border-radius: 2px; background: #e4dccb; overflow: hidden; position: relative; }
.rd-bar i::after { content: ""; position: absolute; inset: 0; width: var(--f, 0%); background: #a9823f; border-radius: 2px; }
.rd-rank { font-size: 12.5px; color: #6b6153; }
.rd-rank strong { color: #2b251d; font-weight: 600; }
.rd-notes-h { font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #7a6f5f; margin: 0 0 10px; }
.rd-notes {
  position: relative; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 17px; line-height: 1.5;
  color: #2b251d; margin: 0; padding-left: 4px; white-space: pre-line;
}
.rd-notes::before {
  content: "\201C"; position: absolute; left: -18px; top: -16px; font-size: 64px; line-height: 1; color: #963a27; opacity: .22; font-style: normal;
}
.rd-quote {
  font-family: var(--serif); font-weight: 500; font-size: 17px; line-height: 1.45; color: #2b251d; margin: 0;
  padding-left: 14px; border-left: 3px solid #a9823f; white-space: pre-line;
}
.rd-none { font-family: var(--serif); font-style: italic; color: #8a7f6d; font-size: 15px; margin: 0; }
.rd-edit { display: inline-block; margin-top: 22px; font-size: 12px; color: #963a27; }
.rd-reading { font-family: var(--serif); font-size: 26px; line-height: 1.15; margin: 0; }
.rd-folio { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-family: var(--serif); font-size: 11px; color: #a1967f; letter-spacing: .1em; }

/* phone: no 3-D, one tall page */
@media (max-width: 760px) {
  .reader { place-items: end center; }
  .spread {
    --pw: min(100vw, 520px); width: var(--pw); height: 88vh; height: 88dvh; perspective: none;
    transform: translateY(40px); border-radius: 18px 18px 0 0; overflow: hidden;
  }
  .reader.show .spread, .reader.open .spread { transform: translateY(0); }
  .flap, .page { position: static; width: auto; height: auto; transform: none !important; }
  .flap-front, .flap-back { position: static; transform: none; }
  .spread-scroll { height: 100%; overflow-y: auto; background: var(--page); }
  .flap-front { display: flex; justify-content: center; padding: 28px 0 6px; background: linear-gradient(to bottom, var(--bg), color-mix(in srgb, var(--bg) 70%, var(--page))); }
  .flap-front .cover { width: 150px; height: 224px; }
  .flap-back, .page-right { box-shadow: none; border-radius: 0; }
  .page-inner { height: auto; overflow: visible; padding: 24px 22px; }
  .flap-back .page-inner { padding: 24px 22px 0; }
  .rd-rating b { font-size: 64px; }
  .rd-mini-cover { display: none; }
  .reader-nav { display: none; }
  .reader-close { top: calc(12vh + 10px); right: 12px; background: rgba(0,0,0,.35); }
  .rd-folio { display: none; }
}
@media (min-width: 761px) { .spread-scroll { display: contents; } }

@media (prefers-reduced-motion: reduce) {
  .spread, .flap, .reader-bg, .spine, .faceout { transition-duration: .01s !important; }
  .progress-dot { animation: none; }
}

/* ---------- generic cards / tables (stats, manage) ---------- */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 22px; }
.grid { display: grid; gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 16px 18px; }
.kpi .l { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.kpi .v { font-family: var(--serif); font-size: 34px; font-weight: 400; letter-spacing: -.02em; line-height: 1.1; margin-top: 6px; }
.kpi .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--card); cursor: pointer; font-size: 13.5px; font-weight: 500; text-decoration: none;
}
.btn:hover { background: var(--paper-2); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { opacity: .88; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.muted { color: var(--ink-3); }
.footer { padding: 50px 0 60px; color: var(--ink-3); font-size: 12.5px; text-align: center; font-family: var(--serif); font-style: italic; }

@media (max-width: 760px) {
  :root { --row: 206px; --sc: .8; }
  .hero { padding: 40px 0 22px; }
  .nav a { padding: 7px 9px; }
  .brand span { display: none; }
  .shelf { padding: 0 6px; }
  .faceout { width: 118px; height: 178px; margin: 0 4px; }
  .count-note { width: 100%; margin-left: 0; }
}
