/* ─────────────────────────────────────────────────────────────────────
 * ScriptureScroll — site styles
 *
 * The palette is lifted straight from the app (constants/colors.ts) so the
 * website and the product read as one thing. Warm ivory rather than white,
 * warm near-black rather than blue-black, in both schemes.
 * ───────────────────────────────────────────────────────────────────── */

:root {
  --canvas: #fbf8f2;
  --surface: #fefcf6;
  --ink: #1e2a21;
  --ink-soft: #4a5a4e;
  --muted: #6e7166;
  --hairline: #eae3d4;
  --hairline-light: #f3ede0;
  --green: #3e9160;
  --green-deep: #256240;
  --green-soft: #e4efe1;
  --on-green: #fffdf7;
  --shadow: 0 1px 2px rgba(30, 42, 33, 0.04), 0 8px 28px rgba(30, 42, 33, 0.06);
  --shadow-lift: 0 2px 6px rgba(30, 42, 33, 0.06), 0 24px 60px rgba(30, 42, 33, 0.12);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;

  --measure: 68ch;
  --gutter: clamp(20px, 5vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #11150f;
    --surface: #1b1f17;
    --ink: #edefe4;
    --ink-soft: #b8c0b2;
    --muted: #8d947f;
    --hairline: #2b3126;
    --hairline-light: #22271e;
    --green: #56b47c;
    --green-deep: #8fd2a8;
    --green-soft: #1d2a20;
    --on-green: #11150f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.45), 0 24px 60px rgba(0, 0, 0, 0.5);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--green-deep);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover { color: var(--green); }

img { max-width: 100%; height: auto; display: block; }

.wrap {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--prose { max-width: 760px; }

/* ── Header ─────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(30, 42, 33, 0.16);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  font-size: 15px;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

.nav a:hover { color: var(--green-deep); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* Brand plus three links does not fit one row on a small phone — it pushed
   the page 15px wider than the viewport and gave the whole site a sideways
   scroll. Below this width the header stacks instead. */
@media (max-width: 540px) {
  .site-header .wrap {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 20px;
    padding-block: 12px;
    min-height: 0;
  }

  .brand { font-size: 16px; }
  .nav { font-size: 14.5px; gap: 20px; }
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
  padding-block: clamp(48px, 9vw, 104px) clamp(40px, 8vw, 88px);
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

@media (max-width: 860px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-deep);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 6px 14px;
  margin: 0 0 22px;
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 6.2vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}

h1 em {
  font-style: normal;
  color: var(--green-deep);
}

.lede {
  font-size: clamp(18px, 2.1vw, 20px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 32px;
}

@media (max-width: 860px) {
  .lede { margin-inline: auto; }
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

@media (max-width: 860px) {
  .actions { justify-content: center; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 14px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.btn--primary {
  background: var(--green-deep);
  color: var(--on-green);
  box-shadow: var(--shadow);
}

.btn--primary:hover {
  color: var(--on-green);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
}

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--hairline);
}

.btn--ghost:hover {
  color: var(--ink);
  border-color: var(--green);
}

.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

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

/* ── Phone frame ────────────────────────────────────────────────────── */

.phone {
  --w: clamp(232px, 30vw, 300px);
  width: var(--w);
  border-radius: calc(var(--w) * 0.155);
  padding: calc(var(--w) * 0.032);
  background: linear-gradient(160deg, #3a3f38, #161a14);
  box-shadow: var(--shadow-lift);
  margin-inline: auto;
}

.phone img {
  border-radius: calc(var(--w) * 0.125);
  display: block;
  width: 100%;
  background: var(--canvas);
}

.phone-row {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.phone-row .phone { --w: clamp(200px, 22vw, 260px); }

.shot {
  text-align: center;
}

.shot figcaption {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
  max-width: 26ch;
  margin-inline: auto;
}

/* ── Sections ───────────────────────────────────────────────────────── */

section { padding-block: clamp(48px, 8vw, 88px); }

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--hairline);
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}

.section-head {
  max-width: 34ch;
  margin: 0 0 clamp(32px, 5vw, 52px);
}

.section-head p {
  color: var(--ink-soft);
  margin: 0;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

/* ── Steps + feature cards ──────────────────────────────────────────── */

.grid {
  display: grid;
  gap: clamp(18px, 2.6vw, 26px);
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 26px 24px;
}

.section-alt .card { background: var(--canvas); }

.card h3 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.6;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 16px;
}

/* ── Verse ──────────────────────────────────────────────────────────── */

.verse {
  text-align: center;
  padding-block: clamp(52px, 8vw, 92px);
}

.verse blockquote {
  font-family: var(--serif);
  font-size: clamp(22px, 3.4vw, 31px);
  line-height: 1.42;
  color: var(--ink);
  margin: 0 auto 18px;
  max-width: 22ch;
}

.verse cite {
  font-style: normal;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Prose pages ────────────────────────────────────────────────────── */

.prose { padding-block: clamp(40px, 6vw, 72px) clamp(56px, 8vw, 96px); }

.prose h1 {
  font-size: clamp(32px, 5vw, 44px);
  margin-bottom: 10px;
}

.prose .meta {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 clamp(32px, 5vw, 48px);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}

.prose h2 {
  font-family: var(--sans);
  font-weight: 650;
  font-size: 21px;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  scroll-margin-top: 88px;
}

.prose h3 {
  font-size: 17px;
  font-weight: 650;
  margin: 28px 0 8px;
}

.prose p,
.prose li {
  color: var(--ink-soft);
  max-width: var(--measure);
}

.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 9px; }
.prose li::marker { color: var(--green); }

.prose strong { color: var(--ink); font-weight: 650; }

.callout {
  background: var(--green-soft);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 28px 0;
}

.callout p {
  margin: 0;
  color: var(--ink);
}

.toc {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 40px;
}

.toc p {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 32px;
  font-size: 15px;
}

@media (max-width: 620px) {
  .toc ol { columns: 1; }
}

.toc li { margin-bottom: 5px; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 15px;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

@media (min-width: 700px) {
  table { display: table; white-space: normal; }
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

th {
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

td { color: var(--ink-soft); }

/* ── Contact ────────────────────────────────────────────────────────── */

.contact-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: clamp(26px, 4vw, 38px);
  box-shadow: var(--shadow);
}

.contact-card .email {
  font-family: var(--serif);
  font-size: clamp(22px, 3.6vw, 30px);
  letter-spacing: -0.01em;
  word-break: break-word;
  display: inline-block;
  margin: 6px 0 14px;
}

.faq {
  border-top: 1px solid var(--hairline);
  padding-top: 6px;
}

.faq details {
  border-bottom: 1px solid var(--hairline);
  padding: 4px 0;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 34px 16px 0;
  font-weight: 600;
  font-size: 16.5px;
  position: relative;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 400;
  color: var(--green);
  line-height: 1;
}

.faq details[open] summary::after { content: "\2212"; }

.faq details > *:not(summary) {
  color: var(--ink-soft);
  margin: 0 0 16px;
  max-width: var(--measure);
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  padding-block: 40px;
  font-size: 14.5px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--green-deep); }
.site-footer .copy { color: var(--muted); margin: 0; }

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 50;
  background: var(--green-deep);
  color: var(--on-green);
  padding: 10px 16px;
  border-radius: 10px;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}
