/* Dark tokens mirror the Astral app's theme (astral-fable src/ui/frontend/src/App.css). */
:root {
  --bg-deep: #0f0b18;
  --bg-card: #1a1424;
  --bg-elevated: #241b33;
  --border: #2c1b47;
  --border-subtle: #1f1530;
  --text-primary: #e8e4f0;
  --text-secondary: #9a8fb8;
  --text-muted: #6b6280;
  --accent-gold: #d4a843;
  --accent-gold-hover: #e0b854;
  --accent-text: #d4a843;
  --accent-text-hover: #e0b854;
  --accent-warm: #d4a843;
  --grade-x: #a78bfa;
  --error-text: #f08a94;
  --glow: rgba(60, 44, 110, 0.45);
  --btn-fg: #0f0b18;
  --heading: #e8e4f0;
  --eyebrow: #d4a843;
  --pill-bg: transparent;
  --pill-border: #2c1b47;
  --pill-text: #d4a843;
  --btn-bg: #d4a843;
  --btn-bg-hover: #e0b854;
  --step-on: #28a745;
  --step-on-glow: rgba(40, 167, 69, 0.45);
  --step-off: #43355f;
  color-scheme: dark;
}

:root {
  --radius: 14px;
  --maxw: 1080px;
}

/* Light theme: the app's light palette (astral-fable dev, App.css [data-theme="light"], AST-2042).
   Set by theme.js from the saved choice or the system setting. */
:root[data-theme="light"] {
  --bg-deep: #f5f3fa;
  --bg-card: #ffffff;
  --bg-elevated: #ece8f4;
  --border: #d6cfe6;
  --border-subtle: #e6e1ef;
  --text-primary: #1f1830;
  --text-secondary: #5a5070;
  --text-muted: #857b99;
  --accent-gold: #241b33;        /* app --accent-contrast: fills use it too */
  --accent-gold-hover: #2c1b47;
  --accent-text: #5205cb;        /* "Career Match" violet from the light logo */
  --accent-text-hover: #3f049e;
  --accent-warm: #9a5c00;        /* deep amber, a nod to the logo's stars */
  --grade-x: #7048e8;
  --error-text: #c82333;
  --glow: rgba(31, 24, 48, 0.04);
  --btn-fg: #ffffff;
  --btn-bg: #5205cb;             /* logo violet CTAs */
  --btn-bg-hover: #3f049e;
  --heading: #2a036b;            /* deep purple from the logo's "Astral" lettering */
  --eyebrow: #5205cb;
  --pill-bg: #fde8c8;            /* logo star's pale gold */
  --pill-border: #f3d6a6;
  --pill-text: #2a036b;
  --step-on: #1e7e34;
  --step-on-glow: rgba(30, 126, 52, 0.2);
  --step-off: #d6cfe6;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-text-hover); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* --- Sky: layered starfield behind the hero --- */
.sky {
  position: relative;
  color: var(--text-primary);
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 70% 0%, rgba(60, 44, 110, 0.55), transparent 70%),
    radial-gradient(ellipse 60% 50% at 10% 20%, rgba(44, 27, 71, 0.6), transparent 70%),
    var(--bg-deep);
}
.sky::before,
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: repeat;
}
.sky::before {
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff8, transparent),
    radial-gradient(1px 1px at 120px 80px, #fff6, transparent),
    radial-gradient(1.5px 1.5px at 200px 150px, #fffa, transparent),
    radial-gradient(1px 1px at 260px 40px, #fff5, transparent),
    radial-gradient(1px 1px at 330px 210px, #fff7, transparent),
    radial-gradient(1px 1px at 70px 260px, #fff4, transparent);
  background-size: 360px 300px;
  opacity: 0.7;
}
.sky::after {
  background-image:
    radial-gradient(2px 2px at 90px 120px, #d4a84399, transparent),
    radial-gradient(1.5px 1.5px at 410px 60px, #a78bfa88, transparent),
    radial-gradient(1px 1px at 300px 330px, #fff9, transparent);
  background-size: 520px 420px;
  animation: twinkle 7s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) { .sky::after { animation: none; } }

/* --- Nav --- */
.nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.brand { display: block; line-height: 0; }
.brand img { height: 56px; width: auto; display: block; }
.nav-links { display: flex; gap: 22px; align-items: center; font-size: 15px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; }
.nav-links a:hover { color: var(--text-primary); }
.nav-links .btn { color: var(--btn-fg); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--btn-bg-hover); color: var(--btn-fg); transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* --- Hero --- */
.hero {
  position: relative;
  z-index: 1;
  padding: 72px 0 110px;
  max-width: 760px;
}
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--eyebrow);
  margin-bottom: 18px;
}
h1 {
  font-size: clamp(38px, 6.2vw, 64px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  font-weight: 700;
}
h1, h2, h3 { color: var(--heading); }
h1 em { font-style: normal; color: var(--accent-text); }
.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--text-secondary); margin: 0 0 34px; max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* --- Sections --- */
section { padding: 96px 0; }
section + section { border-top: 1px solid var(--border-subtle); }
h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
}
.section-lede { color: var(--text-secondary); max-width: 640px; margin: 0 0 48px; }

/* How it works — numbered steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.step {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 26px 28px;
}
/* Vertical progress dots: steps done so far lit, the rest dimmed. */
.dots { display: flex; flex-direction: column; gap: 7px; padding-top: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--step-off); }
.dots i.on { background: var(--step-on); box-shadow: 0 0 8px var(--step-on-glow); }
.step h3 { margin: 0 0 6px; font-size: 20px; }
.step p { margin: 0; color: var(--text-secondary); }

/* The three-question fit check */
/* The three fit questions, nested in step 3. */
.fit {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0 4px;
}
/* Each question is an inset block, styled like the FAQ question list but sunk into the step card. */
.fit > div {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.fit dt { font-size: 18px; font-weight: 600; color: var(--text-primary); margin: 0 0 6px; }
.fit dt strong { color: var(--accent-text); font-weight: 700; letter-spacing: 0.06em; }
.fit dd { margin: 0; font-size: 15px; color: var(--text-secondary); }
.step p + p { margin-top: 10px; }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 40px; }
.principle h3 { margin: 0 0 6px; font-size: 19px; }
.principle p { margin: 0; color: var(--text-secondary); }
.principle h3::before { content: "✦ "; color: var(--accent-warm); }

/* About / founder */
.founder { display: grid; grid-template-columns: 150px 1fr; gap: 40px; align-items: center; }
/* Full portrait; its own transparent background and bottom fade blend into either theme. */
.founder-photo { width: 150px; height: auto; display: block; }
.founder h2 { margin-bottom: 12px; }
.founder p { margin: 0; font-size: 19px; color: var(--text-secondary); max-width: 640px; }

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--border-subtle);
  padding: 20px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-text); font-weight: 400; font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--text-secondary); margin: 12px 0 0; max-width: 760px; }

/* CTA / form */
.cta {
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, var(--glow), transparent 70%),
    var(--bg-deep);
}
.cta-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.scarcity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--pill-text);
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 18px;
}
.cta-note { margin: 14px 0 0; font-size: 14px; color: var(--text-muted); max-width: 640px; }
.scarcity::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-warm); box-shadow: 0 0 10px var(--accent-warm); }
form.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  display: grid;
  gap: 18px;
}
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
label .opt { font-weight: 400; color: var(--text-muted); }
input, textarea {
  font: inherit;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
}
textarea { min-height: 110px; resize: vertical; }

/* Single-choice pills (radio inputs styled as chips) */
.choices { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row label { display: block; font-weight: 500; color: var(--text-primary); }
.choice-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-row span {
  display: inline-block;
  padding: 7px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-deep);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.choice-row span:hover { border-color: var(--accent-text); }
.choice-row input:checked + span { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-fg); }
.choice-row input:focus-visible + span { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
input:focus, textarea:focus { outline: 2px solid var(--accent-gold); outline-offset: 1px; border-color: transparent; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fineprint { font-size: 13px; color: var(--text-muted); margin: 0; }
.form-msg { margin: 0; font-size: 15px; }
.form-msg.err { color: var(--error-text); }
.thanks { text-align: center; padding: 20px 6px; }
.thanks h3 { font-size: 24px; margin: 0 0 8px; }
.thanks p { color: var(--text-secondary); margin: 0; }

/* Footer */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 34px 0 48px;
  color: var(--text-muted);
  font-size: 14px;
}
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--text-secondary); }

/* Prose page (privacy) */
.prose { max-width: 720px; padding: 40px 0 96px; }
.prose h1 { font-size: clamp(34px, 5vw, 48px); }
.prose h2 { font-size: 24px; margin-top: 40px; }
.prose p, .prose li { color: var(--text-secondary); }
.notice {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-gold);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 24px 0 32px;
}
.notice p { margin: 0; color: var(--text-primary); }

/* --- Responsive --- */
@media (max-width: 820px) {
  .fit, .principles, .cta-grid, .founder { grid-template-columns: 1fr; }
  .founder { gap: 20px; }
  .founder-photo { width: 120px; }
  .cta-grid { gap: 32px; }
  section { padding: 72px 0; }
  .hero { padding: 48px 0 80px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .nav-links a:not(.btn) { display: none; }
  .step { gap: 16px; padding: 22px; }
  form.card { padding: 22px; }
}

/* FAQ page */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px 24px 20px 44px;
  margin: 8px 0 24px;
}
.toc ol { margin: 0; padding: 0; display: grid; gap: 8px; }
.toc li::marker { color: var(--accent-warm); }
.toc a { color: var(--text-primary); text-decoration: none; }
.toc a:hover { color: var(--accent-text); }
.faq-page h2 { scroll-margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.faq-more { margin-top: 28px; }

/* Light-theme header: flat like the app, with only a whisper of stars. */
[data-theme="light"] .sky { background: var(--bg-deep); }
[data-theme="light"] .sky::before { filter: invert(1); opacity: 0.12; }
[data-theme="light"] .sky::after { display: none; }

/* Logo per theme */
.brand .logo-light { display: none; }
[data-theme="light"] .brand .logo-dark { display: none; }
[data-theme="light"] .brand .logo-light { display: block; }

/* Theme toggle: shows the theme you'd switch to */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover { color: var(--text-primary); background: var(--bg-elevated); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Open vs. waitlist wording: the server stamps data-mode on <html> from ASTRAL_SITE_MODE. */
[data-mode="waitlist"] .when-open { display: none !important; }
html:not([data-mode="waitlist"]) .when-waitlist { display: none !important; }
