/* Gold in the Void: the tokens in apps/mobile/src/theme/tokens.ts. */

@font-face { font-family: 'Cinzel'; src: url('/fonts/cinzel-400.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('/fonts/cinzel-600.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-400.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-400-italic.woff') format('woff'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('/fonts/cormorant-500-italic.woff') format('woff'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope-400.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope-600.woff') format('woff'); font-weight: 600; font-display: swap; }

:root {
  --void: #07060f;
  --nebula: #15112e;
  --veil: #2a2352;
  --starlight: #eee9ff;
  --mist: #a49cc8;
  --gold: #f2b544;
  --gold-glow: rgba(242, 181, 68, 0.35);
  --sunstar: #fbf1dc;
  --violet: #7b5cff;

  --title: 'Cinzel', 'Times New Roman', serif;
  --oracle: 'Cormorant Garamond', Georgia, serif;
  --ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --breath: 5s;
  color-scheme: dark;
}

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

html { background: var(--void); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--starlight);
  font: 400 1rem/1.65 var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--starlight); text-decoration-color: var(--veil); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--mist); }
a:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 2px; }

/* The sky behind every page, drawn on one canvas by sky.js. */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.page { position: relative; z-index: 1; }

/* ——— Landing ——— */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 72px 16px 56px;
  gap: 18px;
}

.mark {
  width: min(42vw, 196px);
  aspect-ratio: 1;
  position: relative;
  margin-bottom: 12px;
}
.mark-glow { position: absolute; inset: -45%; pointer-events: none; transition: opacity 1.6s ease; }
.mark-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(242, 181, 68, 0.2) 0%, rgba(242, 181, 68, 0.06) 45%, transparent 70%);
  animation: glow var(--breath) ease-in-out infinite alternate;
}
.mark svg { position: relative; width: 100%; height: 100%; animation: breathe var(--breath) ease-in-out infinite alternate; }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.04); } }
@keyframes glow { from { opacity: 0.55; } to { opacity: 1; } }

/*
 * The homepage intro (sky.js): shooting stars link constellations, the last one lands on the
 * mark's guiding star and the mark draws itself; then the words arrive. `intro` is set before
 * first paint; `drawing` once sky.js has the mark; `formed` when it is whole (or after 9 s,
 * so the words never stay hidden).
 */
.intro:not(.drawing):not(.formed) .mark svg { opacity: 0; }
.intro:not(.formed) .mark svg { animation: none; }
.intro:not(.formed) .mark-glow { opacity: 0; }
.intro .hero > :not(.mark) { transition: opacity 1.2s ease, transform 1.2s ease; }
.intro:not(.formed) .hero > :not(.mark) { opacity: 0; transform: translateY(10px); }
.intro .hero > .proverb { transition-delay: 0.25s; }
.intro .hero > .meaning { transition-delay: 0.4s; }
.intro .hero > .tagline { transition-delay: 0.8s; }
.intro .hero > .soon { transition-delay: 1.1s; }

.wordmark {
  margin: 0;
  font: 400 clamp(2.2rem, 9vw, 3.6rem) / 1.1 var(--title);
  letter-spacing: 0.32em;
  padding-left: 0.32em; /* letter-spacing trails the last letter; keep the word centred */
}

.proverb {
  margin: 0;
  font: italic 500 clamp(1.35rem, 5vw, 1.75rem) / 1.3 var(--oracle);
  color: var(--gold);
}
.meaning { margin: -8px 0 0; color: var(--mist); font-size: 0.95rem; }

.tagline {
  margin: 28px 0 0;
  max-width: 32ch;
  text-wrap: balance;
  font: 400 clamp(1.3rem, 4.6vw, 1.6rem) / 1.4 var(--oracle);
}

.soon {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border: 1px solid var(--veil);
  border-radius: 999px;
  background: rgba(21, 17, 46, 0.7);
  color: var(--mist);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.soon .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold-glow); animation: glow var(--breath) ease-in-out infinite alternate; }

.pillars {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 88px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.pillar {
  padding: 28px 24px;
  border: 1px solid var(--veil);
  border-radius: 24px;
  background: rgba(21, 17, 46, 0.72);
}
.pillar h2 {
  margin: 14px 0 8px;
  font: 400 1.05rem/1.3 var(--title);
  letter-spacing: 0.08em;
}
.pillar p { margin: 0; color: var(--mist); }
.pillar svg { display: block; }

.closing {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 96px;
  text-align: center;
}
.closing p { margin: 0; font: italic 400 clamp(1.25rem, 4.4vw, 1.5rem) / 1.45 var(--oracle); color: var(--starlight); text-wrap: balance; }

footer {
  border-top: 1px solid var(--veil);
  padding: 28px 16px 40px;
  text-align: center;
  color: var(--mist);
  font-size: 0.85rem;
}
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-bottom: 10px; }
footer a { color: var(--mist); }
footer p { margin: 0; }

/* ——— Policy pages ——— */

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 80px;
}
.doc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; text-decoration: none; }
.doc-head svg { width: 36px; height: 36px; }
.doc-head span { font: 400 1rem/1 var(--title); letter-spacing: 0.3em; color: var(--starlight); }
.doc h1 { margin: 0 0 6px; font: 400 clamp(1.7rem, 6vw, 2.3rem) / 1.2 var(--title); letter-spacing: 0.04em; }
.doc .updated { margin: 0 0 32px; color: var(--mist); font-size: 0.9rem; }
.doc .lede { font: 400 1.3rem/1.5 var(--oracle); margin: 0 0 32px; }
.doc h2 { margin: 40px 0 10px; font: 600 1.05rem/1.4 var(--ui); color: var(--gold); letter-spacing: 0.01em; }
.doc p, .doc li { color: var(--starlight); }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--mist); }
.doc .card {
  padding: 18px 20px;
  border: 1px solid var(--veil);
  border-radius: 18px;
  background: rgba(21, 17, 46, 0.72);
}
.doc strong { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .mark svg, .mark-glow::before, .soon .dot { animation: none; }
}
