/* Anchored — anchoredbiblestudy.com
   Colors follow the app's "Professional" theme (app/src/theme/themes.ts). */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-italic.woff2") format("woff2");
  font-weight: 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --primary: #2c5282;
  --primary-ink: #ffffff;
  --navy: #1e3a64;
  --navy-deep: #172e50;
  --sky: #90cdf4;
  --bg: #f7fafc;
  --surface: #ffffff;
  --warm: #f6f1e8;
  --ink: #1a202c;
  --muted: #4a5568;
  --line: #e2e8f0;
  --link: #2c5282;
  --shadow: 0 1px 2px rgb(26 32 44 / 6%), 0 8px 24px rgb(26 32 44 / 8%);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 16px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(64px, 9vw, 112px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a202c;
    --surface: #2d3748;
    --warm: #232b38;
    --ink: #f7fafc;
    --muted: #cbd5e0;
    --line: #4a5568;
    --link: #90cdf4;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section-head { max-width: 640px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}
@media (prefers-color-scheme: dark) { .eyebrow { color: var(--sky); } }
.lede { font-size: 1.1875rem; color: var(--muted); }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--surface); color: var(--ink);
  padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow);
}
.skip-link:focus { top: 16px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Dark (navy) bands: hero + final CTA ---------- */
.on-navy {
  color: #ffffff;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgb(144 205 244 / 22%), transparent 60%),
    linear-gradient(160deg, var(--primary) 0%, var(--navy) 55%, var(--navy-deep) 100%);
}
.on-navy a:not(.btn) { color: #ffffff; }
.on-navy .lede { color: #e2e8f0; }
.on-navy .eyebrow { color: var(--sky); }

/* ---------- Header ---------- */
.site-header { padding-block: 20px; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 700; font-size: 1.375rem;
  text-decoration: none;
}
.brand svg { width: 36px; height: 36px; flex: none; }
.nav { display: flex; gap: clamp(16px, 3vw, 28px); font-size: 0.9375rem; }
.nav a { text-decoration: none; opacity: 0.9; }
.nav a:hover { opacity: 1; text-decoration: underline; }
@media (max-width: 560px) { .nav { display: none; } }

/* ---------- Hero ---------- */
.hero { overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  padding-block: clamp(24px, 6vw, 72px) 0;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: 56px; padding-bottom: 0; }
}
.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: italic; font-weight: 600; color: var(--sky); }
.hero .lede { max-width: 34em; margin-bottom: 32px; }
.hero-note { margin-top: 20px; font-size: 0.9375rem; color: #cbd5e0; }
.hero-shot {
  justify-self: center;
  width: min(360px, 78vw);
  margin-bottom: -2px; /* sits flush on the band's bottom edge */
}
.hero-shot img {
  border-radius: 28px 28px 0 0;
  box-shadow: 0 30px 60px rgb(0 0 0 / 35%);
}

/* ---------- Download buttons ---------- */
.downloads { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.downloads.center { justify-content: center; }
.badge-link { display: inline-block; border-radius: 10px; line-height: 0; }
.badge-link img { height: 52px; width: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding-inline: 18px;
  border-radius: 10px;
  font-weight: 600; font-size: 0.9375rem; line-height: 1.1;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn small { display: block; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.02em; opacity: 0.85; }
.btn-light { background: #ffffff; color: var(--navy); }
.btn-light:hover { background: #ebf8ff; }
.btn-soon {
  background: transparent; color: #e2e8f0;
  border-color: rgb(255 255 255 / 35%);
  cursor: default;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--navy); }
@media (prefers-color-scheme: dark) {
  .btn-primary { background: #63b3ed; color: #1a202c; }
  .btn-primary:hover { background: var(--sky); }
}

/* ---------- Verse band ---------- */
.verse { padding-block: clamp(48px, 7vw, 80px); text-align: center; }
.verse blockquote { margin: 0 auto; max-width: 760px; }
.verse p {
  font-family: var(--serif); font-style: italic; font-weight: 600;
  font-size: clamp(1.375rem, 3vw, 1.875rem); line-height: 1.4;
  margin-bottom: 12px;
}
.verse cite { font-style: normal; color: var(--muted); font-size: 0.9375rem; letter-spacing: 0.04em; }

/* ---------- Features ---------- */
.features { background: var(--surface); border-block: 1px solid var(--line); }
.feature-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  list-style: none; margin: 0; padding: 0;
}
.feature {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.feature p { color: var(--muted); margin: 0; }
.icon {
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-bottom: 18px;
  border-radius: 12px;
  background: #ebf4ff; color: var(--primary);
}
@media (prefers-color-scheme: dark) { .icon { background: #2a4365; color: var(--sky); } }
.icon svg { width: 22px; height: 22px; }

/* ---------- Library ---------- */
.library { background: var(--warm); }
.library-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  list-style: none; margin: 0 0 32px; padding: 0;
}
.cover {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.cover img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.cover div { padding: 14px 16px 18px; }
.cover h3 { font-size: 1.0625rem; margin-bottom: 2px; }
.cover p { margin: 0; font-size: 0.875rem; color: var(--muted); }
.library-more { color: var(--muted); max-width: 720px; }

/* ---------- Steps ---------- */
.steps {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  list-style: none; margin: 0; padding: 0;
  counter-reset: step;
}
.steps li { counter-increment: step; padding-top: 8px; }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-bottom: 16px;
  border-radius: 50%;
  background: var(--primary); color: #ffffff;
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem;
}
.steps p { color: var(--muted); margin: 0; }

/* ---------- Screenshot strip ---------- */
.gallery { background: var(--surface); border-block: 1px solid var(--line); }
.strip {
  display: flex; gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  --strip-inset: var(--gutter);
  padding: 4px var(--strip-inset) 24px;
  scroll-padding-inline: var(--strip-inset);
  margin: 0;
  list-style: none;
  scrollbar-width: thin;
}
@media (min-width: 1120px) {
  .strip { --strip-inset: calc((100vw - 1120px) / 2 + var(--gutter)); }
}
.strip > li { flex: none; scroll-snap-align: start; }
.strip img { width: 240px; border-radius: 22px; box-shadow: var(--shadow); }
/* Screens 1 and 2 are one continuous panorama — keep them touching */
.strip .pair { display: flex; }
.strip .pair img:first-child { border-radius: 22px 0 0 22px; }
.strip .pair img:last-child { border-radius: 0 22px 22px 0; }
@media (max-width: 560px) { .strip img { width: 200px; } }
.strip-hint { text-align: center; font-size: 0.875rem; color: var(--muted); margin: 0; }

/* ---------- Everywhere (iPad + web) ---------- */
.everywhere-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .everywhere-grid { grid-template-columns: 1fr 1fr; } }
.ipads { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ipads img { border-radius: 18px; box-shadow: var(--shadow); }
.ipads img:last-child { margin-top: 48px; }
.platforms { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; }
.platforms li { display: flex; gap: 10px; align-items: baseline; }
.platforms li::before { content: "✓"; color: #2f855a; font-weight: 700; }
@media (prefers-color-scheme: dark) { .platforms li::before { color: #68d391; } }

/* ---------- Final CTA ---------- */
.cta { text-align: center; padding-block: var(--section); }
.cta h2 { max-width: 18em; margin-inline: auto; }
.cta .lede { max-width: 34em; margin: 0 auto 32px; }

/* ---------- Footer ---------- */
.site-footer { padding-block: 40px; font-size: 0.9375rem; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.credits { margin-top: 20px; font-size: 0.8125rem; }

/* ---------- 404 ---------- */
.notfound { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: var(--gutter); }
.notfound .brand { justify-content: center; margin-bottom: 32px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
.site-footer .brand { color: var(--ink); }
