@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Outfit:wght@200;300;400;500&family=DM+Mono:wght@300;400&display=swap');

:root {
  --ink: #0f0e0d;
  --paper: #f5f2ed;
  --paper-warm: #ede9e1;
  --rule: #c8c2b8;
  --rule-light: #e2ddd6;
  --muted: #7a7570;
  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Outfit', system-ui, sans-serif;
  --mono: 'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: var(--serif); -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* ── HEADER ── */
.site-header { border-bottom: 1px solid var(--rule); padding: 0 clamp(1.5rem, 5vw, 4rem); position: sticky; top: 0; background: var(--paper); z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.wordmark { font-family: var(--sans); font-weight: 300; font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; color: var(--ink); }
.wordmark span { display: inline-block; width: 1px; height: 12px; background: var(--rule); margin: 0 10px; vertical-align: middle; }
.series-label-nav { font-family: var(--sans); font-weight: 200; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.skip-to-content {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.75rem;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s;
}

/* ── HERO ── */
.hero { max-width: 1200px; margin: 0 auto; padding: clamp(4rem, 10vw, 9rem) clamp(1.5rem, 5vw, 4rem) clamp(3rem, 6vw, 6rem); }
.hero-eyebrow { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 2rem; }
.hero-title { font-size: clamp(3rem, 8vw, 7rem); font-weight: 400; line-height: 0.95; letter-spacing: -0.01em; margin-bottom: 2.5rem; max-width: 14ch; }
.hero-title em { font-style: italic; color: var(--muted); }
.hero-rule { width: 60px; height: 1px; background: var(--ink); margin-bottom: 2rem; }
.hero-body { font-size: clamp(1rem, 1.8vw, 1.2rem); line-height: 1.7; color: var(--muted); max-width: 52ch; font-style: italic; }

/* ── BOOKS GRID ── */
.books-section { border-top: 1px solid var(--rule); background: var(--paper-warm); }
.books-inner { max-width: 1200px; margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) clamp(1.5rem, 5vw, 4rem); }
.section-label { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: 3rem; display: flex; align-items: center; gap: 1rem; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.books-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1px; background: var(--rule); }

.book-card { background: var(--paper-warm); padding: clamp(2rem, 4vw, 3.5rem); text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 2rem; transition: background 0.25s ease; cursor: pointer; }
.book-card:hover { background: #e8e3da; }

/* ── COVER IMAGE ── */
.book-cover-wrap {
  width: 100%;
  aspect-ratio: 1/1.414;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}

.book-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.book-meta {}
.book-series-tag { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.75rem; }
.book-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 400; line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 1rem; }
.book-themes { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.theme-tag { font-family: var(--sans); font-size: 0.65rem; font-weight: 300; letter-spacing: 0.06em; color: var(--muted); border: 1px solid var(--rule); padding: 0.25rem 0.6rem; }
.book-cta { margin-top: auto; display: flex; align-items: center; gap: 0.75rem; font-family: var(--sans); font-size: 0.75rem; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.book-cta-arrow { width: 24px; height: 1px; background: var(--ink); position: relative; transition: width 0.25s ease; }
.book-cta-arrow::after { content: ''; position: absolute; right: 0; top: -3px; width: 6px; height: 6px; border-right: 1px solid var(--ink); border-top: 1px solid var(--ink); transform: rotate(45deg); }
.book-card:hover .book-cta-arrow { width: 40px; }

/* ── THEMES BAND ── */
.themes-band { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); overflow: hidden; padding: 1rem 0; background: var(--paper); }
.themes-scroll { display: flex; gap: 3rem; animation: scrollThemes 30s linear infinite; white-space: nowrap; width: max-content; }
.themes-scroll span { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.themes-scroll span.sep { color: var(--rule); }
@keyframes scrollThemes { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── FOOTER ── */
.site-footer { border-top: 1px solid var(--rule); padding: 3rem clamp(1.5rem, 5vw, 4rem); }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-copy { font-family: var(--sans); font-size: 0.72rem; font-weight: 300; color: var(--muted); letter-spacing: 0.05em; }

/* ── BOOK DETAIL HERO ── */
.book-hero { max-width: 1200px; margin: 0 auto; padding: clamp(3rem, 6vw, 6rem) clamp(1.5rem, 5vw, 4rem); display: grid; grid-template-columns: 1fr 2fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
@media (max-width: 680px) { .book-hero { grid-template-columns: 1fr; } .book-cover-hero { max-width: 220px; } }

.book-cover-hero {
  width: 100%;
  aspect-ratio: 1/1.414;
  overflow: hidden;
  background: var(--ink);
}

.book-cover-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.back-link { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-decoration: none; margin-bottom: 2rem; transition: color 0.2s; }
.back-link:hover { color: var(--ink); }
.back-link svg { transition: transform 0.2s; }
.back-link:hover svg { transform: translateX(-3px); }
.book-hero-series { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.book-hero-title { font-size: clamp(2.4rem, 5vw, 4.5rem); font-weight: 400; line-height: 1; letter-spacing: -0.02em; margin-bottom: 2rem; }
.book-hero-synopsis { font-size: 1.05rem; line-height: 1.75; color: var(--muted); font-style: italic; max-width: 52ch; margin-bottom: 1.5rem; padding: 1.5rem 0; border-top: 1px solid var(--rule-light); border-bottom: 1px solid var(--rule-light); }
.start-reading-btn { display: inline-flex; align-items: center; gap: 0.75rem; font-family: var(--sans); font-size: 0.75rem; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--ink); border: 1px solid var(--ink); padding: 0.65rem 1.2rem; margin-bottom: 2.5rem; transition: background 0.2s, color 0.2s; }
.start-reading-btn:hover { background: var(--ink); color: var(--paper); }
.start-reading-arrow { width: 20px; height: 1px; background: currentColor; position: relative; transition: width 0.2s; }
.start-reading-arrow::after { content: ''; position: absolute; right: 0; bottom: -3px; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
.start-reading-btn:hover .start-reading-arrow { width: 30px; }

.purchase-section { margin-bottom: 2.5rem; }
.purchase-label { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.purchase-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.purchase-link { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--sans); font-size: 0.72rem; font-weight: 400; letter-spacing: 0.06em; text-decoration: none; color: var(--paper); background: var(--ink); padding: 0.55rem 1.1rem; transition: background 0.2s; }
.purchase-link:hover { background: var(--muted); }
.purchase-link.secondary { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.purchase-link.secondary:hover { background: var(--rule-light); }

/* ── TOC ── */
.toc-section { border-top: 1px solid var(--rule); background: var(--paper-warm); }
.toc-inner { max-width: 1200px; margin: 0 auto; padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4rem); }
.toc-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 3rem; gap: 1rem; }
.toc-title { font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 400; }
.toc-count { font-family: var(--mono); font-size: 0.65rem; color: var(--muted); letter-spacing: 0.1em; }
.toc-part { margin-bottom: 2.5rem; }
.toc-part-label { font-family: var(--sans); font-size: 0.65rem; font-weight: 400; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule-light); margin-bottom: 0.25rem; }
.toc-chapter { display: flex; align-items: baseline; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule-light); }
.chapter-num { font-family: var(--mono); font-size: 0.65rem; color: var(--muted); min-width: 2rem; flex-shrink: 0; }
.chapter-title { font-size: 1rem; font-weight: 400; flex: 1; line-height: 1.4; }
.chapter-lock { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em; color: var(--rule); text-transform: uppercase; flex-shrink: 0; }
.chapter-open { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em; color: var(--ink); text-transform: uppercase; flex-shrink: 0; }
.chapter-open:hover { text-decoration: underline !important; }
.toc-intro, .toc-conclusion { display: flex; align-items: baseline; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule-light); }
.toc-intro .chapter-title, .toc-conclusion .chapter-title { font-style: italic; }

/* ── PREVIEW ── */
.preview-section { border-top: 1px solid var(--rule); max-width: 1200px; margin: 0 auto; padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 5vw, 4rem); }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--rule); margin-top: 2rem; }
.preview-card { background: var(--paper); padding: 2rem; position: relative; overflow: hidden; }
.preview-card.locked { background: var(--paper-warm); cursor: not-allowed; }
.preview-chapter-label { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.75rem; }
.preview-chapter-title { font-size: 1.15rem; font-weight: 400; margin-bottom: 1rem; line-height: 1.3; }
.preview-text { font-size: 0.9rem; line-height: 1.7; color: var(--muted); }
.preview-blur { margin-top: 1rem; filter: blur(4px); user-select: none; pointer-events: none; opacity: 0.5; font-size: 0.88rem; line-height: 1.7; }
.locked-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 2rem; background: linear-gradient(to bottom, transparent 40%, var(--paper-warm) 75%); }
.locked-badge { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--sans); font-size: 0.65rem; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--rule); padding: 0.4rem 0.8rem; background: var(--paper-warm); }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { opacity: 0; animation: fadeUp 0.7s ease forwards; }
.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.15s; }
.fade-up:nth-child(3) { animation-delay: 0.25s; }
.fade-up:nth-child(4) { animation-delay: 0.35s; }

@media (max-width: 600px) { .header-inner { height: 56px; } .series-label-nav { display: none; } .books-grid { grid-template-columns: 1fr; } }
