/*
  Bible Journal — marketing site styles.

  The palette and type are lifted verbatim from the app's design tokens
  (lib/core/theme/app_tokens.dart + app_typography.dart). The app authors color
  in OKLCH and CSS speaks the same oklch(L C H) dialect, so these values render
  identically here and in the app — the site is the app's "Paper" theme in a
  browser, with "Candlelit" as the dark face via prefers-color-scheme.

  Design rules carried over from PRD §9: typography-led, image-light, generous
  whitespace, gentle (never bouncy) motion, restrained color. Everything is fluid
  (clamp/%, no fixed breakpoints required) so it holds from a small phone to a
  wide desktop — screen-size-agnostic, per the project's prime directive.
*/

/* ---- Design tokens: Paper (light, default) ---- */
:root {
  --bg:          oklch(0.966 0.013 83);
  --raised:      oklch(0.992 0.008 86);
  --sunk:        oklch(0.945 0.016 82);
  --ink:         oklch(0.305 0.018 52);
  --ink-soft:    oklch(0.46 0.02 52);
  --ink-faint:   oklch(0.62 0.018 58);
  --line:        oklch(0.885 0.015 76);
  --line-soft:   oklch(0.925 0.012 80);
  --accent:      oklch(0.55 0.092 44);
  --accent-wash: oklch(0.55 0.092 44 / 0.10);
  --accent-deep: oklch(0.48 0.094 42);
  --on-accent:   oklch(0.98 0.01 85);

  /* Shape & motion — from AppDimens / AppMotion. */
  --card-radius: 14px;
  --pill-radius: 999px;
  --reading-max: 620px;
  --page-max: 1140px;
  --side-pad: clamp(20px, 5vw, 48px);
  --ease: cubic-bezier(0.22, 0.61, 0.27, 1); /* the app's signature transform curve */
  --shadow-soft: 0 1px 2px oklch(0.3 0.02 52 / 0.04), 0 12px 32px oklch(0.3 0.02 52 / 0.06);
  --shadow-raise: 0 2px 6px oklch(0.3 0.02 52 / 0.06), 0 22px 48px oklch(0.3 0.02 52 / 0.08);

  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'EB Garamond', Georgia, 'Times New Roman', serif;

  color-scheme: light;
}

/* ---- Candlelit (dark) — follows the device, like the app's "Match system" ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:          oklch(0.215 0.012 58);
    --raised:      oklch(0.255 0.014 60);
    --sunk:        oklch(0.185 0.011 56);
    --ink:         oklch(0.905 0.02 82);
    --ink-soft:    oklch(0.72 0.02 78);
    --ink-faint:   oklch(0.56 0.018 72);
    --line:        oklch(0.34 0.016 60);
    --line-soft:   oklch(0.30 0.014 60);
    --accent:      oklch(0.755 0.088 70);
    --accent-wash: oklch(0.755 0.088 70 / 0.12);
    --accent-deep: oklch(0.80 0.084 72);
    --on-accent:   oklch(0.2 0.012 60);
    --shadow-soft: 0 1px 2px oklch(0 0 0 / 0.2), 0 14px 36px oklch(0 0 0 / 0.28);
    --shadow-raise: 0 2px 8px oklch(0 0 0 / 0.28), 0 26px 56px oklch(0 0 0 / 0.34);

    color-scheme: dark;
  }
}

/* ---- Reset & base ---- */
*, *::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; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 0.6vw + 0.95rem, 1.1875rem); /* ~17 → 19px */
  line-height: 1.6;
  font-feature-settings: 'liga' 1, 'kern' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-color: var(--accent-wash); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--accent); }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

p { margin: 0; }

/* ---- Layout helpers ---- */
.wrap { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--side-pad); }
.section { padding-block: clamp(56px, 9vw, 120px); }
.prose { max-width: var(--reading-max); }
.center { text-align: center; margin-inline: auto; }

/* Eyebrow — the app's small-caps tracked label. */
.eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.75rem;
}
.eyebrow.on-accent { color: oklch(0.98 0.01 85 / 0.8); }

.lede { color: var(--ink-soft); font-size: clamp(1.125rem, 0.8vw + 1rem, 1.375rem); line-height: 1.55; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-size: 1.0625rem; font-weight: 500; line-height: 1;
  padding: 0.85rem 1.4rem; border-radius: var(--pill-radius);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  min-height: 44px; /* AppDimens.minTap */
  transition: transform 0.28s var(--ease), background-color 0.28s var(--ease), border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: var(--shadow-raise); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--raised); border-color: var(--ink-faint); transform: translateY(-1px); }
.btn[aria-disabled='true'] { pointer-events: none; opacity: 0.55; }

/* ---- Site header ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklch, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
/* Drive the inline logo's colors from CSS (var() isn't reliable in SVG
   presentation attributes) so it tracks the active theme. */
.brand-mark .mark-bg { fill: var(--accent); }
.brand-mark .mark-line { fill: none; stroke: var(--on-accent); }
.brand-name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-name .plus { color: var(--accent); }
.header-nav { display: flex; align-items: center; gap: clamp(0.5rem, 2vw, 1.75rem); }
.header-nav a.navlink { color: var(--ink-soft); text-decoration: none; font-size: 1rem; }
.header-nav a.navlink:hover { color: var(--ink); }
@media (max-width: 620px) { .header-nav a.navlink { display: none; } }

/* ---- Hero ---- */
.hero { position: relative; padding-top: clamp(48px, 8vw, 96px); padding-bottom: clamp(40px, 7vw, 88px); overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -20% -10% auto -10%; height: 70%;
  background: radial-gradient(60% 70% at 50% 0%, var(--accent-wash), transparent 70%);
  pointer-events: none; z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-title { font-size: clamp(2.6rem, 6vw + 1rem, 5rem); letter-spacing: -0.02em; }
.hero-sub { margin-top: 1.25rem; max-width: 34ch; }
.hero.center .hero-sub { margin-inline: auto; }
.hero-cta { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.85rem; }
.hero.center .hero-cta { justify-content: center; }
.hero-note { margin-top: 1rem; font-size: 0.95rem; color: var(--ink-soft); }

/* Hero "reflection" showpiece — a verse card, the app's signature moment. */
.reflection-card {
  margin-top: clamp(40px, 6vw, 72px);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: calc(var(--card-radius) + 6px);
  box-shadow: var(--shadow-raise);
  padding: clamp(28px, 4vw, 48px);
  max-width: 640px; margin-inline: auto;
}
.reflection-card .entry {
  font-style: italic; color: var(--ink-soft); font-size: 1.05rem;
  padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line-soft);
}
.reflection-card .entry::before { content: '“'; color: var(--accent); font-family: var(--font-display); font-size: 1.6em; line-height: 0; vertical-align: -0.35em; margin-right: 0.1em; }
.verse-ref { font-style: italic; font-weight: 500; letter-spacing: 0.02em; color: var(--accent); font-size: 1.05rem; }
.verse-text { font-size: clamp(1.3rem, 1.4vw + 1rem, 1.6rem); line-height: 1.5; margin-top: 0.5rem; color: var(--ink); }
.verse-framing { margin-top: 1.1rem; font-style: italic; color: var(--ink-soft); }

/* ---- Narrative sections ---- */
.story { display: grid; gap: clamp(40px, 6vw, 72px); }
.story-row { display: grid; gap: clamp(20px, 3vw, 40px); align-items: start; }
@media (min-width: 760px) { .story-row { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }
.story-row h2 { font-size: clamp(1.9rem, 2.4vw + 1rem, 2.9rem); }
.story-row .body { color: var(--ink-soft); font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.25rem); }

/* ---- Feature grid ---- */
.features { display: grid; gap: clamp(14px, 1.6vw, 22px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.feature {
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--card-radius);
  padding: clamp(22px, 2.4vw, 30px); box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-raise); border-color: var(--accent-wash); }
.feature .icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 1rem; }
.feature h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.feature p { color: var(--ink-soft); font-size: 1.02rem; }
.feature.feature-wide { grid-column: 1 / -1; }

/* ---- Privacy promise band ---- */
.promise {
  background: var(--sunk); border-block: 1px solid var(--line-soft);
}
.promise .inner { display: grid; gap: clamp(20px, 3vw, 40px); align-items: center; }
@media (min-width: 800px) { .promise .inner { grid-template-columns: auto 1fr; } }
.promise .seal { width: clamp(72px, 9vw, 104px); height: clamp(72px, 9vw, 104px); color: var(--accent); margin-inline: auto; }
.promise h2 { font-size: clamp(1.9rem, 2.2vw + 1rem, 2.7rem); }
.promise p { color: var(--ink-soft); margin-top: 0.85rem; max-width: 60ch; }

/* ---- Closing CTA ---- */
.closing { text-align: center; }
.closing-card {
  background: var(--raised); border: 1px solid var(--line);
  border-radius: calc(var(--card-radius) + 8px); box-shadow: var(--shadow-raise);
  padding: clamp(40px, 6vw, 80px) clamp(24px, 5vw, 64px); max-width: 760px; margin-inline: auto;
}
.closing h2 { font-size: clamp(2.1rem, 3vw + 1rem, 3.4rem); }
.closing p { color: var(--ink-soft); margin-top: 1rem; margin-inline: auto; max-width: 46ch; }
.store-badges { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.85rem; justify-content: center; }

/* App-store style badges (no external images — image-light brand). */
.store-badge {
  display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none;
  background: var(--ink); color: var(--bg);
  border-radius: 12px; padding: 0.7rem 1.15rem; min-height: 52px;
  transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
}
a.store-badge:hover { transform: translateY(-2px); text-decoration: none; }
.store-badge svg { width: 26px; height: 26px; color: var(--bg); flex: none; }
.store-badge .b-small { font-size: 0.66rem; line-height: 1; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.05em; }
.store-badge .b-large { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; line-height: 1.1; }
.store-badge.is-soon { opacity: 0.85; cursor: default; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--line-soft); padding-block: clamp(40px, 6vw, 64px); color: var(--ink-faint); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: center; justify-content: space-between; }
.site-footer .foot-brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; }
.site-footer .foot-brand .brand-name { font-size: 1.2rem; }
.footer-tagline { font-style: italic; color: var(--ink-faint); max-width: 40ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { color: var(--ink-soft); text-decoration: none; font-size: 0.98rem; }
.footer-links a:hover { color: var(--accent); }
.footer-legal { width: 100%; font-size: 0.875rem; color: var(--ink-soft); border-top: 1px solid var(--line-soft); padding-top: 1.25rem; margin-top: 0.5rem; }

/* ---- Legal pages (privacy / terms) ---- */
.legal { padding-block: clamp(48px, 7vw, 88px); }
.legal .doc { max-width: 720px; margin-inline: auto; }
.legal h1 { font-size: clamp(2.2rem, 3vw + 1rem, 3.2rem); }
.legal .updated { color: var(--ink-faint); font-size: 0.95rem; margin-top: 0.75rem; }
.legal .doc-intro { font-size: clamp(1.1rem, 0.6vw + 1rem, 1.3rem); color: var(--ink-soft); margin-top: 1.5rem; }
.legal h2 { font-size: clamp(1.4rem, 1vw + 1rem, 1.8rem); margin-top: clamp(2.25rem, 4vw, 3rem); padding-top: 1.25rem; border-top: 1px solid var(--line-soft); }
.legal h2:first-of-type { border-top: none; }
.legal section p { color: var(--ink-soft); margin-top: 1rem; }
.legal section p + p { margin-top: 0.85rem; }
.legal a { font-weight: 500; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink-soft); text-decoration: none; font-size: 0.98rem; margin-bottom: 1.5rem; }
.back-link:hover { color: var(--accent); }

/* ---- Accessibility & small helpers ---- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--accent); color: var(--on-accent);
  padding: 0.7rem 1.1rem; border-radius: 0 0 var(--card-radius) 0; font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { left: 0; top: 0; }

.section-head { margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: clamp(2rem, 2.6vw + 1rem, 3rem); }
.promise .read-more { margin-top: 1.25rem; }

/* ---- FAQ ---- */
.faq h2 { font-size: clamp(1.9rem, 2.4vw + 1rem, 2.8rem); margin-bottom: 1.5rem; }
.faq h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.4rem; margin-top: 2rem; }
.faq p { color: var(--ink-soft); margin-top: 0.5rem; }
.faq h3:first-of-type { margin-top: 0.5rem; }

/* ---- Tasteful entrance, respecting reduced-motion ---- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); animation: rise 0.7s var(--ease) forwards; }
  .reveal.d1 { animation-delay: 0.06s; }
  .reveal.d2 { animation-delay: 0.12s; }
  .reveal.d3 { animation-delay: 0.18s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}
