/* Landing page for the Semantic Interlinear Bible.
   Shares the reader's palette (style.css :root) but stands alone. */
:root {
  --bg: #14161a;
  --panel: #1a1d23;
  --panel-2: #21252c;
  --ink: #e8e6e1;
  --muted: #9aa0a8;
  --line: #2b2f37;
  --accent: #e6b277;        /* warm amber */
  --accent-ink: #f0c896;
  --xref: #7fb0d8;
  --serif: "Iowan Old Style", "Palatino Linotype", "Source Serif 4", Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.55;
}
a { color: inherit; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 5vw, 48px);
  backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, rgba(20,22,26,.85), rgba(20,22,26,0));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand-mark {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--accent-ink);
  line-height: 1;
}
.brand-name { letter-spacing: .2px; }
.nav-cta {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-ink);
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  transition: border-color .2s, transform .2s;
}
.nav-cta:hover { border-color: var(--accent); transform: translateY(-1px); }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(18px, 5vw, 48px); }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 9vw, 120px) 0 36px; text-align: center; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 18px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.12;
  margin: 0 auto 22px;
  max-width: 22ch;          /* wide enough for the longest line ("that understands the") */
  letter-spacing: -.5px;
}
/* the live-rewriting verb in the headline — steady-width slot so it never reflows */
.morph-word {
  color: var(--accent-ink);
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  transition: color .3s;
}
.morph-word.changing { color: var(--ink); }
.lede {
  max-width: 60ch;
  margin: 0 auto 30px;
  font-size: clamp(16px, 2vw, 19px);
  color: var(--muted);
}
.lede em { color: var(--ink); font-style: italic; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 12px;
  transition: transform .18s, box-shadow .25s, background .2s, border-color .2s;
  display: inline-block;
}
.btn.primary {
  color: #1a140c;
  background: linear-gradient(180deg, var(--accent-ink), var(--accent));
  box-shadow: 0 8px 24px rgba(230,178,119,.28);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(230,178,119,.4); }
.btn.ghost { color: var(--ink); border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.btn.ghost:hover { border-color: var(--accent); transform: translateY(-2px); }
.btn.big { font-size: 17px; padding: 16px 30px; }

/* ---------- Live Reading banner ---------- */
.banner { margin: 14px 0 8px; }
.banner-inner {
  display: block;
  text-decoration: none;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(22px, 4vw, 38px) clamp(20px, 4vw, 44px);
  background:
    linear-gradient(180deg, rgba(230,178,119,.06), rgba(127,176,216,.04)),
    var(--panel);
  overflow: hidden;
  transition: border-color .25s, transform .25s;
}
.banner-inner:hover { border-color: var(--accent); transform: translateY(-2px); }

.banner-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 16px;
}
.pulse {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(230,178,119,.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(230,178,119,.55); }
  70%  { box-shadow: 0 0 0 10px rgba(230,178,119,0); }
  100% { box-shadow: 0 0 0 0 rgba(230,178,119,0); }
}
.banner-text {
  font-family: var(--serif);
  font-size: clamp(20px, 3.2vw, 31px);
  line-height: 1.6;
  margin: 0;
  color: var(--ink);
}
.banner-text .vnum {
  font-family: var(--sans);
  font-size: .5em;
  font-weight: 700;
  color: var(--accent);
  vertical-align: super;
  margin-right: 3px;
  user-select: none;
}
/* a morphing phrase: amber, steady-width slot so nothing reflows; text centered
   within the reserved width, exactly like the reader's Live Reading mode */
.banner-text .sem {
  color: var(--accent-ink);
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-bottom: 1.5px dotted rgba(230, 178, 119, .5);   /* same marker as the reader */
  border-radius: 2px;
}
.banner-loading { color: var(--muted); font-style: italic; }
.banner-hint { margin-top: 18px; font-family: var(--sans); font-size: 13.5px; color: var(--muted); }

/* ---------- How it works / cards ---------- */
.how { padding: clamp(40px, 6vw, 60px) 0 32px; text-align: center; }
.how h2, .final h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 4.5vw, 46px);
  margin: 0 0 16px;
  letter-spacing: -.3px;
}
.section-lede { max-width: 58ch; margin: 0 auto 48px; color: var(--muted); font-size: clamp(15px, 1.8vw, 18px); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; text-align: left; }
.cards.two { grid-template-columns: repeat(2, 1fr); max-width: 900px; margin: 0 auto; }
.card p + p { margin-top: 12px; }
.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 26px;
  background: var(--panel);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--float-shadow, 0 6px 22px rgba(0,0,0,.45)); }
.card-ico {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: rgba(230,178,119,.12);
  color: var(--accent-ink);
  margin-bottom: 18px;
}
.card-ico svg { width: 22px; height: 22px; }
.card h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 10px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card em { color: var(--ink); font-style: italic; }

/* ---------- Word-context example ---------- */
.word-example { padding: clamp(20px, 5vw, 56px) 0 30px; text-align: center; }
.word-example h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 4.5vw, 46px);
  margin: 0 0 16px;
  letter-spacing: -.3px;
}
.we-card {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 0;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--panel);
}

/* left: the original word */
.we-lex {
  padding: clamp(24px, 3vw, 36px);
  background: linear-gradient(180deg, rgba(230,178,119,.06), transparent);
  border-right: 1px solid var(--line);
}
.we-eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
}
.we-surface {
  font-family: var(--serif);
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 12px;
}
.we-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.we-translit { font-style: italic; color: var(--accent-ink); font-size: 17px; }
.we-strongs {
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  color: var(--accent-ink);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 7px; background: rgba(230,178,119,.1);
}
.we-morph { width: 100%; color: var(--muted); font-size: 13px; }
.we-english { font-family: var(--serif); font-size: 22px; color: var(--ink); margin-bottom: 4px; }
.we-role { color: var(--muted); font-size: 13.5px; font-style: italic; margin-bottom: 16px; }
.we-def { margin: 0 0 12px; color: var(--ink); font-size: 15px; line-height: 1.55; }
.we-usagenote { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* right: range of meaning + cross-usages */
.we-detail { padding: clamp(24px, 3vw, 36px); display: flex; flex-direction: column; gap: 26px; }
.we-block {}
.we-h {
  margin: 0 0 14px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted);
}
.we-facets { display: flex; flex-direction: column; gap: 12px; }
.we-facet { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: start; }
.we-facet-label { color: var(--accent-ink); font-size: 13px; font-weight: 600; padding-top: 4px; }
.we-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.we-chip {
  font-size: 13.5px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--panel-2);
}

.we-usages { display: grid; grid-template-columns: 1fr; gap: 10px; }
.we-usage {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--panel-2);
  transition: border-color .2s, transform .2s;
}
.we-usage-link:hover { border-color: var(--accent); transform: translateX(2px); }
.we-usage-ref { color: var(--accent-ink); font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.we-snippet { margin: 0; color: var(--ink); font-family: var(--serif); font-size: 15px; line-height: 1.5; }
.we-match { background: var(--sel, rgba(230,178,119,.16)); color: var(--accent-ink); border-radius: 3px; padding: 0 2px; }
.we-usage-note { margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* ---------- Final CTA ---------- */
.final { text-align: center; padding: clamp(60px, 10vw, 120px) 0 40px; }
.final p { color: var(--muted); margin: 0 0 28px; font-size: clamp(15px, 1.8vw, 18px); }

/* ---------- Footer ---------- */
.foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px clamp(18px, 5vw, 48px) 48px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  color: var(--muted); font-size: 14px;
  border-top: 1px solid var(--line);
}
.foot a { color: var(--accent-ink); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .dot { opacity: .5; }
.foot .credits { flex-basis: 100%; margin: 12px 0 0; font-size: 11.5px; line-height: 1.7; opacity: .75; }

/* ---------- Reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .cards, .cards.two { grid-template-columns: 1fr; }
  .we-card { grid-template-columns: 1fr; }
  .we-lex { border-right: none; border-bottom: 1px solid var(--line); }
  .nav-cta { display: none; }
}
@media (max-width: 460px) {
  .we-facet { grid-template-columns: 1fr; gap: 5px; }
  .we-facet-label { padding-top: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ───────── Live completion graph ───────── */
.completion { padding: clamp(40px, 7vw, 90px) 0; text-align: center; }
.completion .section-lede { margin-left: auto; margin-right: auto; }
.home-stats {
  margin: 26px auto 14px; padding: 18px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  overflow-x: auto;
}
.home-stats .verse-maps {
  display: flex; flex-wrap: wrap; gap: 8px 10px;
  align-items: flex-end; justify-content: center;
}
.home-stats canvas { display: block; image-rendering: pixelated; opacity: .95; }
.home-stats .hs-break { flex-basis: 100%; height: 0; }
.completion-summary { color: var(--muted); font-size: 14px; margin: 6px 0 20px; }
