/* ───────────────────────────────────────────────────────────────────────────
   Holy Instant — the landing page.

   A quiet doorway, not a sales page. Warm paper by day, deep ink by night,
   one accent of candlelight gold. The whole discipline of the type is air:
   wide margins, generous leading, a narrow reading measure, and long pauses
   of empty space that are not empty — they are room to exhale.

   Colours are the app's own tokens (DesignSystem/Theme.swift), verbatim.
─────────────────────────────────────────────────────────────────────────── */

:root {

  /* ── the palette (light / paper is the default) ───────────────────────── */
  --paper:          #FAF6EF;   /* the page                                   */
  --surface:        #F3EDE2;   /* a raised surface, a shade warmer           */
  --ink:            #2B2620;   /* primary text — 13.9:1 on paper             */
  --ink-secondary:  #6B6357;   /* quieter text  —  5.5:1 on paper            */
  --accent:         #A8863C;   /* muted gold — for rules & glow, never body  */
  --hairline:       #E4DCC9;   /* a whisper of a line                        */

  /* the deep-ink field of the aperture — the hero holds it in BOTH themes,
     because the light can only be seen against the dark. */
  --field-hi:       #1e1b14;
  --field-mid:      #16130d;
  --field-lo:       #100e08;
  --on-field:       #EDE7DA;   /* text over the field — 15:1                 */
  --on-field-quiet: #A9A08D;   /* quieter text over the field —  7.2:1       */
  --field-gold:     #C9A860;   /* gold reads as light on the dark field      */

  /* ── motion tokens (Matt's own easing) ────────────────────────────────── */
  --ease-spring:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --breath:        10s;        /* one full breath of the aperture — 4 in, 6 out */

  /* ── type ─────────────────────────────────────────────────────────────── */
  --serif: Palatino, "Palatino Linotype", "Iowan Old Style", "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
           Arial, system-ui, sans-serif;

  --measure: 34rem;            /* the reading measure — never wider          */

  color-scheme: light dark;
}

/* deep-ink night mode — the reading sections turn to ink, the hero was
   already dark, so the page reads as one seamless dusk. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper:         #171510;
    --surface:       #1E1B15;
    --ink:           #EDE7DA;   /* 14.8:1 on ink                             */
    --ink-secondary: #A9A08D;   /*  7.0:1 on ink                             */
    --accent:        #C9A860;   /* on the dark page, gold is legible light   */
    --hairline:      #322D24;
  }
}


/* ── reset-ish, kept tiny ─────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.0625rem, 0.9rem + 0.6vw, 1.25rem);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;                 /* the glow never spills a scrollbar   */
}

p { margin: 0; }


/* ───────────────────────────────────────────────────────────────────────────
   the hero — the aperture

   A single luminous seam of gold light rising through a deep, warm field of
   ink, recreated entirely in CSS. The field is a radial deep-ink ground; the
   light is five stacked elliptical gradients — a felt whole-field warmth, a
   candlelight haze, luminous gold, a bright white seam, and the concentrated
   heart of the instant — the same layering as the app icon.
─────────────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 100svh;
  padding: 0 clamp(1.5rem, 6vw, 4rem) clamp(3.5rem, 12vh, 7rem);
  overflow: hidden;
  text-align: center;

  /* dawn — the same light as the app icon, so the face of the app and its
     doorway are one image: a cream sky lifting off a warm horizon and sinking
     into deep ink, where the words come to rest. Held in both themes, like the
     icon; the reading below is what turns to paper or to night. */
  background:
    linear-gradient(180deg,
      #EFE8D8   0%,     /* cream sky            */
      #EADEC4  30%,
      #DCBE84  45%,     /* the warming toward light */
      #C59A52  52%,     /* the horizon          */
      #7A6038  63%,
      #3A2F1F  78%,
      #221C13 100%);    /* deep ink, under the words */
}

/* the sun cresting the horizon — a hot core inside a warm bloom inside a wide
   aura, stacked so the light reads as lit, not painted. A wide, low band rather
   than a tall seam, centred on the horizon line, and breathing. */
.hero__glow {
  position: absolute;
  z-index: -1;
  top: 50%;                            /* the horizon */
  left: 50%;
  width: min(150vw, 1100px);
  height: min(64svh, 680px);
  transform: translate(-50%, -50%);
  pointer-events: none;

  background:
    radial-gradient(closest-side, rgba(255,253,246,0.98) 0%, rgba(255,253,246,0) 64%) 50% 50% / 30% 22% no-repeat,
    radial-gradient(closest-side, rgba(255,242,214,0.72) 0%, rgba(255,242,214,0) 68%) 50% 50% / 54% 38% no-repeat,
    radial-gradient(closest-side, rgba(240,206,140,0.44) 0%, rgba(240,206,140,0) 72%) 50% 50% / 92% 58% no-repeat,
    radial-gradient(closest-side, rgba(190,150,80,0.24) 0%, rgba(190,150,80,0) 78%) 50% 50% / 132% 100% no-repeat;

  animation: breathe var(--breath) ease-in-out infinite;
  will-change: opacity, transform, filter;
}

/* the slow breath: an unhurried inhale to the peak (~4s), a longer exhale back
   to rest (~6s) — the app's own 4-in / 6-out cadence. transform / opacity /
   filter only, so nothing around it ever shifts. */
@keyframes breathe {
  0%   { opacity: 0.84; transform: translate(-50%, -50%) scale(0.98); filter: brightness(0.98); }
  40%  { opacity: 1;    transform: translate(-50%, -50%) scale(1.04); filter: brightness(1.05); }
  100% { opacity: 0.84; transform: translate(-50%, -50%) scale(0.98); filter: brightness(0.98); }
}

.hero__words { position: relative; }

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 1.6rem + 4.6vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--on-field);
  text-shadow: 0 1px 30px rgba(201, 168, 96, 0.18);
}

.hero__line {
  margin-top: clamp(0.75rem, 2vh, 1.25rem);
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.2rem);
  letter-spacing: 0.015em;
  color: var(--on-field-quiet);
}


/* ───────────────────────────────────────────────────────────────────────────
   the reading — passages, quote, ethos
─────────────────────────────────────────────────────────────────────────── */

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(3rem, 9vh, 5.5rem) clamp(1.5rem, 6vw, 3rem);
}

section { width: 100%; }

.passages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 5vh, 3.25rem);      /* an intentional pause between breaths, not a void */
  max-width: var(--measure);
  margin-inline: auto;
}

.passage {
  max-width: var(--measure);
  font-size: clamp(1.125rem, 1rem + 0.7vw, 1.375rem);
  line-height: 1.72;
  text-align: left;                    /* prose reads left; centring is for a line, not a paragraph */
  text-wrap: pretty;                   /* even ragged edge, no orphans */
  color: var(--ink);
}


/* the pull-quote — serif, held between two soft gold rules */
.quote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.75rem, 5vh, 2.75rem);
  margin: clamp(5rem, 16vh, 9rem) auto;
  max-width: var(--measure);
  text-align: center;
}

.quote__body {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.375rem);
  line-height: 1.42;
  font-style: italic;
  color: var(--ink);
}

.quote__body p { margin: 0; }

.quote__cite {
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
}

/* a short seam of gold — the decorative use the gold is safe for on paper */
.rule {
  display: block;
  width: clamp(48px, 12vw, 80px);
  height: 1px;
  background: linear-gradient(90deg,
    transparent, var(--accent), transparent);
  opacity: 0.7;
}


.ethos {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 6vh, 3rem);
  max-width: var(--measure);
  margin-inline: auto;
  text-align: center;
}

.coming {
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--ink-secondary);
}


/* ── footer — the year, and a line ────────────────────────────────────────── */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: clamp(3rem, 10vh, 5rem) 1.5rem clamp(3.5rem, 10vh, 5rem);
  border-top: 1px solid var(--hairline);
  text-align: center;
  color: var(--ink-secondary);
}

.footer__mark {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.footer__love {
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}


/* a quiet door, never a wall — a single line that is easy to walk past.
   ink text (gold never carries body copy), a hairline underline that only
   warms to gold on hover. it gates nothing and asks nothing. */
.support {
  max-width: 30rem;
  margin: 0 auto clamp(1.75rem, 5vh, 2.75rem);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ink-secondary);
  text-wrap: balance;
}

.support__link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
  transition: border-color 240ms var(--ease-out-soft);
}

.support__link:hover { border-bottom-color: var(--accent); }

.support__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}


/* ───────────────────────────────────────────────────────────────────────────
   document pages — support & privacy

   The same paper, ink, and measure as the doorway, but laid for reading a
   little longer: a quiet masthead that walks home, a narrow column, headings
   that differ from body on weight and colour, never font.
─────────────────────────────────────────────────────────────────────────── */

.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: clamp(3rem, 10vh, 5rem) 1.5rem clamp(1.5rem, 5vh, 2.5rem);
  text-align: center;
}

.masthead__mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.375rem);
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.masthead__kicker {
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.doc {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(1rem, 4vh, 2rem) clamp(1.5rem, 6vw, 3rem) clamp(4rem, 12vh, 6rem);
}

.doc__lede {
  font-size: clamp(1.125rem, 1rem + 0.7vw, 1.375rem);
  line-height: 1.7;
  color: var(--ink);
  text-wrap: pretty;
}

.doc h2 {
  margin: clamp(2.5rem, 7vh, 3.5rem) 0 0.75rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.375rem, 1.15rem + 1vw, 1.75rem);
  line-height: 1.3;
  color: var(--ink);
}

.doc p {
  margin: 0 0 1.1rem;
  color: var(--ink);
  text-wrap: pretty;
}

.doc p.quiet { color: var(--ink-secondary); }

.doc a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 1px;
  transition: border-color 240ms var(--ease-out-soft);
}

.doc a:hover { border-bottom-color: var(--accent); }

.doc a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.doc__updated {
  margin-top: clamp(2.5rem, 7vh, 3.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--ink-secondary);
}


/* ───────────────────────────────────────────────────────────────────────────
   motion — restrained, and it honours a request for stillness

   The fade-in is progressive enhancement, and it can never strand content.
   Every passage is VISIBLE BY DEFAULT — with no javascript, with a failed
   observer, or with reduced-motion on, it is simply present from first paint.
   The hidden-then-revealed state is armed only by `html.reveal-on`, a class
   javascript adds ONLY once a live IntersectionObserver is already watching
   (and a timed backstop reveals everything regardless). So the light of the
   words can dim only where there is a mechanism certain to bring it back.
─────────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: no-preference) {
  html.reveal-on [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition:
      opacity   560ms var(--ease-out-soft),
      transform 560ms var(--ease-out-soft);
  }
  html.reveal-on [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }
}

/* stillness does not shout: kill the ambient breath, hold the light at full */
@media (prefers-reduced-motion: reduce) {
  .hero__glow {
    animation: none;
    opacity: 1;
  }
}
