@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

:root {
  --dust: #0a0402;
  --iron-dark: #160804;
  --iron-mid: #240e06;
  --iron-warm: #3c1a0a;
  --rust: #b83010;
  --rust-glow: rgba(184,48,16,0.12);
  --rust-border: rgba(184,48,16,0.25);
  --ochre: #c8641c;
  --ochre-bright: #e08030;
  --sand: #d4a060;
  --pale: #e8c898;
  --text: #b08060;
  --text-bright: #e0b890;
  --text-dim: #603820;
  --polar: #c8d8e0;
}

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

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--dust);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#mars-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(184,48,16,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 20%, rgba(200,100,28,0.04) 0%, transparent 50%);
  z-index: 1;
  pointer-events: none;
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 28px 90px;
}

/* ── HERO ── */
.hero {
  padding: 68px 0 54px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 44px;
  align-items: center;
  border-bottom: 1px solid var(--rust-border);
  margin-bottom: 56px;
}

.hero-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--ochre);
  opacity: 0.65;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(5rem, 13vw, 9rem);
  font-weight: 700;
  line-height: 0.85;
  color: var(--pale);
  text-transform: uppercase;
  letter-spacing: -2px;
}

.hero h1 .tagline {
  display: block;
  font-size: 0.2em;
  font-weight: 300;
  letter-spacing: 6px;
  color: var(--ochre);
  text-transform: uppercase;
  margin-top: 10px;
}

.hero-desc {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  font-weight: 300;
  margin-top: 18px;
  max-width: 500px;
  font-family: 'Source Serif 4', serif;
}

/* ── Mars sphere ── */
#mars-sphere {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 35% 30%, #e08050 0%, #c06028 30%, #8a2808 60%, #3a0e04 100%);
  box-shadow:
    0 0 50px rgba(184,48,16,0.2),
    0 0 100px rgba(184,48,16,0.08),
    inset -35px -25px 50px rgba(0,0,0,0.55),
    inset 15px 8px 30px rgba(220,130,60,0.1);
  position: relative;
  overflow: hidden;
  animation: mars-rotate 40s linear infinite;
  cursor: pointer;
  transition: transform 0.3s;
}

#mars-sphere::before {
  content: '';
  position: absolute;
  top: 5%;
  left: 10%;
  right: 10%;
  height: 8%;
  background: rgba(180,90,30,0.4);
  border-radius: 50%;
  filter: blur(4px);
}

/* Valles Marineris hint */
#mars-sphere::after {
  content: '';
  position: absolute;
  top: 42%;
  left: 15%;
  right: 5%;
  height: 6%;
  background: rgba(60,10,0,0.5);
  border-radius: 4px;
  filter: blur(2px);
  transform: rotate(-8deg);
}

/* Polar cap */
.polar-cap {
  position: absolute;
  top: -2%;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 30px;
  background: radial-gradient(ellipse, rgba(230,240,248,0.7) 0%, rgba(230,240,248,0) 100%);
  border-radius: 50%;
}

.polar-cap.south {
  top: auto;
  bottom: -2%;
  width: 40px;
  height: 20px;
}

@keyframes mars-rotate {
  from { filter: hue-rotate(0deg); }
  to   { filter: hue-rotate(0deg); }
}

/* ── Data strip ── */
.data-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--rust-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 60px;
}

.d-cell {
  padding: 18px 10px;
  border-right: 1px solid var(--rust-border);
  background: var(--iron-dark);
  transition: background 0.2s;
}

.d-cell:last-child { border-right: none; }
.d-cell:hover { background: var(--rust-glow); }

.d-label {
  font-size: 0.58rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ochre);
  opacity: 0.6;
  margin-bottom: 6px;
  font-weight: 600;
}

.d-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pale);
  line-height: 1.1;
}

.d-unit {
  font-size: 0.66rem;
  color: var(--text-dim);
  font-weight: 300;
}

/* ── Sections ── */
.section {
  margin-bottom: 56px;
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.section.visible { opacity: 1; transform: none; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rust-border);
}

.sn {
  font-size: 0.62rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--rust);
  opacity: 0.55;
  font-weight: 600;
}

.section h2 {
  font-size: 1.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--pale);
  letter-spacing: 1px;
}

p {
  font-family: 'Source Serif 4', serif;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--text);
  font-weight: 300;
  margin-bottom: 14px;
}

strong { color: var(--text-bright); font-weight: 600; font-family: 'Rajdhani', sans-serif; }

/* ── Geography features ── */
.geo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.geo-card {
  background: var(--iron-mid);
  border: 1px solid var(--rust-border);
  border-radius: 4px;
  padding: 20px;
  transition: transform 0.2s, border-color 0.2s;
}

.geo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(184,48,16,0.5);
}

.geo-card .geo-icon { font-size: 1.4rem; margin-bottom: 8px; display: block; }

.geo-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ochre-bright);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.geo-card .geo-size {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 8px;
  font-weight: 600;
}

.geo-card p { font-size: 0.82rem; margin: 0; line-height: 1.55; font-family: 'Source Serif 4', serif; }

/* ── Rovers timeline ── */
.rovers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.rover-card {
  background: var(--iron-dark);
  border: 1px solid var(--rust-border);
  border-top: 3px solid var(--rust);
  border-radius: 4px;
  padding: 18px;
  transition: box-shadow 0.2s;
}

.rover-card:hover {
  box-shadow: 0 8px 24px rgba(184,48,16,0.15);
}

.rover-card h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--pale);
  margin-bottom: 4px;
}

.rover-card .rover-agency {
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ochre);
  margin-bottom: 4px;
  font-weight: 600;
}

.rover-card .rover-year {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 600;
}

.rover-card p { font-size: 0.8rem; margin: 0; line-height: 1.5; }

/* ── Atmosphere comparison ── */
.atmo-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.atmo-card {
  background: var(--iron-mid);
  border: 1px solid var(--rust-border);
  border-radius: 6px;
  padding: 20px;
}

.atmo-card h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ochre);
  margin-bottom: 12px;
}

.atmo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(184,48,16,0.1);
  font-size: 0.83rem;
}

.atmo-row:last-child { border-bottom: none; }

.atmo-row .a-name { color: var(--text); }
.atmo-row .a-val { color: var(--pale); font-weight: 600; font-family: 'Rajdhani', sans-serif; }

/* ── Terraformation box ── */
.terra-box {
  background: linear-gradient(135deg, var(--iron-mid), var(--iron-warm));
  border: 1px solid rgba(200,100,28,0.35);
  border-left: 3px solid var(--ochre);
  border-radius: 6px;
  padding: 26px 28px;
  margin-top: 20px;
}

.terra-box h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ochre-bright);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.terra-box p { margin: 0 0 12px; }
.terra-box p:last-child { margin: 0; }

/* ── Footer ── */
.footer-band {
  margin-top: 70px;
  border-top: 1px solid var(--rust-border);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-band span {
  font-size: 0.62rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  #mars-sphere { width: 160px; height: 160px; margin: 0 auto; }
  .data-strip { grid-template-columns: repeat(3,1fr); }
  .atmo-compare { grid-template-columns: 1fr; }
}
