:root {
  --bg: #ffffff;
  --ink: #0b1220;
  --muted: #5b6577;
  --line: #e7ebf2;
  --blue: #0a66c2;
  --blue-deep: #074a8c;
  --blue-soft: #eef5fc;
  --blue-mid: #3d8fdc;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(10, 40, 90, 0.08);
  --max: 1080px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-deep); }

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(231,235,242,0.9);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 24px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 600;
}
.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff !important;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(10,102,194,0.22);
}
.nav-cta:hover { background: var(--blue-deep); color: #fff !important; }

.hero {
  padding: 72px 0 56px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.4vw, 3.55rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  font-weight: 600;
}
.lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 34rem;
  margin: 0 0 28px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(10,102,194,0.24);
}
.btn-primary:hover { background: var(--blue-deep); color: #fff; }
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: #cfd7e4; background: #fafbfd; color: var(--ink); }

.hero-aside {
  display: grid;
  gap: 18px;
  justify-items: center;
}
.cover-frame {
  width: min(280px, 100%);
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  background:
    linear-gradient(160deg, #0a66c2 0%, #074a8c 48%, #0b1220 100%);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 22px;
}
.cover-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.18), transparent 45%),
    linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.35));
}
.cover-kicker, .cover-title, .cover-author {
  position: relative;
  z-index: 1;
}
.cover-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 10px;
}
.cover-title {
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.15;
  margin: 0 0 10px;
}
.cover-author {
  font-size: 0.85rem;
  opacity: 0.9;
}
.cover-note {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

.section {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}
.section-head {
  max-width: 40rem;
  margin-bottom: 36px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  font-weight: 600;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 48px;
  align-items: center;
}
.photo-ph {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, var(--blue-soft), #f7f9fc 70%),
    repeating-linear-gradient(135deg, transparent, transparent 12px, rgba(10,102,194,0.04) 12px, rgba(10,102,194,0.04) 13px);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.photo-ph strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.photo-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: linear-gradient(145deg, var(--blue-mid), var(--blue-deep));
  opacity: 0.85;
}
.about-copy p {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 16px;
}
.about-copy p:last-child { margin-bottom: 0; }

.series-card {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 28px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  align-items: start;
}
.series-card h3 {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.series-card p {
  margin: 0 0 16px;
  color: var(--muted);
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.pill {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--blue-deep);
  background: var(--blue-soft);
  border-radius: 999px;
  padding: 6px 10px;
}
.coming {
  opacity: 0.92;
  background: linear-gradient(180deg, #fbfcfe, #f5f8fc);
}
.coming .mini-cover {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  border: 1px dashed #c5d0e0;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 12px;
}
.mini-cover.live {
  background: linear-gradient(160deg, #0a66c2, #074a8c);
  border: none;
  color: #fff;
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.2;
  padding: 14px;
}

.signup {
  background: linear-gradient(180deg, var(--blue-soft), #ffffff 55%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.signup-box {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.signup-box h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.signup-box > p {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 1.05rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}
input[type="email"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-size: 1rem;
  outline: none;
  background: #fff;
}
input[type="email"]:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 4px rgba(10,102,194,0.12);
}
.form-note {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.form-status {
  margin-top: 14px;
  font-size: 0.95rem;
  min-height: 1.4em;
}
.form-status.ok { color: var(--blue-deep); }
.form-status.err { color: #b42318; }

.site-footer {
  padding: 36px 0 48px;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .hero-grid, .about-grid, .series-card {
    grid-template-columns: 1fr;
  }
  .hero { padding-top: 48px; }
  .series-card .mini-cover, .series-card .mini-cover.live {
    width: 140px;
  }
  .nav-links .hide-sm { display: none; }
  .form-row { grid-template-columns: 1fr; }
}

.cover-link { display:block; width:min(280px, 100%); }
.cover-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--blue-soft);
}
.mini-cover-link {
  display: block;
  width: 100%;
  max-width: 220px;
}
.mini-cover-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(10,40,90,0.12);
  background: var(--blue-soft);
}
@media (max-width: 860px) {
  .mini-cover-link { max-width: 160px; }
}

.author-photo {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #0b1220;
  aspect-ratio: 1 / 1;
}
.author-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

/* Multi-page */
.page-hero { padding: 56px 0 12px; }
.page-title {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  font-weight: 600;
  line-height: 1.1;
}
.page-lede {
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0;
}
.about-heading {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  font-weight: 600;
}
.nav-links a[aria-current="page"] { color: var(--ink); }

.home-teaser { background: #fafbfd; }
.teaser-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.teaser-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  font-weight: 600;
}
.teaser-copy { margin: 0; color: var(--muted); max-width: 32rem; }

/* Interactive saga shelf */
.saga-shelf {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.shelf-book {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 16px 16px 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(10, 40, 90, 0.06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  font: inherit;
}
.shelf-book:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(10, 40, 90, 0.12);
}
.shelf-book:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(10,102,194,0.18), 0 18px 40px rgba(10, 40, 90, 0.12);
}
.shelf-book.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10,102,194,0.14), 0 18px 44px rgba(10, 40, 90, 0.12);
}
.shelf-book img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  background: var(--blue-soft);
}
.shelf-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}
.shelf-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.shelf-book.is-soon .shelf-soon-art {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  border: 1px dashed #c5d0e0;
  background: linear-gradient(180deg, #fbfcfe, #f1f5fa);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 2rem;
  color: var(--muted);
}

.saga-stage {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(120% 80% at 50% 0%, #f7fbff 0%, #ffffff 55%);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 460px;
  perspective: 1800px;
}
.book-panel {
  padding: 22px 22px 26px;
  transform-style: preserve-3d;
}
.book-panel[hidden] { display: none !important; }
.book-tag {
  font-size: 1.12rem;
  color: var(--ink);
  margin: 0 0 14px !important;
}

/* ---- Open book stage ---- */
.open-book {
  position: relative;
  perspective: 1800px;
  max-width: 920px;
  margin: 0 auto;
}
.book-spread {
  position: relative;
  display: grid;
  grid-template-columns: minmax(160px, 280px) 1fr;
  gap: 0;
  align-items: stretch;
  min-height: 380px;
  border-radius: 4px 14px 14px 4px;
  background:
    linear-gradient(90deg, #e8eef6 0%, #f8fafc 8%, #ffffff 50%, #f7f9fc 92%, #e8eef6 100%);
  box-shadow:
    0 22px 50px rgba(10, 40, 90, 0.12),
    inset 0 0 0 1px rgba(10, 40, 90, 0.06);
  overflow: hidden;
  transform-style: preserve-3d;
}
.book-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: min(280px, 42%);
  width: 16px;
  margin-left: -8px;
  background: linear-gradient(90deg,
    rgba(10,40,90,0.10),
    rgba(255,255,255,0.55) 45%,
    rgba(10,40,90,0.12));
  pointer-events: none;
  z-index: 3;
  opacity: 0.85;
}
.page-left {
  position: relative;
  z-index: 1;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.35), transparent 40%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 11px,
      rgba(10, 40, 90, 0.015) 12px
    );
  border-right: 1px solid rgba(10, 40, 90, 0.06);
}
.page-left img {
  width: 100%;
  max-width: 240px;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(10, 40, 90, 0.18);
}
.page-right {
  position: relative;
  z-index: 1;
  padding: 28px 32px 28px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease 0.05s, transform 0.45s ease 0.05s;
}
.page-right.is-revealed,
.book-panel.is-open .page-right {
  opacity: 1;
  transform: none;
}
.page-right h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 600;
}
.page-right p {
  color: var(--muted);
  margin: 0 0 14px;
  font-size: 1.02rem;
}
.page-right .actions { margin-top: 6px; }

/* Cover door — hinges from the left (spine side of left page) */
.book-cover-door {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  width: min(280px, 42%);
  height: 100%;
  transform-origin: left center;
  transform: rotateY(0deg);
  border-radius: 4px 2px 2px 4px;
  box-shadow: 8px 0 28px rgba(10, 40, 90, 0.22);
  backface-visibility: hidden;
  overflow: hidden;
  pointer-events: none;
  transition: transform 0.7s cubic-bezier(0.22, 0.8, 0.28, 1),
              opacity 0.35s ease 0.45s,
              box-shadow 0.5s ease;
}
.book-cover-door img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.book-cover-door::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.18), transparent 18%, transparent 82%, rgba(255,255,255,0.08));
  pointer-events: none;
}

/* Flip sheets — paper turning across the right page */
.flip-sheet {
  position: absolute;
  top: 4%;
  bottom: 4%;
  left: 42%;
  width: 48%;
  z-index: 5;
  border-radius: 2px 8px 8px 2px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f3f6fa 100%);
  box-shadow:
    -4px 0 16px rgba(10, 40, 90, 0.08),
    inset 0 0 0 1px rgba(10, 40, 90, 0.05);
  transform-origin: left center;
  transform: rotateY(0deg);
  opacity: 0;
  pointer-events: none;
  backface-visibility: hidden;
}
.flip-sheet::before {
  content: "";
  position: absolute;
  inset: 14px 18px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(10, 40, 90, 0.045) 0,
      rgba(10, 40, 90, 0.045) 1px,
      transparent 1px,
      transparent 14px
    );
  opacity: 0.7;
  border-radius: 2px;
}
.flip-sheet-1 { width: 46%; }
.flip-sheet-2 { width: 50%; background: linear-gradient(180deg, #fbfcfe, #eef3f9); }
.flip-sheet-3 { width: 44%; background: linear-gradient(180deg, #ffffff, #f0f4f9); }

/* Opening sequence */
.book-panel.is-opening .book-cover-door {
  transform: rotateY(-158deg);
  opacity: 0;
  box-shadow: -18px 0 40px rgba(10, 40, 90, 0.18);
}
.book-panel.is-opening .flip-sheet {
  animation: pageFlip 0.55s ease forwards;
}
.book-panel.is-opening .flip-sheet-1 { animation-delay: 0.18s; }
.book-panel.is-opening .flip-sheet-2 { animation-delay: 0.34s; }
.book-panel.is-opening .flip-sheet-3 { animation-delay: 0.48s; }
.book-panel.is-opening .page-right {
  animation: copyIn 0.5s ease 0.72s forwards;
}

@keyframes pageFlip {
  0%   { opacity: 0.95; transform: rotateY(0deg); }
  35%  { opacity: 1; }
  100% { opacity: 0; transform: rotateY(-168deg); }
}
@keyframes copyIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Settled open */
.book-panel.is-open .book-cover-door {
  transform: rotateY(-158deg);
  opacity: 0;
  visibility: hidden;
  transition: none;
}
.book-panel.is-open .flip-sheet {
  opacity: 0;
  visibility: hidden;
  animation: none;
}

/* Brief close when switching volumes */
.book-panel.is-closing .book-cover-door {
  visibility: visible;
  opacity: 1;
  transform: rotateY(-28deg);
  transition: transform 0.28s ease, opacity 0.2s ease;
}
.book-panel.is-closing .page-right {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.book-panel.is-closing .flip-sheet {
  visibility: visible;
  opacity: 0.55;
  transform: rotateY(-40deg);
  transition: transform 0.28s ease, opacity 0.2s ease;
}

@media (max-width: 860px) {
  .saga-stage { min-height: 0; }
  .book-spread {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 14px;
  }
  .book-spine { display: none; }
  .page-left {
    border-right: none;
    border-bottom: 1px solid rgba(10, 40, 90, 0.06);
    padding: 20px 20px 8px;
  }
  .page-left img { max-width: 180px; }
  .page-right { padding: 18px 22px 24px; }
  .book-cover-door {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    max-width: 220px;
    left: 50%;
    top: 18px;
    transform: translateX(-50%) rotateY(0deg);
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(10, 40, 90, 0.2);
  }
  .book-panel.is-opening .book-cover-door,
  .book-panel.is-open .book-cover-door {
    transform: translateX(-50%) rotateY(-110deg);
  }
  .book-panel.is-closing .book-cover-door {
    transform: translateX(-50%) rotateY(-20deg);
  }
  .flip-sheet {
    left: 8%;
    width: 84%;
    top: 8%;
    bottom: auto;
    height: 42%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-cover-door,
  .page-right,
  .flip-sheet {
    transition: none !important;
    animation: none !important;
  }
  .book-panel.is-opening .book-cover-door,
  .book-panel.is-open .book-cover-door {
    opacity: 0;
    visibility: hidden;
    transform: rotateY(-158deg);
  }
  .book-panel.is-opening .page-right,
  .book-panel.is-open .page-right,
  .page-right.is-revealed {
    opacity: 1;
    transform: none;
  }
  .flip-sheet { display: none; }
}
.soon-cover {
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  border: 1px dashed #c5d0e0;
  background: linear-gradient(180deg, #fbfcfe, #eef3f9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}
.soon-cover strong {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--ink);
}

@media (max-width: 860px) {
  .saga-shelf { grid-template-columns: 1fr; }
}

.home-bookshelf {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  padding-bottom: 88px;
}
.bookshelf-head { margin-bottom: 28px; }
.bookshelf-head h2 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  font-weight: 600;
}
.bookshelf-head p { margin: 0; color: var(--muted); max-width: 36rem; }

.shelf-wood {
  height: 14px;
  border-radius: 6px;
  margin: 0 4px 18px;
  background:
    linear-gradient(180deg, #c9a57a 0%, #a67c52 45%, #8b623f 100%);
  box-shadow:
    0 8px 18px rgba(80, 50, 20, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.35);
}

.home-shelf .shelf-book {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
}
.home-stage {
  margin-top: 8px;
}


/* Dramatic per-book atmospheres — matched to cover art */
.home-bookshelf,
.saga-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: background 0.9s ease, color 0.6s ease;
}
.home-bookshelf::before,
.saga-section::before {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: -2;
  pointer-events: none;
  background-position: center 30%;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(28px) saturate(1.25) brightness(0.55);
  transform: scale(1.12);
  opacity: 0;
  transition: opacity 0.85s ease, filter 0.85s ease;
}
.home-bookshelf::after,
.saga-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease, background 0.9s ease;
  background: transparent;
}

.home-bookshelf {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
}
.saga-section {
  background: transparent;
}

/* Book 1 — Flame of Rebellion: midnight blue coat + harbor fire orange/amber */
.home-bookshelf[data-active-book="1"]::before,
.saga-section[data-active-book="1"]::before {
  opacity: 1;
  background-image: url("/assets/flame-of-rebellion-cover.jpg");
  filter: blur(26px) saturate(1.35) brightness(0.48);
}
.home-bookshelf[data-active-book="1"],
.saga-section[data-active-book="1"] {
  background:
    linear-gradient(165deg, rgba(12, 18, 36, 0.88) 0%, rgba(28, 22, 28, 0.72) 45%, rgba(18, 14, 22, 0.9) 100%);
}
.home-bookshelf[data-active-book="1"]::after,
.saga-section[data-active-book="1"]::after {
  opacity: 1;
  background:
    radial-gradient(ellipse 70% 55% at 78% 35%, rgba(255, 110, 28, 0.45), transparent 58%),
    radial-gradient(ellipse 55% 50% at 22% 70%, rgba(20, 48, 110, 0.4), transparent 60%),
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(8, 10, 18, 0.75), transparent 55%),
    linear-gradient(180deg, rgba(10, 14, 28, 0.35), rgba(8, 8, 14, 0.55));
}

/* Book 2 — Last Patriot: smoke, burning harbor, cannon iron, relic gold */
.home-bookshelf[data-active-book="2"]::before,
.saga-section[data-active-book="2"]::before {
  opacity: 1;
  background-image: url("/assets/the-last-patriot-cover.png");
  filter: blur(26px) saturate(1.3) brightness(0.46);
}
.home-bookshelf[data-active-book="2"],
.saga-section[data-active-book="2"] {
  background:
    linear-gradient(165deg, rgba(14, 16, 22, 0.9) 0%, rgba(32, 24, 18, 0.75) 48%, rgba(10, 14, 22, 0.92) 100%);
}
.home-bookshelf[data-active-book="2"]::after,
.saga-section[data-active-book="2"]::after {
  opacity: 1;
  background:
    radial-gradient(ellipse 65% 50% at 70% 40%, rgba(230, 92, 0, 0.42), transparent 58%),
    radial-gradient(ellipse 45% 40% at 18% 75%, rgba(212, 175, 55, 0.22), transparent 62%),
    radial-gradient(ellipse 50% 45% at 40% 15%, rgba(44, 62, 80, 0.45), transparent 60%),
    linear-gradient(180deg, rgba(12, 14, 20, 0.4), rgba(6, 8, 12, 0.6));
}

/* Book 3 — Blood & Union: Union navy, sunset gold, blood crimson, mud brown */
.home-bookshelf[data-active-book="3"]::before,
.saga-section[data-active-book="3"]::before {
  opacity: 1;
  background-image: url("/assets/blood-and-union-cover.png");
  filter: blur(26px) saturate(1.25) brightness(0.47);
}
.home-bookshelf[data-active-book="3"],
.saga-section[data-active-book="3"] {
  background:
    linear-gradient(165deg, rgba(16, 22, 40, 0.9) 0%, rgba(36, 22, 20, 0.78) 50%, rgba(12, 12, 18, 0.92) 100%);
}
.home-bookshelf[data-active-book="3"]::after,
.saga-section[data-active-book="3"]::after {
  opacity: 1;
  background:
    radial-gradient(ellipse 60% 48% at 55% 20%, rgba(196, 120, 50, 0.32), transparent 58%),
    radial-gradient(ellipse 50% 45% at 30% 70%, rgba(120, 20, 28, 0.4), transparent 60%),
    radial-gradient(ellipse 55% 50% at 85% 60%, rgba(20, 40, 90, 0.35), transparent 62%),
    linear-gradient(180deg, rgba(10, 12, 22, 0.38), rgba(8, 8, 12, 0.58));
}

/* Pulse when opening — brief surge from cover glow */
.home-bookshelf.mood-pulse::after,
.saga-section.mood-pulse::after {
  animation: moodSurge 1.1s ease-out;
}
.home-bookshelf.mood-pulse::before,
.saga-section.mood-pulse::before {
  animation: moodCoverPush 1.1s ease-out;
}
@keyframes moodSurge {
  0% { opacity: 0.35; }
  30% { opacity: 1; }
  100% { opacity: 1; }
}
@keyframes moodCoverPush {
  0% { transform: scale(1.08); filter: blur(32px) saturate(1.1) brightness(0.35); }
  40% { transform: scale(1.16); filter: blur(22px) saturate(1.45) brightness(0.62); }
  100% { transform: scale(1.12); filter: blur(26px) saturate(1.3) brightness(0.48); }
}

/* Readable type + shelf cards on dark moods */
.home-bookshelf[data-active-book] .bookshelf-head h2,
.saga-section[data-active-book] .section-head h1,
.saga-section[data-active-book] .section-head h2 {
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.45);
}
.home-bookshelf[data-active-book] .bookshelf-head p,
.home-bookshelf[data-active-book] .eyebrow,
.saga-section[data-active-book] .section-head p,
.saga-section[data-active-book] .eyebrow {
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 12px rgba(0,0,0,0.35);
}
.home-bookshelf[data-active-book="1"] .eyebrow,
.saga-section[data-active-book="1"] .eyebrow {
  color: #ffb068;
}
.home-bookshelf[data-active-book="2"] .eyebrow,
.saga-section[data-active-book="2"] .eyebrow {
  color: #e8c56a;
}
.home-bookshelf[data-active-book="3"] .eyebrow,
.saga-section[data-active-book="3"] .eyebrow {
  color: #e8a070;
}

.home-bookshelf[data-active-book] .shelf-wood {
  box-shadow:
    0 10px 28px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.35);
}
.home-bookshelf[data-active-book] .shelf-book,
.saga-section[data-active-book] .shelf-book {
  background: rgba(255,255,255,0.95);
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 14px 36px rgba(0,0,0,0.4);
}
.home-bookshelf[data-active-book="1"] .shelf-book.is-active,
.saga-section[data-active-book="1"] .shelf-book.is-active {
  box-shadow:
    0 0 0 3px rgba(255, 120, 40, 0.55),
    0 18px 44px rgba(0,0,0,0.45);
}
.home-bookshelf[data-active-book="2"] .shelf-book.is-active,
.saga-section[data-active-book="2"] .shelf-book.is-active {
  box-shadow:
    0 0 0 3px rgba(212, 175, 55, 0.55),
    0 18px 44px rgba(0,0,0,0.45);
}
.home-bookshelf[data-active-book="3"] .shelf-book.is-active,
.saga-section[data-active-book="3"] .shelf-book.is-active {
  box-shadow:
    0 0 0 3px rgba(160, 40, 50, 0.55),
    0 18px 44px rgba(0,0,0,0.45);
}

.saga-stage[data-active-book] {
  border-color: rgba(255,255,255,0.2);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.97), rgba(248,246,242,0.96));
  box-shadow:
    0 24px 60px rgba(0,0,0,0.5),
    0 0 90px rgba(255, 110, 28, 0.18);
}
.saga-stage[data-active-book="2"] {
  box-shadow:
    0 24px 60px rgba(0,0,0,0.5),
    0 0 90px rgba(212, 175, 55, 0.16);
}
.saga-stage[data-active-book="3"] {
  box-shadow:
    0 24px 60px rgba(0,0,0,0.5),
    0 0 90px rgba(140, 30, 40, 0.18);
}

body.page-saga {
  transition: background 0.9s ease;
}
body.page-saga:has(.saga-section[data-active-book="1"]) {
  background: #0c101c;
}
body.page-saga:has(.saga-section[data-active-book="2"]) {
  background: #0e1016;
}
body.page-saga:has(.saga-section[data-active-book="3"]) {
  background: #0e121c;
}



/* Keep open-book + shelf cards on dark ink — mood color must not inherit into white panels */
.home-bookshelf[data-active-book] .shelf-book,
.saga-section[data-active-book] .shelf-book,
.home-bookshelf[data-active-book] .saga-stage,
.saga-section[data-active-book] .saga-stage,
.home-bookshelf[data-active-book] .open-book,
.saga-section[data-active-book] .open-book,
.home-bookshelf[data-active-book] .book-panel,
.saga-section[data-active-book] .book-panel,
.home-bookshelf[data-active-book] .page-right,
.saga-section[data-active-book] .page-right,
.home-bookshelf[data-active-book] .page-left,
.saga-section[data-active-book] .page-left {
  color: var(--ink);
}
.home-bookshelf[data-active-book] .shelf-title,
.saga-section[data-active-book] .shelf-title,
.home-bookshelf[data-active-book] .page-right h2,
.saga-section[data-active-book] .page-right h2,
.home-bookshelf[data-active-book] .book-panel-copy h2,
.saga-section[data-active-book] .book-panel-copy h2 {
  color: var(--ink) !important;
  text-shadow: none;
}
.home-bookshelf[data-active-book] .shelf-label,
.saga-section[data-active-book] .shelf-label {
  color: var(--blue);
}
.home-bookshelf[data-active-book] .page-right p,
.saga-section[data-active-book] .page-right p,
.home-bookshelf[data-active-book] .book-tag,
.saga-section[data-active-book] .book-tag {
  color: var(--muted);
}
.home-bookshelf[data-active-book] .book-tag,
.saga-section[data-active-book] .book-tag {
  color: var(--ink);
}

/* Saga page chrome — readable when mood darkens the body */
body.page-saga:has(.saga-section[data-active-book]) .page-title,
body.page-saga:has(.saga-section[data-active-book]) .saga-hero .page-title {
  color: #ffffff !important;
  text-shadow: 0 2px 28px rgba(0,0,0,0.45);
}
body.page-saga:has(.saga-section[data-active-book]) .page-lede {
  color: rgba(255,255,255,0.82) !important;
  text-shadow: 0 1px 14px rgba(0,0,0,0.35);
}
body.page-saga:has(.saga-section[data-active-book]) .saga-hero .eyebrow {
  color: #ffb068;
}
body.page-saga:has(.saga-section[data-active-book="2"]) .saga-hero .eyebrow {
  color: #e8c56a;
}
body.page-saga:has(.saga-section[data-active-book="3"]) .saga-hero .eyebrow {
  color: #e8a070;
}
body.page-saga:has(.saga-section[data-active-book]) .site-header {
  background: rgba(8, 10, 16, 0.72);
  border-bottom-color: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
}
body.page-saga:has(.saga-section[data-active-book]) .wordmark,
body.page-saga:has(.saga-section[data-active-book]) .nav-links a {
  color: rgba(255,255,255,0.88);
}
body.page-saga:has(.saga-section[data-active-book]) .nav-links a:hover,
body.page-saga:has(.saga-section[data-active-book]) .nav-links a[aria-current="page"] {
  color: #fff;
}
body.page-saga:has(.saga-section[data-active-book]) .site-footer {
  background: transparent;
  border-top-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.65);
}
body.page-saga:has(.saga-section[data-active-book]) .site-footer a {
  color: rgba(255,255,255,0.85);
}

@media (prefers-reduced-motion: reduce) {
  .home-bookshelf,
  .saga-section,
  .home-bookshelf::before,
  .saga-section::before,
  .home-bookshelf::after,
  .saga-section::after,
  body.page-saga {
    transition: none !important;
  }
  .home-bookshelf.mood-pulse::after,
  .saga-section.mood-pulse::after,
  .home-bookshelf.mood-pulse::before,
  .saga-section.mood-pulse::before {
    animation: none !important;
  }
}
