/* ---------------------------------------------------------------
   Hugo Fawkes Rathbun — base styles
   Mobile-first, dark cosmic theme. Phoenix amber + cosmic violet.
   --------------------------------------------------------------- */

:root {
  /* color — faded vintage dark, slight warm purple tint */
  --void: #14111a;
  --void-2: #1c1824;
  --ink: #ede4cf;
  --ink-soft: #b8aea0;
  --ink-mute: #847b6d;
  --rule: rgba(237, 228, 207, 0.09);
  --rule-strong: rgba(237, 228, 207, 0.20);

  --ember: #ff8c42;
  --ember-soft: #ffb37a;
  --ember-deep: #c45a1d;
  --gold: #ffd28e;
  --cosmic: #8b7bff;
  --cosmic-deep: #5a4ec8;
  --rose: #ff6b8a;

  /* retro NASA */
  --nasa-red: #fc3d21;
  --nasa-blue: #105bd8;
  --nasa-cream: #f7f0e0;
  --nasa-phosphor: #6dffb0;

  /* type */
  --font-display: "VT323", "JetBrains Mono", ui-monospace, monospace;
  --font-pixel: "Press Start 2P", "VT323", monospace;
  --font-cinematic: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* layout */
  --measure: 38rem;
  --measure-wide: 56rem;
  --gap: clamp(1rem, 4vw, 2rem);
  --gap-lg: clamp(2rem, 8vw, 5rem);

  /* radius */
  --r-sm: 0.5rem;
  --r-md: 0.875rem;
  --r-lg: 1.5rem;

  /* shadow / glow */
  --glow-ember: 0 0 80px -10px rgba(255, 140, 66, 0.55);
  --glow-cosmic: 0 0 80px -10px rgba(139, 123, 255, 0.5);
}

/* ---------- reset-ish ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11", "kern";
  min-height: 100dvh;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--ember-soft);
  text-decoration-color: rgba(255, 140, 66, 0.4);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover, a:focus-visible { color: var(--gold); text-decoration-color: var(--gold); }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: rgba(255, 140, 66, 0.35);
  color: var(--ink);
}

/* ---------- starfield + blueprint grid + scanlines (retro layers) ---------- */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 13% 22%, rgba(255, 255, 255, 0.55), transparent 50%),
    radial-gradient(1px 1px at 28% 71%, rgba(255, 255, 255, 0.45), transparent 50%),
    radial-gradient(1px 1px at 47% 12%, rgba(255, 255, 255, 0.35), transparent 50%),
    radial-gradient(1px 1px at 64% 81%, rgba(255, 255, 255, 0.5), transparent 50%),
    radial-gradient(1px 1px at 79% 33%, rgba(255, 255, 255, 0.4), transparent 50%),
    radial-gradient(1px 1px at 92% 58%, rgba(255, 255, 255, 0.35), transparent 50%),
    radial-gradient(2px 2px at 20% 88%, rgba(255, 210, 142, 0.6), transparent 50%),
    radial-gradient(2px 2px at 88% 14%, rgba(139, 123, 255, 0.5), transparent 50%),
    radial-gradient(circle at 50% -10%, rgba(139, 123, 255, 0.10), transparent 60%),
    radial-gradient(circle at 50% 110%, rgba(255, 140, 66, 0.07), transparent 60%),
    var(--void);
  background-attachment: fixed;
}
/* blueprint grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(247, 240, 224, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 240, 224, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(247, 240, 224, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 240, 224, 0.012) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
}
/* CRT scanlines */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.10) 2px,
    rgba(0, 0, 0, 0.10) 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}
@media (prefers-reduced-motion: reduce) {
  body::after { opacity: 0.3; }
}

/* ---------- mission control bar (sticky, every page) ---------- */
.mission-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem clamp(0.75rem, 3vw, 1.25rem);
  background: var(--nasa-red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 6px 20px -8px rgba(252, 61, 33, 0.45);
}
.mission-bar__id { justify-self: start; white-space: nowrap; }
.mission-bar__center {
  justify-self: center;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}
#mission-tplus { font-weight: 700; padding-left: 0.2em; }
.mission-bar__status {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  white-space: nowrap;
}
.mission-bar__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px #fff;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.85); }
}
@media (max-width: 600px) {
  .mission-bar {
    grid-template-columns: 1fr 1fr;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
  }
  .mission-bar__center { display: none; }
}
@media (prefers-reduced-motion: reduce) { .mission-bar__dot { animation: none; } }

/* ---------- header / nav ---------- */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem var(--gap);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 30px; /* sit below mission bar */
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 7, 13, 0.72);
}
@media (min-width: 720px) { .site-header { top: 32px; } }

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}
.site-logo__patch {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(252, 61, 33, 0.4));
}
.site-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.site-logo__sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--nasa-red);
  margin-bottom: 0.25rem;
}
.site-logo__main {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 36, "SOFT" 50;
  color: var(--ink);
}
.site-logo:hover .site-logo__main { color: var(--gold); }
.site-logo:hover .site-logo__sub { color: var(--ember); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.1rem;
  font-size: 0.875rem;
}
.site-nav__link {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.4rem 0.25rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.site-nav__link:hover, .site-nav__link.is-active {
  color: var(--ink);
  border-bottom-color: var(--ember);
}

@media (min-width: 720px) {
  .site-header {
    flex-direction: row;
    justify-content: space-between;
    padding: 1.25rem clamp(1.5rem, 4vw, 3rem);
  }
  .site-logo { font-size: 1.15rem; }
  .site-nav { font-size: 0.95rem; gap: 0 1.5rem; }
}

/* ---------- main wrapper ---------- */
.site-main {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: var(--gap-lg) var(--gap) var(--gap-lg);
}

/* ---------- hero (homepage) ---------- */
.hero--home {
  text-align: center;
  padding: clamp(2rem, 8vw, 4rem) 0 clamp(2.5rem, 10vw, 5rem);
  position: relative;
}

/* cinematic hero image (homepage) */
.hero__cinematic {
  position: relative;
  margin: 0 auto clamp(1.5rem, 5vw, 3rem);
  width: 100%;
  max-width: 1100px;
  border-radius: 4px;
  overflow: visible;
  box-shadow:
    0 0 0 1px rgba(252, 61, 33, 0.35),
    0 30px 80px -20px rgba(139, 123, 255, 0.4),
    0 0 100px -20px rgba(255, 140, 66, 0.35);
  isolation: isolate;
}
/* NASA viewfinder corner brackets */
.hero__cinematic::before,
.hero__cinematic::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid var(--nasa-red);
  z-index: 3;
  pointer-events: none;
}
.hero__cinematic::before {
  top: -8px;
  left: -8px;
  border-right: none;
  border-bottom: none;
}
.hero__cinematic::after {
  bottom: -8px;
  right: -8px;
  border-left: none;
  border-top: none;
}
.hero__cinematic-img {
  border-radius: 4px;
}
.hero__cinematic-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 853;
  object-fit: cover;
  animation: hero-fade 1.2s ease-out;
}
.hero__cinematic-glow {
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(circle at 25% 60%, rgba(255, 140, 66, 0.5), transparent 60%),
    radial-gradient(circle at 80% 40%, rgba(139, 123, 255, 0.45), transparent 60%);
  filter: blur(30px);
  opacity: 0.7;
  animation: cinematic-pulse 8s ease-in-out infinite;
}
@keyframes hero-fade {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes cinematic-pulse {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__cinematic-img, .hero__cinematic-glow { animation: none; }
}

.hero__astronaut {
  position: relative;
  width: clamp(180px, 38vw, 280px);
  margin: 0 auto 1.5rem;
  aspect-ratio: 636 / 853;
}
.hero__astronaut-img {
  position: relative;
  width: 100%;
  height: auto;
  z-index: 2;
  image-rendering: pixelated;
  filter: drop-shadow(0 25px 35px rgba(255, 140, 66, 0.35)) drop-shadow(0 0 60px rgba(139, 123, 255, 0.25));
  animation: float 6s ease-in-out infinite;
}
.hero__astronaut-orbit {
  position: absolute;
  inset: -10% -10% -2% -10%;
  border-radius: 50%;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 140, 66, 0.20), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(139, 123, 255, 0.15), transparent 70%);
  filter: blur(20px);
  animation: pulse 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__astronaut-img, .hero__astronaut-orbit { animation: none; }
}

.hero__eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 14, "SOFT" 80;
  font-weight: 400;
  font-size: clamp(1.05rem, 2.5vw, 1.4rem);
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  margin: 0 0 0.8rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-size: clamp(3rem, 14vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--ink);
}
.hero__title-line {
  display: block;
}
.hero__title-line--accent {
  color: var(--ember);
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  text-shadow: 0 0 60px rgba(255, 140, 66, 0.5);
}

.hero__lede {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 24, "SOFT" 60;
  font-weight: 400;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: var(--ink-soft);
  max-width: 36rem;
  margin: 1.5rem auto 0;
  line-height: 1.45;
}
.hero__lede strong {
  color: var(--ink);
  font-weight: 500;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  max-width: 36rem;
  margin: 2rem auto 0;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem 0.95rem;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--nasa-red);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(252, 61, 33, 0.05), rgba(255, 255, 255, 0));
  text-align: left;
  position: relative;
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--nasa-red);
  font-weight: 600;
}
.stat__value {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  font-variation-settings: "opsz" 24, "SOFT" 30;
}

@media (min-width: 600px) {
  .hero__stats { grid-template-columns: repeat(4, 1fr); }
}

.hero__intro {
  max-width: 32rem;
  margin: 2.5rem auto 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.65;
}

.hero__age {
  margin: 2.5rem auto 0;
  max-width: 38rem;
  text-align: center;
}
.hero__age-label {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 14;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 0.85rem;
  letter-spacing: 0.01em;
}
.hero__age-counter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.age-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.85rem 0.4rem;
  border: 1px solid rgba(109, 255, 176, 0.18);
  border-top: 2px solid var(--nasa-phosphor);
  border-radius: 3px;
  background:
    repeating-linear-gradient(180deg, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(109, 255, 176, 0.04) 2px, rgba(109, 255, 176, 0.04) 3px),
    linear-gradient(180deg, rgba(109, 255, 176, 0.04), rgba(0, 0, 0, 0));
  position: relative;
  overflow: hidden;
}
.age-unit__num {
  font-family: var(--font-mono);
  font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  font-weight: 500;
  color: var(--nasa-phosphor);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 8px rgba(109, 255, 176, 0.6), 0 0 16px rgba(109, 255, 176, 0.25);
}
.age-unit__label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--nasa-phosphor);
  opacity: 0.7;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.age-unit:last-child .age-unit__num {
  animation: tick 1s ease-in-out infinite;
}
@keyframes tick {
  0%, 80%, 100% { opacity: 1; }
  90% { opacity: 0.5; }
}
@media (prefers-reduced-motion: reduce) {
  .age-unit:last-child .age-unit__num { animation: none; }
}

/* ---------- chapters grid ---------- */
.chapters {
  margin-top: clamp(3rem, 10vw, 5rem);
  padding-top: clamp(2rem, 6vw, 3rem);
  border-top: 1px solid var(--rule);
}
.chapters__title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--nasa-red);
  margin: 0 0 1.5rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  position: relative;
  padding-bottom: 1rem;
}
.chapters__title::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: var(--nasa-red);
  margin: 0.85rem auto 0;
}

.chapters__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 720px) {
  .chapters__grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}

.chapter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "code code code"
    "num title arrow"
    "num desc arrow";
  gap: 0.25rem 1rem;
  padding: 1.5rem 1.4rem 1.5rem 1.4rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--nasa-red);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0));
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.chapter::before {
  content: attr(data-mission);
  grid-area: code;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nasa-red);
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed rgba(252, 61, 33, 0.22);
  line-height: 1.6;
}
.chapter:hover, .chapter:focus-visible {
  transform: translateY(-2px);
  border-color: var(--rule-strong);
  border-left-color: var(--nasa-red);
  background: linear-gradient(180deg, rgba(252, 61, 33, 0.05), rgba(255, 140, 66, 0));
  box-shadow: 0 0 50px -10px rgba(252, 61, 33, 0.4);
}
.chapter__num {
  grid-area: num;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--nasa-cream);
  align-self: start;
  padding-top: 0.4em;
  letter-spacing: 0.05em;
  background: var(--nasa-red);
  padding: 0.35rem 0.55rem;
  border-radius: 2px;
  line-height: 1;
}
.chapter__title {
  grid-area: title;
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 36, "SOFT" 30;
  font-size: 1.3rem;
  margin: 0;
  letter-spacing: -0.015em;
}
.chapter__desc {
  grid-area: desc;
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}
.chapter__arrow {
  grid-area: arrow;
  align-self: center;
  color: var(--ink-mute);
  font-size: 1.4rem;
  transition: color 0.2s ease, transform 0.2s ease;
}
.chapter:hover .chapter__arrow { color: var(--ember); transform: translateX(4px); }

.chapter--featured {
  border-color: rgba(255, 140, 66, 0.35);
  background: linear-gradient(180deg, rgba(255, 140, 66, 0.08), rgba(139, 123, 255, 0.04));
  box-shadow: 0 0 0 1px rgba(255, 140, 66, 0.06), 0 30px 80px -40px rgba(255, 140, 66, 0.5);
}
.chapter--featured .chapter__num,
.chapter--featured .chapter__arrow { color: var(--gold); }
@media (min-width: 720px) {
  .chapter--featured { grid-column: 1 / -1; padding: 2rem; }
  .chapter--featured .chapter__title { font-size: 1.65rem; }
}

/* ---------- opening letter ---------- */
.opening-letter {
  margin: clamp(3rem, 10vw, 5rem) auto 0;
  max-width: var(--measure);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(139, 123, 255, 0.06), rgba(255, 140, 66, 0.03));
}
.opening-letter__heading {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 24;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 1rem;
  letter-spacing: 0.01em;
}
.opening-letter__body {
  margin: 0;
  padding: 0;
  border: none;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 18, "SOFT" 70;
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  line-height: 1.55;
  color: var(--ink);
}
.opening-letter__body p { margin: 0 0 1em; }
.opening-letter__body p:last-child {
  margin-bottom: 0;
  color: var(--ember);
  font-style: italic;
}

/* ---------- standard article (single/list pages) ---------- */
.page-article {
  max-width: var(--measure);
  margin: 0 auto;
}

.page-article__header {
  text-align: center;
  margin-bottom: clamp(2.5rem, 7vw, 4rem);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}
.page-article__eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 14;
  color: var(--ink-mute);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}
.page-article__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  font-size: clamp(2.5rem, 9vw, 5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  color: var(--ink);
}
.page-article__subtitle {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 24, "SOFT" 90;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: var(--ink-soft);
  margin: 0;
  max-width: 38rem;
  margin-inline: auto;
  line-height: 1.45;
}

/* ---------- prose ---------- */
.prose {
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  line-height: 1.7;
  color: var(--ink);
}
.prose > * + * { margin-top: 1.2em; }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 48, "SOFT" 30;
  font-size: clamp(1.6rem, 5vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-top: 2.5em;
  margin-bottom: 0.4em;
}
.prose h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 36, "SOFT" 40;
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  line-height: 1.25;
  margin-top: 2em;
  margin-bottom: 0.4em;
  color: var(--ink);
}
.prose h2 + p, .prose h3 + p { margin-top: 0.5em; }
.prose p { margin: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { color: var(--ink); font-style: italic; }
.prose blockquote {
  margin: 2em 0;
  padding: 1em 1.25em;
  border-left: 3px solid var(--ember);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: rgba(255, 140, 66, 0.04);
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 18;
  color: var(--ink);
}
.prose hr {
  border: none;
  height: 1px;
  background: var(--rule);
  margin: 3em auto;
  width: 60%;
}
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.5em; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: rgba(139, 123, 255, 0.10);
  padding: 0.12em 0.4em;
  border-radius: var(--r-sm);
  color: var(--gold);
}
.prose pre {
  font-family: var(--font-mono);
  background: var(--void-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 1em 1.2em;
  overflow-x: auto;
  font-size: 0.88em;
  line-height: 1.55;
}
.prose pre code { background: none; padding: 0; color: var(--ink); }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
  margin: 1.5em 0;
}
.prose th, .prose td {
  padding: 0.6em 0.8em;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}
.prose th { color: var(--ember-soft); font-weight: 600; }

/* ---------- shortcode: astronaut ---------- */
.astronaut {
  margin: 1.5em auto 2em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}
.astronaut img {
  image-rendering: pixelated;
  filter: drop-shadow(0 18px 25px rgba(255, 140, 66, 0.30)) drop-shadow(0 0 40px rgba(139, 123, 255, 0.20));
  animation: float 6s ease-in-out infinite;
}
.astronaut--sm img { width: clamp(80px, 18vw, 120px); height: auto; }
.astronaut--md img { width: clamp(140px, 28vw, 200px); height: auto; }
.astronaut--lg img { width: clamp(180px, 38vw, 260px); height: auto; }
.astronaut__caption {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 14, "SOFT" 80;
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
}
@media (prefers-reduced-motion: reduce) {
  .astronaut img { animation: none; }
}

/* ---------- shortcodes: hero, timeline, hugofact ---------- */
.hero {
  text-align: center;
  margin-bottom: 2.5em;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 40;
  font-size: clamp(2.5rem, 9vw, 5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
.hero h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 24;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin: 0;
  font-weight: 400;
}

.timeline {
  margin: 2.5em 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 1.05rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: linear-gradient(180deg, rgba(139, 123, 255, 0.5), rgba(255, 140, 66, 0.5));
}

.hugofact {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1rem;
  padding: 1.1rem 1.2rem 1.1rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0));
  position: relative;
  margin-left: 2.2rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.hugofact:hover { border-color: var(--rule-strong); }
.hugofact::before {
  content: "";
  position: absolute;
  left: -1.85rem;
  top: 1.4rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 4px rgba(255, 140, 66, 0.18), 0 0 14px rgba(255, 140, 66, 0.7);
}
.hugofact__year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ember-soft);
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding-top: 0.45rem;
  text-align: right;
  min-width: 4rem;
}
.hugofact__body { min-width: 0; }
.hugofact__head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.2em;
}
.hugofact__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 30;
  font-size: 1.15rem;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.hugofact__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cosmic);
  padding: 0.15em 0.5em;
  border: 1px solid rgba(139, 123, 255, 0.3);
  border-radius: 999px;
  background: rgba(139, 123, 255, 0.07);
}
.hugofact__content {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.6;
}
.hugofact__content p { margin: 0; }
.hugofact__content p + p { margin-top: 0.6em; }
.hugofact__content em { color: var(--ink); }
.hugofact__content strong { color: var(--ink); font-weight: 600; }

/* featured (Hugo Rathbun himself) */
.hugofact--featured {
  border-color: rgba(255, 140, 66, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 140, 66, 0.10), rgba(139, 123, 255, 0.05)),
    var(--void-2);
  box-shadow: 0 0 0 1px rgba(255, 140, 66, 0.05), 0 30px 80px -40px rgba(255, 140, 66, 0.6);
  padding: 1.5rem 1.5rem 1.5rem 0.75rem;
}
.hugofact--featured::before {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 210, 142, 0.25), 0 0 22px rgba(255, 210, 142, 0.9);
  width: 0.85rem;
  height: 0.85rem;
  left: -1.95rem;
  top: 1.5rem;
}
.hugofact--featured .hugofact__name {
  font-size: clamp(1.4rem, 4vw, 1.85rem);
  background: linear-gradient(90deg, var(--gold), var(--ember-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hugofact--featured .hugofact__year { color: var(--gold); font-size: 0.85rem; }

@media (min-width: 720px) {
  .timeline::before { left: 7.7rem; }
  .hugofact { grid-template-columns: 6rem 1fr; margin-left: 0; padding-left: 0; }
  .hugofact::before { left: 7.4rem; }
  .hugofact__year {
    text-align: right;
    padding-right: 1rem;
    border-right: none;
    padding-top: 0.5rem;
  }
  .hugofact { padding: 1.25rem 1.5rem; }
  .hugofact--featured::before { left: 7.25rem; }
}

/* ---------- retro NASA: telemetry, cta-link, mission-stripe ---------- */
.telemetry {
  margin: 1.5em 0;
  padding: 0.5rem 1.1rem;
  border: 1px solid rgba(252, 61, 33, 0.35);
  border-left: 4px solid var(--nasa-red);
  border-radius: var(--r-sm);
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0) 31px, rgba(255, 255, 255, 0.03) 31px, rgba(255, 255, 255, 0.03) 32px),
    var(--void-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.telemetry__row {
  display: grid;
  grid-template-columns: minmax(7rem, 35%) 1fr;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed rgba(247, 240, 224, 0.07);
}
.telemetry__row:last-child { border-bottom: none; }
.telemetry__k {
  color: var(--ink-mute);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
}
.telemetry__v {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
  word-break: break-word;
}
.telemetry__v--ok {
  color: var(--nasa-cream);
  background: var(--nasa-red);
  padding: 0.15em 0.6em;
  border-radius: 2px;
  text-align: center;
  justify-self: end;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  font-weight: 600;
  text-transform: uppercase;
}

.cta-link {
  display: inline-block;
  margin: 1.2em 0;
  padding: 0.85rem 1.2rem;
  border: 1px solid var(--nasa-red);
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, rgba(252, 61, 33, 0.08), rgba(252, 61, 33, 0.02));
  color: var(--ink) !important;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none !important;
  transition: background 0.2s ease, transform 0.2s ease;
}
.cta-link:hover, .cta-link:focus-visible {
  background: linear-gradient(180deg, rgba(252, 61, 33, 0.18), rgba(252, 61, 33, 0.05));
  transform: translateY(-1px);
}

.mission-stripe {
  display: flex;
  margin: 1rem auto 1.25rem;
  width: clamp(180px, 50vw, 320px);
  height: 8px;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 0 20px -5px rgba(252, 61, 33, 0.4);
}
.mission-stripe__bar {
  flex: 1;
  height: 100%;
}
.mission-stripe__bar--red { background: var(--nasa-red); }
.mission-stripe__bar--white { background: var(--nasa-cream); }
.mission-stripe__bar--blue { background: var(--nasa-blue); }

/* mission-patch ring around astronaut figures */
.astronaut {
  position: relative;
}
.astronaut::before {
  content: "";
  position: absolute;
  width: clamp(180px, 35vw, 260px);
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  border-radius: 50%;
  border: 1px dashed rgba(252, 61, 33, 0.3);
  box-shadow: inset 0 0 0 6px rgba(247, 240, 224, 0.04), inset 0 0 0 7px rgba(16, 91, 216, 0.18);
  z-index: -1;
  pointer-events: none;
}
.astronaut--sm::before { width: clamp(120px, 22vw, 160px); }
.astronaut--lg::before { width: clamp(220px, 42vw, 320px); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: clamp(3rem, 10vw, 6rem);
  padding: 2.5rem var(--gap) 3rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  color: var(--ink-mute);
  font-size: 0.875rem;
  line-height: 1.7;
}
.site-footer__sprite {
  display: block;
  margin: 0 auto 1rem;
  width: clamp(110px, 22vw, 140px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 16px rgba(255, 107, 138, 0.25));
  animation: float 8s ease-in-out infinite;
}
.site-footer__credit {
  margin: 0.6rem 0 0.4rem;
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 18, "SOFT" 80;
  font-size: 0.95rem;
  color: var(--ink);
}
.site-footer__credit a {
  color: var(--ember);
  text-decoration-color: rgba(255, 140, 66, 0.5);
}
.site-footer__credit a:hover { color: var(--gold); }
@media (prefers-reduced-motion: reduce) {
  .site-footer__sprite { animation: none; }
}
.site-footer__line { margin: 0; }
.site-footer__line a { color: var(--ink-soft); }
.site-footer__meta {
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

/* ---------- sky map (cosmos page) ---------- */
.sky-card {
  margin: 2rem auto;
  border: 1px solid rgba(139, 123, 255, 0.25);
  border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse at top, rgba(139, 123, 255, 0.08), transparent 60%),
    var(--void-2);
  overflow: hidden;
  box-shadow: 0 30px 80px -50px rgba(139, 123, 255, 0.6);
}
.sky-map {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 80vh;
  background: var(--void);
}
.sky-map svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.sky-card__caption {
  margin: 0;
  padding: 1rem 1.25rem 1.25rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
  border-top: 1px solid var(--rule);
  background: rgba(7, 7, 13, 0.55);
}
.sky-card__sub {
  display: block;
  margin-top: 0.4rem;
  color: var(--ink-mute);
  font-size: 0.78rem;
}

/* ---------- planets grid (cosmos page) ---------- */
.planets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin: 2em 0;
}
@media (min-width: 600px) { .planets { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .planets { grid-template-columns: repeat(3, 1fr); } }

.planet {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "glyph name"
    "glyph sign"
    "glyph note";
  gap: 0.05em 0.9rem;
  padding: 0.85rem 1.05rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0));
  align-items: center;
}
.planet__glyph {
  grid-area: glyph;
  font-size: 1.7rem;
  color: var(--gold);
  align-self: center;
  line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Symbol", "Inter", sans-serif;
}
.planet__name {
  grid-area: name;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
}
.planet__sign {
  grid-area: sign;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 24, "SOFT" 30;
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.2;
}
.planet__note {
  grid-area: note;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}
.planet--lucky {
  border-color: rgba(255, 210, 142, 0.3);
  background: linear-gradient(180deg, rgba(255, 210, 142, 0.08), rgba(255, 210, 142, 0.02));
}
.planet--lucky .planet__glyph { color: var(--ember); text-shadow: 0 0 14px rgba(255, 140, 66, 0.5); }

/* ---------- page list (for /posts/ etc.) ---------- */
.page-list {
  list-style: none;
  padding: 0;
  margin: 2em 0 0;
}
.page-list__item {
  padding: 1.2em 0;
  border-bottom: 1px solid var(--rule);
}
.page-list__item a {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}
.page-list__item a:hover { color: var(--ember); }
.page-list__subtitle { color: var(--ink-soft); font-size: 0.95rem; margin: 0.3em 0 0; }
