/* ─────────────────────────────────────────────────────────
   READER · Estilos compartidos para las páginas de capítulo
   ───────────────────────────────────────────────────────── */

:root {
  --ink: #efe6d4;
  --ink-dim: #b8ad97;
  --ink-faint: #6e6553;
  --paper: #0c0a08;
  --paper-2: #14110d;
  --paper-3: #1c1812;
  --rule: #2a241b;
  --accent: #8c2030;
  --accent-soft: #6a1824;
  --serif-display: "Cormorant Garamond", "Times New Roman", serif;
  --serif-body: "Spectral", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Film grain overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a { color: inherit; text-decoration: none; }

/* ── NAV ── */
nav.reader-nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 36px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(12, 10, 8, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
nav.reader-nav .back {
  color: var(--ink-dim);
  display: inline-flex; align-items: center; gap: 10px;
  transition: color 0.2s ease, gap 0.2s ease;
}
nav.reader-nav .back:hover { color: var(--ink); gap: 14px; }
nav.reader-nav .back .arr { font-family: var(--serif-display); font-size: 14px; color: var(--accent); }

nav.reader-nav .brand {
  color: var(--ink);
  font-weight: 500;
}
nav.reader-nav .brand .dot {
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  margin: 0 10px 2px 0;
  vertical-align: middle;
}

/* Reading-progress bar */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 101;
  transition: width 0.05s linear;
}

@media (max-width: 720px) {
  nav.reader-nav { padding: 14px 20px; font-size: 10px; }
  nav.reader-nav .meta { display: none; }
}

/* ── HEADER ── */
.book-header {
  padding: 160px 24px 80px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}
.book-header .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 14px;
  margin-bottom: 28px;
}
.book-header .label::before,
.book-header .label::after {
  content: "";
  width: 28px; height: 1px;
  background: var(--accent);
}
.book-header h1 {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 1.0;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
  color: var(--ink);
  text-wrap: balance;
}
.book-header h1 em {
  font-style: italic;
  color: var(--ink-dim);
  font-weight: 300;
}
.book-header .subtitle {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 60px;
}
.book-header .ornament {
  display: flex; justify-content: center; align-items: center; gap: 16px;
  color: var(--accent);
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 28px;
}
.book-header .ornament::before,
.book-header .ornament::after {
  content: ""; width: 60px; height: 1px;
  background: var(--rule);
}

/* ── CHAPTER ── */
.chapter {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px 160px;
}
.chapter-head {
  text-align: center;
  margin-bottom: 80px;
}
.chapter-head .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 18px;
}
.chapter-head h2 {
  font-family: var(--serif-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

/* The reading body */
.prose p {
  margin: 0 0 1.4em;
  color: var(--ink);
  text-wrap: pretty;
  hyphens: auto;
  text-align: justify;
}
.prose p.no-indent { text-indent: 0; }
.prose p + p { text-indent: 1.6em; }

/* Drop cap on the first paragraph */
.prose > p:first-of-type::first-letter {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: 5.6em;
  line-height: 0.85;
  float: left;
  padding: 0.05em 0.12em 0 0;
  color: var(--accent);
  margin-top: 0.05em;
}
.prose > p:first-of-type { text-indent: 0; }

/* Section break ornament */
.prose .break {
  text-align: center;
  margin: 2.4em 0;
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 24px;
  color: var(--accent);
  letter-spacing: 0.6em;
}

.prose em { font-style: italic; color: var(--ink-dim); }
.prose strong { font-weight: 400; color: var(--ink); }

/* Author dialogue / pull-quote */
.prose blockquote {
  margin: 2em 0;
  padding-left: 24px;
  border-left: 2px solid var(--accent);
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 1.15em;
  line-height: 1.5;
  color: var(--ink-dim);
}

/* ── CTA after the chapter ── */
.chapter-end {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px 120px;
  text-align: center;
}
.chapter-end .ornament {
  display: flex; justify-content: center; align-items: center; gap: 16px;
  color: var(--accent);
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 28px;
  margin-bottom: 56px;
}
.chapter-end .ornament::before,
.chapter-end .ornament::after {
  content: ""; width: 60px; height: 1px;
  background: var(--rule);
}
.chapter-end .end-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 18px;
}
.chapter-end h3 {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--ink);
  text-wrap: balance;
}
.chapter-end h3 em { font-style: italic; color: var(--ink-dim); }
.chapter-end .pitch {
  color: var(--ink-dim);
  font-size: 17px;
  max-width: 480px;
  margin: 0 auto 40px;
  text-wrap: pretty;
}
.chapter-end .actions {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
}
.chapter-end .btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 28px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transition: gap 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.chapter-end .btn.primary {
  background: var(--accent);
  color: var(--ink);
}
.chapter-end .btn.primary:hover { background: var(--accent-soft); gap: 18px; }
.chapter-end .btn.ghost {
  border: 1px solid var(--rule);
  color: var(--ink-dim);
}
.chapter-end .btn.ghost:hover { color: var(--ink); border-color: var(--ink-faint); gap: 18px; }
.chapter-end .btn .arr { font-family: var(--serif-display); font-size: 14px; }

/* ── FOOTER ── */
footer.reader-foot {
  padding: 32px 36px 40px;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  flex-wrap: wrap;
  gap: 16px;
}
footer.reader-foot .brand { color: var(--ink-dim); }
footer.reader-foot .brand .dot {
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  margin: 0 10px 2px 0;
  vertical-align: middle;
}

@media (max-width: 720px) {
  .book-header { padding: 130px 20px 60px; }
  .chapter { padding: 0 20px 100px; }
  .chapter-end { padding: 0 20px 80px; }
  footer.reader-foot { padding: 24px 20px; font-size: 9px; }
  body { font-size: 17px; }
  .prose p + p { text-indent: 1.2em; }
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

::selection { background: var(--accent); color: var(--ink); }
