:root {
  --bg: #030510;
  --bg-2: #070b1a;
  --panel: rgba(13, 18, 38, 0.72);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #e9edf6;
  --muted: #99a3ba;
  --accent: #ffb454;
  --accent-soft: rgba(255, 180, 84, 0.55);
  --accent-2: #6ea8ff;
  --accent-2-soft: rgba(110, 168, 255, 0.5);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
}

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

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(ellipse 900px 500px at 85% -5%, rgba(110, 168, 255, 0.14), transparent 60%),
    radial-gradient(ellipse 700px 500px at 10% 15%, rgba(140, 90, 255, 0.10), transparent 60%),
    radial-gradient(ellipse 800px 600px at 50% 110%, rgba(255, 140, 60, 0.07), transparent 60%),
    linear-gradient(var(--bg), var(--bg-2));
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
}

::selection { background: rgba(255, 180, 84, 0.35); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

/* ---------- Sky: stars + shooting stars ---------- */
.sky { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.stars { position: absolute; top: 0; left: 0; width: 1px; height: 1px; border-radius: 50%; }
#stars-1 { animation: twinkle 3.5s ease-in-out infinite alternate; }
#stars-2 { animation: twinkle 5.5s ease-in-out 0.8s infinite alternate; }
#stars-3 { animation: twinkle 7.5s ease-in-out 1.6s infinite alternate; }
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 1; } }

.shooting {
  position: absolute;
  top: 12%;
  right: 8%;
  width: 140px;
  height: 1.5px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));
  transform: rotate(-33deg) translateX(0);
  opacity: 0;
  animation: shoot 11s linear infinite;
}
.shooting.alt { top: 4%; right: 55%; animation-delay: 6s; animation-duration: 14s; }
@keyframes shoot {
  0%, 90% { opacity: 0; transform: rotate(-33deg) translateX(0); }
  91% { opacity: 1; }
  100% { opacity: 0; transform: rotate(-33deg) translateX(-70vw); }
}

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

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Header ---------- */
.header { text-align: center; margin-bottom: 3rem; position: relative; }
.header::before {
  content: "";
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  height: 340px;
  background: radial-gradient(closest-side, rgba(255, 180, 84, 0.16), transparent);
  filter: blur(24px);
  pointer-events: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.9rem;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 2px var(--accent-soft);
  animation: blink 2.2s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

h1 {
  font-size: clamp(2.8rem, 9vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background: linear-gradient(110deg, #ffffff 15%, #ffd9a0 38%, #6ea8ff 62%, #ffffff 85%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 9s linear infinite;
}
@keyframes sheen { to { background-position: -250% 0; } }

.subtitle { color: var(--muted); margin-top: 0.6rem; font-size: 1.05rem; }

/* ---------- Cards ---------- */
.card {
  position: relative;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  margin-bottom: 1.6rem;
  background:
    linear-gradient(165deg, rgba(16, 22, 46, 0.85), rgba(7, 10, 24, 0.85)) padding-box,
    linear-gradient(165deg, rgba(110, 168, 255, 0.45), rgba(110, 168, 255, 0.08) 35%, rgba(255, 180, 84, 0.3)) border-box;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55); }

.label {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.8rem;
}

/* ---------- Distance ---------- */
.distance-card { text-align: center; }
.big-number {
  font-family: var(--mono);
  font-size: clamp(2rem, 7vw, 3.9rem);
  font-weight: 700;
  color: #ffc46b;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-shadow: 0 0 34px rgba(255, 180, 84, 0.4), 0 0 90px rgba(255, 180, 84, 0.15);
}
.unit { color: var(--muted); margin-bottom: 1.6rem; }

.secondary-stats {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 5vw, 3.2rem);
  flex-wrap: wrap;
  margin-bottom: 1.9rem;
}
.secondary-stats div { display: flex; flex-direction: column; }
.secondary-stats span {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.secondary-stats small { color: var(--muted); font-size: 0.74rem; margin-top: 3px; letter-spacing: 0.04em; }

/* ---------- Progress ---------- */
.progress-block { text-align: left; }
.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
#progress-pct { font-family: var(--mono); color: var(--text); }
.progress-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}
.progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), #fff1dc, var(--accent), var(--accent-2));
  background-size: 200% 100%;
  animation: sheen 3.2s linear infinite;
  transition: width 0.5s ease;
}
.progress-fill::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 14px 4px rgba(255, 205, 130, 0.85);
}

/* ---------- Countdown ---------- */
.countdown-card { text-align: center; }
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 3vw, 1.3rem);
  flex-wrap: wrap;
  margin: 1.1rem 0 1.4rem;
}
.unit-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 4.8rem;
  padding: 1rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)) padding-box,
    linear-gradient(170deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04)) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 26px rgba(0, 0, 0, 0.35);
}
.unit-box:nth-child(4) { animation: pulse-border 2s ease-in-out infinite; }
@keyframes pulse-border {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 26px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(255, 180, 84, 0); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 26px rgba(0, 0, 0, 0.35), 0 0 18px 2px rgba(255, 180, 84, 0.35); }
}
.unit-num {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 5vw, 2.5rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.unit-name { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.milestone-date { color: var(--muted); font-size: 0.9rem; }
.milestone-date time { color: var(--accent-2); font-weight: 500; }

.crossed .unit-num { color: var(--accent); text-shadow: 0 0 24px var(--accent-soft); }

/* ---------- Facts row ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2.2rem 0 0;
}
.fact {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.035);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.fact:hover { transform: translateY(-3px); border-color: rgba(110, 168, 255, 0.4); }
.fact-num {
  display: block;
  font-family: var(--mono);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  color: var(--accent-2);
}
.fact-label { font-size: 0.74rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { margin: 4rem 0; }
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: 0.5rem;
}
.section-title::after {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  border-radius: 99px;
  margin: 0.7rem auto 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px var(--accent-soft);
}
.section-intro {
  color: var(--muted);
  text-align: center;
  max-width: 62ch;
  margin: 1.2rem auto 2.4rem;
  font-size: 0.95rem;
}

/* Spacecraft hero figure */
.craft-figure {
  position: relative;
  margin: 0 0 2.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(165deg, rgba(16, 22, 46, 0.9), rgba(7, 10, 24, 0.9)) padding-box,
    linear-gradient(165deg, rgba(110, 168, 255, 0.5), rgba(255, 180, 84, 0.25)) border-box;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(110, 168, 255, 0.08);
}
.craft-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: cover;
  transition: transform 0.8s ease;
}
.craft-figure:hover img { transform: scale(1.03); }
.craft-figure figcaption {
  padding: 1rem 1.3rem 1.15rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  background: linear-gradient(180deg, rgba(10, 14, 30, 0.4), rgba(10, 14, 30, 0.9));
}
.craft-figure figcaption strong { color: var(--text); }

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  position: relative;
  margin: 0 0 0 6px;
  padding-left: 30px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  opacity: 0.55;
}
.timeline li { position: relative; padding-bottom: 2rem; transition: transform 0.25s ease; }
.timeline li:hover { transform: translateX(5px); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -36.5px;
  top: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 180, 84, 0.14), 0 0 12px rgba(255, 180, 84, 0.65);
}
.timeline li:last-child::before {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(110, 168, 255, 0.16), 0 0 12px rgba(110, 168, 255, 0.7);
}
.t-date { font-family: var(--mono); font-size: 0.82rem; color: var(--accent-2); letter-spacing: 0.04em; }
.timeline h3 { font-size: 1.08rem; margin: 0.15rem 0 0.3rem; }
.timeline p { color: var(--muted); font-size: 0.92rem; max-width: 64ch; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.3rem;
}
.photo {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(10, 14, 30, 0.8);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.photo:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 180, 84, 0.35);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}
.photo.wide { grid-column: 1 / -1; }
.photo img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.6s ease;
  filter: saturate(1.05);
}
.photo.wide img { height: 340px; }
.photo:hover img { transform: scale(1.05); filter: saturate(1.2); }
.photo figcaption {
  padding: 0.95rem 1.15rem 1.05rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.55;
}
.photo figcaption strong { color: var(--text); }
.credit {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  color: var(--accent-2);
  opacity: 0.8;
}

/* ---------- Did you know ---------- */
.know {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.know-card {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.3rem;
  background: rgba(255, 255, 255, 0.035);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.know-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 180, 84, 0.35);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}
.know-card h3 { font-size: 1rem; margin-bottom: 0.45rem; color: var(--accent); }
.know-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.6; }

/* ---------- Footer ---------- */
.footer {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  max-width: 640px;
  margin: 3rem auto 0;
  line-height: 1.7;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 1.6rem;
}
.credits { margin-bottom: 0.75rem; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Lightbox ---------- */
.photo img, .craft-figure img { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(2, 4, 10, 0.93);
  backdrop-filter: blur(10px);
  animation: lb-fade 0.25s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }

.lb-stage {
  max-width: min(1100px, 92vw);
  text-align: center;
  animation: lb-zoom 0.25s ease;
}
@keyframes lb-zoom { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

#lb-img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 50px rgba(110, 168, 255, 0.08);
}
#lb-cap {
  margin: 1.1rem auto 0;
  max-width: 72ch;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}
#lb-cap strong { color: var(--text); }

.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 180, 84, 0.5); transform: scale(1.07); }
.lb-btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.lb-close { top: 1.2rem; right: 1.2rem; }
.lb-prev { left: clamp(0.6rem, 3vw, 2rem); top: 50%; transform: translateY(-50%); }
.lb-next { right: clamp(0.6rem, 3vw, 2rem); top: 50%; transform: translateY(-50%); }
.lb-prev:hover { transform: translateY(-50%) scale(1.07); }
.lb-next:hover { transform: translateY(-50%) scale(1.07); }

@media (max-width: 640px) {
  .lb-btn { width: 40px; height: 40px; font-size: 1.3rem; }
  #lb-img { max-height: 62vh; }
}
