/* Sown (sownbible.app) — Fable-inspired Literary Modernism × Sown Theme.kt palette */
:root {
  --night: #10162b;
  --night-deep: #0b1020;
  --ink: #202a46;
  --ink-soft: #2b365a;
  --paper: #efe7d9;
  --paper-warm: #f7f2e8;
  --paper-deep: #e5dac7;
  --gold: #d3ad6b;
  --gold-soft: rgba(211, 173, 107, 0.22);
  --bronze: #725524;
  --bronze-dark: #573f18;
  --muted-dark: #bbc3d3;
  --muted-light: #4a5470;
  --edge-dark: rgba(239, 231, 217, 0.14);
  --edge-light: rgba(32, 42, 70, 0.14);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-reading: 'Spectral', Georgia, serif;
  --font-ui: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  --max-w: 1120px;
  --prose-w: 780px;
  --shadow-card: 0 24px 60px rgba(6, 10, 22, 0.48);
  --shadow-soft: 0 12px 32px rgba(16, 22, 43, 0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.62;
  color: var(--paper);
  background: var(--night);
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { opacity: 0.88; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Sticky Literary Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(16, 22, 43, 0.86);
  border-bottom: 1px solid var(--edge-dark);
}

.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.topnav a {
  color: var(--muted-dark);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

.topnav a:hover { color: var(--paper); }

.topnav .nav-cta {
  background: var(--gold);
  color: var(--night);
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 14px;
}

.topnav .nav-cta:hover { background: #e0be7f; color: var(--night); opacity: 1; }

/* Layout Containers */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.prose-wrap {
  max-width: var(--prose-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Fable-Inspired Split Editorial Hero */
.hero {
  background: radial-gradient(ellipse 80% 65% at 65% 15%, rgba(43, 54, 90, 0.72), transparent 72%), var(--night);
  padding: 48px 0 64px;
  border-bottom: 1px solid var(--edge-dark);
}

.hero.compact {
  padding: 40px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 44px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
  text-decoration: none;
}

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 5.2vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  color: var(--paper);
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.3vw, 2.75rem);
  line-height: 1.1;
  margin: 0 0 14px;
}

h3 {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0 0 8px;
}

.lede {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--muted-dark);
  margin: 0 0 26px;
  max-width: 58ch;
}

.store-note {
  font-size: 14px;
  color: var(--muted-dark);
  margin: 14px 0 0;
}

.store-note strong { color: var(--paper); }

/* Store Badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.badges a {
  display: inline-flex;
  align-items: center;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.badges a:hover { transform: translateY(-2px); opacity: 1; }
.badges img { height: 48px; width: auto; }

/* Interactive Painted Verse Deck (Hero + Topic Pages + Share Landing) */
.deck-shell {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
}

.verse-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 500px;
  background-color: var(--ink);
  background-size: cover;
  background-position: center bottom;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(239, 231, 217, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 24px 24px;
  color: var(--paper);
  user-select: none;
  transition: transform 0.22s ease;
}

.verse-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(16, 22, 43, 0.34) 0%,
    rgba(16, 22, 43, 0.50) 48%,
    rgba(11, 16, 32, 0.72) 100%
  );
  z-index: 0;
}

.verse-card > * { position: relative; z-index: 1; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: rgba(239, 231, 217, 0.85);
}

.card-pill {
  background: rgba(16, 22, 43, 0.68);
  border: 1px solid rgba(211, 173, 107, 0.35);
  color: var(--gold);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-counter {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: rgba(239, 231, 217, 0.82);
}

.card-body {
  margin: auto 0;
  padding: 22px 0;
}

.card-quote {
  font-family: var(--font-reading);
  font-size: clamp(1.28rem, 2.3vw, 1.62rem);
  line-height: 1.5;
  color: var(--paper);
  margin: 0 0 18px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.card-ref {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(239, 231, 217, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(239, 231, 217, 0.25);
  background: rgba(16, 22, 43, 0.72);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.btn:hover { background: rgba(32, 42, 70, 0.92); border-color: var(--gold); opacity: 1; }
.btn:active { transform: scale(0.98); }

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--night);
  font-weight: 700;
}

.btn-gold:hover { background: #e1c082; border-color: #e1c082; color: var(--night); }

.btn-bronze {
  background: var(--bronze);
  border-color: var(--bronze);
  color: var(--paper);
}

.btn-bronze:hover { background: var(--bronze-dark); border-color: var(--bronze-dark); color: var(--paper); }

.deck-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.deck-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.deck-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(239, 231, 217, 0.25);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.deck-dot.active {
  width: 22px;
  border-radius: var(--radius-pill);
  background: var(--gold);
}

/* Explain Drawer inside Deck */
.explain-drawer {
  margin-top: 14px;
  background: var(--paper-warm);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 1px solid var(--edge-light);
  box-shadow: var(--shadow-soft);
}

.explain-drawer[hidden] { display: none; }

.explain-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bronze);
  margin: 0 0 4px;
}

.explain-drawer p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

.explain-drawer p:last-child { margin-bottom: 0; }

.explain-caution {
  background: rgba(114, 85, 36, 0.09);
  border-left: 3px solid var(--bronze);
  padding: 10px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 10px;
}

/* Soft Wall End-of-Deck Card */
.soft-wall {
  text-align: left;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(155deg, var(--ink-soft) 0%, var(--night-deep) 100%);
}

.soft-wall::before { display: none; }
.soft-wall h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
  color: var(--paper);
}

/* Alternating Editorial Bands (Fable Dark ↔ Warm Parchment Rhythm) */
.band-dark {
  background: var(--night);
  color: var(--paper);
  padding: 64px 0;
  border-bottom: 1px solid var(--edge-dark);
}

.band-paper {
  background: var(--paper);
  color: var(--ink);
  padding: 64px 0;
  border-bottom: 1px solid var(--edge-light);
}

.band-paper h2, .band-paper h3 { color: var(--ink); }
.band-paper a { color: var(--bronze); }
.band-paper .eyebrow { color: var(--bronze); }
.band-paper .lede { color: var(--muted-light); }

/* Fable-style Painted Topic Rail */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.topic-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 230px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.topic-tile {
  scroll-snap-align: start;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 205px;
  background-color: var(--ink);
  background-size: cover;
  background-position: center;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  color: var(--paper);
  border: 1px solid rgba(239, 231, 217, 0.16);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.topic-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 22, 43, 0.12) 0%, rgba(11, 16, 32, 0.88) 100%);
}

.topic-tile > * { position: relative; z-index: 1; }
.topic-tile:hover { transform: translateY(-4px); border-color: var(--gold); opacity: 1; }
.topic-tile .tile-count { font-size: 12px; font-weight: 600; color: var(--gold); letter-spacing: 0.04em; text-transform: uppercase; }
.topic-tile .tile-title { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; line-height: 1.08; margin: 4px 0 4px; color: var(--paper); }
.topic-tile .tile-sub { font-size: 13.5px; color: var(--muted-dark); line-height: 1.35; }

/* Feature Cards (3-column editorial grid) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.editorial-card {
  background: var(--paper-warm);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  border: 1px solid var(--edge-light);
  box-shadow: var(--shadow-soft);
}

.editorial-card.dark {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--edge-dark);
}

.editorial-card .card-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--bronze);
  margin-bottom: 10px;
}

.editorial-card.dark .card-num { color: var(--gold); }
.editorial-card p { margin: 0; color: var(--muted-light); font-size: 15.5px; }
.editorial-card.dark p { color: var(--muted-dark); }

/* Verdict / Answer-First Summary Card (Berean AEO Pattern) */
.summary-card {
  background: var(--paper-warm);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  border: 1px solid var(--edge-light);
  border-left: 5px solid var(--bronze);
  box-shadow: var(--shadow-soft);
  margin-bottom: 30px;
}

.summary-card p { margin: 0 0 18px; font-size: 1.08rem; line-height: 1.62; color: var(--ink); }
.summary-card .verdict-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--bronze);
  margin: 0 0 8px;
}

/* Sown at a Glance Fact Table (Berean AEO <dl> pattern) */
.facts {
  background: var(--paper-warm);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: 28px 30px;
  border: 1px solid var(--edge-light);
  box-shadow: var(--shadow-soft);
}

.facts h2 { color: var(--ink); margin-bottom: 16px; }
.facts dl { margin: 0; }

.fact-row {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--edge-light);
}

.fact-row:first-child { border-top: 0; padding-top: 0; }
.fact-row dt { font-weight: 700; color: var(--bronze); font-size: 15px; }
.fact-row dd { margin: 0; color: var(--ink); font-size: 15.5px; }

/* Comparison Tables */
.table-wrap {
  overflow-x: auto;
  margin: 24px 0 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--edge-light);
  background: var(--paper-warm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  color: var(--ink);
}

caption {
  text-align: left;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  padding: 16px 18px 10px;
  color: var(--ink);
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-top: 1px solid var(--edge-light);
  vertical-align: top;
}

thead th {
  background: var(--paper-deep);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--bronze-dark);
}

tbody tr:hover td { background: rgba(114, 85, 36, 0.05); }

/* Dedicated AEO FAQ Section (Homepage + /faq + Buyer Guides) */
.faq-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.faq-item {
  background: var(--paper-warm);
  color: var(--ink);
  border: 1px solid var(--edge-light);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.faq-item h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
}

.faq-item p {
  margin: 0;
  color: var(--muted-light);
  font-size: 16px;
  line-height: 1.62;
}

.faq-item strong { color: var(--ink); }

/* Interactive Learn-by-Heart Widget */
.memory-box {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid rgba(211, 173, 107, 0.28);
  box-shadow: var(--shadow-card);
}

.memory-verse {
  font-family: var(--font-reading);
  font-size: 1.32rem;
  line-height: 1.85;
  margin: 16px 0 22px;
  color: var(--paper);
}

.mem-blank {
  display: inline-block;
  min-width: 72px;
  padding: 1px 10px;
  margin: 0 3px;
  border-bottom: 2px solid var(--gold);
  background: rgba(211, 173, 107, 0.14);
  border-radius: 6px 6px 0 0;
  text-align: center;
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
}

.mem-blank.active {
  background: rgba(211, 173, 107, 0.3);
  box-shadow: 0 0 0 2px rgba(211, 173, 107, 0.45);
}

.mem-blank.filled {
  background: rgba(94, 189, 134, 0.2);
  border-bottom-color: #6fd39b;
  color: #b7f5d0;
}

.mem-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mem-chip {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(239, 231, 217, 0.24);
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
  cursor: pointer;
}

.mem-chip:hover { border-color: var(--gold); background: rgba(211, 173, 107, 0.15); }
.mem-chip.wrong { border-color: #e27d60; background: rgba(226, 125, 96, 0.22); }
.mem-chip:disabled { opacity: 0.35; cursor: default; }

.mem-status {
  margin-top: 16px;
  font-size: 15px;
  color: var(--gold);
  font-weight: 600;
}

/* Translation Switcher */
.edition-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.edition-tab {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--edge-light);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.edition-tab.active {
  background: var(--ink);
  color: var(--gold);
  border-color: var(--ink);
}

.edition-quote {
  font-family: var(--font-reading);
  font-size: 1.3rem;
  line-height: 1.62;
  margin: 0 0 10px;
  color: var(--ink);
}

.edition-attr {
  font-size: 13px;
  color: var(--muted-light);
  margin: 0;
}

/* Prose / Editorial Guides */
.prose h2 { margin-top: 38px; color: var(--ink); }
.prose p { margin: 0 0 16px; }
.prose ul { padding-left: 20px; margin: 0 0 18px; }
.prose li { margin-bottom: 8px; }

/* Semantic Crawler-Friendly Verse List on Topic Pages */
.verse-list {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.verse-item {
  background: var(--paper-warm);
  border: 1px solid var(--edge-light);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  color: var(--ink);
}

.verse-item blockquote {
  font-family: var(--font-reading);
  font-size: 1.2rem;
  line-height: 1.58;
  margin: 0 0 8px;
  color: var(--ink);
}

.verse-item cite {
  font-style: normal;
  font-size: 14px;
  font-weight: 700;
  color: var(--bronze);
}

.verse-item details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--edge-light);
}

.verse-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--bronze);
}

/* Link Pill Grids */
.link-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.link-pills a {
  display: inline-block;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--edge-dark);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
}

.link-pills a:hover { border-color: var(--gold); color: var(--gold); opacity: 1; }

.band-paper .link-pills a {
  border-color: var(--edge-light);
  background: var(--paper-warm);
  color: var(--ink);
}

.band-paper .link-pills a:hover { border-color: var(--bronze); color: var(--bronze); }

/* Footer */
footer {
  background: var(--night-deep);
  color: var(--muted-dark);
  padding: 44px 0 54px;
  font-size: 14.5px;
  border-top: 1px solid var(--edge-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

footer h4 {
  font-family: var(--font-ui);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin: 0 0 10px;
}

footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
footer a { color: var(--muted-dark); text-decoration: none; }
footer a:hover { color: var(--paper); }

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--edge-dark);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .feature-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .fact-row { grid-template-columns: 1fr; gap: 4px; }
  .verse-card { min-height: 440px; }
}

@media (max-width: 560px) {
  .topnav a:not(.nav-cta) { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .band-dark, .band-paper { padding: 44px 0; }
}
