/* =========================================================
   Bumblequill design system
   Midnight Black + Soft Pastel Yellow + Cozy 3D Atmosphere
   ========================================================= */

:root {
  /* Brand */
  --midnight: #111113;
  --honey: #F6DF91;
  --cream: #FFF5DB;
  --gold: #D5AD58;

  /* Derived */
  --ink-1: #0c0c0e;
  --ink-2: #18181b;
  --ink-3: #222226;
  --surface: rgba(22, 22, 25, 0.66);
  --surface-strong: rgba(20, 20, 23, 0.86);
  --line: rgba(246, 223, 145, 0.14);
  --line-strong: rgba(246, 223, 145, 0.32);
  --text: var(--cream);
  --muted: rgba(255, 245, 219, 0.7);
  --faint: rgba(255, 245, 219, 0.5);
  --glow: 0 0 0 1px rgba(246, 223, 145, 0.18), 0 18px 50px -18px rgba(246, 223, 145, 0.28);

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Space & shape */
  --gutter: clamp(16px, 4vw, 40px);
  --maxw: 1200px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --header-h: 72px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--midnight);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--honey);
  color: var(--midnight);
  border-radius: var(--r-sm);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Background (fixed, behind everything) ---------- */
.bq-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Static fallback: always present underneath the canvas. */
  background:
    radial-gradient(60% 45% at 28% 38%, rgba(213, 173, 88, 0.16), transparent 70%),
    radial-gradient(45% 35% at 72% 62%, rgba(246, 223, 145, 0.09), transparent 70%),
    var(--midnight);
}
.bq-bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.bq-bg__silk { opacity: 0; transition: opacity 1.6s var(--ease); }
.bq-bg.is-ready .bq-bg__silk { opacity: var(--silk-opacity, 1); }
.bq-bg__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 17, 19, 0) 0%, rgba(17, 17, 19, 0.35) 100%);
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(64px, 10vw, 120px); }
.section--tight { padding-block: clamp(40px, 6vw, 72px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(42px, 7.4vw, 92px); }
h2 { font-size: clamp(30px, 4.2vw, 50px); }
h3 { font-size: clamp(20px, 2vw, 24px); }

.lead {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--muted);
  max-width: 60ch;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 48px);
  flex-wrap: wrap;
}
.section-head p { margin: 12px 0 0; color: var(--muted); max-width: 52ch; }

.honey { color: var(--honey); }

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 14px;
  --pad-x: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease), background-color 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary {
  background: var(--honey);
  color: var(--midnight);
  box-shadow: 0 10px 30px -10px rgba(246, 223, 145, 0.55);
}
.btn--primary:hover { background: #fae7a8; transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(246, 223, 145, 0.6); }
.btn--ghost {
  background: rgba(255, 245, 219, 0.04);
  border-color: var(--line-strong);
  color: var(--cream);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn--ghost:hover { border-color: var(--honey); background: rgba(246, 223, 145, 0.08); transform: translateY(-2px); }
.btn--small { --pad-y: 10px; --pad-x: 18px; min-height: 42px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(17, 17, 19, 0.72);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--cream);
}
.brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1c2, var(--honey) 45%, var(--gold));
  color: var(--midnight);
  box-shadow: 0 0 22px -4px rgba(246, 223, 145, 0.6);
}
.brand__mark svg { width: 18px; height: 18px; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav__links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__link {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.nav__link:hover { color: var(--cream); background: rgba(255, 245, 219, 0.05); }
.nav__link[aria-current="page"] { color: var(--honey); }

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 245, 219, 0.03);
  color: var(--cream);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { border-color: var(--line-strong); background: rgba(246, 223, 145, 0.08); }
.icon-btn svg { width: 19px; height: 19px; }

.menu-btn { display: none; }

@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .nav__links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px var(--gutter) 24px;
    background: rgba(17, 17, 19, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav__links.is-open { opacity: 1; transform: none; visibility: visible; }
  .nav__link { padding: 14px 16px; font-size: 17px; border-radius: var(--r-sm); }
  .site-header.menu-open { background: rgba(17, 17, 19, 0.96); }
}

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: calc(var(--header-h) + 6vh) var(--gutter) 24px;
  background: rgba(10, 10, 12, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-overlay__panel {
  width: 100%;
  max-width: 640px;
  transform: translateY(-10px);
  transition: transform 0.35s var(--ease);
}
.search-overlay.is-open .search-overlay__panel { transform: none; }
.search-overlay__hint { margin: 14px 4px 0; color: var(--faint); font-size: 14px; }

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.search-field svg {
  position: absolute;
  left: 20px;
  width: 20px;
  height: 20px;
  color: var(--gold);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  min-height: 58px;
  padding: 14px 20px 14px 54px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-strong);
  color: var(--cream);
  font: inherit;
  font-size: 17px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.search-field input::placeholder { color: var(--faint); }
.search-field input:focus { outline: none; border-color: var(--honey); box-shadow: 0 0 0 4px rgba(246, 223, 145, 0.14); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-items: center;
  padding-block: clamp(48px, 10vh, 120px);
}
.hero__inner { max-width: 880px; }
.hero h1 {
  margin-bottom: 26px;
  text-shadow: 0 2px 40px rgba(17, 17, 19, 0.6);
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--honey);
}
.hero .lead { margin: 0 0 40px; font-size: clamp(18px, 1.9vw, 22px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}
.hero__scroll span {
  width: 1px;
  height: 36px;
  background: linear-gradient(var(--honey), transparent);
  animation: scrollHint 2.6s var(--ease) infinite;
  transform-origin: top;
}
@keyframes scrollHint {
  0% { transform: scaleY(0); opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}
@media (max-height: 640px), (max-width: 560px) { .hero__scroll { display: none; } }

/* ---------- Glass panel ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ---------- Book cover (generated placeholder) ---------- */
.cover {
  --c1: #241f2c;
  --c2: var(--honey);
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 6px 14px 14px 6px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 30% 15%, color-mix(in srgb, var(--c2) 22%, transparent), transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--c1) 100%, #fff 6%), var(--c1) 55%, color-mix(in srgb, var(--c1) 80%, #000));
  box-shadow:
    inset 6px 0 10px -6px rgba(0, 0, 0, 0.7),
    inset 1px 0 0 rgba(255, 255, 255, 0.06),
    0 24px 40px -18px rgba(0, 0, 0, 0.8);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 10% 10% 9%;
  color: var(--cream);
  isolation: isolate;
}
.cover::before {
  /* spine crease */
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7%;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(255, 255, 255, 0.05) 70%, transparent);
  z-index: -1;
}
.cover__tag {
  justify-self: start;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c2) 45%, transparent);
  color: var(--c2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.cover__motif {
  align-self: center;
  justify-self: center;
  width: 46%;
  color: var(--c2);
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--c2) 45%, transparent));
}
.cover__motif svg { width: 100%; height: auto; }
.cover__title {
  font-family: var(--font-display);
  font-size: clamp(16px, 1.6vw, 21px);
  line-height: 1.15;
  text-align: center;
  color: var(--cream);
}
.cover--lg .cover__title { font-size: clamp(22px, 3vw, 34px); }
.cover--lg .cover__tag { font-size: 12px; padding: 4px 12px; }

/* ---------- Book cards ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: clamp(18px, 2.4vw, 30px);
}
@media (max-width: 640px) {
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}

.book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.book-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: var(--glow);
}
.book-card .cover { transition: transform 0.6s var(--ease); }
.book-card:hover .cover { transform: perspective(900px) rotateY(-6deg) translateZ(4px); }
.book-card__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 4px 4px; flex: 1; }
.book-card__cat {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.book-card h3 { font-size: 21px; }
.book-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; flex: 1; }
.book-card .btn { margin-top: 10px; align-self: flex-start; }
.book-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.book-card .btn { position: relative; z-index: 1; }
.book-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.book-card__foot .btn { margin-top: 0; }
.book-card__price { font-weight: 700; font-size: 16px; color: var(--gold); }

@media (max-width: 520px) {
  .book-card { padding: 10px; }
  .book-card__body { padding: 12px 2px 2px; gap: 6px; }
  .book-card h3 { font-size: 17px; }
  .book-card p { display: none; }
  .book-card__cat { font-size: 10.5px; letter-spacing: 0.08em; }
  .book-card .btn { width: 100%; --pad-x: 12px; }
  .book-card__foot { flex-direction: column-reverse; align-items: stretch; gap: 6px; }
  .book-card__price { font-size: 14px; }
}

.book-card--soon { border-style: dashed; }
.book-card--soon:hover { transform: none; box-shadow: none; border-color: var(--line); }
.cover--soon {
  background: radial-gradient(70% 50% at 50% 45%, rgba(246, 223, 145, 0.1), transparent 70%), rgba(255, 245, 219, 0.02);
  border: 1px dashed var(--line-strong);
  box-shadow: none;
  grid-template-rows: 1fr;
}
.cover--soon::before { display: none; }

/* Real book covers: the book's own cover art, with its title laid over the bottom */
.cover--img { padding: 7% 8% 8%; }
.cover--img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.cover--img::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(8, 8, 18, 0.78));
  z-index: -1;
}
.cover--img .cover__tag { color: var(--midnight); background: var(--honey); border-color: var(--honey); }
.cover--img .cover__title { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); }
.cover--soon .cover__motif { color: var(--honey); opacity: 0.7; }

.sample-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  color: var(--faint);
  font-size: 13px;
}

/* ---------- Category cards ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
  padding: 26px 24px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.cat-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 223, 145, 0.16), transparent 70%);
  transition: transform 0.6s var(--ease);
}
.cat-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--glow); }
.cat-card:hover::after { transform: scale(1.35); }
.cat-card__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(246, 223, 145, 0.1);
  color: var(--honey);
  margin-bottom: 8px;
}
.cat-card__icon svg { width: 24px; height: 24px; }
.cat-card h3 { font-size: 21px; }
.cat-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.cat-card__go {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--honey);
  font-size: 14px;
  font-weight: 700;
}
.cat-card__go svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease); }
.cat-card:hover .cat-card__go svg { transform: translateX(4px); }

/* ---------- Worlds ---------- */
.worlds {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
@media (max-width: 900px) { .worlds { grid-template-columns: 1fr; } }
.worlds__list { display: grid; gap: 14px; }
.world {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px 22px 18px 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.world__orb {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--honey);
  background: radial-gradient(circle at 35% 30%, rgba(246, 223, 145, 0.25), rgba(17, 17, 19, 0.2) 70%);
  border: 1px dashed var(--line-strong);
  position: relative;
}
.world__orb svg { width: 30px; height: 30px; }
.world h3 { font-size: 20px; margin-bottom: 4px; }
.world p { margin: 0; color: var(--muted); font-size: 15px; }
.world--next .world__orb { animation: orbPulse 4s ease-in-out infinite; }
@keyframes orbPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(246, 223, 145, 0); }
  50% { box-shadow: 0 0 30px 2px rgba(246, 223, 145, 0.22); }
}
@media (prefers-reduced-motion: reduce) { .world--next .world__orb { animation: none; } }

/* ---------- About block ---------- */
.about-band {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(32px, 6vw, 72px);
  align-items: center;
}
@media (max-width: 860px) { .about-band { grid-template-columns: 1fr; } }
.about-band p { color: var(--muted); margin: 0 0 16px; }
.pillars { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.pillars li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border-radius: var(--r-sm);
  background: rgba(255, 245, 219, 0.03);
  border: 1px solid var(--line);
}
.pillars svg { width: 22px; height: 22px; color: var(--honey); margin-top: 3px; }
.pillars strong { display: block; font-weight: 700; color: var(--cream); }
.pillars span { color: var(--muted); font-size: 15px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(40px, 6vw, 80px);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 17, 19, 0.5), rgba(12, 12, 14, 0.92));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.site-footer .container {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  padding-block: 56px 36px;
}
@media (max-width: 720px) { .site-footer .container { grid-template-columns: 1fr; } }
.site-footer p { color: var(--muted); margin: 14px 0 0; max-width: 40ch; font-size: 15px; }
.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-content: start;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}
.footer-links a:hover { color: var(--honey); }
.footer-links .soon {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
}
.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 90;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  color: var(--cream);
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Page header (inner pages) ---------- */
.page-hero { padding-block: clamp(56px, 9vw, 110px) clamp(28px, 4vw, 48px); }
.page-hero h1 { font-size: clamp(38px, 6vw, 72px); margin-bottom: 18px; }
.page-hero .lead { margin: 0; }

/* ---------- Library ---------- */
.library-tools {
  display: grid;
  gap: 18px;
  padding: 20px;
  margin-bottom: 32px;
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 10;
}
@media (max-width: 720px) { .library-tools { position: static; padding: 16px; } }
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 245, 219, 0.03);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--line-strong); color: var(--cream); }
.chip[aria-pressed="true"] { background: var(--honey); color: var(--midnight); border-color: var(--honey); }
.library-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; color: var(--faint); font-size: 14px; }
.empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state h3 { margin-bottom: 8px; color: var(--cream); }

/* ---------- Book detail ---------- */
.breadcrumb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 28px; font-size: 14px; color: var(--faint); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--honey); }
.book-detail {
  display: grid;
  grid-template-columns: minmax(240px, 420px) 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 820px) { .book-detail { grid-template-columns: 1fr; } .book-detail__cover { max-width: 320px; margin-inline: auto; width: 100%; } }
.book-detail__cover { position: relative; }
.book-detail__cover::after {
  content: "";
  position: absolute;
  inset: 10% -10% -8%;
  z-index: -1;
  background: radial-gradient(closest-side, rgba(246, 223, 145, 0.22), transparent);
  filter: blur(20px);
}
.book-detail h1 { font-size: clamp(36px, 5vw, 64px); margin: 10px 0 18px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.pill--gold { color: var(--midnight); background: var(--honey); border-color: var(--honey); }
.book-detail__desc { color: var(--muted); font-size: 18px; margin: 0 0 30px; max-width: 60ch; }
.buy-box { padding: 22px; display: grid; gap: 14px; max-width: 520px; }
.buy-box p { margin: 0; color: var(--faint); font-size: 14px; }
.buy-box__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.buy-box .buy-box__digital { color: var(--text); font-weight: 600; }
.buy-box .buy-box__price { color: var(--text); font-size: 30px; font-weight: 700; line-height: 1.1; }
.buy-box .buy-box__price span { display: block; margin-top: 4px; color: var(--faint); font-size: 14px; font-weight: 400; }
/* Book page: feature list ("What's in the book") and AI-assistance note */
.book-features { margin-top: 28px; max-width: 520px; }
.book-features__title { font-size: 20px; margin-bottom: 12px; }
.book-features ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.book-features li { position: relative; padding-left: 22px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.book-features li::before { content: ""; position: absolute; left: 4px; top: 0.6em; width: 7px; height: 7px; border-radius: 50%; background: var(--honey); }
.book-features__note { margin: 16px 0 0; color: var(--faint); font-size: 13px; line-height: 1.5; }
.book-detail__subtitle { margin: -6px 0 18px; color: var(--muted); font-size: 20px; font-style: italic; }

/* Real preview pages */
.preview-strip.preview-strip--real { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.preview-thumb.preview-thumb--img { aspect-ratio: 3 / 4; overflow: hidden; }
.preview-thumb--img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview-thumb--img span {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(8, 8, 18, 0.7);
  color: var(--cream);
}
@media (max-width: 640px) { .preview-strip.preview-strip--real { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lightbox__stage .lb-img {
  display: block;
  max-width: 100%;
  max-height: calc(78vh - 70px);
  margin: 0 auto 10px;
  border-radius: var(--r-sm);
}

.preview-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 640px) { .preview-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } }
.preview-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background:
    radial-gradient(80% 70% at 50% 40%, rgba(246, 223, 145, 0.12), transparent 70%),
    var(--ink-2);
  cursor: zoom-in;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
  padding: 0;
}
.preview-thumb:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.preview-thumb svg { width: 28%; color: var(--gold); opacity: 0.8; }
.preview-thumb span { position: absolute; bottom: 8px; left: 10px; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 8, 10, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage {
  position: relative;
  width: min(900px, 100%);
  aspect-ratio: 4 / 3;
  max-height: 78vh;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(70% 60% at 50% 40%, rgba(246, 223, 145, 0.14), transparent 70%),
    var(--ink-2);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}
.lightbox__stage svg { width: 90px; color: var(--gold); margin: 0 auto 14px; }
.lightbox__close { position: absolute; top: 18px; right: 18px; }
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox__nav--prev { left: 18px; }
.lightbox__nav--next { right: 18px; }
@media (max-width: 640px) {
  .lightbox__nav { top: auto; bottom: 22px; transform: none; }
  .lightbox__nav--prev { left: calc(50% - 56px); }
  .lightbox__nav--next { right: calc(50% - 56px); }
}

/* ---------- About page ---------- */
.prose-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 900px) { .prose-grid { grid-template-columns: 1fr; } }
.prose-card { padding: 30px 28px; }
.prose-card h3 { margin: 14px 0 10px; }
.prose-card p { color: var(--muted); margin: 0; }
.prose-card .cat-card__icon { margin: 0; }

.statement {
  padding: clamp(36px, 6vw, 80px);
  text-align: center;
}
.statement h2 { max-width: 22ch; margin: 0 auto 18px; }
.statement p { color: var(--muted); max-width: 56ch; margin: 0 auto 28px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .book-card, .cat-card, .btn, .book-card .cover { transition: none; }
  .book-card:hover .cover { transform: none; }
}

/* Touch devices: no hover lifts that stick after a tap. */
@media (hover: none) {
  .book-card:hover, .cat-card:hover, .btn:hover { transform: none; }
  .book-card:hover .cover { transform: none; }
}

/* ---------- Legal pages (Privacy, Terms) ---------- */
.legal { max-width: 780px; margin-inline: auto; padding: clamp(24px, 5vw, 56px); }
.legal h2 { font-size: clamp(22px, 2.6vw, 28px); margin: 40px 0 12px; }
.legal h2:first-of-type { margin-top: 8px; }
.legal p, .legal li { color: var(--muted); line-height: 1.75; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--cream); }
.legal a { color: var(--honey); }
.legal-updated { font-size: 14px; color: var(--muted); margin-top: 16px; }
.draft-banner {
  max-width: 780px; margin: 0 auto 24px; padding: 14px 18px;
  border: 1px dashed var(--line-strong); border-radius: 14px;
  background: rgba(246, 223, 145, 0.06); color: var(--honey); font-size: 14px; line-height: 1.6;
}
.fill { background: rgba(246, 223, 145, 0.18); color: var(--honey); padding: 1px 6px; border-radius: 6px; }

/* ---------- Book bundles (homepage carousel + Bundles page), 2026-12-01 ---------- */
/* Shorter hero: the bundles shelf now uses the space that was empty under it. */
body[data-page="home"] .hero { min-height: min(calc(100svh - var(--header-h)), 720px); padding-block: clamp(40px, 8vh, 96px) clamp(56px, 9vh, 104px); }
.bundles-section { padding-block: clamp(32px, 5vw, 64px) clamp(16px, 3vw, 32px); }
.bundles-section:not([hidden]) + #featured { padding-top: clamp(40px, 6vw, 80px); }
.bundles-section__tools { display: flex; align-items: center; gap: 10px; }
.bundle-arrow:disabled { opacity: 0.35; cursor: default; }
.bundles-section.is-static .bundle-arrow { display: none; }
@media (hover: none), (max-width: 640px) { .bundle-arrow { display: none; } }

.bundle-track {
  list-style: none;
  margin: 0;
  padding: 6px 2px 18px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(232px, 27%, 290px);
  gap: 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-padding-inline: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 223, 145, 0.45) rgba(255, 245, 219, 0.06);
  border-radius: var(--r-md);
}
.bundle-track::-webkit-scrollbar { height: 8px; }
.bundle-track::-webkit-scrollbar-track { background: rgba(255, 245, 219, 0.06); border-radius: 999px; }
.bundle-track::-webkit-scrollbar-thumb { background: rgba(246, 223, 145, 0.45); border-radius: 999px; }
.bundle-track:focus-visible { outline: 2px solid var(--honey); outline-offset: 4px; }
@media (max-width: 640px) { .bundle-track { grid-auto-columns: 78%; gap: 14px; } }
@media (prefers-reduced-motion: reduce) { .bundle-track { scroll-behavior: auto; } }

.bundle-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.bundle-card:hover, .bundle-card:focus-within { border-color: var(--line-strong); box-shadow: var(--glow); }
.bundle-card__cover { position: relative; display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--ink-2); }
.bundle-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease); }
.bundle-card:hover .bundle-card__cover img { transform: scale(1.03); }
.bundle-card__cover .cover__tag { position: absolute; top: 10px; left: 10px; color: var(--midnight); background: var(--honey); border-color: var(--honey); }
.bundle-card__body { display: flex; flex-direction: column; gap: 6px; padding: 16px 4px 4px; flex: 1; }
.bundle-card h3 { font-size: 21px; }
.bundle-card .btn { margin-top: auto; align-self: stretch; }
.bundle-card .bprice__value { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .bundle-card:hover .bundle-card__cover img { transform: none; } }

.bprice { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 0; }
.bprice__now { font-family: var(--font-display); font-size: 26px; color: var(--honey); }
.bprice__was { color: var(--faint); font-size: 16px; }
.bprice--lg .bprice__now { font-size: 36px; }
.bprice--lg .bprice__was { font-size: 19px; }
.bprice__sale { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gold); }
.bprice__value { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.bprice__value strong { color: var(--cream); font-weight: 700; }
.buy-box .bprice__value { color: var(--muted); }

.bundles-list { display: grid; gap: clamp(24px, 4vw, 40px); }
.bundle-detail {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(18px, 3vw, 36px);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.bundle-detail__cover img { width: 100%; height: auto; border-radius: 14px; display: block; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8); }
.bundle-detail__cover { align-self: start; position: sticky; top: calc(var(--header-h) + 16px); }
.bundle-detail h2 { margin-bottom: 14px; }
.bundle-detail .meta-row { margin-bottom: 16px; }
.bundle-detail__blurb { color: var(--muted); line-height: 1.7; margin: 0 0 22px; max-width: 64ch; }
.bundle-detail .buy-box { margin-bottom: 28px; }
.bundle-detail__h { font-size: 22px; margin-bottom: 14px; }
@media (max-width: 760px) {
  .bundle-detail { grid-template-columns: 1fr; }
  .bundle-detail__cover { position: static; max-width: 320px; }
}
.bundle-books { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.bundle-books li { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; padding-top: 14px; border-top: 1px solid var(--line); }
.bundle-books li:first-child { border-top: 0; padding-top: 0; }
.bundle-books img { width: 64px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; display: block; }
.bundle-books__title { color: var(--cream); font-weight: 700; text-decoration: none; }
.bundle-books__title:hover { color: var(--honey); }
.bundle-books__meta { display: block; font-size: 13px; color: var(--gold); margin-top: 2px; }
.bundle-books p { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.bundle-books .bundle-books__feats { font-size: 14px; color: var(--faint); }
.bundle-help { padding: clamp(20px, 3vw, 36px); }
.bundle-help h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 14px; }
.bundle-help ol { margin: 0 0 14px; padding-left: 1.3em; color: var(--muted); line-height: 1.75; }
.bundle-help p { margin: 0; color: var(--muted); }
.bundle-help a { color: var(--honey); }
