/* Life of Prayer landing page. Rules: docs/website/DESIGN-SYSTEM.md (LIF-359).
   LIF-436 (owner, 2026-11-03): one simple pattern, on the app's white page (LIF-399/400). The painting opens
   the page; then each flow is four real screens on one numbered rail, like the app's Today timeline. One phone
   frame at one size everywhere. No scroll effects. EB Garamond for words, the system font for the rest.
   Everything below the token block uses a token. `node scripts/landing-audit.js` fails on a raw colour,
   an off-grid space, size or corner. Breakpoint (cannot be a token): 720. */

/* ========== Tokens ========== */

/* Primitives: the app's own values (constants/theme.ts `prayerColors.light`). Rules use the roles below. */
:root {
  --white: #ffffff;
  --warm-grey: #eeeae3;
  --hairline: #e0d9cf;
  --ink: #3b2b23;
  --ink-soft: #735f4f;
  --burgundy: #8c3d47;
  --cream: #fff9ee;
  --umber: #2b1a0e;
  --bezel: #221a16;
  --field: #6b4a2c; /* under the painting while it loads */

  /* Roles */
  --page: var(--white);
  --card: var(--warm-grey);
  --line: var(--hairline);
  --text: var(--ink);
  --text-soft: var(--ink-soft);
  --action: var(--burgundy);
  --on-action: var(--cream);
  --on-painting: var(--cream);
  --focus: var(--burgundy);
  --device: var(--bezel);
  --shadow-ink: var(--ink);

  /* Type */
  --serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --fs-1: 0.875rem; /* 14: notes, eyebrows, footer */
  --fs-2: 0.9375rem; /* 15: small buttons, counts' labels */
  --fs-3: 1.0625rem; /* 17: body, buttons */
  --fs-4: 1.25rem; /* 20: brand, quotes, the hero line */
  --fs-5: 1.5rem; /* 24: a step */
  --fs-num: clamp(2.125rem, 1.8rem + 1vw, 2.5rem);
  --fs-h2: clamp(2.125rem, 1.6rem + 2.2vw, 3rem);
  --fs-h1: clamp(2.5rem, 1.6rem + 4vw, 4.25rem); /* the legal pages */
  --fs-display: clamp(2.75rem, 1.6rem + 5vw, 4.75rem); /* the home page's one headline */
  --lh-tight: 1.02;
  --lh-display: 1.08;
  --lh-title: 1.15;
  --lh-body: 1.5;
  --lh-prose: 1.65;
  --track-eyebrow: 0.08em;
  --measure: 60ch;
  --measure-lead: 46ch;

  /* Space: a 4 px grid in rem. */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.25rem;
  --s6: 1.5rem;
  --s7: 2rem;
  --s8: 2.5rem;
  --s9: 3rem;
  --s10: 4rem;
  --s11: 5rem;
  --s12: 6rem;
  --s13: 7rem;

  /* Layout */
  --container: 71.5rem; /* 1080 + margins */
  --margin: var(--s4);
  --pad-l: max(var(--margin), env(safe-area-inset-left, 0px));
  --pad-r: max(var(--margin), env(safe-area-inset-right, 0px));
  --nav-h: var(--s10);
  --rail: var(--s7); /* the step number's circle */
  --rail-gap: 3.25rem; /* circle + space, phone layout */
  --phone-w: 14.5rem; /* a phone in a flow, phone layout */
  --phone-real: 15rem; /* the prayer phone */
  --device-ratio: 600 / 1304;
  --tap: 2.75rem;
  --tap-lg: 3rem;

  /* Corners and lines */
  --r-sm: 0.5rem;
  --r-md: 0.75rem;
  --r-pill: 62.4375rem;
  --bw: 1px;
  --focus-w: 2px;

  /* Depth */
  --shadow-device: 0 24px 48px -24px color-mix(in srgb, var(--shadow-ink) 45%, transparent);
  /* Shade under the hero words only (owner 2026-11-03: a full-width shade was too dark). A soft oval sits behind
     the words; the rest of the painting keeps its light. A faint glow on the letters does the rest. */
  --scrim: radial-gradient(130% 60% at 20% 38%, color-mix(in srgb, var(--umber) 52%, transparent) 0%, color-mix(in srgb, var(--umber) 38%, transparent) 55%, transparent 100%);
  --scrim-wide: radial-gradient(60% 75% at 22% 50%, color-mix(in srgb, var(--umber) 50%, transparent) 0%, color-mix(in srgb, var(--umber) 30%, transparent) 60%, transparent 100%);
  --text-glow: 0 0 1.25rem color-mix(in srgb, var(--umber) 70%, transparent), 0 0 0.5rem color-mix(in srgb, var(--umber) 50%, transparent);
  --glass: color-mix(in srgb, var(--umber) 40%, transparent);
  --blur: 8px;

  /* Motion: a press only. */
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --dur-press: 150ms;
  --dur-fade: 250ms;

  color-scheme: light;
}

/* ========== Base ========== */
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("fonts/eb-garamond-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/eb-garamond-italic-400.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); }
body { margin: 0; background: var(--page); color: var(--text); font: var(--fs-3) / var(--lh-body) var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; text-wrap: balance; }
p, ol, ul, figure { margin: 0; }
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: var(--focus-w) solid var(--focus); outline-offset: var(--s1); border-radius: var(--r-sm); }
.wrap { max-width: var(--container); margin: 0 auto; padding-left: var(--pad-l); padding-right: var(--pad-r); }
.skip { position: absolute; left: var(--s4); top: var(--s2); z-index: 20; padding: var(--s2) var(--s4); border-radius: var(--r-pill); background: var(--cream); color: var(--text); transform: translateY(-300%); }
.skip:focus { transform: none; }

/* Buttons: burgundy on white, cream on the painting. */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap-lg); border: var(--bw) solid transparent; border-radius: var(--r-pill); padding: 0 var(--s6); font: 600 var(--fs-3) / 1 var(--sans); text-decoration: none; text-align: center; cursor: pointer; transition: transform var(--dur-press) var(--ease); }
.btn:active { transform: scale(0.97); }
.btn-wine { background: var(--action); color: var(--on-action); }
.btn-cream { background: var(--cream); color: var(--text); }
.btn-line { background: transparent; color: var(--action); border-color: var(--action); }
.btn-sm { min-height: var(--tap); padding: 0 var(--s5); font-size: var(--fs-2); }

/* Nav: clear over the painting, white once the page scrolls. The legal pages start scrolled. */
.nav { position: sticky; top: 0; z-index: 10; color: var(--on-painting); border-bottom: var(--bw) solid transparent; transition: background var(--dur-fade) var(--ease), color var(--dur-fade) var(--ease); }
.home .nav { position: fixed; inset: 0 0 auto; }
.nav.is-scrolled { background: color-mix(in srgb, var(--page) 92%, transparent); color: var(--text); border-bottom-color: var(--line); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); }
.nav.is-scrolled .btn-cream { background: var(--action); color: var(--on-action); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); height: var(--nav-h); padding-top: env(safe-area-inset-top, 0px); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); min-height: var(--tap); font-family: var(--serif); font-size: var(--fs-4); text-decoration: none; }
.brand img { border-radius: var(--r-sm); }

/* ========== Hero: the painting, the line, one button ========== */
.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--field); color: var(--on-painting); }
.hero picture img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--scrim); }
.hero-in { aspect-ratio: 3 / 4; padding-top: calc(var(--nav-h) + var(--s7)); }
.hero h1 { font-size: var(--fs-display); line-height: var(--lh-tight); }
.hero p { margin: var(--s4) 0 var(--s7); font-size: var(--fs-4); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.hero h1, .hero p { text-shadow: var(--text-glow); }
.hero p span { display: block; text-wrap: balance; }
.btn-on-painting { background: var(--glass); color: var(--on-painting); border-color: var(--on-painting); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); }

/* ========== Sections ========== */
.sec { padding-top: var(--s12); }
.eyebrow { margin-bottom: var(--s3); color: var(--action); font: 600 var(--fs-1) / 1 var(--sans); letter-spacing: var(--track-eyebrow); text-transform: uppercase; }
.sec h2 { max-width: 18ch; font-size: var(--fs-h2); line-height: var(--lh-display); }
.lede { max-width: var(--measure-lead); margin-top: var(--s3); color: var(--text-soft); }
.note { margin-top: var(--s7); color: var(--text-soft); font-size: var(--fs-1); }

/* The phone: one frame, one size. The padding is a share of the width, so the bezel scales with it. */
.phone { width: 100%; max-width: 100%; aspect-ratio: var(--device-ratio); padding: 2.6%; border-radius: 15% / 7%; background: var(--device); box-shadow: var(--shadow-device); }
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 13% / 6%; }

/* The flow: four steps on a numbered rail. Phone: down the page. Desktop: across. */
.flow { list-style: none; padding: 0; margin-top: var(--s9); display: grid; gap: var(--s9); }
.step { position: relative; min-width: 0; padding-left: var(--rail-gap); }
.num { position: absolute; top: 0; left: 0; z-index: 1; display: grid; place-items: center; width: var(--rail); height: var(--rail); border: var(--bw) solid var(--action); border-radius: 50%; background: var(--page); color: var(--action); font: var(--fs-4) / 1 var(--serif); font-variant-numeric: tabular-nums; }
.step:not(:last-child)::before { content: ""; position: absolute; top: var(--s8); bottom: calc(var(--s8) * -1); left: var(--s4); width: var(--bw); background: var(--line); }
.step h3 { margin-bottom: var(--s4); padding-top: var(--s1); font-size: var(--fs-5); line-height: var(--lh-title); }
.step .phone { width: min(100%, var(--phone-w)); }

/* Real prayers */
.real { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s8); }
.counts { list-style: none; padding: 0; margin-top: var(--s7); display: grid; grid-template-columns: repeat(3, minmax(0, max-content)); gap: var(--s5); }
.counts b { display: block; font: 400 var(--fs-num) / 1 var(--serif); font-variant-numeric: tabular-nums; }
.counts span { color: var(--text-soft); font-size: var(--fs-2); }
.source { max-width: 40ch; margin-top: var(--s7); padding: var(--s4) var(--s5); border-radius: var(--r-md); background: var(--card); }
.source q { font-family: var(--serif); font-size: var(--fs-4); line-height: var(--lh-title); }
.source small { display: block; margin-top: var(--s2); color: var(--text-soft); font-size: var(--fs-1); }
.real .phone { width: min(100%, var(--phone-real)); }

/* The beta: the same card colour as the app. */
.beta { margin-top: var(--s13); background: var(--card); }
.beta-in { display: grid; gap: var(--s4); justify-items: start; padding-top: var(--s11); padding-bottom: var(--s11); }
.beta h2 { font-size: var(--fs-h2); line-height: var(--lh-display); }
.beta .lead { color: var(--text-soft); }
.phone-pick { display: flex; flex-wrap: wrap; gap: var(--s3); }
.android-beta { margin-top: var(--s4); max-width: var(--measure-lead); }
.android-beta h3, .iphone-beta h3 { font-size: var(--fs-5); margin-bottom: var(--s3); }
.iphone-beta { max-width: var(--measure-lead); }
/* A recognised phone sees only its own steps, so they sit where the choice was. */
.beta[data-phone] .android-beta { margin-top: 0; }
.phone-pick[hidden] { display: none; }

/* The launch list: under the beta, set off by a line. 17 px text in the field so iOS does not zoom. */
.launch, .launch-done { margin-top: var(--s7); padding-top: var(--s6); border-top: var(--bw) solid var(--line); max-width: var(--measure-lead); }
.launch { display: grid; gap: var(--s3); }
.launch[hidden], .launch-error[hidden] { display: none; }
.launch-lead { color: var(--text-soft); }
.launch-row { display: grid; gap: var(--s2); }
.launch input[type="email"] { width: 100%; min-height: var(--tap-lg); padding: 0 var(--s5); font: var(--fs-3) / 1 var(--sans); color: var(--text); background: var(--page); border: var(--bw) solid var(--line); border-radius: var(--r-pill); -webkit-appearance: none; appearance: none; }
.launch input[type="email"]:focus-visible { border-color: var(--focus); }
.launch .note { margin-top: 0; }
.launch-error { font-size: var(--fs-1); }
.launch-trap { position: absolute; left: -100vw; width: var(--bw); height: var(--bw); overflow: hidden; }
.signup-link { display: grid; gap: var(--s3); justify-items: start; }
.signup-link ol { padding-left: var(--s5); display: grid; gap: var(--s1); }
.signup-link .note { margin-top: 0; }

/* ========== Legal pages ========== */
.legal { padding: var(--s9) 0 var(--s11); }
.legal-in { max-width: var(--measure); margin: 0 auto; padding-left: var(--pad-l); padding-right: var(--pad-r); }
.legal h1 { font-size: var(--fs-h1); line-height: var(--lh-display); }
.legal-date { margin-top: var(--s2); color: var(--text-soft); font-size: var(--fs-1); }
.legal h2 { font-size: var(--fs-5); line-height: var(--lh-title); margin: var(--s9) 0 var(--s3); }
.legal p, .legal li { line-height: var(--lh-prose); }
.legal p + p { margin-top: var(--s3); }
.legal ul { list-style: disc; margin: var(--s3) 0 0; padding-left: var(--s5); display: grid; gap: var(--s2); }
.legal a { color: var(--action); text-underline-offset: 0.2em; }
.legal-summary { margin-top: var(--s7); padding: var(--s5) var(--s6); border-radius: var(--r-md); background: var(--card); }
.legal-summary h2 { margin-top: 0; }

/* ========== Footer ========== */
.foot { padding: var(--s6) 0 calc(var(--s7) + env(safe-area-inset-bottom, 0px)); font-size: var(--fs-1); color: var(--text-soft); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s7); }
.foot .brand { color: var(--text); }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 var(--s2); }
.foot nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s2); text-decoration: none; }
.foot p { flex-basis: 100%; }

@media (hover: hover) {
  .foot nav a:hover { text-decoration: underline; text-underline-offset: 0.25em; }
}

/* ========== Desktop ========== */
@media (min-width: 720px) {
  :root { --margin: var(--s7); }
  .hero-in { aspect-ratio: auto; min-height: min(50vw, 40rem); padding-bottom: var(--s10); }
  .hero::after { background: var(--scrim-wide); }
  .sec { padding-top: var(--s13); }
  .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s7); }
  .step { padding-left: 0; padding-top: var(--rail-gap); }
  .step:not(:last-child)::before { top: var(--s4); bottom: auto; left: var(--s8); right: calc(var(--s6) * -1); width: auto; height: var(--bw); }
  .step h3 { min-height: 2.3em; padding-top: 0; margin-bottom: var(--s5); }
  .step .phone { width: 100%; }
  .real { grid-template-columns: minmax(0, 1fr) var(--phone-real); gap: var(--s10); align-items: center; }
  .counts { column-gap: var(--s7); }
  .beta-in { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s10); }
  .beta-in > h2 { grid-column: 1; }
  .beta-in > .lead { grid-column: 1; }
  .beta-in > .signup-box { grid-column: 2; grid-row: 1 / span 2; }
  .launch-row { grid-template-columns: minmax(0, 1fr) auto; }
  /* The launch form makes the box tall; keep the question under the heading, not halfway down. */
  .beta-in { grid-template-rows: auto 1fr; }
  .beta-in > h2 { align-self: end; }
  .beta-in > .lead { align-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .nav { transition: none; }
  .btn:active { transform: none; }
}
