/* ================================================================
   WORD OF GOD — Stylesheet
   Same design language as Dram Ledger / Stonewood: flat surfaces, 1px hairlines instead of shadows,
   square corners, Cormorant display type, Inter UI, one muted accent (gold leaf) and a rubric red
   for verse numbers. Two themes: Ink (dark) and Parchment (light), switched with html[data-theme].
   ================================================================ */

/* ── 1. Tokens ────────────────────────────────────────────────── */
:root, :root[data-theme="ink"] {
  --bg:        #131417;
  --bg2:       #1a1b20;
  --bg3:       #22232a;
  --text:      #ece7dd;
  --muted:     #b8b1a4;
  --dim:       #8d8679;
  --gold:      #c9a55a;          /* accent: gold leaf */
  --gold-ink:  #131417;
  --rubric:    #d07466;          /* verse numbers, the scarlet thread */
  --line:        rgba(201, 165, 90, 0.14);
  --line-strong: rgba(201, 165, 90, 0.34);
  --line-soft:   rgba(236, 231, 221, 0.06);
  --topbar:    rgba(19, 20, 23, 0.92);
  /* highlighter inks (alpha over the page) */
  --hl-gold: rgba(214, 170, 70, 0.30); --hl-rose: rgba(214, 110, 120, 0.30);
  --hl-sage: rgba(120, 170, 110, 0.30); --hl-sky: rgba(100, 150, 210, 0.32);
  color-scheme: dark;
}
:root[data-theme="parchment"] {
  --bg:        #f4efe4;
  --bg2:       #ece5d6;
  --bg3:       #e2d9c6;
  --text:      #231f19;
  --muted:     #564e41;
  --dim:       #7a715f;
  --gold:      #8a6a24;
  --gold-ink:  #f4efe4;
  --rubric:    #9b2d2d;
  --line:        rgba(110, 85, 35, 0.18);
  --line-strong: rgba(110, 85, 35, 0.38);
  --line-soft:   rgba(35, 31, 25, 0.06);
  --topbar:    rgba(244, 239, 228, 0.92);
  --hl-gold: rgba(230, 180, 60, 0.38); --hl-rose: rgba(225, 120, 130, 0.32);
  --hl-sage: rgba(120, 175, 105, 0.34); --hl-sky: rgba(100, 155, 220, 0.30);
  color-scheme: light;
}
:root {
  /* genre + tradition palettes: mid-lightness so they read on both themes; always shown with a label */
  --g-law: #b7793a; --g-history: #6f9a5a; --g-wisdom: #8f6fc4; --g-prophets: #c4583f;
  --g-gospels: #2f9aa6; --g-epistles: #4f80c4; --g-apocalypse: #b8527e;
  --t-ecumenical: #a39676; --t-early: #b7793a; --t-swiss: #c4583f; --t-continental: #4f80c4;
  --t-presbyterian: #2f9aa6; --t-baptist: #6f9a5a;

  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --scripture: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --pad: clamp(1rem, 5vw, 2.5rem);
  --max: 1240px;
  --nav-h: 72px;
  --t-fast: 0.2s ease;
  --t-base: 0.35s ease;
}

/* ── 2. Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; font-weight: 300; line-height: 1.7;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100vh;
  transition: background var(--t-base), color var(--t-base);
}
:root[data-theme="parchment"] body { font-weight: 400; }
a { color: var(--gold); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--text); }
img { max-width: 100%; display: block; }
strong, b { font-weight: 500; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
::selection { background: var(--gold); color: var(--gold-ink); }
[hidden] { display: none !important; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.1; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h3 { font-size: 1.4rem; font-weight: 500; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.9em; margin: 0 0 0.9rem;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: 0.6; }
.lede { font-size: clamp(1.02rem, 1.2vw, 1.15rem); color: var(--muted); max-width: 640px; margin: 1rem 0 0; }
.muted { color: var(--dim); }
.small { font-size: 0.875rem; }
.serif { font-family: var(--serif); }

/* ── 3. Header ────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 1500; height: var(--nav-h);
  display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.25rem); padding: 0 var(--pad);
  background: var(--topbar); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.crest { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--text); flex-shrink: 0; }
.crest svg { width: 30px; height: 30px; color: var(--gold); }
.crest-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: clamp(1.1rem, 2.2vw, 2.1rem); flex: 1; min-width: 0; }
.nav a, .navtop { font: inherit; font-size: 0.75rem; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; padding: 0.4rem 0; border: 0; border-bottom: 1px solid transparent; background: none; }
.nav a:hover, .navgroup:hover .navtop { color: var(--text); }
.nav a.active, .navgroup.active > .navtop { color: var(--text); border-bottom-color: var(--gold); }
.navgroup { position: relative; }
.navtop { cursor: pointer; }
.navtop::after { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 0 3px 8px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); opacity: 0.7; }
.navmenu { display: none; position: absolute; top: calc(100% + 20px); left: -20px; min-width: 300px; padding: 6px 0; background: var(--bg); border: 1px solid var(--line); z-index: 1100; }
.navmenu::before { content: ""; position: absolute; top: -21px; left: 0; right: 0; height: 21px; }
.navgroup:hover .navmenu, .navgroup:focus-within .navmenu, .navgroup.open .navmenu { display: block; }
.nav .navmenu a { display: block; padding: 0.7rem 20px; border-bottom: 0; }
.nav .navmenu a:hover { background: var(--bg2); }
.nav .navmenu a.active { color: var(--gold); }
.navmenu small { display: block; margin-top: 3px; font-size: 0.75rem; letter-spacing: 0; text-transform: none; color: var(--dim); }
.navmenu .soon { opacity: 0.55; pointer-events: none; }
.top-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; margin-left: auto; }
.menu-btn { display: none !important; }
@media (max-width: 900px) {
  .menu-btn { display: inline-flex !important; }
  .nav { position: fixed; top: var(--nav-h); left: 0; width: min(320px, 100vw); max-height: calc(100vh - var(--nav-h)); overflow-y: auto; flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem var(--pad) 1.25rem; background: var(--bg); border: 1px solid var(--line); border-top: 0; display: none; }
  .nav.open { display: flex; }
  .nav > a { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
  .navtop { pointer-events: none; padding: 1.1rem 0 0.2rem; font-size: 0.6875rem; color: var(--gold); text-align: left; }
  .navtop::after { display: none; }
  .navmenu { display: block; position: static; min-width: 0; padding: 0; border: 0; background: none; }
  .navmenu::before, .navmenu small { display: none; }
  .nav .navmenu a { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
  .crest-name { font-size: 1rem; }
}
@media (max-width: 480px) { .crest-name { display: none; } }

/* ── 4. Buttons, chips, inputs ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  padding: 0.85em 1.6em; border: 1px solid var(--line-strong); border-radius: 0; background: transparent; color: var(--text);
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1.2;
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); text-decoration: none;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg { width: 15px; height: 15px; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-ghost { border-color: transparent; }
.btn-sm { padding: 0.55em 1em; font-size: 0.6875rem; }
.icon-btn { padding: 0.55em 0.7em; }
.btns { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 0.5em; padding: 0.35em 0.8em;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-family: var(--sans); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}
button.chip { cursor: pointer; }
button.chip:hover, a.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.on { border-color: var(--gold); color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.plaque { display: inline-block; padding: 0.3em 0.75em; border: 1px solid var(--line-strong); color: var(--gold); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }

.input, select.input, textarea.input {
  width: 100%; padding: 0.75em 0.9em; border: 1px solid var(--line-strong); border-radius: 0; background: var(--bg);
  color: var(--text); font-family: var(--sans); font-size: 0.9rem; font-weight: 300; outline: none; transition: border-color var(--t-fast);
}
.input:focus { border-color: var(--gold); }
textarea.input { line-height: 1.6; min-height: 90px; resize: vertical; }
label.lbl { display: block; margin-bottom: 0.4rem; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); }
.field { margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.radio-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.radio-row label { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; border: 1px solid var(--line-strong); cursor: pointer; font-size: 0.875rem; }
.radio-row input { accent-color: var(--gold); }
.err { color: var(--rubric); font-size: 0.875rem; min-height: 1.2em; }

/* ── 5. Layout ────────────────────────────────────────────────── */
main { min-height: calc(100vh - var(--nav-h)); }
.page { max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) var(--pad) 5rem; }
.page-narrow { max-width: 820px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: clamp(2rem, 4vw, 3rem); }
.rule { border: 0; height: 1px; background: var(--line); margin: clamp(2.5rem, 5vw, 4rem) 0; }
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; background: var(--bg2); color: var(--text); overflow: hidden; transition: background var(--t-base); }
a.card:hover { background: var(--bg3); color: var(--text); }
.card-body { padding: 1.25rem 1.4rem 1.4rem; flex: 1; display: flex; flex-direction: column; gap: 0.35rem; }
.card-title { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; line-height: 1.15; }
.card-meta { font-size: 0.75rem; color: var(--dim); letter-spacing: 0.02em; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.card-band { height: 2px; }
.card.soon { opacity: 0.6; }
.panel { background: var(--bg2); border: 1px solid var(--line); padding: 1.4rem 1.5rem; }
.panel h3, .kicker { font-family: var(--sans); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin: 0 0 1rem; }
.section-title { margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-title h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 1.5rem 0; }
.stat { padding: 1.1rem 1.2rem 1.1rem 0; }
.stat + .stat { padding-left: 1.2rem; border-left: 1px solid var(--line); }
.stat .v { font-family: var(--serif); font-size: 2rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .l { margin-top: 0.3rem; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.empty { padding: 2rem; text-align: center; color: var(--dim); border: 1px dashed var(--line-strong); }
.notice { padding: 0.9rem 1.1rem; border: 1px solid var(--line-strong); border-left: 2px solid var(--gold); background: var(--bg2); font-size: 0.9rem; color: var(--muted); margin-bottom: 1.5rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: calc(var(--nav-h) + 1.5rem); }

/* ── 6. Home ──────────────────────────────────────────────────── */
.home-hero { max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 8vw, 6.5rem) var(--pad) 1rem; }
.home-hero h1 { font-size: clamp(2.8rem, 6.4vw, 5.2rem); line-height: 1.02; max-width: 12ch; }
.home-hero .btns { margin-top: 2rem; }
.votd { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.votd-inner { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: start; padding: 2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.votd blockquote { margin: 0; font-family: var(--scripture); font-size: clamp(1.35rem, 2.4vw, 1.9rem); line-height: 1.4; }
.votd cite { display: block; margin-top: 0.8rem; font-style: normal; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
@media (max-width: 640px) { .votd-inner { grid-template-columns: 1fr; gap: 0.5rem; } }

/* ── 7. Line art: Creation → New Creation ─────────────────────── */
.story { max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) var(--pad); }
.story-svg { width: 100%; height: auto; display: block; overflow: visible; }
.story-svg .ln { vector-effect: non-scaling-stroke; fill: none; stroke: var(--dim); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.6s ease; }
.story-svg .ground { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.story-svg .thread { fill: none; stroke: var(--rubric); stroke-width: 1.4; stroke-dasharray: 5 7; animation: thread 2.4s linear infinite; opacity: 0.8; }
.story-svg .thread-lit { fill: none; stroke: var(--rubric); stroke-width: 1.8; transition: stroke-dashoffset 1.2s ease; }
.story-svg .st { cursor: pointer; }
.story-svg .st .hit { fill: transparent; }
.story-svg .st.on .ln, .story-svg .st:hover .ln { stroke: var(--gold); }
.story-svg .st .fill { fill: var(--gold); opacity: 0; transition: opacity 0.6s; }
.story-svg .st.on .fill { opacity: 0.9; }
.story-svg .lbl { font-family: var(--sans); font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; fill: var(--dim); transition: fill 0.4s; }
.story-svg .num { font-family: var(--serif); font-size: 12px; fill: var(--dim); }
.story-svg .st.on .lbl, .story-svg .st.on .num { fill: var(--text); }
.story-svg .bob { animation: bob 3.2s ease-in-out infinite; transform-box: fill-box; }
.story-svg .flick { animation: flick 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.story-svg .twinkle { animation: twinkle 2.8s ease-in-out infinite; }
.story-svg .spin { animation: spin 40s linear infinite; transform-box: fill-box; transform-origin: center; }
.story-svg .drift { animation: drift 6s ease-in-out infinite; }
.story.paused .story-svg * { animation-play-state: paused !important; }
@keyframes thread { to { stroke-dashoffset: -24; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes flick { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.15) skewX(-3deg); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .story-svg * { animation: none !important; } }
.story-caption { display: grid; grid-template-columns: 70px 1fr auto; gap: 1.2rem; align-items: baseline; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); min-height: 5.5rem; }
.story-caption .n { font-family: var(--serif); font-size: 2.4rem; color: var(--gold); line-height: 1; }
.story-caption .t { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; }
.story-caption p { margin: 0.3rem 0 0; color: var(--muted); max-width: 70ch; }
@media (max-width: 640px) { .story-caption { grid-template-columns: 50px 1fr; } .story-caption a { grid-column: 2; } }

/* ── 8. Books index ───────────────────────────────────────────── */
.testament { margin-bottom: 3rem; }
.genre-block { margin-bottom: 1.6rem; }
.genre-block h3 { font-family: var(--sans); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 8px; margin-bottom: 0.6rem; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.book-grid a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0.75rem 1rem; background: var(--bg2); color: var(--text); font-family: var(--serif); font-size: 1.2rem; font-weight: 500; transition: background var(--t-fast); border-left: 2px solid var(--gc, transparent); }
.book-grid a:hover { background: var(--bg3); }
.book-grid small { font-family: var(--sans); font-size: 0.6875rem; color: var(--dim); font-weight: 400; }

/* ── 9. Reader ────────────────────────────────────────────────── */
.reader-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.reader-head h1 { font-size: clamp(2.6rem, 5.5vw, 4.2rem); }
.reader-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.scripture { font-family: var(--scripture); font-size: var(--read-size, 1.3rem); line-height: 1.75; max-width: 68ch; }
.scripture.lines .v { display: block; margin-bottom: 0.25em; }
.scripture .v { cursor: pointer; border-radius: 2px; transition: background var(--t-fast); -webkit-tap-highlight-color: transparent; }
.scripture .v:hover { background: var(--line-soft); }
.scripture .v.sel { background: var(--line-strong); box-shadow: 0 1px 0 var(--gold); }
.scripture .v.hl-gold { background: var(--hl-gold); } .scripture .v.hl-rose { background: var(--hl-rose); }
.scripture .v.hl-sage { background: var(--hl-sage); } .scripture .v.hl-sky { background: var(--hl-sky); }
.scripture sup { font-family: var(--sans); font-size: 0.55em; font-weight: 600; color: var(--rubric); margin: 0 0.25em 0 0.1em; vertical-align: 0.5em; user-select: none; }
.scripture sup.ch1 { display: none; }
.scripture .dropcap { float: left; font-family: var(--serif); font-size: 4.2em; line-height: 0.82; margin: 0.08em 0.12em 0 0; color: var(--gold); }
.scripture i.sup { font-style: italic; color: var(--muted); }
.scripture .note-mark { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin: 0 3px 0.15em; vertical-align: middle; }
.chapter-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 2rem; }
.ch-grid a { display: grid; place-items: center; padding: 0.5rem 0; background: var(--bg2); color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.ch-grid a:hover, .ch-grid a.on { background: var(--bg3); color: var(--gold); }
.side-list { display: grid; gap: 0; border-top: 1px solid var(--line); font-size: 0.875rem; }
.side-list > * { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--line); color: var(--text); }
.side-list a:hover { color: var(--gold); }
.side-list .k { font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); display: block; }
.side-list .q { color: var(--muted); display: block; line-height: 1.5; margin-top: 2px; }

/* selection action bar */
.actionbar { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, calc(100% + 40px)); visibility: hidden; z-index: 1800; display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line-strong); transition: transform 0.25s ease; max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }
.actionbar.show { transform: translate(-50%, 0); visibility: visible; }
.actionbar .ref { font-family: var(--serif); font-size: 1.05rem; padding: 0 8px; white-space: nowrap; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); cursor: pointer; padding: 0; }
.swatch.gold { background: var(--hl-gold); } .swatch.rose { background: var(--hl-rose); } .swatch.sage { background: var(--hl-sage); } .swatch.sky { background: var(--hl-sky); }
.swatch.none { background: transparent; position: relative; }
.swatch.none::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 1px; background: var(--dim); transform: rotate(-45deg); }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* dialog */
.modal-bg { position: fixed; inset: 0; z-index: 2500; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--bg); border: 1px solid var(--line-strong); padding: 1.6rem; }
.modal h2 { font-size: 1.8rem; margin-bottom: 0.3rem; }
.modal .btns { margin-top: 1.2rem; justify-content: flex-end; }

/* hover bubble */
.bubble { position: fixed; z-index: 3000; max-width: min(380px, calc(100vw - 24px)); padding: 12px 14px; background: var(--bg); border: 1px solid var(--line-strong); color: var(--text); font-family: var(--scripture); font-size: 1.02rem; line-height: 1.5; pointer-events: none; opacity: 0; transition: opacity 0.12s; }
.bubble.show { opacity: 1; }
.bubble .bt { font-family: var(--sans); font-size: 0.625rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.bubble sup { font-family: var(--sans); font-size: 0.6em; color: var(--rubric); margin-right: 2px; }
a.ref-link { border-bottom: 1px dotted var(--line-strong); }

/* ── 10. Confessions ──────────────────────────────────────────── */
.conf-list { border-top: 1px solid var(--line); }
.conf-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 1.2rem; align-items: baseline; padding: 1rem 0; border-bottom: 1px solid var(--line); color: var(--text); }
.conf-row:hover { color: var(--text); background: linear-gradient(90deg, var(--bg2), transparent); }
.conf-row .yr { font-family: var(--serif); font-size: 1.3rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.conf-row .ti { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; line-height: 1.15; }
.conf-row .bl { font-size: 0.875rem; color: var(--muted); }
.conf-row .ct { font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
@media (max-width: 640px) { .conf-row { grid-template-columns: 52px 1fr; } .conf-row .ct { display: none; } }
.qa { padding: 1.6rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--nav-h) + 16px); }
.qa-n { font-family: var(--serif); font-size: 1rem; color: var(--gold); letter-spacing: 0.06em; }
.qa-q { font-family: var(--serif); font-size: 1.55rem; font-weight: 500; line-height: 1.25; margin: 0.2rem 0 0.6rem; }
.qa-a, .qa-text { font-family: var(--scripture); font-size: 1.18rem; line-height: 1.65; }
.qa-a sup a, .qa-text sup a { font-family: var(--sans); font-size: 0.65em; font-weight: 600; color: var(--rubric); padding: 0 1px; }
.proofs { margin-top: 0.8rem; display: grid; gap: 4px; font-size: 0.8125rem; color: var(--dim); }
.proofs div { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.proofs b { color: var(--rubric); font-weight: 600; min-width: 1.2em; }
.sub-qa { margin: 0.8rem 0 0 1.2rem; padding-left: 1rem; border-left: 1px solid var(--line); font-size: 0.95rem; }
.sub-qa p { margin: 0.4rem 0; }
.toc { max-height: calc(100vh - var(--nav-h) - 3rem); overflow-y: auto; font-size: 0.8125rem; }
.toc a { display: block; padding: 0.35rem 0; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
.toc a:hover { color: var(--gold); }

/* ── 11. Memory ───────────────────────────────────────────────── */
.mem-card { background: var(--bg2); border: 1px solid var(--line); padding: clamp(1.5rem, 4vw, 2.6rem); text-align: center; min-height: 280px; display: flex; flex-direction: column; justify-content: center; gap: 1.2rem; }
.mem-card .ref { font-family: var(--serif); font-size: clamp(1.8rem, 4vw, 2.6rem); }
.mem-card .txt { font-family: var(--scripture); font-size: 1.3rem; line-height: 1.6; max-width: 60ch; margin: 0 auto; }
.mem-card .hint { font-family: var(--scripture); font-size: 1.3rem; letter-spacing: 0.08em; color: var(--muted); }
.mem-card .btns { justify-content: center; }
.boxes { display: inline-flex; gap: 4px; }
.boxes i { width: 8px; height: 8px; border: 1px solid var(--gold); border-radius: 50%; }
.boxes i.on { background: var(--gold); }
.mem-row { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.mem-row .r { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; }
.mem-row .p { font-size: 0.875rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }

/* ── 12. Join ─────────────────────────────────────────────────── */
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 1000px) { .tiers { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .tiers { grid-template-columns: 1fr; } }
.tier { background: var(--bg2); padding: 1.6rem 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; }
.tier.feature { background: var(--bg3); box-shadow: inset 0 2px 0 var(--gold); }
.tier h3 { font-size: 1.8rem; font-weight: 500; }
.tier .price { font-family: var(--serif); font-size: 1.3rem; color: var(--gold); }
.tier ul { list-style: none; margin: 0; padding: 0; font-size: 0.875rem; color: var(--muted); display: grid; gap: 0.45rem; }
.tier li::before { content: "—"; color: var(--gold); margin-right: 0.5em; }
.tier .btns { margin-top: auto; }
.tier > .plaque { align-self: flex-start; margin-top: auto; }

/* ── 13. Footer ───────────────────────────────────────────────── */
footer.site { border-top: 1px solid var(--line); padding: 2.5rem var(--pad); text-align: center; font-size: 0.75rem; color: var(--dim); letter-spacing: 0.04em; }
footer.site .verse { font-family: var(--scripture); font-size: 1rem; font-style: italic; color: var(--muted); margin-top: 6px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.tbl th { text-align: left; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line-strong); }
.tbl td { padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }

.toast { position: fixed; left: 20px; bottom: 20px; z-index: 3500; padding: 0.8rem 1.1rem; background: var(--bg); border: 1px solid var(--line-strong); border-left: 2px solid var(--gold); font-size: 0.875rem; max-width: min(420px, calc(100vw - 40px)); transform: translateY(160%); transition: transform 0.25s ease; }
.toast.show { transform: translateY(0); }
@media (max-width: 640px) {
  .actionbar { left: 0; right: 0; bottom: 0; max-width: none; transform: translateY(calc(100% + 20px)); display: grid; grid-template-columns: 1fr auto; gap: 8px 6px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-width: 1px 0 0; }
  .actionbar.show { transform: translateY(0); }
  .actionbar .ref { grid-column: 1; padding: 0; align-self: center; }
  .actionbar .swatches { grid-column: 2; display: flex; gap: 8px; }
  .actionbar .acts { grid-column: 1 / -1; display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 6px; }
  .actionbar .sep { display: none; }
  .scripture { padding-bottom: 7rem; }
}
.actionbar .swatches, .actionbar .acts { display: flex; align-items: center; gap: 6px; }

/* ── 14. Study: interlinear, lexicon ──────────────────────────── */
.modal.modal-wide { width: min(900px, 100%); }
.interlinear { display: grid; gap: 1rem; margin: 1rem 0; }
.il-verse { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.il-ref { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; color: var(--rubric); padding-top: 6px; }
.il-words { display: flex; flex-wrap: wrap; gap: 6px; }
.il-words.rtl { direction: rtl; }
.il-w { direction: ltr; display: grid; justify-items: center; gap: 1px; padding: 6px 8px; min-width: 56px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); cursor: pointer; font: inherit; }
.il-w:hover, .il-w.on { border-color: var(--gold); }
.il-w .o { font-family: "SBL Hebrew", "Ezra SIL", "Cardo", "Times New Roman", serif; font-size: 1.45rem; line-height: 1.3; }
.il-w .tr { font-size: 0.7rem; color: var(--dim); font-style: italic; }
.il-w .gl { font-size: 0.75rem; color: var(--muted); max-width: 120px; text-align: center; line-height: 1.25; }
.lexbox { padding: 1rem 1.1rem; background: var(--bg2); border: 1px solid var(--line); border-left: 2px solid var(--gold); min-height: 4rem; }
.lex-head { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.lex-head .o { font-family: "SBL Hebrew", "Cardo", "Times New Roman", serif; font-size: 1.9rem; }
.lex-head .tr { font-style: italic; color: var(--muted); }
.lex-gloss { font-family: var(--serif); font-size: 1.35rem; margin: 0.2rem 0; }
.lex-def { margin-top: 0.8rem; font-size: 0.875rem; line-height: 1.65; color: var(--muted); max-height: 16rem; overflow-y: auto; }
.lex-def a { color: var(--gold); border-bottom: 1px dotted var(--line-strong); cursor: default; }
#readBtn.on { color: var(--gold); border-color: var(--line-strong); }
.reader-side .chips .chip { text-transform: none; letter-spacing: 0.02em; font-size: 0.75rem; }
.reader-side { max-height: calc(100vh - var(--nav-h) - 3rem); overflow-y: auto; scrollbar-width: thin; }
.actionbar [data-act="study"] { display: none; }
@media (max-width: 960px) { .reader-side { max-height: none; overflow: visible; } .actionbar [data-act="study"] { display: inline-flex; } }
@media (max-width: 640px) { .actionbar .acts .btn { padding: 0.5em 0.45em; letter-spacing: 0.06em; } }

/* ── 15. Search, topics, plans, passport ──────────────────────── */
mark { background: var(--hl-gold); color: inherit; padding: 0 1px; }
.bybook { display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; }
.bybook button { display: grid; grid-template-columns: 110px 1fr 36px; gap: 8px; align-items: center; padding: 3px 4px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.8125rem; cursor: pointer; text-align: left; }
.bybook button:hover, .bybook button.on { color: var(--text); background: var(--bg3); }
.bybook i { height: 6px; display: block; }
.bybook b { font-weight: 400; text-align: right; font-variant-numeric: tabular-nums; color: var(--dim); }
.topic-cols { columns: 4 200px; column-gap: 2rem; }
.topic-cols a { display: flex; justify-content: space-between; gap: 8px; break-inside: avoid; padding: 0.35rem 0; border-bottom: 1px solid var(--line-soft); color: var(--text); font-size: 0.9rem; }
.topic-cols a:hover { color: var(--gold); }
.topic-cols small { color: var(--dim); font-size: 0.75rem; }
.topic-verse { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.topic-verse .tv-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topic-verse .k { font-family: var(--serif); font-size: 1.35rem; font-weight: 500; }
.topic-verse p { margin: 0.4rem 0 0; font-family: var(--scripture); font-size: 1.2rem; line-height: 1.6; }
.aspect { margin-bottom: 1.4rem; }
.aspect .chip, .chips a.chip[data-ref] { text-transform: none; letter-spacing: 0.02em; font-size: 0.75rem; }
.plans { display: grid; gap: 1rem; }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.bar { height: 3px; background: var(--line); margin: 1rem 0; }
.bar i { display: block; height: 100%; background: var(--gold); }
.plan-today { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.plan-today .chip { text-transform: none; letter-spacing: 0.02em; font-size: 0.8125rem; color: var(--text); }
.plan details summary { cursor: pointer; margin-top: 0.4rem; }
.daygrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 3px; margin-top: 0.8rem; }
.daygrid button { padding: 4px 0; font: inherit; font-size: 0.6875rem; background: var(--bg); border: 1px solid var(--line); color: var(--dim); cursor: pointer; }
.daygrid button.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.daygrid button.now { outline: 1px solid var(--rubric); }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 1.2rem 0.8rem; }
.stamp { display: grid; justify-items: center; gap: 4px; color: var(--muted); font-size: 0.75rem; text-align: center; }
.stamp svg { width: 88px; height: 88px; overflow: visible; }
.stamp .s-out { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.stamp .s-track { fill: none; stroke: var(--line); stroke-width: 3; }
.stamp .s-prog { fill: none; stroke: var(--c); stroke-width: 3; }
.stamp .s-abbr { font-family: var(--serif); font-size: 17px; text-anchor: middle; fill: var(--dim); letter-spacing: 0.04em; }
.stamp .s-count, .stamp .s-date { font-family: var(--sans); font-size: 7.5px; text-anchor: middle; fill: var(--dim); letter-spacing: 0.12em; }
.stamp.done .s-out { stroke: var(--c); stroke-width: 2.4; stroke-dasharray: none; }
.stamp.done .s-in { fill: none; stroke: var(--c); stroke-width: 1; stroke-dasharray: 1 2.2; }
.stamp.done .s-abbr, .stamp.done .s-date { fill: var(--c); font-weight: 600; }
.stamp.done { color: var(--text); }
.stamp:hover { color: var(--gold); }
@media print {
  .topbar, footer.site, .btns, .notice, .actionbar { display: none !important; }
  body { background: #fff; color: #000; }
  .stamps { grid-template-columns: repeat(8, 1fr); }
}

/* ── 16. Lands (home-page map) ────────────────────────────────── */
:root, :root[data-theme="ink"] { --land: #2c2b27; --land-edge: #0b0c0e; --river: #50636a; --wall: #e4ddcd; --wall2: #bfb6a3; --roof: #0f1012; --site-label: #c9c1b2; }
:root[data-theme="parchment"] { --land: #e0d4b8; --land-edge: #b9a67e; --river: #7e9aa3; --wall: #fbf8f1; --wall2: #d8ccb2; --roof: #3a3226; --site-label: #4c4337; }
.lands { max-width: var(--max); margin: 0 auto; padding: 1rem var(--pad) 2rem; }
.lands-svg { width: 100%; height: auto; display: block; overflow: hidden; }
.ld-land { fill: var(--land); } .ld-edge { fill: var(--land-edge); opacity: 0.8; }
.ld-lake { fill: var(--bg); stroke: var(--river); stroke-width: 0.8; }
.ld-river { fill: none; stroke: var(--river); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.ld-route { fill: none; stroke-width: 1.6; stroke-linecap: round; }
.ld-abraham { stroke: var(--g-history); stroke-dasharray: 2 5; }
.ld-exodus { stroke: var(--gold); stroke-dasharray: 6 5; }
.ld-paul { stroke: var(--rubric); stroke-dasharray: 8 6; animation: thread 3s linear infinite; }
.ld-shadow { fill: var(--land-edge); opacity: 0.55; }
.ld-wall { fill: var(--wall); } .ld-wall2 { fill: var(--wall2); } .ld-roof { fill: var(--roof); }
.ld-mount { fill: var(--wall2); stroke: var(--roof); stroke-width: 0.6; } .ld-fire { fill: var(--rubric); }
.ld-dot { fill: var(--wall); stroke: var(--roof); stroke-width: 0.8; }
.ld-label { font-family: var(--serif); letter-spacing: 0.18em; fill: var(--site-label); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-opacity: 0.6; }
.ld-site { cursor: pointer; }
.ld-site:hover .ld-label, .ld-site:focus .ld-label { fill: var(--gold); }
.ld-site:hover .ld-wall, .ld-site:focus .ld-wall { fill: var(--gold); }
.ld-hull { fill: var(--roof); } .ld-mast { stroke: var(--roof); stroke-width: 1; } .ld-sail { fill: var(--wall); stroke: var(--rubric); stroke-width: 0.8; }
:root[data-theme="ink"] .ld-hull { fill: #c9c1b2; } :root[data-theme="ink"] .ld-mast { stroke: #c9c1b2; }
.lands-key { display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; align-items: center; margin-top: 0.8rem; font-size: 0.8125rem; color: var(--muted); }
.lands-key i { display: inline-block; width: 26px; height: 0; border-top: 2px dashed; margin-right: 8px; vertical-align: middle; }
.k-abraham { border-color: var(--g-history) !important; border-top-style: dotted !important; } .k-exodus { border-color: var(--gold) !important; } .k-paul { border-color: var(--rubric) !important; }
@media (prefers-reduced-motion: reduce) { .ld-paul { animation: none; } }
