/* Books — reading room: ivory paper, oxblood cloth, gilt.
   Deliberately unlike the movement sites: this one is for sitting still. */
:root {
  --bg:      #f6f2ea;
  --surface: #fffdf8;
  --ink:     #1f1b16;
  --muted:   #6a6055;
  --faint:   #9b9184;
  --hair:    #e0d8c9;
  --accent:  #7b2d26;
  --gilt:    #9a7b2f;
  --wash:    #f4ead6;
  --lift: 0 1px 2px rgba(40,30,15,.05), 0 18px 40px -26px rgba(40,30,15,.4);
  --serif: "Iowan Old Style", Charter, Palatino, Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #14120f; --surface: #1c1915; --ink: #ece6dc; --muted: #a79c8c;
  --faint: #7a7061; --hair: #2e2921; --accent: #cf6a5c; --gilt: #d9b459;
  --wash: #29231a;
  --lift: 0 1px 2px rgba(0,0,0,.5), 0 18px 40px -24px rgba(0,0,0,.9);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120f; --surface: #1c1915; --ink: #ece6dc; --muted: #a79c8c;
    --faint: #7a7061; --hair: #2e2921; --accent: #cf6a5c; --gilt: #d9b459;
    --wash: #29231a;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 4rem;
}
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }

.mast {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 20px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--hair);
}
.mast b { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.mast .sub {
  display: block; font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint); font-weight: 500;
}
.icon {
  background: none; border: 1px solid var(--hair); color: var(--ink);
  width: 34px; height: 34px; border-radius: 50%; line-height: 1;
}
.back {
  background: none; border: 0; color: var(--muted); padding: 0;
  font-size: .9rem;
}
.back:hover { color: var(--accent); }

.wrap { max-width: 52rem; margin: 0 auto; padding: 0 20px; }
.view[hidden] { display: none; }

/* ── the shelf ─────────────────────────────────────────────────────────── */
.hero { padding: 2.6rem 0 1.4rem; }
.hero h1 {
  font-family: var(--serif); font-size: clamp(1.9rem, 5.5vw, 2.7rem);
  margin: 0 0 .4rem; font-weight: 600; line-height: 1.15;
}
.hero p { color: var(--muted); margin: 0; max-width: 34rem; }

.shelf { display: grid; gap: 1rem; padding-bottom: 2rem; }
@media (min-width: 720px) { .shelf { grid-template-columns: 1fr 1fr; } }

.book {
  display: flex; gap: 1rem; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: 12px; padding: 1rem; box-shadow: var(--lift);
  color: inherit;
}
.book:hover { border-color: var(--accent); }
.cover {
  flex: none; width: 84px; height: 116px; border-radius: 6px;
  background: linear-gradient(150deg, var(--accent), #2c1a16);
  display: grid; place-items: center; overflow: hidden;
  box-shadow: inset -6px 0 12px -8px rgba(0,0,0,.7);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover span {
  font-family: var(--serif); color: #f3e2c0; font-size: 1.6rem;
}
.book h2 {
  font-family: var(--serif); font-size: 1.15rem; margin: 0 0 .15rem;
  font-weight: 600; line-height: 1.25;
}
.book .by { font-size: .85rem; color: var(--muted); margin: 0 0 .5rem; }
.book .meta {
  font-size: .78rem; color: var(--faint); display: flex; flex-wrap: wrap;
  gap: .3rem .7rem; margin: 0;
}
.bar {
  height: 4px; border-radius: 2px; background: var(--hair);
  margin-top: .6rem; overflow: hidden;
}
.bar i { display: block; height: 100%; background: var(--gilt); }

/* ── one book ──────────────────────────────────────────────────────────── */
.bookhead { padding: 1.6rem 0 1rem; display: flex; gap: 1.2rem; align-items: flex-start; }
.bookhead .cover { width: 108px; height: 150px; }
.bookhead h1 {
  font-family: var(--serif); font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  margin: 0 0 .2rem; font-weight: 600; line-height: 1.2;
}
.bookhead .by { color: var(--muted); margin: 0 0 .5rem; }
.bookhead .meta { font-size: .82rem; color: var(--faint); }
.bookhead .meta a { color: var(--muted); }

.find {
  width: 100%; font: inherit; font-size: .95rem; padding: .55rem .75rem;
  border: 1px solid var(--hair); border-radius: 9px;
  background: var(--surface); color: inherit; margin-bottom: .4rem;
}

.chapters { display: grid; gap: .5rem; padding: .6rem 0 3rem; }
.chapter {
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: 10px; overflow: hidden;
}
.chapter > .row {
  display: flex; align-items: baseline; gap: .7rem; width: 100%;
  padding: .65rem .85rem; background: none; border: 0; text-align: left;
  color: inherit;
}
.chapter > .row:hover { background: var(--wash); }
.chapter .num {
  flex: none; font-variant-numeric: tabular-nums; font-size: .78rem;
  color: var(--gilt); min-width: 2.2rem; font-weight: 600;
}
.chapter .t { flex: 1; font-family: var(--serif); font-size: 1rem; }
.chapter .len {
  flex: none; font-size: .76rem; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.chapter .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--hair); }
.chapter.ok .dot { background: var(--gilt); }

.marks { padding: 0 .85rem .8rem 3.9rem; display: grid; gap: .2rem; }
.marks a {
  font-size: .88rem; text-decoration: none; color: var(--muted);
  display: flex; gap: .6rem;
}
.marks a:hover { color: var(--accent); }
.marks .at {
  font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--gilt);
  min-width: 3.2rem;
}
.marks .none { font-size: .85rem; color: var(--faint); }

.note {
  border: 1px dashed var(--hair); border-radius: 10px; padding: .85rem 1rem;
  font-size: .9rem; color: var(--muted); margin: 1rem 0 2rem;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.note b { color: var(--ink); }
.foot {
  margin-top: 2rem; padding: 1.2rem 0 2rem; border-top: 1px solid var(--hair);
  font-size: .85rem; color: var(--faint);
}
.foot a { color: var(--muted); }

.book { cursor: pointer; }
.book:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bookbody { min-width: 0; }
