@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #070c10;
  --bg-soft: rgba(10, 17, 22, .92);
  --bg-elev: #0d151a;
  --panel: #0c1318;
  --panel-strong: #111b21;
  --text: #e7ebe8;
  --text-soft: #a1aca9;
  --muted: #71807e;
  --line: rgba(202, 222, 216, .12);
  --line-strong: rgba(202, 222, 216, .24);
  --accent: #8ac9bf;
  --accent-2: #87aeb8;
  --accent-3: #d4b06a;
  --accent-warm: #c87551;
  --success: #7fc9a8;
  --danger: #d98373;
  --shadow: none;
  --hero-glow: none;
  --card-radius: 12px;
  --pill-radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="light"] {
  --bg: #edf0ed;
  --bg-soft: rgba(237, 240, 237, .94);
  --bg-elev: #f8faf7;
  --panel: #f6f8f5;
  --panel-strong: #fff;
  --text: #15201f;
  --text-soft: #4e5d5a;
  --muted: #6b7774;
  --line: rgba(21, 32, 31, .12);
  --line-strong: rgba(21, 32, 31, .23);
  --accent: #276e66;
  --accent-2: #416f7a;
  --accent-3: #806423;
  --accent-warm: #9d4f32;
  --success: #276e55;
  --danger: #a84839;
}

html { scroll-padding-top: 128px; }
body {
  font-size: 16px;
  background:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
}

body::selection { background: var(--accent); color: var(--bg); }
.stars { opacity: .18; filter: grayscale(1); }

.container { width: min(1220px, calc(100% - 44px)); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
}
.topbar-inner {
  width: min(1440px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { min-width: 275px; gap: 12px; }
.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}
.brand-mark::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid var(--accent);
  border-radius: 50%;
}
.brand-mark::after {
  content: '';
  position: absolute;
  width: 44px;
  height: 15px;
  top: 10px;
  left: -4px;
  border-top: 1px solid var(--accent-3);
  border-radius: 50%;
  transform: rotate(-28deg);
}
.brand-copy h1 {
  font-family: var(--mono);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .12em;
}
.brand-copy p { margin-top: 4px; color: var(--muted); font-size: .72rem; letter-spacing: .02em; }

.nav-actions { margin-left: auto; justify-content: flex-end; gap: 2px; }
.chip, .theme-toggle {
  min-height: 38px;
  padding: 9px 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--text-soft);
  font-size: .8rem;
  font-weight: 500;
}
.chip:hover, .theme-toggle:hover { background: var(--panel-strong); color: var(--text); }
.theme-toggle { margin-left: 6px; border: 1px solid var(--line); }

.mode-dock {
  position: sticky;
  top: 78px;
  z-index: 900;
  padding: 10px 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.mode-dock-inner {
  min-height: 46px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: none;
}
.mode-label { padding-left: 10px; color: var(--muted); font-family: var(--mono); font-size: .65rem; letter-spacing: .12em; }
.mode-button {
  min-height: 34px;
  padding: 7px 13px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-soft);
  box-shadow: none;
  font-size: .8rem;
}
.mode-button.active { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }

.hero { padding: 54px 0 34px; }
.hero-panel {
  overflow: hidden;
  padding: clamp(32px, 5vw, 64px);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    radial-gradient(circle at 82% 28%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 27%),
    var(--panel);
  box-shadow: none;
}
.hero-panel::before { display: none; }
.hero-grid { gap: clamp(40px, 7vw, 90px); }
.hero-grid > * { min-width: 0; }
.hero h2 {
  max-width: 850px;
  margin-top: 20px;
  font-size: clamp(3rem, 6vw, 5.9rem);
  line-height: .96;
  letter-spacing: -.065em;
}
.gradient-text { color: var(--accent); background: none; -webkit-text-fill-color: currentColor; }
.hero p { max-width: 740px; color: var(--text-soft); font-size: 1.05rem; line-height: 1.7; }
.eyebrow, .section-kicker, .stat-label, .tag, .mission-date {
  font-family: var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.eyebrow { width: max-content; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: .66rem; }
.eyebrow .dot { width: 16px; height: 1px; border-radius: 0; background: var(--accent); box-shadow: none; }
.hero-actions { gap: 8px; margin-top: 28px; }
.cta-button, .ghost-button, .stream-button, button:not(.moon-marker) {
  border-radius: 7px;
  box-shadow: none;
}
.cta-button { background: var(--accent); color: #07100e; }
.cta-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.ghost-button, .stream-button { border-color: var(--line-strong); background: transparent; }
.ghost-button:hover, .stream-button:hover { background: var(--panel-strong); border-color: var(--line-strong); }

.hero-stats { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 0; margin-top: 42px; border: 1px solid var(--line); border-radius: 9px; }
.stat-card { min-height: 93px; padding: 17px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.stat-card:last-child { border-right: 0; }
.stat-label { color: var(--muted); font-size: .58rem; }
.stat-value { margin-top: 9px; font-family: var(--mono); font-size: .93rem; font-weight: 500; }
.hero-visual { min-height: 420px; filter: saturate(.55); }
.orrery { transform: scale(.9); }
.floating-tag { border-color: var(--line-strong); border-radius: 5px; background: var(--bg-soft); box-shadow: none; color: var(--text-soft); font-family: var(--mono); font-size: .65rem; }

.section { padding: 76px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-title-row { align-items: flex-end; margin-bottom: 26px; }
.section-title-row h3 { max-width: 900px; margin-top: 10px; font-size: clamp(2rem, 4.2vw, 3.8rem); line-height: 1.03; letter-spacing: -.05em; }
.section-subtitle { max-width: 760px; color: var(--text-soft); font-size: 1rem; line-height: 1.65; }
.section-kicker { color: var(--accent); font-size: .66rem; }

.card {
  border-color: var(--line);
  border-radius: var(--card-radius);
  background: var(--panel);
  box-shadow: none;
}
.card:hover { border-color: var(--line-strong); }
.card-head { border-bottom-color: var(--line); }
.card-head h4 { font-size: 1.05rem; letter-spacing: -.015em; }
.card-head p { font-size: .86rem; line-height: 1.55; }
.tag { border-radius: 5px; background: transparent; color: var(--text-soft); font-size: .6rem; }
.tag-live { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }

input, select, .search-input, .select-input {
  min-height: 44px;
  border-radius: 7px;
  border-color: var(--line-strong);
  background: var(--bg);
  color: var(--text);
}

.body-item, .neo-item, .crew-card, .gallery-card, .future-mission-card, .mission-bullet, .timeline-item, .mini-card {
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-strong) 72%, transparent);
  box-shadow: none;
}
.body-item.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.future-moon-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.future-mission-card { border-color: var(--line); }
.future-mission-card h5 { font-size: 1rem; }
.future-mission-card p { color: var(--text-soft); font-size: .86rem; line-height: 1.55; }
.future-mission-card a, .gallery-link { color: var(--accent); }

.moon-stage { border-radius: 10px; background: #080d10; box-shadow: none; }
.moon-disc { filter: grayscale(.85) contrast(1.08); box-shadow: inset -30px -20px 60px rgba(0,0,0,.5); }
.moon-filter-row { gap: 6px; }
.filter-button { border-radius: 6px; background: transparent; }

.artemis-highlight { border-left: 3px solid var(--accent); }
.countdown-grid { gap: 0; border: 1px solid var(--line); border-radius: 8px; }
.countdown-box { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; }
.countdown-box:last-child { border-right: 0; }
.countdown-box strong { font-family: var(--mono); font-size: 1rem; color: var(--accent); }
.countdown-box span { font-size: .68rem; }
.status-banner { border-radius: 7px; border-color: color-mix(in srgb, var(--accent) 25%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.mission-timeline::before { background: var(--line-strong); }

.mars-section {
  position: relative;
  background:
    radial-gradient(circle at 92% 8%, rgba(200, 117, 81, .12), transparent 28%),
    linear-gradient(180deg, transparent, rgba(200,117,81,.025));
}
.mars-title-row { gap: 40px; }
.mars-orbit-mark { position: relative; width: 142px; height: 142px; flex: 0 0 142px; display: grid; place-items: center; }
.mars-orbit-mark::before, .mars-orbit-mark::after { content: ''; position: absolute; border: 1px solid rgba(200,117,81,.36); border-radius: 50%; }
.mars-orbit-mark::before { inset: 8px; }.mars-orbit-mark::after { inset: 31px; border-color: var(--line-strong); }
.mars-orbit-mark span { position: absolute; inset: 24px 1px; border-top: 1px solid var(--accent-warm); border-radius: 50%; transform: rotate(-24deg); }
.mars-orbit-mark i { position: absolute; width: 8px; height: 8px; top: 15px; right: 28px; border-radius: 50%; background: var(--accent-warm); box-shadow: 0 0 16px rgba(200,117,81,.7); }
.mars-orbit-mark b { font-family: var(--mono); font-size: .67rem; letter-spacing: .12em; }

.mars-command-strip { display: grid; grid-template-columns: repeat(4,1fr); margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.mars-command-strip > div { min-width: 0; padding: 19px 20px; border-right: 1px solid var(--line); }
.mars-command-strip > div:last-child { border-right: 0; }
.mars-command-strip small, .mars-command-strip strong, .mars-command-strip span { display: block; }
.mars-command-strip small { color: var(--accent-warm); font-family: var(--mono); font-size: .59rem; letter-spacing: .1em; }
.mars-command-strip strong { margin-top: 8px; font-size: .93rem; }
.mars-command-strip span { margin-top: 3px; color: var(--muted); font-size: .76rem; }

.mars-feature-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.mars-feature { min-width: 0; overflow: hidden; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.mars-card-head { display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; }
.mars-card-head > span { color: var(--accent-warm); }
.mars-feature h4 { margin: 22px 0 10px; font-size: 1.45rem; letter-spacing: -.035em; }
.mars-feature > p { margin: 0 0 18px; color: var(--text-soft); font-size: .92rem; line-height: 1.65; }
.mars-feature > a, .mars-status-card a, .sample-return-note a { color: var(--accent); font-size: .82rem; font-weight: 600; }
.mars-route, .rover-track { position: relative; height: 105px; margin: 22px -24px 0; border-block: 1px solid var(--line); background: linear-gradient(90deg, transparent, rgba(200,117,81,.05), transparent); }
.earth-node, .mars-node { position: absolute; top: 43px; width: 18px; height: 18px; border-radius: 50%; }
.earth-node { left: 13%; background: #6f9cad; box-shadow: 0 0 20px rgba(111,156,173,.5); }
.mars-node { right: 13%; background: var(--accent-warm); box-shadow: 0 0 20px rgba(200,117,81,.5); }
.mars-route::before, .mars-route::after { content: ''; position: absolute; top: 51px; height: 1px; background: repeating-linear-gradient(90deg,var(--line-strong) 0 5px,transparent 5px 9px); }
.mars-route::before { left: calc(13% + 22px); right: 50%; }.mars-route::after { left: 50%; right: calc(13% + 22px); }
.mars-route i, .mars-route b { position: absolute; top: 47px; width: 9px; height: 9px; border: 1px solid var(--accent); transform: rotate(45deg); }
.mars-route i { left: calc(50% - 10px); }.mars-route b { left: calc(50% + 8px); }
.rover-track::before { content: ''; position: absolute; left: 12%; right: 12%; top: 55px; height: 1px; background: repeating-linear-gradient(90deg,var(--line-strong) 0 7px,transparent 7px 12px); }
.rover-track span { position: absolute; width: 45px; height: 21px; left: calc(50% - 22px); top: 37px; border: 1px solid var(--accent-warm); border-radius: 4px; }
.rover-track span::before, .rover-track span::after { content: ''; position: absolute; bottom: -7px; width: 9px; height: 9px; border: 1px solid var(--text-soft); border-radius: 50%; background: var(--bg); }
.rover-track span::before { left: 4px; }.rover-track span::after { right: 4px; }
.rover-track i { position: absolute; left: calc(50% - 1px); top: 25px; width: 1px; height: 13px; background: var(--accent-warm); }

.mars-fleet-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.mars-status-card { position: relative; min-width: 0; padding: 21px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.status-line { position: absolute; inset: 0 auto 0 0; width: 2px; border-radius: 2px 0 0 2px; }
.status-line.active { background: var(--success); }.status-line.caution { background: var(--accent-3); }.status-line.complete { background: var(--muted); }
.mars-status-card > span { color: var(--muted); font-family: var(--mono); font-size: .58rem; letter-spacing: .1em; }
.mars-status-card h5 { margin: 13px 0 8px; font-size: .98rem; }
.mars-status-card p { min-height: 90px; margin: 0 0 16px; color: var(--text-soft); font-size: .82rem; line-height: 1.55; }
.sample-return-note { display: grid; grid-template-columns: .8fr 1.4fr auto; align-items: center; gap: 34px; margin-top: 12px; padding: 24px; border: 1px solid rgba(200,117,81,.28); border-radius: 10px; background: rgba(200,117,81,.05); }
.sample-return-note h4 { margin: 8px 0 0; font-size: 1.1rem; }
.sample-return-note p { margin: 0; color: var(--text-soft); font-size: .9rem; line-height: 1.55; }

.iss-map, .goes-solar-preview { border-radius: 10px; filter: saturate(.78); }
.source-health { border-radius: 7px; }
.footer-panel { border-radius: 12px; background: var(--panel); box-shadow: none; }

@media (max-width: 1100px) {
  .topbar-inner { align-items: flex-start; padding: 15px 0; }
  .nav-actions { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .chip { flex: 0 0 auto; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .hero-stats { grid-template-columns: repeat(3,1fr); }
  .stat-card { border-bottom: 1px solid var(--line); }
  .mars-fleet-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 150px; }
  .container { width: min(100% - 28px, 1220px); }
  .topbar-inner { width: min(100% - 28px, 1440px); display: block; }
  .brand { min-width: 0; }
  .brand-copy p { display: none; }
  .nav-actions { margin-top: 12px; padding-bottom: 2px; }
  .chip, .theme-toggle { min-height: 34px; padding: 7px 9px; font-size: .72rem; }
  .mode-dock { top: 104px; }
  .mode-label { display: none; }
  .mode-dock-inner { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .mode-dock-inner::-webkit-scrollbar { display: none; }
  .mode-button { flex: 1 0 auto; }
  .hero { padding-top: 26px; }
  .hero-panel { padding: 28px 20px; }
  .eyebrow { width: auto; max-width: 100%; line-height: 1.55; }
  .hero h2 { max-width: 100%; font-size: clamp(2.35rem, 12vw, 3.3rem); overflow-wrap: normal; }
  .hero p { font-size: .96rem; }
  .hero-stats { grid-template-columns: repeat(2,1fr); }
  .stat-card { border-right: 1px solid var(--line); }
  .stat-card:nth-child(even) { border-right: 0; }
  .stat-card:last-child { grid-column: 1 / -1; border-right: 0; }
  .section { padding: 56px 0; }
  .section-title-row { display: block; }
  .future-moon-grid { grid-template-columns: 1fr; }
  .countdown-grid { grid-template-columns: repeat(2,1fr); }
  .countdown-box:nth-child(2) { border-right: 0; }
  .countdown-box:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .mars-orbit-mark { display: none; }
  .mars-command-strip { grid-template-columns: repeat(2,1fr); }
  .mars-command-strip > div { border-bottom: 1px solid var(--line); }
  .mars-command-strip > div:nth-child(even) { border-right: 0; }
  .mars-command-strip > div:nth-last-child(-n+2) { border-bottom: 0; }
  .mars-feature-grid, .mars-fleet-grid { grid-template-columns: 1fr; }
  .mars-status-card p { min-height: 0; }
  .sample-return-note { grid-template-columns: 1fr; gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
