/* Abide — a quiet reader. Warm paper by day, lamplight by night.
   Palette (60/30/10): paper neutral / ink / amber accent.
   Reading face: Literata (variable, subset to TS2009's glyph ranges) —
   Google's long-form ebook font, chosen by bake-off 2026-07-20. */

@font-face {
  font-family: "Literata";
  src: url("/fonts/literata.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/fonts/literata-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #faf6ee;
  --ink: #241f17;
  --muted: #756a58;
  --accent: #96682a;
  --hairline: rgba(36, 31, 23, 0.12);
  --hairline-faint: rgba(36, 31, 23, 0.06);
  --card: rgba(36, 31, 23, 0.03);
  --serif: "Literata", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161310;
    --ink: #e8e1d2;
    --muted: #988d79;
    --accent: #d2a55e;
    --hairline: rgba(232, 225, 210, 0.14);
    --hairline-faint: rgba(232, 225, 210, 0.07);
    --card: rgba(232, 225, 210, 0.04);
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--serif);
  font-optical-sizing: auto;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}

.shell {
  max-width: 40rem;
  margin: 0 auto;
  /* bottom padding clears the fixed tab bar */
  padding: calc(1.25rem + env(safe-area-inset-top)) 1.25rem calc(6.5rem + env(safe-area-inset-bottom));
}

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

/* ---------- shared ---------- */

.quiet-link {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  display: inline-block;
  padding: 0.6rem 0;
  min-height: 44px;
  transition: color 120ms ease;
}
.quiet-link:active { color: var(--accent); }

.back-link { display: block; }

.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; }

.section-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 2rem 0 0.5rem;
}

/* ---------- home ---------- */

.home-hero {
  min-height: calc(100dvh - 10rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3rem;
  text-align: center;
}

.wordmark { font-size: 2rem; font-weight: 600; letter-spacing: -0.01em; }

.tagline {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.home-quote { max-width: 28rem; margin: 0 auto; }

.home-quote p {
  font-size: 1.35rem;
  line-height: 1.65;
  font-weight: 400;
}

.home-quote cite {
  display: block;
  margin-top: 1.25rem;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.home-epub { margin-top: 1rem; }

.epub-ask {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}

.epub-link {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  margin-top: 0.75rem;
  min-height: 44px;
  transition: background 120ms ease;
}
.epub-link:active { background: var(--card); }

/* ---------- books ---------- */

.book-list { list-style: none; }

.book-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0.25rem;
  min-height: 48px;
  border-bottom: 1px solid var(--hairline);
  transition: background 120ms ease;
}
.book-row:active { background: var(--card); }

.book-name { font-size: 1.05rem; }

.book-chapters { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }

/* ---------- chapter grid ---------- */

.chapter-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.25rem, 1fr));
  gap: 0.6rem;
}

.chapter-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  font-size: 1.05rem;
  transition: background 120ms ease, border-color 120ms ease;
}
.chapter-cell:active { background: var(--card); border-color: var(--accent); }

/* ---------- reading ---------- */

.reading-header { margin-bottom: 2rem; }

.reading-book {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 0.75rem;
}
.reading-book-link { padding: 0.4rem 0; display: inline-block; }
.reading-book-link:active { color: var(--accent); }

.reading-chapter {
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.1;
  margin-top: 0.2rem;
}

.verses { display: grid; }

.verse + .verse {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
}

/* Divider aligns with the text column, not the number gutter */
.verse + .verse::before {
  content: "";
  position: absolute;
  top: 0;
  left: 2rem;
  right: 0;
  border-top: 1px solid var(--hairline-faint);
}

/* Verse numbers live in a left gutter, centered on the verse block,
   so the text itself stays flush left like a print Bible. */
.verse {
  font-size: 1.125rem;
  line-height: 1.75;
  position: relative;
  padding-left: 2rem;
}

.verse-num {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1.4rem;
  text-align: right;
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
}

.mark-read {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  min-height: 44px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.mark-read:active { background: var(--card); }
.mark-read.is-read {
  color: var(--paper);
  background: var(--accent);
  border-color: var(--accent);
}

.chapter-cell.is-read {
  color: var(--muted);
  border-color: transparent;
  background: var(--card);
  position: relative;
}
.chapter-cell.is-read::after {
  content: "✓";
  font-family: var(--sans);
  font-size: 0.6rem;
  color: var(--accent);
  position: absolute;
  top: 0.3rem;
  right: 0.45rem;
}

.pager-link {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--accent);
  padding: 0.85rem 0.25rem;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  transition: opacity 120ms ease;
}
.pager-link:active { opacity: 0.6; }
.pager-next { justify-self: end; text-align: right; }

/* ---------- tab bar ---------- */

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.45rem 0;
  min-height: 52px;
  color: var(--muted);
  transition: color 120ms ease;
}
.tab:active { color: var(--ink); }
.tab.is-active { color: var(--accent); }

.tab-icon { width: 23px; height: 23px; }

.tab-label {
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
