/* Tiny Psalms marketing site — shared styles (landing + guides)
   Palette and type mirror the app: lib/theme/colors.dart + typography.dart */

:root {
  --night: #0A1226;
  --night-top: #15214A;
  --navy: #0F1B33;
  --navy-soft: #2A3654;
  --cream: #FFF9EE;
  --ivory: #F7F2E9;
  --beige: #E8DCC6;
  --gold: #D4A852;
  --gold-deep: #B88A2F;
  --gold-soft: #EBD9A8;
  --dusty: #8FA7C4;
  --lavender: #C8B6D9;
  --sage: #AEBBA0;
  --peach: #EBC4A7;
  --ink: #0F1B33;
  --muted: #5C6783;
  --star: #EBD9A8;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(15, 27, 51, 0.10);
  --stitch: 2px dashed rgba(255, 249, 238, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-deep); }
a:hover { color: var(--navy); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }

h1, h2, h3, .brand { font-family: var(--serif); font-weight: 600; line-height: 1.15; }
h1 { font-size: clamp(2.3rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }

.section-kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 10px;
}

/* ---------- header ---------- */
.site-header {
  background: var(--night);
  background: linear-gradient(180deg, var(--night-top), var(--night) 130%);
  position: relative;
  z-index: 5;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.45rem;
  color: var(--cream);
  text-decoration: none;
}
.brand img { border-radius: 9px; }
.site-nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.site-nav a {
  color: var(--gold-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.site-nav a:hover { color: #fff; }
.nav-cta {
  background: var(--gold);
  color: var(--navy) !important;
  font-weight: 700 !important;
  padding: 8px 18px;
  border-radius: 999px;
  outline: 2px dashed rgba(15, 27, 51, 0.35);
  outline-offset: -5px;
}
.nav-cta:hover { background: var(--gold-soft); }

/* ---------- night sky + stars ---------- */
.night-sky {
  position: relative;
  background: linear-gradient(180deg, var(--night-top) 0%, var(--navy) 55%, var(--night) 100%);
  color: var(--cream);
  overflow: hidden;
}
.stars, .stars::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 8% 22%, var(--star) 55%, transparent 60%),
    radial-gradient(1px 1px at 21% 68%, var(--star) 55%, transparent 60%),
    radial-gradient(1.7px 1.7px at 33% 14%, var(--star) 55%, transparent 60%),
    radial-gradient(1px 1px at 46% 47%, var(--star) 55%, transparent 60%),
    radial-gradient(1.5px 1.5px at 58% 9%, var(--star) 55%, transparent 60%),
    radial-gradient(1px 1px at 67% 74%, var(--star) 55%, transparent 60%),
    radial-gradient(1.8px 1.8px at 76% 31%, var(--star) 55%, transparent 60%),
    radial-gradient(1px 1px at 88% 58%, var(--star) 55%, transparent 60%),
    radial-gradient(1.3px 1.3px at 95% 12%, var(--star) 55%, transparent 60%),
    radial-gradient(1px 1px at 14% 88%, var(--star) 55%, transparent 60%),
    radial-gradient(1.2px 1.2px at 82% 86%, var(--star) 55%, transparent 60%);
  opacity: 0.8;
}
.stars::after {
  background-position: 4% 9%;
  transform: scale(-1, 1);
  animation: twinkle 5.5s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.25; }
  to { opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) {
  .stars::after { animation: none; }
}

/* scalloped cloud divider (night → cream) */
.cloud-divider { display: block; width: 100%; height: 56px; margin-top: -1px; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 8px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 44px;
  align-items: center;
}
.hero h1 { color: #fff; margin: 14px 0 18px; }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero .lede { font-size: 1.13rem; color: #D5DAE7; max-width: 33em; }
.hero-verse {
  margin: 22px 0 4px;
  font-family: var(--serif);
  font-size: 1.18rem;
  font-style: italic;
  color: var(--gold-soft);
}
.hero-verse cite { font-style: normal; font-size: 0.85rem; color: var(--dusty); margin-left: 8px; }
.hero-art { position: relative; text-align: center; }
.hero-art img { margin: 0 auto; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45)); }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 26px;
  padding: 0;
  list-style: none;
}
.hero-stats li { font-size: 0.9rem; color: var(--dusty); }
.hero-stats strong { display: block; font-family: var(--serif); font-size: 1.35rem; color: var(--gold-soft); font-weight: 600; }

/* store badges */
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gold);
  color: var(--navy);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.15;
  outline: 2px dashed rgba(15, 27, 51, 0.35);
  outline-offset: -6px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.badge-btn:hover { background: var(--gold-soft); color: var(--navy); transform: translateY(-2px); }
.badge-btn svg { width: 22px; height: 22px; flex: none; }
.badge-btn small { display: block; font-size: 0.68rem; font-weight: 500; opacity: 0.75; }

/* ---------- sections ---------- */
section { padding: 68px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); margin-top: 10px; }

/* screenshot rail */
.shot-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.shot-rail figure {
  background: #fff;
  border-radius: var(--radius);
  padding: 12px 12px 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 27, 51, 0.06);
}
.shot-rail img { border-radius: 14px; }
.shot-rail figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  padding-top: 10px;
}

/* how it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: step; }
.step {
  background: #fff;
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 27, 51, 0.06);
  position: relative;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold-soft);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 16px;
  outline: 2px dashed rgba(235, 217, 168, 0.5);
  outline-offset: -5px;
}
.step h3 { font-size: 1.35rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.97rem; }
.step .eg {
  display: block;
  margin-top: 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--gold-deep);
}

/* ---------- psalm tile grid (night tiles) ---------- */
.psalm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.psalm-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(160deg, var(--night-top), var(--navy) 80%);
  border-radius: var(--radius);
  padding: 22px 22px;
  text-decoration: none;
  color: var(--cream);
  overflow: hidden;
  border: 1px solid rgba(235, 217, 168, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.psalm-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 82% 20%, var(--star) 55%, transparent 60%),
    radial-gradient(1px 1px at 64% 72%, var(--star) 55%, transparent 60%),
    radial-gradient(1.5px 1.5px at 91% 62%, var(--star) 55%, transparent 60%),
    radial-gradient(1px 1px at 74% 38%, var(--star) 55%, transparent 60%);
  opacity: 0.7;
}
.psalm-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(10, 18, 38, 0.35);
  color: #fff;
}
.psalm-tile img { width: 54px; height: auto; flex: none; }
.psalm-tile .ref {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold-soft);
  display: block;
  line-height: 1.2;
}
.psalm-tile .hook { font-size: 0.85rem; color: var(--dusty); }

/* ---------- feature cards ---------- */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.feature-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 27, 51, 0.06);
}
.feature-card img { border-radius: 14px; }
.feature-card h3 { font-size: 1.45rem; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 0.95rem; }
.feature-card.wide { grid-column: 1 / -1; grid-template-columns: 0.55fr 1.45fr; }
.feature-list { list-style: none; margin-top: 12px; }
.feature-list li { padding-left: 26px; position: relative; margin-bottom: 7px; font-size: 0.95rem; color: var(--muted); }
.feature-list li::before { content: "✦"; position: absolute; left: 2px; color: var(--gold); }

/* ---------- guide grid ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.guide-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 26px 24px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 27, 51, 0.06);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.guide-card:hover { transform: translateY(-4px); border-color: var(--gold); color: var(--ink); }
.guide-card img { width: 46px; height: auto; margin-bottom: 14px; }
.guide-card h3 { font-size: 1.25rem; margin-bottom: 6px; }
.guide-card p { font-size: 0.88rem; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq details {
  background: #fff;
  border-radius: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(15, 27, 51, 0.08);
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 18px 22px;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans);
  font-size: 1.3rem;
  color: var(--gold-deep);
}
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 22px 20px; color: var(--muted); font-size: 0.97rem; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  background: linear-gradient(160deg, var(--night-top), var(--night) 90%);
  color: var(--cream);
  border-radius: 28px;
  padding: 56px 40px;
  text-align: center;
  overflow: hidden;
  border: 1px solid rgba(235, 217, 168, 0.2);
}
.cta-band > * { position: relative; }
.cta-band img { margin: 0 auto 18px; border-radius: 18px; }
.cta-band h2 { color: #fff; }
.cta-band h2 em { color: var(--gold); }
.cta-band p { color: var(--dusty); max-width: 34em; margin: 12px auto 0; }
.cta-band .store-badges { justify-content: center; }

/* ---------- footer ---------- */
.site-footer { background: var(--night); color: var(--dusty); padding: 34px 0 44px; margin-top: 68px; }
.site-footer a { color: var(--gold-soft); }
.footnote { font-size: 0.8rem; line-height: 1.8; }

/* ================= guide pages ================= */
.guide-page { background: var(--cream); }

.article-hero {
  position: relative;
  background: linear-gradient(180deg, var(--night-top), var(--navy) 85%);
  color: var(--cream);
  padding: 40px 0 46px;
  overflow: hidden;
}
.article-hero > .wrap { position: relative; }
.article-hero h1 { color: #fff; max-width: 17em; }
.article-hero .meta { margin-top: 14px; font-size: 0.85rem; color: var(--dusty); }
.crumbs { font-size: 0.82rem; color: var(--dusty); margin-bottom: 20px; }
.crumbs a { color: var(--gold-soft); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.guide-symbol { display: block; margin-bottom: 14px; }
.guide-symbol img { width: 62px; height: auto; }

article.guide {
  max-width: 720px;
  margin: 0 auto;
  padding: 46px 22px 0;
}
article.guide h2 {
  font-size: 1.75rem;
  margin: 40px 0 14px;
}
article.guide h3 { font-size: 1.3rem; margin: 26px 0 10px; }
article.guide p { margin-bottom: 16px; }
article.guide ul, article.guide ol { margin: 0 0 16px 24px; }
article.guide li { margin-bottom: 9px; }

.answer-first {
  font-size: 1.16rem;
  line-height: 1.75;
  font-weight: 450;
  color: var(--navy);
  border-left: 4px solid var(--gold);
  background: #fff;
  border-radius: 0 16px 16px 0;
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

/* verse blockquote — quilted night card */
blockquote.verse {
  position: relative;
  background: linear-gradient(160deg, var(--night-top), var(--navy) 85%);
  color: var(--gold-soft);
  font-family: var(--serif);
  font-size: 1.32rem;
  font-style: italic;
  line-height: 1.55;
  border-radius: var(--radius);
  padding: 28px 30px 24px;
  margin: 28px 0;
  outline: var(--stitch);
  outline-offset: -8px;
}
blockquote.verse cite {
  display: block;
  margin-top: 12px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.82rem;
  color: var(--dusty);
}

/* kid-level meaning card */
.kid-words {
  background: #fff;
  border: 1px solid var(--beige);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}
.kid-words h3 { margin-top: 0 !important; font-size: 1.3rem; }
.kid-words p:last-child { margin-bottom: 0; }

/* bedtime prayer card */
.prayer-card {
  background: var(--ivory);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin: 24px 0;
  border: 1px solid var(--beige);
  outline: 2px dashed rgba(184, 138, 47, 0.35);
  outline-offset: -8px;
}
.prayer-card h3 { margin-top: 0 !important; }
.prayer-card p { font-family: var(--serif); font-size: 1.18rem; font-style: italic; color: var(--navy); }
.prayer-card p:last-child { margin-bottom: 0; }

/* app CTA box inside guides */
.app-box {
  background: linear-gradient(160deg, var(--night-top), var(--night) 90%);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 32px 30px;
  margin: 40px 0;
  border: 1px solid rgba(235, 217, 168, 0.2);
}
.app-box h2 { color: #fff; margin: 0 0 10px !important; font-size: 1.55rem !important; }
.app-box p { color: var(--dusty); }
.app-box .store-badges { margin-top: 18px; }

.related {
  background: var(--ivory);
  border-radius: var(--radius);
  border: 1px solid var(--beige);
  padding: 24px 28px;
  margin: 36px 0;
}
.related h3 { margin: 0 0 10px !important; }
.related ul { margin: 0 0 0 20px !important; }
.related li { margin-bottom: 8px; }

.table-scroll { overflow-x: auto; margin: 20px 0; }
table.facts { border-collapse: collapse; width: 100%; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); font-size: 0.95rem; }
table.facts th, table.facts td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--ivory); vertical-align: top; }
table.facts th { color: var(--muted); font-weight: 600; white-space: nowrap; width: 34%; }
table.facts tr:last-child th, table.facts tr:last-child td { border-bottom: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 30px; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 300px; }
  .shot-rail { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .psalm-grid { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: 1fr; }
  .feature-card.wide { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  section { padding: 48px 0; }
  .hero { padding-top: 40px; }
  .shot-rail { grid-template-columns: 1fr 1fr; gap: 12px; }
  .psalm-grid { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
  .feature-card { grid-template-columns: 1fr; }
  .site-nav { gap: 14px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .cta-band { padding: 40px 22px; }
}
