/* God Scroll website. Colours are the app's asset-catalog tokens (app/DESIGN.md).
   Scripture and headings: Fraunces, soft, standing in for the app's Recoleta.
   UI text: SF Pro Rounded on Apple devices, the system face elsewhere. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fbf6ee;
  --paper-elevated: #ffffff;
  --ink: #2a1d16;
  --ink-secondary: #6e5e52;
  --amber: #b0603a;
  --amber-ink: #9a4f2c; /* amber for small text on paper: 5:1 */
  --amber-soft: #f2e3cf;
  --rail-idle: #eadfcf;
  --on-accent: #ffffff;

  --serif: "Fraunces", "Iowan Old Style", "New York", Georgia, serif;
  --sans: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* Five sizes. */
  --step-display: clamp(2.25rem, 1.2rem + 3.6vw, 4.25rem);
  --step-title: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
  --step-lead: clamp(1.1875rem, 1.1rem + 0.35vw, 1.375rem);
  --step-body: 1.0625rem;
  --step-small: 0.9375rem;

  --gutter: clamp(20px, 3.2vw, 48px);
  --section: clamp(96px, 12vw, 176px);
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-body)/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; font-variation-settings: "SOFT" 100, "WONK" 0; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; transition: text-decoration-color 160ms var(--ease), color 160ms var(--ease); }
a:hover { text-decoration-color: currentColor; }
::selection { background: var(--amber-soft); color: var(--ink); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -100px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; z-index: 10; }
.skip:focus { top: 12px; }

/* Buttons: one shape on the whole site, a full pill. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 52px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--amber); color: var(--on-accent);
  font: 600 1.0625rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.button:hover { background: color-mix(in srgb, var(--amber) 88%, var(--ink)); }
.button:active { transform: scale(0.97); }
.button.quiet { background: var(--amber-soft); color: var(--ink); }
.button.quiet:hover { background: color-mix(in srgb, var(--amber-soft) 85%, var(--ink)); }
.note { color: var(--ink-secondary); font-size: var(--step-small); }

/* Header bar, shared. */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 0; }
.wordmark { font-family: var(--serif); font-weight: 600; font-variation-settings: "SOFT" 100; font-size: var(--step-lead); letter-spacing: -0.02em; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.wordmark img { width: 32px; height: 32px; border-radius: 8px; }
.bar nav { display: flex; align-items: center; gap: 24px; font-size: var(--step-small); font-weight: 500; white-space: nowrap; }
.wordmark { white-space: nowrap; }
.bar nav a:not(.button) { text-decoration: none; }
.bar nav a:not(.button):hover { color: var(--amber-ink); }
.bar .button { min-height: 44px; padding: 0 20px; font-size: var(--step-small); }

/* ---------- Landing: the hero ---------- */
.bar.over { position: absolute; top: 0; left: 0; z-index: 2; width: 56%; padding: 28px clamp(32px, 5vw, 80px); }

.hero { display: grid; grid-template-columns: minmax(0, 56fr) minmax(0, 44fr); min-height: calc(100svh - 64px); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 120px clamp(32px, 5vw, 80px) 72px; }
.hero h1 { font-size: clamp(3rem, 1.1rem + 4.6vw, 5.5rem); line-height: 1; letter-spacing: -0.035em; }
.hero .lead { margin-top: 28px; font-size: clamp(1.3125rem, 1.15rem + 0.6vw, 1.625rem); line-height: 1.4; max-width: 34ch; text-wrap: pretty; }
.hero .actions { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.hero .soon { font-size: var(--step-lead); font-weight: 600; color: var(--amber-ink); }
.hero-copy > *, .phone { animation: arrive 720ms var(--ease) both; }
.hero .lead { animation-delay: 90ms; }
.hero .actions { animation-delay: 180ms; }
.phone { animation-delay: 120ms; }
@keyframes arrive { from { opacity: 0; transform: translateY(20px); } }

/* The painting is the app's Quiet Mountains reading background. */
.hero-art { position: relative; display: grid; place-items: center; overflow: hidden; padding: 40px 24px; background: var(--amber-soft); }
.hero-art .painting { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.phone { position: relative; height: min(calc(100svh - 164px), 820px); aspect-ratio: 1180 / 2556; padding: 10px; box-sizing: content-box; background: var(--ink); border-radius: 56px; }
.screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 46px; background: var(--paper); }
.screen img, .screen video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Landing footer: one line, so the page is the hero and nothing else. */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; min-height: 64px; padding: 12px clamp(32px, 5vw, 80px); font-size: var(--step-small); color: var(--ink-secondary); }
.foot nav { display: flex; gap: 24px; }
.foot a { color: var(--ink); text-decoration: none; }
.foot a:hover { color: var(--amber-ink); }

/* ---------- Parked sections (src/partials/parked-sections.html) ---------- */
.reading { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }

.block { padding-top: var(--section); }
.block h2 { font-size: var(--step-title); line-height: 1.1; max-width: 18ch; }
.block .lead { margin-top: 20px; font-size: var(--step-lead); line-height: 1.5; max-width: 36ch; }
.block p + p { margin-top: 16px; }

/* The live thing: a real verse with the app's real explanation. */
.try figure { margin: 0; }
.try { margin-top: 40px; background: var(--paper-elevated); border-radius: var(--radius); padding: clamp(24px, 3vw, 36px); }
.try .ref { margin-top: 14px; font: 600 var(--step-small)/1.4 var(--sans); color: var(--amber-ink); }
.try blockquote { margin: 0; font-family: var(--serif); font-weight: 500; font-variation-settings: "SOFT" 100; font-size: var(--step-lead); line-height: 1.3; font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.625rem); letter-spacing: -0.015em; }
.try .button { margin-top: 28px; }
.try .button svg { width: 20px; height: 20px; }
.explained { display: grid; gap: 24px; margin-top: 28px; }
.explained[hidden] { display: none; }
.explained > div { opacity: 0; transform: translateY(14px); animation: rise 520ms var(--ease) forwards; }
.explained > div:nth-child(2) { animation-delay: 80ms; }
.explained > div:nth-child(3) { animation-delay: 160ms; }
.explained h3 { font: 600 var(--step-body)/1.3 var(--sans); letter-spacing: 0; }
.explained p { margin-top: 6px; }
.explained .plain { background: var(--amber-soft); border-radius: 16px; padding: 20px 22px; }
.explained .plain p { font-size: var(--step-lead); line-height: 1.4; }
.explained .takeaway { background: var(--amber); color: var(--on-accent); border-radius: 16px; padding: 20px 22px; }
.explained .takeaway p { font-weight: 600; font-size: var(--step-lead); line-height: 1.35; }
.try .fine { margin-top: 24px; }

/* Features: small proof beside text. */
.features { margin-top: 64px; display: grid; gap: 88px; }
.feature { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.feature .panel { background: var(--amber-soft); border-radius: 16px; overflow: hidden; }
.feature .panel img { width: 100%; }
.feature .panel.words { padding: 22px; font-family: var(--serif); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 2.75rem; line-height: 1; letter-spacing: -0.03em; color: var(--amber-ink); min-height: 140px; display: flex; align-items: flex-end; }
.feature h3 { font: 600 var(--step-body)/1.35 var(--sans); letter-spacing: 0; }
.feature p { margin-top: 8px; }
.feature p.note { margin-top: 8px; }

.inline-shot { margin: 48px 0 0; width: min(78%, 320px); }
.inline-shot img { border-radius: 13.7% / 6.3%; }

/* FAQ: answers as reading text. */
.faq { padding: var(--section) var(--gutter) 0; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 48px; max-width: 1440px; margin: 0 auto; }
.faq h2 { font-size: var(--step-title); line-height: 1.1; }
.faq .answers { columns: 2; column-gap: 56px; }
.faq .answers p { break-inside: avoid; margin-bottom: 22px; }
.faq .answers b { font-weight: 600; }

/* Close: the name at full width, then one quiet line. */
.close { padding: var(--section) var(--gutter) 28px; max-width: 1440px; margin: 0 auto; overflow: hidden; }
.close .name { font-family: var(--serif); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: clamp(4.5rem, 1rem + 15vw, 15rem); line-height: 0.9; letter-spacing: -0.05em; color: var(--amber); transform-origin: left bottom; }
.close .cta { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.footline { margin-top: 96px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px 24px; align-items: baseline; font-size: var(--step-small); color: var(--ink-secondary); }
.footline nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footline nav a { color: var(--ink); }
.footline .year { justify-self: end; }

/* ---------- Document pages: privacy, terms, support ---------- */
.doc-wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.doc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 64px; padding: 64px 0 0; }
.doc .side { position: sticky; top: 32px; align-self: start; }
.doc .side h1 { font-size: var(--step-title); line-height: 1.05; }
.doc .side .note { margin-top: 12px; }
.doc .side ol { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 10px; font-size: var(--step-small); }
.doc .side ol a { text-decoration: none; color: var(--ink-secondary); }
.doc .side ol a:hover { color: var(--amber-ink); }
.doc article { max-width: 68ch; }
.doc article > p:first-child { font-size: var(--step-lead); line-height: 1.5; }
.doc article h2 { font-size: 1.625rem; line-height: 1.2; margin-top: 64px; scroll-margin-top: 24px; }
.doc article h3 { font: 600 1.0625rem/1.35 var(--sans); letter-spacing: 0; margin-top: 28px; }
.doc article p, .doc article ul, .doc article ol { margin-top: 14px; }
.doc article ul, .doc article ol { padding-left: 1.2em; }
.doc article li + li { margin-top: 8px; }
.doc article .callout { background: var(--amber-soft); border-radius: 16px; padding: 20px 24px; }
.doc article .callout p:first-child { margin-top: 0; }
.doc article h2 + .callout { margin-top: 16px; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: var(--step-small); }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rail-idle); }
.doc th { font-weight: 600; }
.doc .copyright { font-size: var(--step-small); color: var(--ink-secondary); }
.doc-wrap .close { padding-left: 0; padding-right: 0; padding-top: 128px; }
.doc-wrap .close .name { font-size: clamp(3.5rem, 1rem + 10vw, 10rem); }

/* ---------- Motion ---------- */
@keyframes rise { to { opacity: 1; transform: none; } }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 640ms var(--ease), transform 760ms var(--ease); transition-delay: var(--delay, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
/* If site.js never runs, show everything after 3 s instead of leaving it hidden. */
.js:not(.ready) .reveal { animation: rise 1ms 3s forwards; }

@supports (animation-timeline: view()) {
  .close .name { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
  @keyframes settle { from { transform: scale(0.93); opacity: 0.6; } to { transform: none; opacity: 1; } }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transition: opacity 200ms linear; transform: none; }
  .hero-copy > *, .phone { animation: none; }
  .explained > div { animation: none; opacity: 1; transform: none; }
  .close .name { animation: none; }
  .button:active { transform: none; }
}

/* ---------- Phone and tablet ---------- */
@media (max-width: 1000px) {
  .bar.over { position: static; width: auto; padding: 20px var(--gutter); }
  .hero { display: block; min-height: 0; }
  .hero h1 { font-size: clamp(2.125rem, 10.4vw, 3.5rem); }
  .hero-copy { padding: 32px var(--gutter) 56px; }
  .hero-art { padding: 48px 24px; }
  .foot { padding: 16px var(--gutter); }
  .phone { height: auto; width: min(68vw, 300px); border-radius: 44px; }
  .screen { border-radius: 36px; aspect-ratio: 1180 / 2556; height: auto; }
  .faq { grid-template-columns: 1fr; gap: 24px; }
  .faq .answers { columns: 1; }
  .doc { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; }
  .doc .side { position: static; }
}
@media (max-width: 640px) {
  .bar nav a:not(.button) { display: none; }
  .bar nav a.keep { display: inline; }
  .feature { grid-template-columns: 1fr; gap: 16px; }
  .features { gap: 64px; }
  .footline { grid-template-columns: 1fr; gap: 8px; margin-top: 64px; }
  .footline .year { justify-self: start; }
  .doc table, .doc thead, .doc tbody, .doc tr, .doc th, .doc td { display: block; }
  .doc thead { display: none; }
  .doc td { border: 0; padding: 4px 0; }
  .doc tr { border-bottom: 1px solid var(--rail-idle); padding: 12px 0; }
}
/* The wordmark, Support and the button don't fit together on a small phone. Support stays in the footer. */
@media (max-width: 420px) {
  .bar nav a.keep:has(+ .button) { display: none; }
}
