/* Faith Companion — site styles.
 *
 * The type and the palette structure follow knsprojects.online: IBM Plex Sans
 * over a cool near-white, hairline borders, small radii, a mono face reserved
 * for eyebrows and labels. What is NOT borrowed is that site's status-dashboard
 * motif — terminal panels and OK dots are right for an infrastructure practice
 * and wrong for a book you read at five in the morning.
 *
 * The brand colours are the APP'S OWN, not the reference site's. `--brand`
 * #1B5F8E and #4FA8E8 are `FcTokens` out of lib/fc_tokens.dart, so a reader who
 * arrives from the App Store meets the same blue twice. They happen to sit a
 * few degrees from knsprojects' #0f4c8a, which is why the two sites read as
 * siblings without either one borrowing the other's identity.
 *
 * EVERYTHING IS SELF-HOSTED. The vhost's Content-Security-Policy is
 * `default-src 'none'` and its comment says the site is "entirely
 * self-contained — no scripts, no CDN, no font host, no analytics". Adding
 * Google Fonts would have meant punching two holes in that for a typeface, so
 * the six woff2 files sit in assets/fonts and the policy gains only `font-src
 * 'self'`.
 */

/* --- fonts ---------------------------------------------------------------
 * Latin subset only. `font-display: swap` so text paints immediately in the
 * fallback and reflows — on a Zimbabwean mobile connection, a blocking font is
 * a blank page.
 */
@font-face {
  font-family: 'Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/plex-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Plex Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('fonts/plex-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('fonts/plex-sans-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/plex-mono-400.woff2') format('woff2');
}
/* The app's own reading face. Used here only where the site quotes Scripture,
   so the one line of the site that IS the product looks like the product. */
@font-face {
  font-family: 'PT Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('fonts/pt-serif-400.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Serif'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('fonts/pt-serif-400i.woff2') format('woff2');
}

/* --- tokens -------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  --bg: #fbfcfe;
  --bg-raised: #ffffff;
  --bg-sunken: #f2f6fb;
  --text: #12263f;
  --text-soft: #546276;
  --border: #e1e8f2;
  --border-strong: #cbd7e8;
  --brand: #1b5f8e;
  --brand-soft: #4fa8e8;
  --brand-wash: #eef5fb;
  --ok: #14784a;
  --grid-dot: #12263f0e;
  --shadow-card: 0 1px 2px #12263f0a, 0 8px 24px -12px #12263f1f;
  --shadow-lift: 0 2px 4px #12263f0f, 0 18px 40px -18px #12263f33;

  --r-sm: 10px;
  --r-lg: 14px;
  --r-xl: 22px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --sans: 'Plex Sans', ui-sans-serif, system-ui, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --serif: 'PT Serif', Georgia, 'Times New Roman', serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Straight out of `FcTokens.dark` — the app's own night palette, so the
       site and the app are the same object in the dark too. */
    --bg: #0d1520;
    --bg-raised: #16212e;
    --bg-sunken: #0a1119;
    --text: #dfe9f2;
    --text-soft: #8ca0b2;
    --border: #2a3a4b;
    --border-strong: #3a4e62;
    --brand: #4fa8e8;
    --brand-soft: #86c6f0;
    --brand-wash: #12253a;
    --ok: #4ec07f;
    --grid-dot: #dfe9f20a;
    --shadow-card: 0 1px 2px #0006, 0 10px 28px -14px #0009;
    --shadow-lift: 0 2px 6px #00000073, 0 22px 48px -20px #000000a6;
  }
}

/* --- base ---------------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  /* The dotted ground the reference site uses. Two pixels of dot every 22,
     which reads as texture rather than as pattern. */
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 22px 22px;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* `height: auto` IS NOT OPTIONAL. The hero image carries width/height
   attributes so the browser can reserve its box before the bytes arrive (no
   layout shift), but those attributes are PRESENTATIONAL once CSS constrains
   the width: without this line the width shrank to the column while the height
   attribute held, stretching the phone to four times its aspect ratio and
   inflating the hero to ~1400px of mostly empty page. */
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* Focus that is visible on both grounds and never removed. */
:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  background: var(--bg-raised); color: var(--text); padding: 12px 18px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
}
.skip:focus { left: 12px; top: 12px; }

/* --- eyebrow / section headings ------------------------------------------ */
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 14px;
}

h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; }

h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); font-weight: 600; margin: 0 0 10px; }
.sub { color: var(--text-soft); margin: 0 0 32px; max-width: 62ch; }

section { padding: 64px 0; }
section.sunken { background: var(--bg-sunken); border-block: 1px solid var(--border); }

/* --- top bar -------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brandmark { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); }
.brandmark:hover { text-decoration: none; }
.brandmark img { width: 28px; height: 28px; border-radius: 8px; }
.topnav { margin-left: auto; display: flex; gap: 22px; font-size: .92rem; }
.topnav a { color: var(--text-soft); }
.topnav a:hover { color: var(--brand); text-decoration: none; }
@media (max-width: 720px) { .topnav { display: none; } }

/* --- hero ---------------------------------------------------------------- */
.hero { padding: 56px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero-grid > :first-child { padding-block: 8px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 44px; } }

.hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 3.4rem);
  font-weight: 600;
  margin: 0 0 16px;
}
.hero .lead { font-size: 1.12rem; color: var(--text-soft); margin: 0 0 30px; max-width: 54ch; }

/* Availability, stated as fact rather than as a badge shouting NEW. */
.avail {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-soft);
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px; margin: 0 0 22px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }

.stores { display: flex; gap: 12px; flex-wrap: wrap; }
.store {
  display: inline-flex; align-items: center; gap: 11px;
  background: var(--text); color: var(--bg);
  border: 1px solid var(--text);
  padding: 11px 20px 11px 17px; border-radius: 999px;
  font-weight: 500; font-size: .96rem;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.store:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.store svg { width: 20px; height: 20px; flex: none; }
.store small { display: block; font-size: .68rem; opacity: .72; line-height: 1.1; font-weight: 400; }
.store b { display: block; font-weight: 600; line-height: 1.2; }

.hero-note { margin: 18px 0 0; font-size: .84rem; color: var(--text-soft); }

/* --- the phone in the hero ------------------------------------------------ */
.device {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  background: var(--bg-raised);
  padding: 10px;
  box-shadow: var(--shadow-lift);
  max-width: 268px;
  margin: 0 auto;
}
.device img { border-radius: 15px; }

/* --- cards --------------------------------------------------------------- */
.grid { display: grid; gap: 16px; }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .cols-4 { grid-template-columns: repeat(2, 1fr); } .cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .cols-4, .cols-3, .cols-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 6px; }
.card p { margin: 0; color: var(--text-soft); font-size: .93rem; }
.card .meta {
  display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .09em;
  text-transform: uppercase; color: var(--brand); margin: 0 0 8px; font-weight: 500;
}
.icon {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--brand-wash); color: var(--brand);
  display: grid; place-items: center; margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, transparent);
}
.icon svg { width: 21px; height: 21px; }

/* --- feature lists -------------------------------------------------------- */
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.ticks li { display: flex; gap: 11px; align-items: flex-start; color: var(--text-soft); font-size: .95rem; }
.ticks svg { width: 17px; height: 17px; color: var(--brand); flex: none; margin-top: 4px; }
.ticks b { color: var(--text); font-weight: 500; }

/* --- the verse ------------------------------------------------------------ */
.verse {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.5;
  margin: 0 0 12px;
}
.verse-ref {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand);
}

/* --- screenshots ---------------------------------------------------------- */
.shots { display: flex; gap: 22px; overflow-x: auto; padding: 6px 4px 20px; scroll-snap-type: x mandatory; }
.shots figure { margin: 0; flex: none; width: 226px; scroll-snap-align: center; }
.shots img {
  border-radius: 18px; border: 1px solid var(--border-strong); box-shadow: var(--shadow-card);
}
.shots figcaption { margin-top: 12px; text-align: center; font-size: .84rem; color: var(--text-soft); }

/* --- privacy callout ------------------------------------------------------ */
.callout {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-lg); padding: 26px 28px; box-shadow: var(--shadow-card);
}
.callout h2 { margin-bottom: 8px; }

/* --- credits -------------------------------------------------------------- */
.credits dl { margin: 0; display: grid; gap: 4px; }
.credits dt {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 500; color: var(--brand); margin-top: 22px;
}
.credits dd { margin: 0; color: var(--text-soft); font-size: .9rem; }
.disclaimer {
  margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border);
  color: var(--text-soft); font-size: .88rem;
}

/* --- footer --------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  padding: 34px 0 46px;
  color: var(--text-soft); font-size: .9rem;
}
.footrow { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.footrow nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
@media (max-width: 620px) { .footrow nav { margin-left: 0; } }
