/* ==========================================================================
   LumiNridge — design system
   Warm paper, deep plum ink, muted gold. Zero external fonts, zero frameworks.
   ========================================================================== */

:root {
  --ink: #2a1f33;
  --ink-soft: #453a52;
  --muted: #746a82;
  --faint: #9a91a6;
  --paper: #faf7f2;
  --paper-2: #f4efe7;
  --card: #ffffff;
  --gold: #b9893f;
  --gold-soft: #efe3cc;
  --line: #e7dfd3;
  --line-soft: #f0ebe2;
  --danger: #9b3b3b;

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Times New Roman, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(42, 31, 51, 0.05), 0 2px 8px rgba(42, 31, 51, 0.04);
  --shadow-md: 0 2px 4px rgba(42, 31, 51, 0.05), 0 12px 28px rgba(42, 31, 51, 0.09);
  --shadow-lg: 0 4px 8px rgba(42, 31, 51, 0.06), 0 24px 56px rgba(42, 31, 51, 0.14);

  --wrap: 1200px;
  --header-h: 68px;
}

/* --------------------------------------------------------------- reset -- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  z-index: 200;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.lead {
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.section { padding-block: 56px; }
.section-more { margin-top: 32px; text-align: center; }

.section-head { margin-bottom: 28px; }
.section-head h2 { font-size: 30px; }
.section-sub {
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}

.sub-head {
  font-size: 21px;
  margin-top: 32px;
}

/* -------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 19px; height: 19px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand-tag {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.main-nav > a,
.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 13px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-soft);
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s, color 0.16s;
}
.main-nav > a:hover,
.nav-trigger:hover { background: var(--paper-2); color: var(--ink); }

.nav-trigger svg { width: 15px; height: 15px; transition: transform 0.2s; }
.nav-item.is-open .nav-trigger svg { transform: rotate(180deg); }

.nav-item { position: relative; }

.nav-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 340px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 70;
}
.nav-item.is-open .nav-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-panel a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: background 0.14s;
}
.nav-panel a:hover { background: var(--paper-2); }
.nav-panel a span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 0.16s, border-color 0.16s;
}
.icon-btn:hover { background: var(--paper-2); border-color: var(--line); }
.icon-btn svg { width: 19px; height: 19px; }

.menu-toggle { display: none; }

/* -------------------------------------------------------------- drawer -- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 31, 51, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s, visibility 0.22s;
  z-index: 90;
}
.drawer-backdrop.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--paper);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform 0.26s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.drawer.is-open { transform: translateX(0); }

.drawer-head {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.drawer-body {
  padding: 18px 20px 40px;
  overflow-y: auto;
}

.drawer-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 22px 0 8px;
}
.drawer-label:first-child { margin-top: 0; }

.drawer-body a {
  display: block;
  padding: 9px 0;
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
}
.drawer-body a:hover { color: var(--gold); }

/* --------------------------------------------------------------- hero -- */

.hero {
  padding-block: 64px 52px;
  background:
    radial-gradient(1200px 480px at 12% -10%, rgba(185, 137, 63, 0.1), transparent 62%),
    radial-gradient(900px 420px at 88% 0%, rgba(42, 31, 51, 0.07), transparent 60%);
  border-bottom: 1px solid var(--line);
}

.hero-copy { max-width: 760px; }

.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

.hero-copy > p {
  font-size: 18px;
  color: var(--muted);
  max-width: 62ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.18s, background 0.18s, border-color 0.18s;
}
.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-ghost {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  list-style: none;
  padding: 0;
  margin: 44px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.hero-stats strong {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.1;
  color: var(--ink);
}
.hero-stats span {
  font-size: 13px;
  color: var(--muted);
}

/* --------------------------------------------------------- featured --- */

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
}

.hero-book {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.2s;
}
.hero-book:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.hero-book-cover { display: block; background: var(--paper-2); }
.hero-book-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.hero-book-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }

.chip {
  align-self: flex-start;
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.chip-gold { background: var(--gold-soft); color: #7a5722; }

.hero-book h2 { font-size: 21px; margin-bottom: 4px; }
.hero-book h2 a { text-decoration: none; }
.hero-book h2 a:hover { color: var(--gold); }

.hero-book-author { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.hero-book-author a { color: var(--ink-soft); }

.hero-book-desc {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 14px;
}

.hero-book-meta {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  color: var(--faint);
  margin: auto 0 16px;
}

/* ------------------------------------------------------------- genres -- */

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.genre-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 22px 20px;
  text-decoration: none;
  transition: transform 0.16s, box-shadow 0.2s, border-color 0.16s;
}
.genre-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-soft);
}

.genre-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--paper-2);
  color: var(--gold);
  margin-bottom: 14px;
}
.genre-icon svg { width: 21px; height: 21px; }

.genre-card h3 { font-size: 18px; margin-bottom: 6px; }
.genre-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 12px;
}
.genre-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.03em;
}

/* -------------------------------------------------------- collections -- */

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}

.collection-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform 0.16s, box-shadow 0.2s;
}
.collection-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.collection-covers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--paper-2);
}
.collection-covers a { display: block; }
.collection-covers img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

.collection-body { padding: 20px 22px 22px; }
.collection-body h3 { font-size: 19px; margin-bottom: 8px; }
.collection-body h3 a { text-decoration: none; }
.collection-body h3 a:hover { color: var(--gold); }
.collection-body p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
.collection-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
}

/* -------------------------------------------------------- book cards -- */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 26px 20px;
}

.book-grid-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.book-card { display: flex; flex-direction: column; }

.book-card-cover {
  display: block;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper-2);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.22s;
}
.book-card-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}
.book-card:hover .book-card-cover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.book-card-body { padding-top: 12px; }

.book-card-body h3 {
  font-size: 15.5px;
  line-height: 1.35;
  margin-bottom: 3px;
}
.book-card-body h3 a { text-decoration: none; }
.book-card-body h3 a:hover { color: var(--gold); }

.book-card-author {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.book-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  color: var(--faint);
  margin: 0;
}
.book-card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

.book-card-pitch {
  font-size: 11.5px;
  color: var(--gold);
  margin: 6px 0 0;
  line-height: 1.45;
}

/* --------------------------------------------------------- book rows -- */

.book-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.book-row-cover {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.book-row-cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.book-row-body h3 { font-size: 17px; margin-bottom: 2px; }
.book-row-body h3 a { text-decoration: none; }
.book-row-body h3 a:hover { color: var(--gold); }
.book-row-desc {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.55;
}
.book-row .go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  white-space: nowrap;
}
.book-row .go svg { width: 16px; height: 16px; }

.mini-book {
  display: flex;
  gap: 12px;
  align-items: center;
}
.mini-book img {
  width: 44px;
  border-radius: 6px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}
.mini-book h4 { font-size: 14px; margin-bottom: 1px; }
.mini-book h4 a { text-decoration: none; }
.mini-book span { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------- pages -- */

.page-head {
  padding-block: 44px 36px;
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: clamp(30px, 4.4vw, 44px); margin-bottom: 14px; }
.page-lead {
  font-size: 17.5px;
  color: var(--muted);
  max-width: 68ch;
  margin: 0;
  line-height: 1.65;
}

.breadcrumb { margin-bottom: 18px; }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--line);
}
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 500; }

.stats-strip { padding-block: 30px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 18px;
}
.stats-grid-sm { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 16px;
  text-align: center;
}
.stat strong {
  display: block;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.1;
  color: var(--ink);
}
.stat span {
  font-size: 12.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------ library -- */

.library-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13.5px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.filter-btn span {
  font-size: 11px;
  color: var(--faint);
  background: var(--paper-2);
  border-radius: 999px;
  padding: 1px 7px;
}
.filter-btn:hover { border-color: var(--gold); }
.filter-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.filter-btn.is-active span { background: rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.85); }

.library-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}
.library-sort select {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.library-count {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 18px;
}

.book-card.is-hidden { display: none; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
  font-size: 15px;
}

/* --------------------------------------------------------- book page -- */

.book-hero {
  display: grid;
  grid-template-columns: minmax(190px, 250px) 1fr;
  gap: 40px;
  padding-block: 36px 32px;
  align-items: start;
}

.book-hero-cover img {
  width: 100%;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}

.book-hero-body h1 {
  font-size: clamp(30px, 4.2vw, 46px);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.book-series {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 6px;
  font-weight: 600;
}

.book-byline {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 18px;
}
.book-byline a { color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.book-byline a:hover { color: var(--gold); }

.book-hero-desc {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 62ch;
}

.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}

.book-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  padding: 18px 0 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.book-hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--muted);
}
.book-hero-meta svg { width: 16px; height: 16px; color: var(--gold); }

.book-section {
  padding-block: 34px;
  border-top: 1px solid var(--line);
}

.book-section .section-head h2 { font-size: 26px; }

.glance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.glance-item {
  background: var(--card);
  padding: 14px 18px;
}
.glance-item dt {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 3px;
}
.glance-item dd {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}
.glance-item dd a { color: var(--gold); text-decoration: none; font-weight: 600; }
.glance-item dd a:hover { text-decoration: underline; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.profile-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
}
.profile-block h3 {
  font-size: 13px;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.profile-block p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.6; margin: 0; }

.structure-note {
  font-size: 16px;
  color: var(--ink-soft);
  border-left: 3px solid var(--gold-soft);
  padding-left: 18px;
  line-height: 1.7;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #7a5722;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.tag:hover { background: var(--gold); color: #fff; }
.tag-static span {
  font-size: 11px;
  opacity: 0.7;
}

.theme-grid,
.who-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.theme-card,
.who-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px 22px;
}
.theme-card h3,
.who-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
  color: var(--ink);
}
.theme-card p,
.who-card p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.guide-part { margin-bottom: 34px; }
.guide-part h3 {
  font-size: 19px;
  color: var(--gold);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.guide-note {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 74ch;
  margin-bottom: 16px;
}

.chapter-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--card);
}
.chapter-list li {
  display: grid;
  grid-template-columns: minmax(150px, 240px) 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.chapter-list li:last-child { border-bottom: 0; }
.chapter-title {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
}
.chapter-note {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.chapter-words {
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
}

.notice {
  background: var(--card);
  border: 1px solid var(--gold-soft);
  border-left: 4px solid var(--gold);
  border-radius: var(--r-md);
  padding: 18px 22px;
}
.notice p { margin: 0; font-size: 15px; color: var(--ink-soft); }
.notice a { color: var(--gold); }

.faq-list { display: grid; gap: 10px; }
.faq {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.faq summary {
  padding: 15px 20px;
  font-family: var(--serif);
  font-size: 16.5px;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans);
  font-size: 22px;
  color: var(--gold);
  line-height: 1;
}
.faq[open] summary::after { content: "\2212"; }
.faq[open] summary { border-bottom: 1px solid var(--line-soft); }
.faq-body { padding: 14px 20px 18px; }
.faq-body p { font-size: 15px; color: var(--ink-soft); margin: 0; }

/* -------------------------------------------------------------- prose -- */

.prose {
  max-width: 74ch;
}
.prose h2 {
  font-size: 25px;
  margin-top: 40px;
  padding-top: 8px;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: 18px;
  font-family: var(--sans);
  font-weight: 700;
  margin-top: 28px;
}
.prose p { font-size: 16.5px; line-height: 1.75; color: var(--ink-soft); }
.prose ul, .prose ol { padding-left: 22px; margin-bottom: 1.1em; }
.prose li { font-size: 16px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 8px; }
.prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--ink); }

.contact-email a {
  font-family: var(--serif);
  font-size: 21px;
  text-decoration: none;
}

.contact-form {
  display: grid;
  gap: 6px;
  max-width: 620px;
  margin: 18px 0 30px;
}
.contact-form label {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 12px;
}
.contact-form .optional { color: var(--faint); font-weight: 400; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185, 137, 63, 0.14);
}
.contact-form textarea { resize: vertical; }
.contact-form .btn { margin-top: 18px; justify-self: start; }
.form-note { font-size: 13.5px; color: var(--muted); }

.notfound { text-align: center; padding-block: 96px; }
.notfound h1 { font-size: clamp(30px, 5vw, 46px); }
.notfound p { color: var(--muted); max-width: 52ch; margin-inline: auto; }
.notfound .hero-actions { justify-content: center; }

/* ---------------------------------------------------------- ad slots -- */

.ad-slot {
  display: block;
  margin: 34px 0;
  text-align: center;
}
.ad-band { margin-block: 8px; }

.ad-slot-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

.ad-placeholder {
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--faint);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 26px 18px;
}

.ad-wrap { min-height: 90px; }
.ad-unit { display: block; }

/* ------------------------------------------------------------ search -- */

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 31, 51, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  padding: 12vh 20px 20px;
  overflow-y: auto;
  z-index: 120;
}
.search-overlay.is-open { display: block; }

.search-box {
  max-width: 680px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.search-field svg { width: 20px; height: 20px; color: var(--faint); flex-shrink: 0; }
.search-field input {
  flex: 1;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 18px;
  background: none;
  color: var(--ink);
}

.search-results { max-height: 58vh; overflow-y: auto; }
.search-result {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 22px;
  text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
}
.search-result:hover { background: var(--paper-2); }
.search-result img {
  width: 38px;
  border-radius: 4px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  flex-shrink: 0;
}
.search-result strong { font-size: 15px; display: block; }
.search-result span { font-size: 12.5px; color: var(--muted); }
.search-empty { padding: 28px 22px; color: var(--muted); font-size: 14.5px; }
.search-hint {
  padding: 10px 22px;
  font-size: 12px;
  color: var(--faint);
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.search-page-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  max-width: 620px;
}
.search-page-field svg { width: 20px; height: 20px; color: var(--faint); }
.search-page-field input {
  flex: 1;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 16.5px;
  background: none;
}
.search-page-count { font-size: 13.5px; color: var(--muted); margin: 18px 0 22px; }

/* ---------------------------------------------------------- to-top --- */

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 80;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top svg { width: 19px; height: 19px; }

/* ------------------------------------------------------------ footer -- */

.site-footer {
  margin-top: 72px;
  background: var(--ink);
  color: rgba(250, 247, 242, 0.78);
  padding-block: 52px 34px;
}
.site-footer .brand-name { color: var(--paper); }
.site-footer .brand-tag { color: rgba(250, 247, 242, 0.5); }
.site-footer .brand-mark { background: rgba(250, 247, 242, 0.12); color: var(--gold-soft); }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 36px;
}
.footer-brand p {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(250, 247, 242, 0.62);
  margin-top: 16px;
  max-width: 38ch;
}
.site-footer h4 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 14px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a {
  color: rgba(250, 247, 242, 0.78);
  text-decoration: none;
  font-size: 14px;
}
.site-footer a:hover { color: var(--gold-soft); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(250, 247, 242, 0.14);
  margin-top: 40px;
  padding-top: 24px;
  font-size: 13.5px;
}
.footer-bottom p { margin: 0; }
.footer-note {
  margin-top: 22px;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(250, 247, 242, 0.45);
  max-width: 90ch;
}

/* -------------------------------------------------------- responsive -- */

@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .main-nav { display: none; }
  .menu-toggle { display: grid; }
  .book-hero { grid-template-columns: 1fr; gap: 26px; }
  .book-hero-cover { max-width: 220px; }
  .chapter-list li { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 640px) {
  .wrap { padding-inline: 18px; }
  .section { padding-block: 40px; }
  .hero { padding-block: 42px 36px; }
  .hero h1 { font-size: 32px; }
  .hero-stats { gap: 22px; }
  .hero-stats strong { font-size: 24px; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 22px 14px; }
  .book-card-body h3 { font-size: 14px; }
  .book-row { grid-template-columns: 58px 1fr; }
  .book-row .go { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .glance-grid { grid-template-columns: 1fr 1fr; }
  .library-toolbar { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .site-footer, .ad-slot, .to-top, .search-overlay, .drawer, .drawer-backdrop { display: none !important; }
  body { background: #fff; }
}
