:root {
  --red: #ee2f16;
  --red-dark: #c42410;
  --gold: #f4c542;
  --ink: #05050a;
  --text: #ffffff;
  --muted: #c9c4cc;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
code { background: rgba(255,255,255,.12); padding: 1px 6px; border-radius: 4px; font-size: .9em; }

.container { width: min(1200px, 92%); margin-inline: auto; }
.container.narrow { width: min(1000px, 92%); }
.center { text-align: center; }
.serif { font-family: var(--serif); font-weight: 400; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .06em;
  padding: .75rem 2rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.btn:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.btn-stack { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-top: 1.6rem; }
.btn-stack .btn { min-width: 260px; text-align: center; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 2rem 0 4rem;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(60,40,70,.55), rgba(110,70,60,.35)),
    linear-gradient(180deg, #6d5566 0%, #8a5f58 55%, #5a3a2e 100%);
  background-size: cover;
  background-position: center;
}
.insta {
  position: absolute; left: 1rem; top: 7rem; z-index: 3; color: #fff;
}
.brand { display: flex; justify-content: center; }
.logo { height: 130px; width: auto; }
.logo-fallback {
  font-style: italic; font-weight: 700; font-size: 2.2rem; letter-spacing: .02em; padding: 1.5rem 0;
}

.nav { margin-top: 1.5rem; display: flex; justify-content: center; }
.nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; list-style: none; padding: 0; margin: 0; }
.nav a { text-decoration: none; font-size: 1.05rem; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a.active { border-bottom-color: #fff; }
.nav-toggle { display: none; background: rgba(0,0,0,.4); color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; padding: .5rem 1rem; font: inherit; }

.hero-grid {
  width: min(1150px, 92%);
  margin: 5rem auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.motto { font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 4vw, 3.2rem); margin: 0 0 1rem; text-align: center; }

.rover-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  width: min(480px, 100%);
  margin-inline: auto;
  background: rgba(0,0,0,.18);
  overflow: hidden;
}
.rover-frame video { width: 100%; height: 100%; object-fit: cover; }
.rover-placeholder {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: .3rem;
  border: 2px dashed rgba(255,255,255,.5); color: #fff;
}
.rover-placeholder small { opacity: .8; }

.about-title { display: flex; align-items: center; gap: .6rem; font-size: 1.6rem; margin: 0 0 .8rem; font-weight: 500; }
.chip { width: 44px; height: 24px; background: var(--red); transform: skewX(-18deg); display: inline-block; }
.hero-right p { margin: 0 0 1.1rem; }

/* ---------- Sections on the starfield ---------- */
.space-section {
  position: relative;
  padding: 5rem 0;
  background-color: #04040a;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 32%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 45% 70%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 82%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 25% 90%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 62% 12%, #fff 50%, transparent 51%);
  background-size: 420px 420px;
}
.space-section h2 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 1.5rem; }

.goal { padding-top: 9rem; }
.mars-edge {
  position: absolute; top: 0; left: 0; right: 0; height: 130px;
  background: linear-gradient(180deg, #8a5236, #5e3523);
  clip-path: ellipse(75% 100% at 50% 0%);
}
.lead { font-size: 1.15rem; font-weight: 500; }
.small-italic { font-style: italic; font-size: .9rem; margin-top: 1.4rem; }

.sponsor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-top: 2rem; }
.sponsor { border: 1px dashed rgba(255,255,255,.35); border-radius: 10px; padding: 2.2rem 1rem; color: var(--muted); }

/* ---------- Challenges ---------- */
.challenge { display: grid; grid-template-columns: 1fr 1.5fr; gap: 2rem; margin-top: 2.5rem; align-items: start; }
.challenge.solo { grid-template-columns: 1fr; max-width: 640px; margin-top: 5rem; }
.challenge-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.challenge-img.missing { background: rgba(255,255,255,.06); border: 1px dashed rgba(255,255,255,.35); }
.challenge-text h3 { font-size: 1.7rem; margin: 0 0 .5rem; }
.mission-list { list-style: none; padding: 0; margin: .6rem 0 0; }
.mission-list li { margin-bottom: .2rem; }
.mission-list a { color: var(--gold); }

/* ---------- Team Moment: moving background ---------- */
.moments { position: relative; padding: 6rem 0 5rem; overflow: hidden; isolation: isolate; background: #111; }
.moments-bg { position: absolute; inset: -8%; z-index: -2; background-size: cover; background-position: center; }
.moments-bg.pan { animation: panZoom 28s ease-in-out infinite alternate; }
.moments-bg video { width: 100%; height: 100%; object-fit: cover; }
.moments-shade { position: absolute; inset: 0; z-index: -1; background: #000; opacity: .45; }
@keyframes panZoom {
  0%   { transform: scale(1.02) translate3d(-2%, -1%, 0); }
  100% { transform: scale(1.14) translate3d(2%, 2%, 0); }
}

.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 2rem; }
.photo-grid figure { margin: 0; overflow: hidden; background: rgba(255,255,255,.08); aspect-ratio: 4/3; }
.photo-grid figure:nth-child(2) { grid-row: span 2; aspect-ratio: auto; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.photo-grid figure:hover img { transform: scale(1.05); }
.photo-grid figure.missing { display: grid; place-content: center; color: var(--muted); font-size: .85rem; border: 1px dashed rgba(255,255,255,.35); }

/* ---------- Footer ---------- */
.footer { background: #000; padding: 4rem 0 5rem; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.footer h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0 0 1rem; }
.signup { display: flex; gap: .6rem; margin-top: 1.5rem; flex-wrap: wrap; }
.signup input { flex: 1 1 240px; padding: .9rem 1rem; border: 0; background: #f1f1f4; font: inherit; color: #222; }
.btn.round { padding: .9rem 2rem; }
.signup-msg { min-height: 1.4em; font-size: .9rem; color: var(--gold); }
.footer-logos { display: flex; gap: 1.2rem; margin-top: 1.4rem; align-items: center; }
.footer-logos img { height: 64px; width: auto; }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .hero-grid, .challenge, .footer-grid { grid-template-columns: 1fr; }
  .hero-grid { margin-top: 3rem; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid figure:nth-child(2) { grid-row: auto; aspect-ratio: 4/3; }
  .nav-toggle { display: inline-block; }
  .nav { flex-direction: column; align-items: center; gap: .6rem; }
  .nav ul { display: none; flex-direction: column; align-items: center; background: rgba(0,0,0,.55); padding: 1rem 2rem; border-radius: 12px; }
  .nav ul.open { display: flex; }
  .insta { top: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .moments-bg.pan { animation: none; }
}
