/* ============================================================================
   Orison — orison.day marketing site
   Shared design system. Single source of truth for the three public pages.
   Palette + type traced to ADR-027 (the Kept Flame) and docs/brand.
   Self-hosted, zero external network dependencies.
   ============================================================================ */

/* --- 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; }

/* ============================================================================
   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;
  --ember:         #B4763A;   /* darkened from #C98A4B for AA text on parchment */
  --ember-soft:    #C98A4B;   /* decorative rules / large marks only */
  --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;
    --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: 600; }

::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;
}
.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); }

/* ============================================================================
   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); }

/* 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, 8rem);
  border-top: 1px solid var(--hairline);
  background: var(--ground-sunk);
}
.site-footer .wrap {
  padding-block: clamp(3rem, 8vh, 4.5rem);
  display: grid;
  gap: 2.5rem;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 3rem;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-brand { max-width: 28ch; }
.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: 2.5rem 3.5rem; }
.footer-col h4 {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-whisper);
  margin-bottom: 0.9rem;
}
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 0.6rem; }
.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.6rem;
  color: var(--ink-whisper);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* app-store "coming soon" placeholders (never fabricate store links) */
.store-badges { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.1rem; }
.badge {
  display: inline-flex;
  flex-direction: column;
  gap: 0.05rem;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 0.55rem 1rem;
  background: var(--ground-raised);
  color: var(--ink-muted);
  min-width: 9.5rem;
}
.badge .small { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-whisper); }
.badge .big { font-size: 1rem; color: var(--ink); }

/* ============================================================================
   LANDING — hero
   The aesthetic risk: 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 mark breathes at candle speed. Sacred, not software.
   ============================================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  text-align: center;
  overflow: hidden;
  color: #EDE7DB;

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

  background:
    radial-gradient(135% 78% at 50% 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-content {
  position: relative;
  z-index: 2;
  padding: 8rem 1.5rem 6rem;
  width: 100%;
  max-width: 44rem;
  animation: rise var(--slow) var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.hero-markwrap {
  position: relative;
  width: clamp(112px, 22vw, 168px);
  margin: 0 auto clamp(2rem, 5vh, 3rem);
  aspect-ratio: 1;
}
/* candle halo behind the mark — breathes at candle speed */
.hero-halo {
  position: absolute;
  inset: -55%;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(217,160,92,0.42) 0%,
    rgba(217,160,92,0.16) 34%,
    transparent 66%);
  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-markwrap .mark {
  position: relative;
  z-index: 1;
  width: 100%;
  filter: drop-shadow(0 6px 26px rgba(0,0,0,0.35));
}

.hero .eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #C7A876;
  margin-bottom: 1.4rem;
}
.hero h1 {
  font-size: clamp(2.7rem, 7.5vw, 4.6rem);
  font-weight: 300;
  letter-spacing: 0.015em;
  color: #F7F2E9;
  margin-bottom: 1.3rem;
}
.hero .definition {
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  line-height: 1.62;
  color: #E4DCCB;
  margin: 0 auto 1.5rem;
  max-width: 32ch;
}
.hero .definition .word { color: #E8B877; font-style: italic; }
.hero .promise { font-size: 1.02rem; color: #B9AF9C; max-width: 34ch; margin: 0 auto; }
.hero .comingsoon {
  margin-top: 2.6rem;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9C927E;
}

/* scroll cue */
.scrollcue {
  position: absolute;
  left: 50%;
  bottom: 1.7rem;
  transform: translateX(-50%);
  z-index: 2;
  color: #8C8371;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  animation: cue 3.2s ease-in-out infinite;
}
.scrollcue span { display: block; width: 1px; height: 26px; background: linear-gradient(#8C8371, transparent); }
@keyframes cue {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 1; }
}

/* ============================================================================
   LANDING — sections
   ============================================================================ */
.section { padding-block: clamp(4.5rem, 12vh, 8.5rem); }
.section + .section { border-top: 1px solid var(--hairline-soft); }
.section-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 1.1rem;
}
.section h2 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); font-weight: 300; margin-bottom: 1.2rem; }
.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); margin-top: 1.1rem; max-width: 52ch; }
.center { text-align: center; margin-inline: auto; }
.center .lede, .center .body { margin-inline: auto; }

/* six ways to pray — a quiet litany */
.ways {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--hairline-soft);
  border: 1px solid var(--hairline-soft);
  border-radius: 18px;
  overflow: hidden;
}
.way { background: var(--ground-raised); padding: clamp(1.6rem, 4vw, 2.4rem) 1.25rem; text-align: center; }
.way .name { font-size: 1.28rem; font-weight: 300; letter-spacing: 0.01em; }
.way .whisper { font-size: 0.9rem; color: var(--ink-whisper); margin-top: 0.4rem; }
.ways-note {
  margin-top: 1.7rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 1.04rem;
  max-width: 54ch;
  margin-inline: auto;
}

/* the room / candle — dark reverent band regardless of theme */
.room {
  position: relative;
  color: #EDE7DB;
  background:
    radial-gradient(120% 90% at 50% 118%, rgba(217,160,92,0.26), transparent 60%),
    linear-gradient(180deg, #101218 0%, #14161C 60%, #0E1015 100%);
  overflow: hidden;
}
.room .section-eyebrow { color: #E0A863; }
.room h2 { color: #F5F0E6; }
.room .lede { color: #CFC6B4; }
.room .body { color: #ADA491; }
.room-candle { width: clamp(88px, 16vw, 128px); margin: 0 auto clamp(1.8rem, 5vh, 2.6rem); position: relative; }
.room-candle .halo {
  position: absolute;
  inset: -60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,160,92,0.40) 0%, rgba(217,160,92,0.12) 38%, transparent 68%);
  animation: breathe 7.5s ease-in-out infinite;
  z-index: 0;
}
.room-candle .mark { position: relative; z-index: 1; color: #EDE7DB; width: 100%; }

/* book of days */
.days-figure {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: var(--ground-raised);
  padding: clamp(1.75rem, 5vw, 2.75rem);
  display: grid;
  gap: 1rem;
  max-width: 40rem;
}
.day-entry {
  padding: 1.05rem 1.2rem;
  border-radius: 12px;
  background: var(--ground);
  border: 1px solid var(--hairline-soft);
}
.day-entry .date {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 0.35rem;
}
.day-entry .line { font-size: 1.06rem; line-height: 1.5; color: var(--ink); font-style: italic; }

/* privacy stance */
.promises {
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}
.promise-card { border-top: 2px solid var(--ember-soft); padding-top: 1.1rem; }
.promise-card h3 { font-size: 1.16rem; font-weight: 400; margin-bottom: 0.5rem; }
.promise-card p { color: var(--ink-muted); font-size: 1rem; }

/* closing */
.closing { text-align: center; }
.closing .mark { width: 54px; margin: 0 auto 1.75rem; color: var(--ink); }
.closing h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.closing .lede { margin-inline: auto; }

/* ============================================================================
   DOCUMENT PAGES (privacy.html, terms.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 {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ember);
  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-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-whisper); 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; }

/* ============================================================================
   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-content { opacity: 1; transform: none; }
  .hero-halo, .room-candle .halo { opacity: 0.5; }
  .scrollcue { opacity: 0.7; }
}
