/* ============================================================================
   Orison: orison.day marketing site
   Shared design system. Single source of truth for the public pages
   (index, help, privacy, terms, 404).
   Palette + type traced to ADR-027 (the Kept Flame) and packages/design.
   Self-hosted, zero external network dependencies: the fonts below are
   served from ./fonts, never from a third party. The privacy page promises
   "the page loads only from us"; this file is where that promise is kept.
   ============================================================================ */

/* --- minimal reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role="list"] { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }

/* ============================================================================
   Literata, self-hosted (SIL Open Font License 1.1, see fonts/OFL.txt).
   Static instances from github.com/googlefonts/literata, unmodified.
   Light 300 (headings, wordmark), Regular 400 (prose, the prayer),
   Medium 500 (actions, inscriptions), Light Italic 300 (the closing line, em).
   ============================================================================ */
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("./fonts/Literata-Light.woff2") format("woff2");
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/Literata-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/Literata-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url("./fonts/Literata-LightItalic.woff2") format("woff2");
}

/* ============================================================================
   Tokens
   Light (dawn / parchment) is the default; dark (vigil night) follows the
   viewer's system theme. Every screen honours both.
   ============================================================================ */
:root {
  --ground:        #F7F2E9;
  --ground-raised: #FFFDF8;
  --ground-sunk:   #F1EADC;
  --ink:           #2E2A24;
  --ink-muted:     #5E564B;
  --ink-whisper:   #857B6C;   /* decorative only: 3.7:1 on parchment, never small text */
  --ember:         #B4763A;   /* strokes, rules, marks: 3.4:1 on parchment, not for small text */
  --ember-soft:    #C98A4B;   /* decorative rules / large marks only */
  --ember-deep:    #8C5A2B;   /* accent when it must be READ: 5.2:1 on parchment (packages/design emberDeep) */
  --hairline:      #E3DACB;
  --hairline-soft: #EDE6D8;

  /* candle-paper gradient (icon treatment) */
  --paper-top:     #F2E3C8;
  --paper-bottom:  #D9A05C;
  --vigil:         #14161C;

  --measure: 65ch;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --slow: 800ms;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground:        #14161C;
    --ground-raised: #1C1F27;
    --ground-sunk:   #101218;
    --ink:           #EDE7DB;
    --ink-muted:     #B7AE9F;
    --ink-whisper:   #93897A;
    --ember:         #D9A05C;
    --ember-soft:    #D9A05C;
    --ember-deep:    #E4B87E;
    --hairline:      #2A2E38;
    --hairline-soft: #23262F;
  }
}

/* ============================================================================
   Base
   ============================================================================ */
body {
  background: var(--ground);
  color: var(--ink);
  overflow-x: hidden;
  font-family: "Literata", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "onum";
}

h1, h2, h3 {
  font-weight: 300;
  line-height: 1.22;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
p { text-wrap: pretty; }
em { font-style: italic; }
strong { font-weight: 500; }

::selection { background: rgba(180, 118, 58, 0.22); }

/* --- accessibility: focus + skip link --- */
:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 3px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  top: 0.75rem;
  z-index: 100;
  background: var(--ground-raised);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 200ms var(--ease);
}
.skip-link:focus { transform: translateX(-50%) translateY(0); }

/* --- shared layout --- */
.wrap {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}
.measure { max-width: var(--measure); }

/* --- small caps: one role, one colour, always readable --- */
.section-eyebrow,
.doc-head .eyebrow,
.doc-group,
.footer-col h4 {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ember-deep);
}

/* --- actions --- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.75rem;
  border-radius: 999px;
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.button--primary { background: #D9A05C; color: #14161C; }
.button--primary:hover { background: #E4B87E; }
.button--primary:active { background: #C98A4B; }
.button--ghost {
  border: 1px solid var(--ember-deep);
  color: var(--ember-deep);
  font-weight: 400;
}
.button--ghost:hover { background: var(--ground-raised); }
.button--ghost:active { background: var(--ground-sunk); }

/* ============================================================================
   The mark
   ============================================================================ */
.mark { color: var(--ink); display: inline-block; }
.mark svg { width: 100%; height: auto; }

/* ============================================================================
   Header
   ============================================================================ */
.site-header { position: relative; z-index: 5; }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(1.1rem, 3vw, 1.6rem);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}
.brand .mark { width: 30px; height: 30px; }
.brand .wordmark {
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.02em;
}
.site-nav { display: flex; gap: clamp(1rem, 3vw, 1.9rem); font-size: 0.98rem; }
.site-nav a {
  text-decoration: none;
  color: var(--ink-muted);
  padding-block: 0.2rem;
  border-bottom: 1px solid transparent;
  transition: color 240ms var(--ease), border-color 240ms var(--ease);
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--ember-soft); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ember-soft); }

/* On the landing page the header sits over the dark hero: force light ink. */
.landing .site-header { position: absolute; inset: 0 0 auto 0; }
.landing .site-header .brand { color: #EDE7DB; }
.landing .site-header .brand .mark { color: #EDE7DB; }
.landing .site-header .site-nav a { color: #C6BCAA; }
.landing .site-header .site-nav a:hover { color: #F7F2E9; }

/* ============================================================================
   Footer
   ============================================================================ */
.site-footer {
  margin-top: clamp(4rem, 12vh, 6rem);
  border-top: 1px solid var(--hairline);
  background: var(--ground-sunk);
}
.site-footer .wrap {
  padding-block: clamp(2.5rem, 7vh, 3.5rem) clamp(2.25rem, 6vh, 3rem);
  display: grid;
  gap: 2.25rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-brand { max-width: 30ch; }
.footer-brand .brand { margin-bottom: 0.85rem; }
.footer-brand .brand .mark { color: var(--ink); }
.footer-brand p { color: var(--ink-muted); font-size: 0.98rem; line-height: 1.6; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 1.75rem 3.5rem; }
.footer-col h4 { margin-bottom: 0.7rem; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.footer-col a, .footer-col span { text-decoration: none; color: var(--ink-muted); font-size: 0.98rem; }
.footer-col a { border-bottom: 1px solid transparent; transition: color 240ms var(--ease), border-color 240ms var(--ease); }
.footer-col a:hover { color: var(--ink); border-bottom-color: var(--ember-soft); }
.footer-note {
  border-top: 1px solid var(--hairline);
  padding-top: 1.4rem;
  color: var(--ink-muted);   /* the crisis line is the one line that must be read */
  font-size: 0.86rem;
  line-height: 1.6;
}
.footer-note p + p { margin-top: 0.55rem; }
.footer-note a { text-decoration: none; border-bottom: 1px solid var(--hairline); }
.footer-note a:hover { color: var(--ink); border-bottom-color: var(--ember-soft); }

/* ============================================================================
   The phone: the app itself as the object. The first frame is live HTML set
   in the app's own type roles (packages/design/src/typography.ts); the
   second holds the room. The screen is always the app's dawn theme,
   whatever the site's theme.
   ============================================================================ */
.phone {
  position: relative;
  z-index: 1;
  width: 350px;
  max-width: 100%;
  margin-inline: auto;
  padding: 12px;
  border-radius: 46px;
  background: #0E0F13;
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
}
.phone-screen {
  /* The app's own screen: 390 x 844 pt, the text inset 24 pt, scaled uniformly
     into the frame (326 px wide) so the prayer wraps exactly as in the app and
     the frame keeps a real phone's proportion instead of growing with content. */
  flex: none;
  position: relative;
  width: 390px;
  height: 844px;
  zoom: 0.8359;
  border-radius: 43px;
  overflow: hidden;
  background: linear-gradient(180deg, #F2E8D8 0%, #F7F2E9 45%, #F7F2E9 100%);
  color: #2E2A24;
  padding: 58px 24px 44px;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.phone-screen .settings-glyph { position: absolute; top: 30px; right: 24px; }
.app-inscription {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8C5A2B;
}
.app-whisper { font-size: 13px; line-height: 18px; font-weight: 400; color: #5E564B; }
.app-prayer { font-size: 21px; line-height: 34px; font-weight: 400; color: #2E2A24; }
.app-action { font-size: 17px; line-height: 24px; font-weight: 500; color: #2E2A24; }
.phone-screen .today { display: grid; gap: 4px; margin-top: 36px; }
.phone-screen .prayer { display: grid; gap: 22px; margin-top: 30px; }
.phone-screen .doors { display: grid; justify-items: center; gap: 22px; margin-top: 40px; }
.phone-screen .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 30px;
  border-radius: 999px;
  background: #F2E3C8;
  border: 1px solid #E3D3B4;
}
.phone-screen .keep { font-size: 17px; line-height: 24px; color: #5E564B; }

.phone--room {
  width: 300px;
  padding: 10px;
  border-radius: 42px;
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.phone--room .phone-screen {
  min-height: 0;
  padding: 0;
  border-radius: 33px;
  background: #14161C;
  aspect-ratio: 280 / 612;
}
.phone--room img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

/* ============================================================================
   LANDING: hero
   The hero keeps a vigil. The sky's dawn-glow shifts with the visitor's own
   local hour (set once on load, no motion), and a candle halo behind the
   phone breathes at candle speed. Sacred, not software.
   ============================================================================ */
.hero {
  position: relative;
  overflow: hidden;
  color: #EDE7DB;
  text-align: center;

  /* time-of-day variables; JS overrides. Defaults = first light (safe no-JS). */
  --glow-color: 242 227 200;
  --glow-x: 50%;
  --glow-y: 64%;
  --glow-alpha: 0.55;

  background:
    radial-gradient(135% 78% at var(--glow-x) var(--glow-y),
      rgba(var(--glow-color) / var(--glow-alpha)) 0%,
      rgba(var(--glow-color) / calc(var(--glow-alpha) * 0.28)) 26%,
      transparent 58%),
    linear-gradient(180deg, #0A0C11 0%, #14161C 52%, #191B23 100%);
}
/* a faint star-field of a few soft points, pure CSS, no assets */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1.5px 1.5px at 22% 24%, rgba(237,231,219,0.30), transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 18%, rgba(237,231,219,0.22), transparent 60%),
    radial-gradient(1.5px 1.5px at 63% 30%, rgba(237,231,219,0.16), transparent 60%),
    radial-gradient(1.5px 1.5px at 34% 15%, rgba(237,231,219,0.14), transparent 60%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  padding: 7.25rem 1.25rem 3rem;
  animation: rise var(--slow) var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.hero h1 {
  font-size: clamp(1.7rem, 6.5vw, 2.75rem);
  font-weight: 300;
  color: #EDE7DB;
  max-width: 18ch;
  margin: 0 0.5rem 1.9rem;
}
.hero-phonewrap { position: relative; width: 100%; max-width: 350px; }
/* candle halo behind the phone: breathes at candle speed */
.hero-halo {
  position: absolute;
  inset: -12% -30%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(217,160,92,0.30) 0%,
    rgba(217,160,92,0.10) 40%,
    transparent 70%);
  animation: breathe 7.5s ease-in-out infinite;
  will-change: opacity, transform;
  z-index: 0;
}
@keyframes breathe {
  0%, 100% { opacity: 0.52; transform: scale(1); }
  22%      { opacity: 0.64; transform: scale(1.035); }
  46%      { opacity: 0.45; transform: scale(0.99); }
  71%      { opacity: 0.60; transform: scale(1.02); }
}
.hero-copy {
  display: grid;
  justify-items: center;
  gap: 1rem;
  margin: 2.1rem 0.5rem 0;
  max-width: 34rem;
}
.hero-copy .context { font-size: 1rem; line-height: 1.6; color: #C6BCAA; max-width: 40ch; }
.hero-copy .early {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #93897A;   /* 5.25:1 on the vigil ground */
  max-width: 36ch;
}
.hero-copy .early a { color: #C6BCAA; text-decoration: none; border-bottom: 1px solid #4A4F5C; }
.hero-copy .early a:hover { color: #F7F2E9; border-bottom-color: #D9A05C; }

/* ============================================================================
   LANDING: sections
   ============================================================================ */
.section { padding-block: clamp(3.5rem, 9vw, 6rem); }
.section + .section, .section-pair + .section, .section + .section-pair { border-top: 1px solid var(--hairline-soft); }
.section-eyebrow { margin-bottom: 0.85rem; }
.section h2 { font-size: clamp(1.625rem, 3.4vw, 2.125rem); font-weight: 300; margin-bottom: 0.9rem; }
.section .lede {
  font-size: clamp(1.12rem, 2.2vw, 1.32rem);
  color: var(--ink-muted);
  line-height: 1.68;
  max-width: 46ch;
}
.section .body { color: var(--ink-muted); max-width: 52ch; }
.section .body + .body { margin-top: 0.9rem; }
.center { text-align: center; margin-inline: auto; }
.center .lede, .center .body { margin-inline: auto; }

/* the room: the real room, in a phone */
.room-figure { margin: 1.9rem auto 0; width: 100%; max-width: 300px; }
.room-caption { margin-top: 0.9rem; font-size: 0.86rem; color: var(--ink-muted); text-align: center; }

/* six ways to pray: a quiet litany of tiles */
.ways {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
}
.way {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: var(--ground-raised);
  font-size: 0.97rem;
  line-height: 1.5;
}

/* private by design: a litany, one column, no cards */
.promises { margin-top: 1.4rem; display: grid; gap: 1.2rem; }
.promise h3 { font-size: 1.125rem; font-weight: 400; margin-bottom: 0.25rem; }
.promise p { color: var(--ink-muted); font-size: 0.97rem; }

/* closing: the blessing, then the honest way in */
.closing { text-align: center; }
.closing .mark { width: 48px; margin: 0 auto 1.5rem; color: var(--ink); }
.closing h2 { font-size: clamp(1.5rem, 3.2vw, 1.9rem); font-style: italic; font-weight: 300; margin-bottom: 1.4rem; }
.closing .get { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.closing .early { margin-top: 1.1rem; font-size: 0.86rem; color: var(--ink-muted); }

/* ============================================================================
   LANDING: desktop, from 960px: the app beside its words
   ============================================================================ */
@media (min-width: 960px) {
  .hero { --glow-x: 34%; --glow-y: 62%; text-align: left; }
  .hero-inner {
    max-width: 68rem;
    margin-inline: auto;
    grid-template-columns: 350px minmax(0, 1fr);
    column-gap: 5.5rem;
    justify-items: start;
    padding: 9.5rem 2.5rem 5.5rem;
  }
  .hero-phonewrap { grid-column: 1; grid-row: 1 / span 2; }
  .hero h1 {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    margin: 0 0 1.4rem;
    max-width: 480px;
  }
  .hero-copy {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    justify-items: start;
    margin: 0;
    max-width: 480px;
    gap: 0.75rem;
  }
  .hero-copy .context { font-size: 1.125rem; margin-bottom: 0.6rem; }

  .room .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: 5.5rem;
    align-items: center;
  }
  .room .body { font-size: 1.125rem; max-width: 520px; }
  .room-figure { margin: 0; }
  .room-caption { text-align: left; }

  .see .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    column-gap: 5.5rem;
    align-items: center;
  }
  .see .body { font-size: 1.125rem; max-width: 520px; }
  .demo-figure { margin: 0; }

  .section-pair { padding-block: clamp(3.5rem, 9vw, 6rem); }
  .section-pair .wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 4.5rem;
    align-items: start;
  }
  .section-pair .section { padding-block: 0; border-top: 0; }

  .promises { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
  .promise h3 { font-size: 1.2rem; }
}

/* ============================================================================
   TRY IT HERE: the tap-through preview (assets/demo.js)
   The app's screens rebuilt as DOM at the app's own 390 x 844 pt inside the
   same scaled phone screen as the hero, so every measurement is the app's:
   type roles from packages/design/typography.ts, spacing from space.ts,
   colours from colors.ts (Dawn and Vigil), motion from motion.ts. The room
   alone is three frames of the real room plus a breathing glow.
   ============================================================================ */
.demo-figure { margin: 1.9rem auto 0; width: 100%; max-width: 350px; }
.demo-screen {
  /* packages/design/src/colors.ts: dawn */
  --d-ground: #F7F2E9;
  --d-raised: #FFFDF8;
  --d-ink: #2E2A24;
  --d-muted: #6E655A;
  --d-whisper: #8F8577;
  --d-ember: #C98A4B;
  --d-ember-rgb: 201 138 75;
  --d-ember-deep: #8C5A2B;
  --d-hairline: #E3DACB;
  --d-veil: rgba(46, 42, 36, 0.28);
  --d-linger: cubic-bezier(0.33, 0, 0.13, 1);
  --d-veil-ease: cubic-bezier(0.45, 0, 0.55, 1);
  display: block;
  padding: 0;
  background-color: var(--d-ground);
  /* the daypart wash (tint.ts + chromeVeilModel.ts): dusk is the no-JS default; the script sets it by the hour */
  background-image: linear-gradient(180deg, rgba(242,234,223,1) 0%, rgba(242,234,223,0.512) 20%, rgba(242,234,223,0.216) 40%, rgba(242,234,223,0.064) 60%, rgba(242,234,223,0.008) 80%, rgba(242,234,223,0) 100%);
  color: var(--d-ink);
  font-feature-settings: "kern", "liga";
  hyphens: manual;
}
.demo-screen[data-theme="vigil"] {
  --d-ground: #14161C;
  --d-raised: #1C1F27;
  --d-ink: #EDE7DB;
  --d-muted: #A79E8F;
  --d-whisper: #736C5F;
  --d-ember: #D9A05C;
  --d-ember-rgb: 217 160 92;
  --d-ember-deep: #E4B87E;
  --d-hairline: #2A2E38;
  --d-veil: rgba(0, 0, 0, 0.40);
}
:where(.demo-screen) p, :where(.demo-screen) h3 { margin: 0; text-wrap: wrap; }
.demo-screen [hidden] { display: none !important; }
.demo-noscript { padding: 120px 24px 0; font-size: 17px; line-height: 26px; color: var(--d-muted); }
.demo-status { height: 54px; }
.demo-app { position: relative; height: 790px; }

/* screens: a stack, each its own scroll; pushed screens carry the ground with them */
.d-screen {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  isolation: isolate; /* each screen's chrome stacks inside its own screen */
}
.d-screen::-webkit-scrollbar { display: none; }
.d-screen--enter { animation: d-push 600ms var(--d-linger) both; }
.d-screen--leave { animation: d-pop 600ms var(--d-linger) both; pointer-events: none; }
@keyframes d-push { from { transform: translateX(100%); } to { transform: none; } }
@keyframes d-pop { from { transform: none; } to { transform: translateX(100%); } }
.d-book, .d-entry-screen, .d-settings, .d-style { background-color: var(--d-ground); background-image: inherit; }

/* type roles: packages/design/src/typography.ts, 1:1 */
.t-prayer { font-size: 21px; line-height: 34px; font-weight: 400; white-space: pre-line; }
.t-title { font-size: 23px; line-height: 31px; font-weight: 400; letter-spacing: 0; }
.t-body { font-size: 17px; line-height: 26px; font-weight: 400; }
.t-action { font-size: 17px; line-height: 24px; font-weight: 500; }
.t-whisper { font-size: 13px; line-height: 18px; font-weight: 400; }
.t-inscription { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--d-whisper); }
.d-muted { color: var(--d-muted); }

/* layout: space.ts */
.d-content { padding: 0 24px; }
.d-settings, .d-style { padding: 0 24px; }
.d-content--settings { padding: 0 0 96px; }
.d-chrome { position: absolute; top: 0; z-index: 10; }
.d-chrome--right { right: 24px; }
.d-chrome--left { left: 24px; }
.d-glyph { width: 44px; height: 44px; display: flex; align-items: center; justify-content: flex-end; color: var(--d-muted); }
.d-back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: flex-start; color: var(--d-muted); }
.d-sun svg, .d-chev svg { display: block; overflow: visible; }
.d-backrow { height: 48px; display: flex; align-items: center; padding: 0 24px; }
.d-backrow--padded { padding: 0; }
.d-header { padding: 0 24px; margin-bottom: 24px; }
.d-date { margin-top: 4px; color: var(--d-muted); }
.d-prayer { max-width: 560px; }
.d-prayer-spaced { margin-top: 32px; }
.d-sep { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 48px 0; }
.d-sep i { width: 3px; height: 3px; border-radius: 50%; background: rgb(var(--d-ember-rgb) / 0.6); }
.d-retired { text-align: center; margin: 12px 24px 0; color: var(--ink-muted); }
.d-retired-link { display: inline-block; margin: 8px auto 0; color: var(--ember); border-bottom: 1px solid transparent; text-decoration: none; }
.d-retired-link:hover { border-bottom-color: var(--ember-soft); }
.d-sep--sealed i { background: var(--d-ember); }
.d-center { display: flex; flex-direction: column; align-items: center; }
.d-mt16 { margin-top: 16px; }
.d-mt32 { margin-top: 32px; }

/* every tap target is a button; the focus ring is the ember */
.d-btn {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; position: relative; text-align: center; border-radius: 999px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.d-btn:focus-visible, .d-input:focus-visible { outline: 2px solid var(--d-ember); outline-offset: 3px; }
.d-threshold {
  min-height: 52px; padding: 12px 24px; width: 100%;
  border: 1px solid rgb(var(--d-ember-rgb) / 0.4);
  background: rgb(var(--d-ember-rgb) / 0.14);
  color: var(--d-ink);
  transition: background-color 350ms var(--d-linger), border-color 350ms var(--d-linger), color 350ms var(--d-linger);
}
.d-threshold:active { background: rgb(var(--d-ember-rgb) / 0.22); }
.d-threshold--hug { width: auto; padding-inline: 48px; }
.d-threshold[disabled] { background: transparent; border-color: var(--d-hairline); color: var(--d-muted); cursor: default; }
.d-quiet { min-height: 44px; padding: 0 12px; color: var(--d-muted); transition: opacity 350ms var(--d-linger); }
.d-quiet:active { opacity: 0.65; }
.d-door { min-height: 44px; margin-top: 32px; padding: 0 8px; color: var(--d-muted); }
.d-door--book { color: var(--d-ember-deep); }
.d-keep { min-height: 44px; padding: 0 12px; display: grid; place-items: center; color: var(--d-muted); }
.d-keep > span { grid-area: 1 / 1; transition: opacity 350ms var(--d-linger); }
.d-keep-kept { color: var(--d-ember-deep); opacity: 0; }
.d-keep[aria-pressed="true"] .d-keep-invite { opacity: 0; }
.d-keep[aria-pressed="true"] .d-keep-kept { opacity: 1; }

/* the ember: ember.ts geometry, motion.ts breath */
.d-ember {
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--d-ember-rgb) / 1) 0%, rgb(var(--d-ember-rgb) / 0.55) 35%, rgb(var(--d-ember-rgb) / 0) 100%);
  animation: d-breath 8s ease-in-out infinite;
}
@keyframes d-breath { 0%, 100% { opacity: 0.55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.045); } }
.d-stage { position: absolute; left: 50%; top: 216px; margin-left: -84px; pointer-events: none; transition: opacity 1500ms var(--d-veil-ease); }
.d-stage--exit { opacity: 0; }

/* entrances surface: opacity 0 to 1, 8 pt of rise */
.d-reveal { animation: d-rise 900ms var(--d-linger) both; }
@keyframes d-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* the guided nudge: a soft ember ring that breathes around the next tap */
[data-nudged]::after {
  content: "";
  position: absolute; inset: -7px;
  border-radius: 999px;
  border: 1.5px solid rgb(var(--d-ember-rgb) / 0.75);
  box-shadow: 0 0 0 5px rgb(var(--d-ember-rgb) / 0.12), 0 0 22px rgb(var(--d-ember-rgb) / 0.35);
  pointer-events: none;
  animation: d-nudge 4s ease-in-out infinite;
}
.d-entry[data-nudged]::after, .d-option[data-nudged]::after { border-radius: 14px; inset: -4px -10px; }
@keyframes d-nudge { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }

/* Book of Days */
.d-list { padding: 0 24px 96px; }
.d-entry { display: block; width: 100%; text-align: left; padding: 16px 0; border-radius: 14px; color: var(--d-ink); }
.d-entry-date { display: block; color: var(--d-muted); }
.d-entry-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 4px; white-space: pre-line; }
.d-letgo { margin-top: 48px; }
.d-confirm { text-align: center; margin-bottom: 24px; max-width: 320px; }

/* Settings */
.d-section { margin-top: 48px; }
.d-input {
  display: block; width: 100%; min-height: 80px; padding: 12px 0; margin: 0;
  border: 0; border-radius: 3px; background: none; color: var(--d-ink); resize: none; font-family: inherit;
}
.d-input::placeholder { color: var(--d-whisper); opacity: 1; }
.d-held { min-height: 80px; padding: 12px 0; }
.d-rule { height: 1px; background: var(--d-hairline); }
.d-intent-actions { margin-top: 16px; }
.d-intent-secondary { display: flex; justify-content: center; margin-top: 12px; }
.d-style-block { margin-top: 12px; }
.d-style-desc { margin-top: 4px; }
.d-style-rule { margin-top: 16px; }
.d-row-actions { display: flex; margin-top: 16px; }
.d-row-actions--tight { margin-top: 8px; }
.d-row-actions--first { margin-top: 12px; }
.d-row-actions--next { margin-top: 4px; }
.d-reminder-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.d-reminder-line { flex: 1; margin-right: 16px; }
.d-version { margin-top: 64px; color: var(--d-whisper); }
.d-switch { width: 64px; height: 26px; flex: none; background: var(--d-hairline); transition: background-color 350ms var(--d-linger); }
.d-switch-knob {
  position: absolute; top: 1px; left: 1px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--d-whisper);
  transition: transform 350ms var(--d-linger), background-color 350ms var(--d-linger);
}
.d-switch[aria-checked="true"] { background: rgb(var(--d-ember-rgb) / 0.6); }
.d-switch[aria-checked="true"] .d-switch-knob { transform: translateX(38px); background: var(--d-ember); }

/* the way: option rows, the dot the only mark of the chosen one */
.d-ways { margin-top: 32px; }
.d-option { display: flex; align-items: flex-start; width: 100%; min-height: 52px; padding: 16px 0; text-align: left; border-radius: 14px; color: var(--d-ink); }
.d-dotslot { width: 24px; height: 26px; display: flex; align-items: center; flex: none; }
.d-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--d-ember-deep); opacity: 0; transition: opacity 350ms var(--d-linger); }
.d-option[aria-checked="true"] .d-dot { opacity: 1; }
.d-option-text { flex: 1; display: block; }
.d-option-text > span { display: block; }
.d-option-desc { margin-top: 4px; }

/* sheets */
.d-sheet-layer { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; justify-content: flex-end; }
.d-scrim { position: absolute; inset: 0; background: var(--d-veil); border-radius: 0; cursor: default; }
.d-sheet {
  position: relative; background: var(--d-raised); border-radius: 14px 14px 0 0;
  padding: 12px 24px 64px; display: flex; flex-direction: column; align-items: center; text-align: left;
}
.d-grabber { width: 36px; height: 4px; border-radius: 2px; background: var(--d-hairline); margin-bottom: 32px; }
.d-sheet-title { align-self: stretch; }
.d-sheet-how { align-self: stretch; margin-top: 12px; margin-bottom: 24px; }
.d-consent-row { display: flex; align-items: flex-start; align-self: stretch; }
.d-consent-label { flex: 1; margin-left: 16px; cursor: pointer; }
.d-link { align-self: stretch; text-align: left; margin-top: 16px; color: var(--d-ember-deep); border-radius: 3px; }
.d-sheet-foot { align-self: stretch; margin-top: 32px; }
.d-wheel-frame { position: relative; width: 120px; height: 220px; }
.d-wheel-frame::before, .d-wheel-frame::after { content: ""; position: absolute; left: 0; right: 0; border-top: 1px solid var(--d-hairline); pointer-events: none; }
.d-wheel-frame::before { top: 88px; }
.d-wheel-frame::after { top: 132px; }
.d-wheel { height: 220px; overflow-y: auto; scroll-snap-type: y mandatory; padding: 88px 0; scrollbar-width: none; }
.d-wheel::-webkit-scrollbar { display: none; }
.d-wheel-item { display: block; width: 100%; height: 44px; scroll-snap-align: center; color: var(--d-whisper); border-radius: 8px; }
.d-wheel-item[aria-pressed="true"] { color: var(--d-ink); }

/* the room: three frames of the real room, and a candle that answers a resting finger */
.d-room { overflow: hidden; background-color: #111419; background-image: none; }
.demo-screen--room .demo-status { background: #111419; }
.d-room-img { position: absolute; top: 0; left: 0; width: 390px; height: auto; display: block; transition: opacity 900ms var(--d-veil-ease); }
.d-room-img--lit, .d-room-img--bare { opacity: 0; }
.d-room--lit .d-room-img--lit { opacity: 1; }
.d-room--bare .d-room-img--bare { opacity: 1; }
.d-flame-glow { position: absolute; left: 224px; top: 431px; width: 280px; height: 280px; margin: -140px 0 0 -140px; pointer-events: none; opacity: 0; transition: opacity 900ms var(--d-veil-ease); }
.d-flame-glow::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,184,112,0.30) 0%, rgba(255,184,112,0.11) 35%, rgba(255,184,112,0) 70%);
  animation: breathe 7.5s ease-in-out infinite;
}
.d-room--lit .d-flame-glow { opacity: 1; }
.d-teach { position: absolute; top: 528px; left: 24px; right: 24px; margin: 0 auto; max-width: 280px; text-align: center; color: #A79E8F; opacity: 0; transition: opacity 600ms var(--d-veil-ease); }
.d-teach--in { opacity: 1; }
.d-candle { position: absolute; left: 194px; top: 404px; width: 60px; height: 96px; -webkit-touch-callout: none; user-select: none; touch-action: none; }
.d-candle[aria-disabled="true"] { cursor: default; }
.d-room-chrome { position: absolute; inset: 0; pointer-events: none; transition: opacity 900ms var(--d-veil-ease); }
.d-room-chrome--veiled { opacity: 0.4; }
.d-room-chrome .d-back { color: #A79E8F; pointer-events: auto; }
.d-room-label { position: absolute; left: 24px; right: 24px; bottom: 66px; min-height: 44px; color: #A79E8F; pointer-events: auto; }

/* beneath the phone: the whisper and the three quiet links */
.demo-foot { margin-top: 1rem; text-align: center; }
.demo-whisper { min-height: 1.7em; font-size: 0.98rem; color: var(--ink-muted); }
.demo-links { margin-top: 0.4rem; display: flex; justify-content: center; gap: 1.5rem; }
.demo-link { font: inherit; font-size: 0.86rem; color: var(--ink-muted); background: none; border: 0; padding: 0.3rem 0.1rem; border-bottom: 1px solid transparent; cursor: pointer; border-radius: 0; }
.demo-link:hover { color: var(--ink); border-bottom-color: var(--ember-soft); }
.demo-link[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ember); }

/* ============================================================================
   DOCUMENT PAGES (help.html, privacy.html, terms.html, 404.html)
   ============================================================================ */
.doc { padding-block: clamp(2.5rem, 6vh, 4rem) clamp(4rem, 10vh, 6rem); }
.doc-head {
  max-width: var(--measure);
  margin: 0 auto clamp(2.5rem, 6vh, 3.5rem);
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--hairline);
}
.doc-head .eyebrow { margin-bottom: 0.9rem; }
.doc-head h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin-bottom: 0.9rem; }
.doc-head .meta { color: var(--ink-muted); font-size: 0.98rem; }
.doc-head .care-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  color: var(--ember-deep);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.doc-head .care-link:hover { border-bottom-color: var(--ember-soft); }
.doc-body { max-width: var(--measure); margin-inline: auto; }
.doc-body > * + * { margin-top: 1.15rem; }
.doc-body h2 {
  font-size: clamp(1.4rem, 3.2vw, 1.85rem);
  font-weight: 400;
  margin-top: 2.8rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--hairline-soft);
}
.doc-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.doc-body h3 { font-size: 1.18rem; font-weight: 500; margin-top: 1.8rem; }
.doc-body p, .doc-body li { color: var(--ink); }
.doc-body ul { padding-left: 1.3rem; display: grid; gap: 0.55rem; }
.doc-body li { padding-left: 0.2rem; }
.doc-body li::marker { color: var(--ember); }
.doc-body strong { color: var(--ink); }
.doc-body blockquote {
  margin: 1.4rem 0;
  padding: 1rem 1.4rem;
  border-left: 3px solid var(--ember-soft);
  background: var(--ground-raised);
  border-radius: 0 12px 12px 0;
  color: var(--ink-muted);
  font-style: italic;
}
.doc-body .placeholder { color: var(--ink-muted); font-style: italic; }
.doc-body .lead { font-size: 1.16rem; line-height: 1.7; color: var(--ink-muted); }
.doc-table-scroll { overflow-x: auto; border-radius: 12px; border: 1px solid var(--hairline); margin: 1.3rem 0; }
.doc-body table { border-collapse: collapse; width: 100%; font-size: 0.96rem; min-width: 34rem; }
.doc-body th, .doc-body td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--hairline-soft);
  vertical-align: top;
}
.doc-body thead th {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
  background: var(--ground-raised);
}
.doc-body tbody tr:last-child td { border-bottom: 0; }
.doc-body table + * { margin-top: 1.15rem; }

/* --- help: contents, grouped questions, and the landed anchor --- */
.help-toc { display: grid; gap: 1.4rem; }
.help-toc ul { list-style: none; padding: 0; display: grid; gap: 0.5rem; margin-top: 0.55rem; }
.help-toc a {
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 240ms var(--ease), border-color 240ms var(--ease);
}
.help-toc a:hover { color: var(--ink); border-bottom-color: var(--ember-soft); }
.doc-body > .doc-group { margin-top: 2.6rem; }
.help-toc .doc-group, .reach .doc-group { margin-top: 0; }
.doc-body > .doc-group + .q { border-top: 0; margin-top: 0.4rem; }
.doc-body > .q { margin-top: 0; }
.q {
  padding: 1.6rem 0 1.6rem 1rem;
  margin-left: -1rem;
  border-top: 1px solid var(--hairline-soft);
  border-left: 2px solid transparent;
  scroll-margin-top: 1.5rem;
  transition: border-color 400ms var(--ease);
}
.q:target { border-left-color: var(--ember); }
.doc-body .q h2 { margin-top: 0; padding-top: 0; border-top: 0; font-size: 1.3rem; }
.doc-body .q p { color: var(--ink-muted); }
.doc-body .q > * + * { margin-top: 0.75rem; }
.doc-body .whisper { font-size: 0.85rem; color: var(--ink-muted); }
.doc-body .whisper a { text-decoration: none; border-bottom: 1px solid var(--hairline); }
.doc-body .whisper a:hover { color: var(--ink); border-bottom-color: var(--ember-soft); }
.doc-body .reach { margin-top: 2.8rem; padding-top: 1.6rem; border-top: 1px solid var(--hairline-soft); }
.doc-body .reach h2 { margin-top: 0.6rem; padding-top: 0; border-top: 0; }
.doc-body .reach p { color: var(--ink-muted); }

/* ============================================================================
   Reduced motion: every animation has a still variant
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero-inner { opacity: 1; transform: none; }
  .hero-halo { opacity: 0.5; }
  .d-ember { animation: none; opacity: 0.91; }
  .d-flame-glow::before { animation: none; opacity: 0.55; }
  [data-nudged]::after { animation: none; }
}
