/* Roadster Starman — mission-control / deep-space observatory
   Distinct from sticky-nav + stacked-cards meme templates */

:root {
  --void: #030712;
  --void-2: #0a1224;
  --panel: rgba(8, 16, 36, 0.72);
  --cyan: #5ce1ff;
  --cyan-dim: #2a8fad;
  --cherry: #e11d2e;
  --cherry-glow: rgba(225, 29, 46, 0.35);
  --text: #e8eef8;
  --muted: #8b9bb8;
  --line: rgba(92, 225, 255, 0.18);
  --font: "Space Grotesk", system-ui, sans-serif;
  --display: "Orbitron", "Space Grotesk", sans-serif;
  --rail-w: 3.25rem;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--void);
  line-height: 1.55;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.font-mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* Fixed aspect boxes — never stretch */
.frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--void-2);
  margin: 0;
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  inset: 0;
}
.ar-16x9 { aspect-ratio: 16 / 9; }
.ar-1x1 { aspect-ratio: 1 / 1; }
.frame figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: var(--text);
  z-index: 1;
}

/* ===== Cosmos parallax ===== */
.cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 70% 20%, rgba(30, 60, 120, 0.35), transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(120, 20, 40, 0.18), transparent 55%),
    var(--void);
}
.stars {
  position: absolute;
  inset: -10%;
  background-repeat: repeat;
  opacity: 0.7;
  will-change: transform;
}
.stars-far {
  background-image: radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 80px 120px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 160px 60px, #fff, transparent),
    radial-gradient(1px 1px at 240px 180px, rgba(255,255,255,0.5), transparent);
  background-size: 280px 220px;
  opacity: 0.45;
}
.stars-mid {
  background-image: radial-gradient(1.5px 1.5px at 40px 70px, #cfefff, transparent),
    radial-gradient(1px 1px at 140px 40px, #fff, transparent),
    radial-gradient(2px 2px at 200px 160px, rgba(92,225,255,0.8), transparent);
  background-size: 320px 260px;
  opacity: 0.55;
  animation: twinkle 8s ease-in-out infinite alternate;
}
.stars-near {
  background-image: radial-gradient(2px 2px at 60px 90px, #fff, transparent),
    radial-gradient(1px 1px at 180px 40px, #5ce1ff, transparent),
    radial-gradient(1.5px 1.5px at 100px 200px, #fff, transparent);
  background-size: 360px 300px;
  opacity: 0.35;
}
.earth-drift {
  position: absolute;
  right: -8%;
  bottom: 8%;
  width: min(52vw, 520px);
  opacity: 0.28;
  filter: blur(0.5px);
  animation: earth-drift 48s linear infinite;
}
.earth-drift img {
  width: 100%;
  height: auto;
  border-radius: 50%;
  aspect-ratio: 1;
  object-fit: cover;
}

@keyframes twinkle {
  from { opacity: 0.4; }
  to { opacity: 0.7; }
}
@keyframes earth-drift {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to { transform: translate3d(-4%, -6%, 0) rotate(12deg); }
}

/* ===== Mission rail (left, fixed — not a sticky top nav) ===== */
.mission-rail {
  position: fixed;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 0.35rem;
  border-radius: 999px;
  background: rgba(3, 7, 18, 0.65);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.rail-dot {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-family: var(--display);
  color: var(--muted);
  border: 1px solid transparent;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.rail-dot:hover,
.rail-dot.active {
  color: var(--cyan);
  border-color: var(--cyan-dim);
  background: rgba(92, 225, 255, 0.08);
  text-decoration: none;
}

/* Status strip — scrolls away */
.status-strip {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.7rem 1.25rem 0.7rem calc(var(--rail-w) + 1.5rem);
  border-bottom: 1px solid var(--line);
  background: rgba(3, 7, 18, 0.55);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.status-left { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); }
.status-center { color: var(--cyan-dim); }
.status-right a { color: var(--text); }
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

main {
  position: relative;
  z-index: 10;
  padding-left: calc(var(--rail-w) + 0.75rem);
}

/* ===== Observatory hero ===== */
.observatory {
  min-height: calc(100vh - 3rem);
  display: flex;
  align-items: center;
  padding: 2rem 1.25rem 3rem;
}
.obs-grid {
  width: min(var(--max), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2rem 2.5rem;
  align-items: center;
}
.obs-canopy {
  position: relative;
}
.roadster-stage {
  position: relative;
  aspect-ratio: 1;
  max-width: 520px;
  margin: 0 auto;
}
.roadster-float {
  width: 100%;
  height: 100%;
  animation: bob 7s ease-in-out infinite;
  filter: drop-shadow(0 0 40px var(--cherry-glow));
}
.roadster-float img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  aspect-ratio: 1;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}
.dont-panic {
  position: absolute;
  right: 4%;
  bottom: 6%;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(0.7rem, 1.6vw, 0.95rem);
  letter-spacing: 0.28em;
  color: rgba(92, 225, 255, 0.55);
  border: 1px solid rgba(92, 225, 255, 0.25);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  background: rgba(3, 7, 18, 0.5);
  user-select: none;
  opacity: 0.7;
  transition: opacity 0.25s, color 0.25s;
}
.dont-panic:hover { opacity: 1; color: var(--cyan); }

.obs-hud .hud-label {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--cyan-dim);
  margin: 0 0 0.75rem;
}
.obs-hud h1 {
  font-family: var(--display);
  font-size: clamp(1.85rem, 4.5vw, 3.1rem);
  line-height: 1.1;
  margin: 0 0 0.35rem;
  font-weight: 700;
}
.cyan { color: var(--cyan); }
.ticker {
  font-family: var(--display);
  color: var(--cherry);
  letter-spacing: 0.18em;
  font-size: 1.05rem;
  margin: 0 0 0.85rem;
}
.tagline {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 36ch;
  margin: 0 0 1.25rem;
}

.ca-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(92, 225, 255, 0.04);
  margin-bottom: 1.15rem;
}
.ca-label { color: var(--muted); font-size: 0.85rem; }
.ca-value {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
}
.copy-btn {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
}
.copy-btn:hover { background: rgba(92, 225, 255, 0.1); }
.copy-btn.copied { border-color: #22c55e; color: #22c55e; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}
.cta-row.center { justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.15rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, #e11d2e, #9f1239);
  color: #fff;
  box-shadow: 0 0 24px var(--cherry-glow);
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn.ghost:hover { border-color: var(--cyan-dim); color: var(--cyan); }

.telemetry {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: var(--panel);
  backdrop-filter: blur(6px);
}
.tele-note {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tele-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.tele-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.tele-k { font-size: 0.65rem; letter-spacing: 0.1em; color: var(--cyan-dim); }
.tele-v { font-size: 1.05rem; color: var(--cyan); font-weight: 600; }
.tele-u { font-size: 0.7rem; color: var(--muted); }

/* ===== Panels ===== */
.panel {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 4rem 1.25rem;
}
.panel-head { margin-bottom: 1.75rem; }
.panel-code {
  display: block;
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--cyan-dim);
  margin-bottom: 0.4rem;
}
.panel-head h2 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0;
}

.mission-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.mission-copy p { color: var(--muted); margin: 0 0 0.9rem; }
.mission-copy .highlight {
  color: var(--text);
  border-left: 3px solid var(--cherry);
  padding-left: 0.85rem;
}
.mission-bullets {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}
.mission-bullets li { margin-bottom: 0.35rem; }
.mission-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
.gallery-mosaic .g-wide {
  grid-column: 1 / -1;
  aspect-ratio: 21 / 7;
}

.tok-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.5rem;
  align-items: stretch;
}
.tok-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.tok-card {
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.tok-k { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tok-v { font-family: var(--display); font-size: 1.05rem; }
.tok-v.muted { color: var(--muted); font-family: var(--font); font-size: 0.95rem; }
.tok-note { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; }

.dock-steps {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}
.dock-steps li {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.dock-steps li:last-child { border-bottom: 0; }
.step-n {
  font-family: var(--display);
  color: var(--cyan);
  font-size: 1.1rem;
}
.dock-steps h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.dock-steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.orbits {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}
.orbits::before {
  content: "";
  position: absolute;
  left: 1.55rem;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 2px;
  background: linear-gradient(var(--cyan-dim), transparent);
  opacity: 0.5;
}
.orbit {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.orbit-ring {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 2px solid var(--cyan-dim);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 0.75rem;
  color: var(--cyan);
  background: var(--void);
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(92, 225, 255, 0.08);
}
.orbit h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.orbit p { margin: 0; color: var(--muted); }

.faq-list { display: flex; flex-direction: column; gap: 0.55rem; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 0;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 1rem 1.15rem;
  font-weight: 600;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--cyan);
  font-weight: 400;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  margin: 0;
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
}
.faq-item code {
  font-size: 0.85em;
  color: var(--cyan);
}

.comm-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: center;
}
.comm-copy p { color: var(--muted); font-size: 1.05rem; }

.site-footer {
  position: relative;
  z-index: 10;
  margin-top: 2rem;
  padding: 2.5rem 1.25rem 3rem calc(var(--rail-w) + 1.5rem);
  border-top: 1px solid var(--line);
  background: rgba(3, 7, 18, 0.85);
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  max-width: var(--max);
}
.footer-brand img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  aspect-ratio: 1;
}
.footer-brand strong { display: block; }
.footer-brand span { color: var(--muted); font-size: 0.85rem; }
.disclaimer {
  max-width: var(--max);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 1rem;
}
.footer-meta {
  max-width: var(--max);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .obs-grid,
  .mission-layout,
  .tok-layout,
  .comm-layout {
    grid-template-columns: 1fr;
  }
  .gallery-mosaic { grid-template-columns: 1fr 1fr; }
  .gallery-mosaic .g-wide { aspect-ratio: 16 / 7; }
  .tele-grid { grid-template-columns: 1fr; }
  .roadster-stage { max-width: 380px; }
}

@media (max-width: 640px) {
  :root { --rail-w: 0px; }
  .mission-rail {
    left: 0; right: 0; top: auto; bottom: 0;
    transform: none;
    flex-direction: row;
    justify-content: space-around;
    border-radius: 14px 14px 0 0;
    padding: 0.45rem 0.35rem calc(0.45rem + env(safe-area-inset-bottom));
  }
  .rail-dot { width: 2rem; height: 2rem; font-size: 0.55rem; }
  main { padding-left: 0; padding-bottom: 4.5rem; }
  .status-strip { padding-left: 1rem; }
  .site-footer { padding-left: 1.25rem; padding-bottom: 5rem; }
  .gallery-mosaic { grid-template-columns: 1fr; }
  .mission-secondary { grid-template-columns: 1fr; }
  .tok-cards { grid-template-columns: 1fr; }
  .dock-steps li { grid-template-columns: 2.5rem 1fr; }
  .orbits::before { left: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .stars-mid,
  .earth-drift,
  .roadster-float,
  .pulse-dot {
    animation: none !important;
  }
}


/* CA copy boxes — clickable, wrap long addresses */
.ca-box {
  cursor: pointer;
}
.ca-box:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.ca-value {
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
}
.ca-box.compact {
  margin: 0.35rem 0 0;
  padding: 0.5rem 0.65rem;
}
.ca-inline {
  display: inline;
  overflow-wrap: anywhere;
  word-break: break-all;
  color: var(--cyan);
  font-size: 0.85em;
}
.tok-ca .tok-v { display: none; }
