/* THE BOOK — minimal, stunning, responsive */
:root {
  --bg: #f6f1e7;
  --bg-2: #efe7d6;
  --ink: #1a1614;
  --ink-soft: #4a423b;
  --ink-mute: #7a6f63;
  --rule: rgba(26,22,20,.14);
  --accent: #b8420f;        /* rubric red */
  --accent-soft: #d97a4a;
  --gold: #b08a3e;
  --paper-grain: rgba(0,0,0,.025);
  --shadow: 0 30px 80px -40px rgba(50,30,10,.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --serif: "Cormorant Garamond", "Iowan Old Style", "Apple Garamond", Garamond, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
html[data-theme="dark"] {
  --bg: #0c0a08;
  --bg-2: #15110d;
  --ink: #ece3d2;
  --ink-soft: #c2b59f;
  --ink-mute: #847665;
  --rule: rgba(236,227,210,.12);
  --accent: #ff8a4c;
  --accent-soft: #ffb487;
  --gold: #d8b76a;
  --paper-grain: rgba(255,255,255,.022);
  --shadow: 0 30px 80px -40px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.62;
  letter-spacing: 0.005em;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body[data-loading="true"] .view { opacity: 0; transform: translateY(8px); }
body { transition: background .5s ease, color .5s ease; }

/* paper-grain backdrop */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(1200px 800px at 70% -10%, var(--bg-2), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, var(--bg-2), transparent 55%);
  opacity: .9;
}
#fx {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; opacity: .5;
}

/* TOP BAR */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: calc(10px + var(--safe-top)) 18px 10px;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.brand {
  justify-self: center;
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: .22em;
  font-size: 12px;
  text-transform: uppercase;
}
.brand-mark { color: var(--accent); font-size: 14px; line-height: 1; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: 1px solid var(--rule);
  color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}
.iconbtn:hover { background: var(--bg-2); }
.iconbtn:active { transform: scale(.96); }
.iconbtn svg { width: 18px; height: 18px; }
.progress {
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; pointer-events: none;
}
.progress > span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width .12s linear;
}

/* NAV (slide-in) */
.nav {
  position: fixed; top: 0; left: 0;
  height: 100dvh; width: min(86vw, 360px);
  background: var(--bg);
  border-right: 1px solid var(--rule);
  z-index: 40;
  transform: translateX(-105%);
  transition: transform .35s cubic-bezier(.6,.05,.2,1);
  padding: calc(20px + var(--safe-top)) 22px 22px;
  overflow-y: auto;
}
.nav.open { transform: translateX(0); box-shadow: var(--shadow); }
.scrim {
  position: fixed; inset: 0; z-index: 35;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .3s ease;
}
.scrim.show { opacity: 1; }
.nav-eyebrow, .nav-foot {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 8px 0 18px;
}
.nav-foot { margin-top: 26px; font-style: normal; }
.chapters { list-style: none; margin: 0; padding: 0; }
.chapters li { border-top: 1px solid var(--rule); }
.chapters li:last-child { border-bottom: 1px solid var(--rule); }
.chapters a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 16px 4px;
  color: var(--ink);
  text-decoration: none;
  align-items: baseline;
}
.chapters a:hover { color: var(--accent); }
.chapters .num {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: .12em;
  padding-top: 4px;
}
.chapters .lbl {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 500;
}
.chapters a.active .lbl { color: var(--accent); font-style: italic; }
.chapters a.active .num { color: var(--accent); }

/* MAIN VIEW */
.view {
  position: relative; z-index: 2;
  transition: opacity .5s ease, transform .5s ease;
}

/* HOME */
.home {
  max-width: 1080px; margin: 0 auto;
  padding: clamp(18px, 4vw, 42px) clamp(16px, 4vw, 42px) 72px;
}
.hero {
  text-align: center;
  padding: clamp(18px, 5vw, 44px) clamp(12px, 3vw, 26px) clamp(20px, 5vw, 46px);
}
.kicker {
  font-family: var(--sans);
  font-size: 12px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink-mute); margin: 0 0 18px;
}
.title {
  margin: 0;
  font-weight: 500;
  line-height: .92;
  font-size: clamp(58px, 13vw, 140px);
  letter-spacing: -.02em;
}
.title .t1 { display: block; font-style: italic; color: var(--ink-soft); font-weight: 400; font-size: .42em; letter-spacing: .04em; margin-bottom: -.1em; }
.title .t2 { display: block; }
.lede {
  max-width: 42ch; margin: 18px auto 22px;
  font-size: clamp(16px, 1.7vw, 20px);
  color: var(--ink-soft);
  font-style: italic;
}
.cta { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btn {
  font-family: var(--sans);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500; font-size: 14px; letter-spacing: .04em;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { border-color: var(--rule); color: var(--ink-soft); }
.btn.ghost:hover { color: var(--ink); }

.home-options {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px auto 0;
}
.home-options[hidden] { display: none; }

.book-intro {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(18px, var(--safe-top)) 18px max(18px, var(--safe-bot));
  background:
    radial-gradient(circle at 50% 30%, color-mix(in oklab, var(--accent) 20%, transparent), transparent 34%),
    color-mix(in oklab, var(--bg) 88%, rgba(0,0,0,.34));
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.book-intro.show { opacity: 1; pointer-events: auto; }
.book-intro-card {
  position: relative;
  width: min(520px, 94vw);
  border: 1px solid color-mix(in oklab, var(--accent) 34%, var(--rule));
  border-radius: 18px;
  padding: clamp(24px, 6vw, 38px);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg) 96%, var(--gold) 4%), var(--bg)),
    var(--bg);
  box-shadow: 0 34px 90px -34px rgba(0,0,0,.58);
  text-align: center;
  transform: translateY(10px) scale(.98);
  transition: transform .28s cubic-bezier(.2,.7,.2,1);
}
.book-intro.show .book-intro-card { transform: translateY(0) scale(1); }
.book-intro-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-mute);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.book-intro-mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  font-size: 24px;
  box-shadow: 0 0 0 8px color-mix(in oklab, var(--accent) 12%, transparent);
}
.book-intro h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(44px, 11vw, 78px);
  line-height: .9;
  font-weight: 500;
}
.book-intro-lede {
  max-width: 42ch;
  margin: 18px auto;
  color: var(--ink-soft);
  font-style: italic;
}
.book-intro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 22px;
  text-align: left;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.book-intro-grid span {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px;
  background: color-mix(in oklab, var(--bg-2) 48%, transparent);
}
.book-intro-grid b { color: var(--accent); font-weight: 600; }
.book-intro-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cards {
  list-style: none; margin: 24px 0 0; padding: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.cards a {
  display: block; padding: 26px 24px 28px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg) 92%, var(--bg-2)) 0%, var(--bg) 100%);
  color: var(--ink); text-decoration: none;
  position: relative; overflow: hidden;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.cards a:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--accent) 60%, var(--rule));
  box-shadow: var(--shadow);
}
.cards .cnum {
  font-family: var(--sans); font-size: 11px;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-mute);
}
.cards h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: 28px; line-height: 1.1;
  margin: 10px 0 10px;
  letter-spacing: -.005em;
}
.cards p {
  margin: 0; font-size: 16px; color: var(--ink-soft); font-style: italic;
}
.cards a::after {
  content: "→"; position: absolute; right: 22px; bottom: 22px;
  color: var(--accent); font-family: var(--sans); font-size: 18px;
  transition: transform .3s ease;
}
.cards a:hover::after { transform: translateX(4px); }

.home-foot {
  margin-top: 56px; text-align: center;
  font-family: var(--sans); font-size: 12px;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-mute);
}

/* ARTICLE */
.article {
  max-width: 720px; margin: 0 auto;
  padding: clamp(28px, 6vw, 64px) clamp(20px, 5vw, 32px) 120px;
}
.article-eyebrow {
  font-family: var(--sans);
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--accent);
  margin: 8px 0 12px;
}
.article-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(36px, 6.4vw, 64px);
  line-height: 1.04; letter-spacing: -.01em;
  margin: 0 0 18px;
}
.article-meta {
  font-family: var(--sans);
  font-size: 12px; color: var(--ink-mute);
  letter-spacing: .04em;
  margin: 0 0 28px;
}
.rule {
  height: 1px; background: var(--rule);
  margin: 8px 0 36px;
  position: relative;
}
.rule::after {
  content: "✦"; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  background: var(--bg);
  padding: 0 12px;
  color: var(--accent); font-size: 14px;
}

/* PROSE */
.prose { font-size: 19px; }
.prose > * { margin: 0 0 1.05em; }
.prose h1 { display: none; }
.prose h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.2;
  margin: 2.4em 0 .6em;
  letter-spacing: -.005em;
}
.prose h2::before {
  content: ""; display: block; width: 36px; height: 2px;
  background: var(--accent); margin-bottom: 14px; opacity: .85;
}
.prose h3 {
  font-family: var(--serif); font-style: italic;
  font-weight: 500; font-size: 22px;
  margin: 2em 0 .4em;
  color: var(--ink-soft);
}
.prose p { color: var(--ink); }
.prose p > strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--ink-soft); }
.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.05em;
}
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--accent); }
.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 50%, transparent);
}
.prose a:hover { color: var(--accent-soft); }
.prose hr {
  border: none; height: auto; background: transparent;
  margin: 2.8em auto;
  max-width: 200px;
  text-align: center;
  color: var(--accent);
  opacity: .8;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: .6em;
}
.prose hr::after { content: "✦ ✦ ✦"; }
.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: .9em;
  background: var(--bg-2);
  padding: 1px 6px; border-radius: 4px;
}
.prose pre {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 14px;
}
.prose table {
  width: 100%; border-collapse: collapse;
  font-size: 16px;
  margin: 1.4em 0;
}
.prose th, .prose td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.prose th { font-family: var(--sans); font-weight: 500; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); }

/* Words of Jesus */
.words-jesus-prose h2 {
  margin-top: 2.8em;
}
.jesus-saying {
  margin: 1.1em 0 1.35em;
  padding: clamp(16px, 3vw, 22px);
  border: 1px solid color-mix(in oklab, var(--accent) 24%, var(--rule));
  border-radius: 12px;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg) 92%, var(--accent) 8%), var(--bg));
  box-shadow: 0 18px 50px -36px rgba(0,0,0,.45);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.jesus-saying:hover {
  border-color: color-mix(in oklab, var(--accent) 56%, var(--rule));
}
.jesus-saying.is-selected {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--bg) 84%, var(--accent) 16%), var(--bg));
  box-shadow: inset 4px 0 0 var(--accent), 0 24px 58px -38px rgba(0,0,0,.5);
}
.jesus-saying h3 {
  margin: 0 0 .65em;
  color: var(--accent);
}
.prose .jesus-saying blockquote,
.jesus-quote {
  margin: .8em 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid color-mix(in oklab, var(--accent) 75%, var(--rule));
  color: var(--ink);
  font-size: 1.02em;
}
.jesus-context {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0 12px;
  font-family: var(--sans);
}
.jesus-context span {
  display: block;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: color-mix(in oklab, var(--bg-2) 54%, transparent);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
}
.jesus-context b {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.jesus-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-family: var(--sans);
}
.jesus-tools button,
.jesus-tools a {
  min-height: 32px;
  padding: 7px 11px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  text-decoration: none;
  font: 600 11px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.jesus-tools button:hover,
.jesus-tools a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Contradictions page */
.contradictions-prose > h1 {
  font-size: clamp(28px, 4vw, 40px);
}
.contradiction-tools {
  position: sticky;
  top: calc(58px + var(--safe-top));
  z-index: 4;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0 26px;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.contradiction-tools button {
  min-height: 32px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 11px;
  background: transparent;
  color: var(--ink-soft);
  font: 600 11px/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.contradiction-tools button.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.contradiction-card {
  margin: 1.05em 0 1.25em;
  padding: clamp(16px, 3vw, 22px);
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg) 92%, var(--bg-2)), var(--bg));
  box-shadow: 0 20px 56px -42px rgba(0,0,0,.45);
}
.contradiction-card[data-strength="hard"] {
  border-color: color-mix(in oklab, var(--accent) 42%, var(--rule));
}
.contradiction-card h3 {
  margin-top: 0;
  color: var(--ink);
}
.contradiction-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  font-family: var(--sans);
}
.contradiction-meta span,
.contradiction-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 11px;
  line-height: 1;
}
.contradiction-meta span:first-child {
  border-color: color-mix(in oklab, var(--accent) 38%, var(--rule));
  color: var(--accent);
}
.contradiction-card p {
  margin-bottom: .65em;
}
.contradiction-card p strong:first-child {
  font-family: var(--sans);
  font-size: .72em;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
}

/* drop cap on first paragraph after rule */
.prose > p:first-of-type::first-letter {
  font-family: var(--serif);
  float: left;
  font-size: 4.6em;
  line-height: .85;
  padding: 6px 10px 0 0;
  color: var(--accent);
  font-weight: 500;
}

/* lede: first paragraph slightly larger, lighter color */
.prose > p:first-of-type {
  font-size: 1.06em;
  color: var(--ink);
}
.essay-one-story .prose > p:first-of-type,
.essay-one-story .prose > p:nth-of-type(2) {
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.46;
  color: var(--ink-soft);
}
.essay-one-story .prose h2 {
  margin-top: 2.7em;
}
.essay-one-story .prose h2::before {
  width: 52px;
}
.essay-one-story .prose ol {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 18px 18px 18px 42px;
  background: color-mix(in oklab, var(--bg-2) 44%, transparent);
}
.essay-one-story .prose ol li {
  padding-left: 4px;
  margin-bottom: .55em;
}
/* extra breathing room before each h2 except the first */
.prose h2 + p { margin-top: .2em; }
/* italic intro phrase highlight */
.prose p > em:first-child { color: var(--accent-soft); font-style: italic; }
/* small caps eyebrow available via class */
.prose .eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 2.4em; margin-bottom: -.4em;
}

/* PAGER */
.pager {
  margin-top: 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pager a {
  display: block; padding: 18px 20px;
  border: 1px solid var(--rule); border-radius: 12px;
  text-decoration: none; color: var(--ink);
  transition: border-color .2s ease, background .2s ease;
}
.pager a:hover { border-color: var(--accent); background: var(--bg-2); }
.pager .lab {
  display: block;
  font-family: var(--sans); font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-mute);
  margin-bottom: 6px;
}
.pager .ttl { font-family: var(--serif); font-size: 18px; font-style: italic; }
.pager .next { text-align: right; }
.pager .empty { visibility: hidden; }

/* TO TOP */
.totop {
  position: fixed; right: 18px; bottom: calc(18px + var(--safe-bot));
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  z-index: 25;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
.totop[aria-visible="true"] { opacity: 1; transform: translateY(0); }
.totop svg { width: 18px; height: 18px; }

/* anims */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.article, .home { animation: rise .55s cubic-bezier(.2,.7,.2,1) both; }

@media (max-width: 540px) {
  body { font-size: 18px; }
  .prose { font-size: 18px; }
  .title { font-size: clamp(52px, 18vw, 92px); }
  .pager { grid-template-columns: 1fr; }
  .book-intro-grid { grid-template-columns: 1fr; }
  .jesus-context { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   Jesus Carousel
   ═══════════════════════════════════════════ */
.jesus-carousel-host {
  padding: 0;
  margin: 0;
}
.jesus-carousel {
  display: flex;
  flex-direction: column;
  width: 100%;
  -webkit-user-select: none;
  user-select: none;
}
.jc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px;
  font-family: var(--sans);
  min-height: 28px;
}
.jc-section {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 12px;
}
.jc-counter {
  font-size: 12px;
  color: var(--ink-mute);
  white-space: nowrap;
  flex-shrink: 0;
}
.jc-swipe-hint {
  flex: 1;
  text-align: center;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  opacity: .6;
  pointer-events: none;
}
.jc-viewport {
  /* clip slides horizontally without locking vertical overflow */
  overflow-x: hidden;
  overflow-y: visible;
  position: relative;
  /* let the browser handle vertical scroll; JS handles horizontal swipe */
  touch-action: pan-y;
}
.jc-track {
  display: flex;
  transition: transform .32s cubic-bezier(.25, .46, .45, .94);
  will-change: transform;
}
.jc-slide {
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 0 4px;
}
/* override scroll-list margin on carousel cards */
.jesus-carousel-host .jesus-saying {
  margin: 0;
  position: relative;
}
.jc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 6px;
  gap: 12px;
}
.rand-carousel .jc-footer {
  max-width: 520px;
  margin: 0 auto;
  padding-top: 18px;
}
.rand-carousel .jc-btn {
  width: 38px;
  height: 38px;
  font-size: 20px;
}
.jc-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.jc-btn:hover  { border-color: var(--accent); color: var(--accent); }
.jc-btn:active { background: color-mix(in oklab, var(--accent) 10%, transparent); }
.jc-btn:disabled { opacity: .3; pointer-events: none; }
.rand-new-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid color-mix(in oklab, var(--accent) 48%, var(--rule));
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 10%, var(--bg));
  color: var(--accent);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.rand-new-btn:hover {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 15%, var(--bg));
  transform: translateY(-1px);
}
.rand-new-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.jc-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  align-items: center;
  flex: 1;
}
.jc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-mute);
  opacity: .35;
  transition: opacity .15s, transform .15s, background .15s;
  cursor: pointer;
  flex-shrink: 0;
}
.jc-dot.is-active {
  background: var(--accent);
  opacity: 1;
  transform: scale(1.28);
}

/* Favorite star on Jesus card */
.jesus-saying { position: relative; }
.jc-star {
  position: absolute;
  top: 11px;
  right: 11px;
  font-size: 15px;
  color: var(--accent);
  pointer-events: none;
  z-index: 2;
  line-height: 1;
  animation: jcStarPop .22s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes jcStarPop {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Favorite star on Bible verses */
.v.is-faved .vn::after {
  content: "★";
  display: inline-block;
  font-size: 8px;
  color: var(--accent);
  margin-left: 2px;
  vertical-align: super;
  opacity: .8;
}

/* Context menu faved state */
.ctx button.is-faved .ki { color: var(--accent); }
.ctx button.is-faved    { color: var(--accent); }

/* ═══════════════════════════════════════════
   Favorites Page
   ═══════════════════════════════════════════ */
.fav-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.fav-item {
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: color-mix(in oklab, var(--bg-2) 40%, transparent);
  transition: border-color .15s;
}
.fav-item:hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--rule)); }
.fav-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.fav-star-icon {
  color: var(--accent);
  font-size: 14px;
  flex-shrink: 0;
}
.fav-ref {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  flex: 1;
}
.fav-ref:hover { color: var(--accent); }
.fav-kind {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 3px 7px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  flex-shrink: 0;
}
.fav-remove {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-mute);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.fav-remove:hover { border-color: #c44; color: #c44; }
.fav-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.fav-when {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-mute);
}

/* Library favorites card */
.lib-fav-card {
  display: flex;
  flex-direction: column;
}
.lib-fav-card .stat {
  color: var(--accent);
}

/* ═══════════════════════════════════════════
   Verse Carousel (swipe mode)
   ═══════════════════════════════════════════ */
.vc-host { padding: 0; }
.verse-carousel { display: flex; flex-direction: column; }
.vc-track {
  display: flex;
  transition: transform .28s cubic-bezier(.25,.46,.45,.94);
  will-change: transform;
}
.vc-slide {
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 0 4px;
}
.vc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: clamp(220px, 28vh, 340px);
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: clamp(20px, 5vw, 36px) clamp(20px, 5vw, 32px);
  border: 1px solid color-mix(in oklab, var(--accent) 18%, var(--rule));
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--bg) 93%, var(--accent) 7%), var(--bg));
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
  overflow: visible;
}
.vc-card:hover    { border-color: color-mix(in oklab, var(--accent) 42%, var(--rule)); }
.vc-card.is-selected {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}
.vc-vn {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.vc-vt {
  display: block;
  font-family: var(--serif);
  font-size: clamp(19px, 5vw, 24px);
  line-height: 1.65;
  color: var(--ink);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}
.vc-note-dot {
  position: absolute;
  bottom: 12px;
  right: 14px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}
/* progress bar at bottom of carousel nav */
.vc-progress-wrap {
  flex: 1;
  height: 3px;
  background: var(--rule);
  border-radius: 999px;
  overflow: hidden;
}
.vc-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .28s ease;
}
/* mode toggle in reader-settings */
.seg-vm button {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 6px 13px;
}
.vc-host[data-size="s"] .vc-vt { font-size: clamp(18px, 3vw, 22px); line-height: 1.58; }
.vc-host[data-size="m"] .vc-vt { font-size: clamp(20px, 3.4vw, 25px); line-height: 1.62; }
.vc-host[data-size="l"] .vc-vt { font-size: clamp(23px, 3.8vw, 30px); line-height: 1.66; }
.vc-host[data-size="xl"] .vc-vt { font-size: clamp(26px, 4.3vw, 34px); line-height: 1.68; }

/* Listen button in Jesus carousel footer */
.jc-listen {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 0 14px !important;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent) !important;
  border-color: color-mix(in oklab, var(--accent) 40%, var(--rule)) !important;
}
.jc-listen:hover {
  background: color-mix(in oklab, var(--accent) 12%, transparent) !important;
}
.jc-listen svg { width: 12px; height: 12px; flex-shrink: 0; fill: var(--accent); }

/* Essay reader row — holds the Listen/Speed launcher */
.essay-reader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 6px;
  min-height: 32px;
}
.essay-reader-row:empty { display: none; }

@media (max-width: 540px) {
  .vc-vt { font-size: 19px; }
  .vc-card { min-height: 180px; padding: 20px; }
  .vc-host[data-size="l"] .vc-vt { font-size: 22px; }
  .vc-host[data-size="xl"] .vc-vt { font-size: 24px; }
}

/* ═══════════════════════════════════════════
   Random Page
   ═══════════════════════════════════════════ */
.rand-carousel {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}
.rand-track {
  display: flex;
  transition: transform .3s cubic-bezier(.25,.46,.45,.94);
  will-change: transform;
}
.rand-slide {
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 0 4px;
}
.rand-card {
  border: 1px solid color-mix(in oklab, var(--accent) 20%, var(--rule));
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--bg) 93%, var(--accent) 7%),
    var(--bg));
  min-height: 300px;
  display: flex;
  align-items: flex-start;
  transition: border-color .2s;
}
.rand-loading {
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.rand-skel { padding: 24px; width: 100%; }
.rand-card-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.rand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
  font-family: var(--sans);
  gap: 8px;
}
.rand-book-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}
.rand-testament {
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}
.rand-ref-big {
  padding: 8px 20px 16px;
  font-family: var(--serif);
  font-size: clamp(22px, 5.5vw, 28px);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.rand-text {
  padding: 16px 20px 18px;
  font-family: var(--serif);
  font-size: clamp(17px, 4.5vw, 20px);
  line-height: 1.72;
  color: var(--ink);
  border-top: 1px solid var(--rule);
}
.rand-text p {
  margin: 0 0 .5em;
}
.rand-text p:last-child { margin: 0; }
.rand-vn {
  font-size: .6em;
  color: var(--accent);
  font-family: var(--sans);
  font-style: normal;
  font-weight: 700;
  margin-right: 4px;
}
.rand-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--rule);
  background: color-mix(in oklab, var(--bg-2) 28%, transparent);
}
.rand-act {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.rand-act:hover  { border-color: var(--accent); color: var(--accent); }
.rand-act:active { background: color-mix(in oklab, var(--accent) 10%, transparent); }
.rand-act.is-faved { border-color: var(--accent); color: var(--accent); }
.rand-act-next {
  width: auto;
  min-width: 92px;
  padding: 0 14px;
  border-radius: 999px;
  margin-left: auto;
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 46%, var(--rule));
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rand-hint {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-mute);
  text-align: center;
  flex: 1;
  letter-spacing: .02em;
}
.rand-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 240px;
  padding: 32px 24px;
  color: var(--ink-mute);
  font-family: var(--sans);
  font-size: 14px;
  text-align: center;
  width: 100%;
}

@media (max-width: 540px) {
  .jc-btn { width: 38px; height: 38px; font-size: 20px; }
  .rand-carousel .jc-footer { gap: 8px; }
  .rand-new-btn {
    min-height: 38px;
    padding: 0 12px;
    font-size: 11px;
    letter-spacing: .08em;
  }
  .rand-new-btn svg { width: 14px; height: 14px; }
  .fav-text { font-size: 14px; }
  .rand-text { font-size: 17px; padding: 14px 16px 16px; }
  .rand-ref-big { font-size: 22px; padding: 8px 16px 14px; }
  .rand-top { padding: 14px 16px 0; }
  .rand-actions { padding: 10px 12px 12px; gap: 6px; }
  .rand-act { width: 38px; height: 38px; font-size: 17px; }
  .rand-act-next {
    width: auto;
    min-width: 78px;
    padding: 0 10px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

::selection { background: var(--accent); color: #fff; }
