/* The web reader: the apps' feed, one verse per screen, snapping like the phone does.
   Same paper, ink, and gold as the apps and the landing page, light and dark. */
:root {
  --paper: #FBF7EF;
  --card: #F6F0E3;
  --ink: #1C1B19;
  --ink-soft: rgba(28, 27, 25, 0.55);
  --rule: rgba(28, 27, 25, 0.1);
  --gold: #B08D57;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --round: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14120F; --card: #1D1914; --ink: #F1EAD9; --ink-soft: rgba(241, 234, 217, 0.55);
    --rule: rgba(241, 234, 217, 0.1); --gold: #D9B36C;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* Without JavaScript: the chapter, readable as a plain page. */
#static { max-width: 680px; margin: 0 auto; padding: 32px 22px 64px; font-family: var(--serif); font-size: 1.15rem; line-height: 1.6; }
#static h1 { font-size: 2rem; }
#static sup { color: var(--gold); font-family: var(--round); font-size: 0.7em; margin-right: 0.2em; }
#static nav { display: flex; justify-content: space-between; margin-top: 32px; font-family: var(--round); }
#static a { color: var(--gold); }
.js #static { display: none; }
html:not(.js) .bar, html:not(.js) .feed, html:not(.js) .scrubber { display: none; }

/* The top bar: chapter title (the way into Go To), the Bible badge, read aloud. */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 5;
  display: flex; align-items: center; gap: 4px;
  padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.bar .title { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; padding: 8px 0; text-align: start; }
.bar .title span { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .title svg { width: 14px; height: 14px; flex: none; opacity: 0.6; }
.badge {
  font-family: var(--round); font-weight: 800; font-size: 0.75rem; color: color-mix(in srgb, var(--ink) 70%, transparent);
  border: 1.2px solid color-mix(in srgb, var(--ink) 35%, transparent); border-radius: 6px; padding: 4px 7px; margin: 0 6px;
}
.icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: color-mix(in srgb, var(--ink) 70%, transparent); flex: none; }
.icon:hover { background: var(--rule); }
.icon.gold, #speak[aria-pressed="true"] { color: var(--gold); }
#speak[aria-pressed="true"] svg { animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.1); } }

/* The feed: one card per screen, snapping. */
.feed {
  position: fixed; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }
.feed.jumping { opacity: 0; }
.feed { transition: opacity 0.12s ease; }
.card {
  height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; place-items: center;
  content-visibility: auto; contain-intrinsic-size: auto 100vh;
}
.card .col { width: min(90vw, 720px); padding: 0 32px; display: flex; flex-direction: column; align-items: center; }
.vt {
  margin: 0; font-family: var(--serif); font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); line-height: 1.5;
  text-align: center; text-wrap: pretty;
}
.vt .spoken { color: color-mix(in srgb, var(--ink) 60%, transparent); }
.vt .word { color: var(--gold); }
.meta { margin-top: 80px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.meta .acts { display: flex; gap: 4px; }
.meta .acts .icon { width: 44px; height: 44px; color: color-mix(in srgb, var(--ink) 30%, transparent); }
.meta .acts svg { width: 21px; height: 21px; }
.ref {
  display: flex; align-items: center; gap: 4px; padding: 6px 4px;
  font-family: var(--round); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft);
}
.ref svg { width: 12px; height: 12px; opacity: 0.6; }

/* Chapter and book beats, with the illuminated drop cap. */
.card.transition { background: var(--card); }
.transition .col { gap: 14px; }
.transition .rule { width: 36px; height: 2px; background: var(--gold); }
.transition .kick { font-family: var(--round); font-weight: 800; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.transition h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 1.6rem + 2vw, 2.6rem); line-height: 1.25; text-align: center; }
.transition h2 .cap { color: var(--gold); font-weight: 700; font-size: 1.55em; }
.transition h2.whole { color: var(--gold); font-weight: 600; }
.card.transition.shown .rule { animation: draw 0.4s ease-out both; }
.card.transition.shown .kick { animation: rise 0.4s 0.15s ease-out both; }
.card.transition.shown h2 { animation: rise 0.45s 0.2s ease-out both; }
@keyframes draw { from { width: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* The scrubber: one dot per verse in the chapter, waking up on touch. */
.scrubber {
  position: fixed; z-index: 4; right: max(0px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%);
  width: 44px; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scrubber .top { display: grid; place-items: center; width: 44px; height: 44px; color: color-mix(in srgb, var(--ink) 70%, transparent); }
.scrubber .top svg { width: 15px; height: 15px; stroke-width: 2.6; }
.dots { width: 44px; touch-action: none; cursor: ns-resize; display: flex; flex-direction: column; }
.dots i { display: grid; place-items: center; flex: 1; }
.dots i::after { content: ""; width: 4.5px; height: 4.5px; max-width: 60%; max-height: 60%; border-radius: 50%; background: var(--ink-soft); opacity: 0.3; transition: opacity 0.15s; }
.scrubbing .dots i::after { opacity: 0.55; }
.dots i.on::after { width: 9px; height: 9px; max-width: 95%; max-height: 95%; background: #fff; box-shadow: 0 0 0 1px var(--ink-soft); opacity: 1; }

/* The quiet invitation to the app. */
.nudge {
  position: fixed; z-index: 6; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(calc(100vw - 24px), 520px);
  display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 14px;
  background: var(--card); border-radius: 18px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  animation: nudge-in 0.35s ease-out;
}
@keyframes nudge-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.nudge img { border-radius: 9px; flex: none; }
.nudge p { margin: 0; flex: 1; font-size: 0.88rem; line-height: 1.35; }
.nudge .get { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--gold); color: var(--paper); font-family: var(--round); font-weight: 800; font-size: 0.85rem; text-decoration: none; }
.nudge .dismiss { width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink-soft); flex: none; }
.nudge .dismiss svg { width: 16px; height: 16px; }

.toast {
  position: fixed; z-index: 7; left: 50%; top: max(70px, calc(env(safe-area-inset-top) + 64px)); transform: translateX(-50%);
  padding: 9px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 0.88rem; font-weight: 600;
}

/* Go To and the Bible picker: full-height sheets. */
.sheet {
  border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  background: var(--paper); color: var(--ink);
}
@media (min-width: 720px) {
  .sheet { margin: auto; width: 560px; height: min(86vh, 860px); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); }
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.35); }
.sheet[open] { display: flex; flex-direction: column; animation: up 0.25s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet > header {
  display: flex; align-items: center; gap: 4px; flex: none;
  padding: max(6px, env(safe-area-inset-top)) 8px 6px; border-bottom: 1px solid var(--rule);
}
.sheet h2 { flex: 1; margin: 0; text-align: center; font-size: 1.05rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .body { flex: 1; overflow-y: auto; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.search { display: block; width: calc(100% - 32px); margin: 12px 16px 4px; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; font-size: 1rem; }
.search:focus { outline: 2px solid var(--gold); }
.section { padding: 22px 20px 6px; font-family: var(--round); font-weight: 800; font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 20px;
  border-bottom: 1px solid var(--rule); text-align: start;
}
.row:hover { background: var(--card); }
.row .grow { flex: 1; min-width: 0; }
.row small { display: block; color: var(--ink-soft); font-size: 0.82rem; margin-top: 2px; }
.row .count { color: var(--ink-soft); font-size: 0.82rem; }
.row .code { width: 48px; flex: none; font-family: var(--round); font-weight: 800; color: var(--gold); }
.row svg.chev { width: 18px; height: 18px; color: var(--ink-soft); flex: none; }
.row svg.check { color: var(--gold); flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 12px; padding: 16px; }
.grid button { min-height: 56px; border-radius: 12px; background: var(--card); font-family: var(--round); font-weight: 700; font-size: 1.05rem; }
.grid button:hover { outline: 2px solid var(--gold); }
.note { padding: 6px 20px; color: var(--ink-soft); font-size: 0.82rem; line-height: 1.45; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
