:root {
  --zone-0: #0A1424;   /* low orbit: earthlight */
  --zone-1: #060B18;   /* translunar */
  --zone-2: #05060F;   /* interplanetary */
  --zone-3: #010208;   /* interstellar */
  --starlight: #DCE6F5;
  --lumen-cyan: #5EEAD4;
  --lumen-violet: #8B8AF0;
  --sol: #F0B45C;
  --ink-high: #E8EEF5;
  --ink-low: #7C8899;
  --hairline: rgba(94, 234, 212, 0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--zone-0);
  color: var(--ink-high);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: rgba(94,234,212,0.25); }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--lumen-cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

#stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Faint nebula wash, fades in mid-journey via JS */
#nebula {
  position: fixed;
  inset: -12%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse 55% 40% at 78% 30%, rgba(139,138,240,0.10), transparent 70%),
    radial-gradient(ellipse 45% 35% at 18% 68%, rgba(94,234,212,0.06), transparent 70%);
  transition: opacity 0.6s linear;
  animation: nebulaDrift 46s ease-in-out infinite alternate;
}
@keyframes nebulaDrift {
  from { transform: translate3d(-2%, -1.5%, 0) scale(1); }
  to   { transform: translate3d(2%, 1.5%, 0) scale(1.06); }
}

/* Earth's limb: a curved atmospheric glow across the top, recedes as you leave orbit */
#limb {
  position: fixed;
  top: -46vw;
  left: 50%;
  transform: translateX(-50%);
  width: 160vw;
  height: 50vw;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 100%, rgba(96,165,250,0.22), rgba(94,234,212,0.08) 40%, transparent 68%);
  filter: blur(6px);
  pointer-events: none;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  color: var(--lumen-cyan);
  opacity: 0;
  animation: rise 0.9s ease 0.2s forwards;
}

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0.75rem 0 1.5rem;
  opacity: 0;
  animation: rise 0.9s ease 0.35s forwards;
}

.thesis {
  max-width: 34rem;
  color: var(--ink-low);
  font-size: 1.1875rem;
  opacity: 0;
  animation: rise 0.9s ease 0.55s forwards;
}

.begin {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 3.5rem;
  color: var(--lumen-cyan);
  text-decoration: none;
  width: fit-content;
  opacity: 0;
  animation: rise 0.9s ease 0.8s forwards;
}
.begin .arrow { display: inline-block; animation: bob 2.6s ease-in-out infinite; }
.begin:hover { text-shadow: 0 0 18px rgba(94,234,212,0.55); }

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ---------- Waypoints ---------- */
.log { padding-bottom: 6rem; }

.discovery {
  padding: 11vh 0;
  max-width: 620px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.discovery.seen { opacity: 1; transform: translateY(0); }
.discovery:nth-child(even) { margin-left: auto; }
.discovery:nth-child(odd) { margin-left: 4%; }

.meta {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
  position: relative;
  padding-bottom: 0.7rem;
}
.meta::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, var(--lumen-cyan), transparent 70%);
  opacity: 0.35;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}
.discovery.seen .meta::after { transform: scaleX(1); }
.distlabel { color: var(--lumen-cyan); }
.tag { color: var(--ink-low); }

.discovery h2 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.discovery h2 a {
  color: var(--ink-high);
  text-decoration: none;
  transition: text-shadow 0.2s ease;
}
.discovery h2 a:hover { text-shadow: 0 0 22px rgba(94,234,212,0.6); }

.discovery p {
  color: var(--ink-low);
  margin: 0.8rem 0 1.4rem;
  max-width: 30rem;
}

.visit {
  color: var(--lumen-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
}
.visit .a { transition: transform 0.2s ease; display: inline-block; }
.visit:hover .a { transform: translateX(4px); }

/* ---------- Studio statement ---------- */
.statement {
  padding: 22vh 0 18vh;
  max-width: 620px;
}
.marker {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--sol);
  box-shadow: 0 0 22px 5px rgba(240,180,92,0.45), 0 0 60px 18px rgba(240,180,92,0.12);
  margin-bottom: 2.2rem;
}
.statement h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.35;
  margin-bottom: 1.4rem;
}
.statement p { color: var(--ink-low); max-width: 32rem; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--hairline);
  padding: 2.2rem 0 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--ink-low);
}
footer a { color: var(--ink-low); text-decoration: none; }
footer a:hover { color: var(--lumen-cyan); }

/* ---------- Mission gauge ---------- */
.gauge {
  position: fixed;
  right: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}
.readout {
  writing-mode: vertical-rl;
  color: var(--lumen-cyan);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  opacity: 0.9;
  min-height: 9.5em;
}
.rail {
  position: relative;
  width: 1px;
  height: 42vh;
  background: var(--hairline);
}
.rail::before {
  content: "";
  position: absolute;
  left: 50%; top: 0;
  width: 1px;
  height: calc(var(--p, 0) * 100%);
  transform: translateX(-50%);
  background: var(--lumen-cyan);
  box-shadow: 0 0 8px rgba(94,234,212,0.7);
}
.node {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 15px; height: 15px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.node::after {
  content: "";
  position: absolute;
  inset: 4.5px;
  border-radius: 50%;
  background: var(--ink-low);
  transition: background 0.3s, box-shadow 0.3s;
}
.node.lit::after {
  background: var(--lumen-cyan);
  box-shadow: 0 0 10px 2px rgba(94,234,212,0.55);
}

@media (max-width: 820px) {
  .gauge {
    right: auto; top: auto; transform: none;
    left: 0; bottom: 0; width: 100%;
    flex-direction: row;
    justify-content: center;
    padding: 0.6rem 1rem;
    background: linear-gradient(transparent, rgba(1,2,8,0.85));
    backdrop-filter: blur(6px);
  }
  .readout { writing-mode: horizontal-tb; min-height: 0; min-width: 11em; text-align: center; }
  .rail { display: none; }
  .discovery:nth-child(odd), .discovery:nth-child(even) { margin-left: 0; }
  .discovery { padding: 9vh 0; }
  #limb { width: 260vw; top: -78vw; height: 84vw; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .eyebrow, h1, .thesis, .begin { animation: none; opacity: 1; }
  .begin .arrow { animation: none; }
  #nebula { animation: none; }
  .meta::after { transition: none; }
  .discovery { transition: opacity 0.4s ease; transform: none; }
}
