:root {
  --bg: #04050c;
  --ink: #f3f0e8;
  --muted: #a9a8b8;
  --accent: #ffd36b;
  --cyan: #7cf3ff;
  --panel: rgba(8, 10, 24, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 120%, #14143a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}

#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ---------- The Moon stage ---------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.moon-wrap {
  --x: 0vw; --y: 40vh; --s: 0.5;
  width: min(80vmin, 760px);
  aspect-ratio: 1;
  transform: translate(var(--x), var(--y)) scale(var(--s));
  will-change: transform;
}

.moon {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 60px rgba(255, 244, 214, 0.25));
}

/* ---------- Chrome ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 48px);
  background: linear-gradient(var(--bg), transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.progress {
  width: min(180px, 30vw);
  height: 3px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- Chapters ---------- */

main { position: relative; z-index: 2; }

.chapter {
  min-height: 160vh;
  display: flex;
  align-items: center;
  padding: 0 clamp(16px, 5vw, 80px);
}
.chapter.tall { min-height: 220vh; }
.hero { min-height: 120vh; }

.panel {
  position: sticky;
  top: 18vh;
  max-width: 460px;
  padding: clamp(22px, 3vw, 36px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.panel.in { opacity: 1; transform: none; }
.panel.wide { max-width: 560px; }
.panel.left { margin-right: auto; }
.panel.right { margin-left: auto; }
.panel.center {
  margin: 0 auto;
  text-align: center;
  background: none;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  max-width: 900px;
}
.hero .panel { top: 22vh; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.08; margin: 0 0 16px; }
h1 { font-size: clamp(42px, 8vw, 104px); letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 4vw, 46px); letter-spacing: -0.01em; }
h3 { font-size: 20px; margin-bottom: 8px; }
h1 em, h2 em { font-style: italic; font-weight: 300; color: var(--accent); }

p { margin: 0 0 14px; }
strong { color: var(--ink); }
.panel p, .panel li { color: #d9d7e2; }

.lede { font-size: clamp(18px, 2.2vw, 24px); color: var(--muted); max-width: 640px; margin-inline: auto; }

.scroll-hint {
  margin-top: 40px;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.scroll-hint span {
  width: 2px; height: 46px;
  background: linear-gradient(var(--accent), transparent);
  animation: drip 1.8s ease-in-out infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

.spec { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.spec li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.spec span { display: block; font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--cyan); }
.spec b { color: var(--ink); }

.big-stat { margin: 6px 0 18px; }
.big-stat b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(52px, 8vw, 92px);
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.big-stat span { color: var(--muted); }

.tiers { display: grid; gap: 12px; margin-top: 18px; }
.tiers article {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}
.tiers article.best { border-color: var(--accent); background: rgba(255, 211, 107, 0.08); }
.tiers p { margin: 0 0 6px; font-size: 16px; }
.tier-num { font-size: 22px !important; color: var(--ink) !important; }
.tier-num b { color: var(--accent); font-family: var(--serif); font-size: 30px; }
.tier-foot { color: var(--cyan) !important; font-size: 14px !important; margin: 0 !important; }

.calc { display: grid; gap: 14px; }
.calc label { display: grid; gap: 4px; font-size: 15px; color: var(--muted); }
.calc output { float: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.calc input[type="range"] { width: 100%; accent-color: var(--accent); }

.results {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0 12px;
}
.results div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.results dt { font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--cyan); }
.results dd { margin: 2px 0 0; font-family: var(--serif); font-size: 22px; color: var(--accent); font-variant-numeric: tabular-nums; }

.fine { font-size: 13px; color: var(--muted) !important; }

.roadmap { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.roadmap li {
  counter-increment: step;
  position: relative;
  padding: 10px 0 10px 48px;
  border-bottom: 1px solid var(--line);
}
.roadmap li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 10px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 14px;
}
.roadmap b { color: var(--ink); }

/* One screen: Moon in the top third, message and footer stacked at the bottom. */
.finale { flex-direction: column; justify-content: flex-end; min-height: 100vh; }
.finale .panel { position: relative; top: 0; margin-top: 0; padding-block: 0 8px; }
.finale-title, .finale .lede { text-shadow: 0 2px 24px rgba(4, 5, 12, 0.9); }
.finale-title { font-size: clamp(34px, min(6.5vw, 8vh), 84px); margin-bottom: 10px; }
.finale .lede { margin-bottom: 0; }

.cta {
  margin-top: 18px;
  font: 700 17px var(--sans);
  color: #1a1404;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 16px 32px;
  cursor: pointer;
  box-shadow: 0 0 40px rgba(255, 211, 107, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 0 60px rgba(255, 211, 107, 0.7); }
.cta:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }

footer {
  position: relative;
  z-index: 2;
  padding: 12px 0 20px;
  text-align: center;
  color: var(--muted);
  max-width: 720px;
}

/* ---------- Small screens: the Moon sits behind the text ---------- */

@media (max-width: 820px) {
  body { font-size: 16px; }
  /* Panels scroll past instead of sticking, leaving gaps where the Moon shows through. */
  .panel, .panel.wide { position: relative; top: 0; max-width: none; margin-inline: 0; }
  .hero .panel { top: 0; margin-top: -30vh; }
  .panel.center { padding-inline: 0; }
  .results dd { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .panel { transition: none; opacity: 1; transform: none; }
  .scroll-hint span { animation: none; }
}
