/* Zonk — Celestial web theme.
   Tokens mirror the in-app Celestial design system (Lucid/Components/ZonkComponents.swift):
   night-sky gradient, cool-white ink (#e9ecff), gold accent (#f2c062),
   Instrument Serif / Newsreader / Archivo type. */

:root {
  color-scheme: dark;

  /* Night sky */
  --bg-0: #070b1c;
  --bg-1: #0c1430;
  --bg-2: #0a1024;
  --glow: rgba(60, 80, 150, 0.40);   /* atmospheric radial at the horizon */

  /* Ink */
  --text: #e9ecff;
  --muted: rgba(233, 236, 255, 0.58);
  --read: rgba(233, 236, 255, 0.74); /* long-form legal body */
  --line: rgba(233, 236, 255, 0.12);
  --card: rgba(233, 236, 255, 0.05);

  /* Accents */
  --gold: #f2c062;
  --warm-gold: #f6dca0;
  --green: #7fd6a8;

  /* Type */
  --serif-display: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --serif-body: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --sans-label: "Archivo", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background-color: var(--bg-2);
  background-image:
    radial-gradient(120% 60% at 50% -5%, var(--glow), transparent 50%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 60%, var(--bg-2) 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  font-family: var(--serif-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Star field — concentrated in the top strip, masked to fade downward,
   echoing CelestialStarField's top-of-screen placement in the app. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
  background-image:
    radial-gradient(1.6px 1.6px at 8% 9%, rgba(255,255,255,0.95), transparent 60%),
    radial-gradient(1.2px 1.2px at 17% 22%, rgba(255,255,255,0.65), transparent 60%),
    radial-gradient(1px 1px   at 24% 6%,  rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1.4px 1.4px at 31% 30%, rgba(255,255,255,0.80), transparent 60%),
    radial-gradient(1px 1px   at 38% 14%, rgba(255,255,255,0.50), transparent 60%),
    radial-gradient(1.8px 1.8px at 45% 25%, rgba(246,220,160,0.85), transparent 60%),
    radial-gradient(1px 1px   at 52% 8%,  rgba(255,255,255,0.60), transparent 60%),
    radial-gradient(1.3px 1.3px at 59% 19%, rgba(255,255,255,0.75), transparent 60%),
    radial-gradient(1px 1px   at 66% 33%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 72% 11%, rgba(255,255,255,0.85), transparent 60%),
    radial-gradient(1px 1px   at 79% 27%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 86% 16%, rgba(255,255,255,0.70), transparent 60%),
    radial-gradient(1.6px 1.6px at 93% 31%, rgba(255,255,255,0.80), transparent 60%),
    radial-gradient(1px 1px   at 13% 38%, rgba(255,255,255,0.40), transparent 60%),
    radial-gradient(1px 1px   at 49% 40%, rgba(255,255,255,0.42), transparent 60%),
    radial-gradient(1.1px 1.1px at 88% 42%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1.3px 1.3px at 3% 24%, rgba(255,255,255,0.60), transparent 60%),
    radial-gradient(1px 1px   at 97% 7%,  rgba(255,255,255,0.55), transparent 60%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 30%, transparent 58%);
  mask-image: linear-gradient(180deg, #000 0%, #000 30%, transparent 58%);
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.7; }
  to   { opacity: 1; }
}

a {
  color: var(--gold);
  text-decoration-color: rgba(242, 192, 98, 0.4);
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--warm-gold);
  text-decoration-color: var(--warm-gold);
}

::selection {
  background: rgba(242, 192, 98, 0.28);
  color: #fff;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(100% - 40px, 760px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 26px;
  padding: 26px 0;
  font: 600 12px/1.2 var(--sans-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--gold);
}

/* The first nav item on legal pages is the wordmark / home link */
.nav .home {
  margin-right: auto;
  color: var(--text);
  font-family: var(--serif-display);
  font-size: 22px;
  letter-spacing: 0;
  text-transform: none;
}

.hero {
  margin: 0;
  padding: 16px 0 0;
}

.icon {
  display: block;
  width: 92px;
  height: 92px;
  border-radius: 22px;
  margin-bottom: 30px;
  border: 1px solid rgba(233, 236, 255, 0.14);
  box-shadow:
    0 18px 60px -14px rgba(242, 192, 98, 0.40),
    0 10px 34px rgba(0, 0, 0, 0.55);
}

.kicker,
.updated,
.footer {
  margin: 0;
  color: var(--muted);
  font: 600 12px/1.5 var(--sans-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.kicker {
  color: var(--gold);
}

h1 {
  margin: 14px 0 20px;
  max-width: 680px;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(54px, 12vw, 108px);
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 .em {
  font-style: italic;
  color: var(--gold);
}

.lede {
  max-width: 520px;
  margin: 0;
  color: var(--read);
  font-family: var(--serif-body);
  font-size: 23px;
  line-height: 1.4;
}

.lede strong {
  color: var(--warm-gold);
  font-weight: 600;
}

.app-store-badge {
  display: block;
  width: 180px;
  height: 60px;
  margin-top: 28px;
  text-decoration: none;
}

.app-store-badge img {
  display: block;
  width: 180px;
  height: 60px;
}

.app-store-badge:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
  border-radius: 8px;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: auto;
  padding: 28px 0 32px;
  border-top: 1px solid var(--line);
  text-transform: none;
  letter-spacing: 0.02em;
}

.footer > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.footer small {
  max-width: 470px;
  color: var(--muted);
  font: 400 10px/1.4 var(--sans-label);
  letter-spacing: 0;
  text-transform: none;
}

.footer a {
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.footer a:hover {
  color: var(--read);
}

/* Three-pillar feature row — celestial cards (mirrors zonkCard surface/border). */
.features {
  list-style: none;
  margin: 38px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 720px;
}

.features li {
  padding: 20px 18px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}

.features .ficon {
  display: block;
  width: 26px;
  height: 26px;
  margin-bottom: 14px;
  color: var(--gold);
}

.features h3 {
  margin: 0 0 7px;
  font: 600 12px/1.3 var(--sans-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm-gold);
}

.features li p {
  margin: 0;
  font-family: var(--serif-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--muted);
}

/* How-it-works steps + closing CTA */
.section-title {
  margin: 0 0 26px;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
}

.how {
  margin-top: 64px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
}

.steps li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-n {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 15px/1 var(--sans-label);
  color: var(--gold);
  background: rgba(242, 192, 98, 0.10);
  border: 1px solid rgba(242, 192, 98, 0.30);
}

.steps h3 {
  margin: 3px 0 5px;
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

.steps li p {
  margin: 0;
  font-family: var(--serif-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

/* (Closing CTA intentionally omitted until launch.) */

/* ── Legal pages ───────────────────────────────────────────── */

.legal {
  display: block;
  padding-bottom: 72px;
}

article {
  max-width: 680px;
  padding: 56px 0 0;
}

article h1 {
  font-size: clamp(40px, 8vw, 72px);
  margin-bottom: 8px;
}

h2 {
  margin: 44px 0 12px;
  font: 600 13px/1.3 var(--sans-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--warm-gold);
}

article p {
  margin: 0 0 14px;
  color: var(--read);
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.65;
}

article .updated {
  margin-bottom: 8px;
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 28px, 760px);
  }

  .nav {
    gap: 18px;
  }

  .hero {
    padding: 8px 0 0;
  }

  .how {
    margin-top: 44px;
  }

  .lede {
    font-size: 20px;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 30px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  article p {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }
}
