/* ========================================
   EARTH SCIENCE - SPACE THEME STYLESHEET
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #0a0a2e;
  --bg-darker: #050519;
  --blue: #00d4ff;
  --purple: #7b2ff7;
  --gold: #ffd700;
  --pink: #ff6b9d;
  --green: #00ff88;
  --white: #e8e8ff;
  --gray: #8888aa;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.1);
  --glow-blue: 0 0 20px rgba(0, 212, 255, 0.3);
  --glow-purple: 0 0 20px rgba(123, 47, 247, 0.3);
  --glow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--gold);
}

/* --- Star Canvas --- */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --- Navigation --- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 10, 46, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transform: translateY(-100%);
  transition: transform 0.4s ease;
}

#navbar.visible {
  transform: translateY(0);
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--gray);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--blue);
  transition: width 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- Hero Section --- */
#hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero-content {
  max-width: 800px;
}

.glow-text {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  animation: glow-pulse 3s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.3));
}

@keyframes glow-pulse {
  from { filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.2)); }
  to { filter: drop-shadow(0 0 40px rgba(123, 47, 247, 0.4)); }
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--gray);
  margin-top: 1rem;
  font-weight: 300;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--blue);
  margin-top: 0.5rem;
  opacity: 0.7;
}

.cta-btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.9rem 2.5rem;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
  color: white;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: float 2s ease-in-out infinite;
}

.scroll-indicator p {
  font-size: 0.8rem;
  color: var(--gray);
}

.mouse {
  width: 26px;
  height: 40px;
  border: 2px solid var(--gray);
  border-radius: 13px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.wheel {
  width: 4px;
  height: 8px;
  background: var(--blue);
  border-radius: 2px;
  animation: scroll-wheel 1.5s ease-in-out infinite;
}

@keyframes scroll-wheel {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(10px); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* --- Content Sections --- */
.content-section {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-number {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.section-header h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--white), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.section-intro {
  font-size: 1.15rem;
  color: var(--gray);
  max-width: 700px;
  margin: 0 auto;
}

.sub-heading {
  font-size: 1.5rem;
  color: var(--white);
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.sub-heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  margin: 0.8rem auto 0;
  border-radius: 2px;
}

/* --- Glass Card --- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.8rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: var(--glow-blue);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.glass-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.glass-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.glass-card p {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.7;
}

.highlight-blue {
  border-color: rgba(0, 212, 255, 0.2);
}

.highlight-blue:hover {
  box-shadow: var(--glow-blue);
}

.highlight-purple {
  border-color: rgba(123, 47, 247, 0.2);
}

.highlight-purple:hover {
  box-shadow: var(--glow-purple);
}

/* --- Info Grid --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* --- Timeline --- */
.timeline-section {
  margin-top: 4rem;
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--blue), var(--purple), var(--pink));
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 1.5rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid var(--bg-dark);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  z-index: 1;
}

.timeline-item:nth-child(even) .timeline-dot {
  background: var(--purple);
  box-shadow: 0 0 10px rgba(123, 47, 247, 0.5);
}

.timeline-content {
  margin-left: 1rem;
}

.timeline-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* --- Future Universe --- */
.future-universe {
  margin-top: 4rem;
}

.expand-visual, .crunch-visual {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 1rem;
}

.expand-visual .dot, .crunch-visual .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.expand-visual .dot {
  animation: expand-dots 2s ease-in-out infinite;
}

.expand-visual .dot:nth-child(1) { animation-delay: 0s; }
.expand-visual .dot:nth-child(2) { animation-delay: 0.15s; }
.expand-visual .dot:nth-child(3) { animation-delay: 0.3s; }
.expand-visual .dot:nth-child(4) { animation-delay: 0.45s; }
.expand-visual .dot:nth-child(5) { animation-delay: 0.6s; }

@keyframes expand-dots {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(2); opacity: 1; }
}

.crunch-visual .dot {
  background: var(--purple);
  animation: crunch-dots 2s ease-in-out infinite;
}

.crunch-visual .dot:nth-child(1) { animation-delay: 0.6s; }
.crunch-visual .dot:nth-child(2) { animation-delay: 0.45s; }
.crunch-visual .dot:nth-child(3) { animation-delay: 0.3s; }
.crunch-visual .dot:nth-child(4) { animation-delay: 0.15s; }
.crunch-visual .dot:nth-child(5) { animation-delay: 0s; }

@keyframes crunch-dots {
  0%, 100% { transform: scale(2); opacity: 1; }
  50% { transform: scale(0.5); opacity: 0.3; }
}

/* --- Star Lifecycle --- */
.lifecycle-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.lifecycle-stage {
  text-align: center;
  flex: 1;
  min-width: 160px;
}

.lifecycle-arrow {
  font-size: 2rem;
  color: var(--blue);
  opacity: 0.5;
}

.stage-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 1rem;
}

.nebula-icon {
  background: radial-gradient(circle, var(--purple), transparent 70%);
  box-shadow: 0 0 30px rgba(123, 47, 247, 0.5);
}

.protostar-icon {
  background: radial-gradient(circle, var(--gold), var(--pink) 70%);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.mainseq-icon {
  background: radial-gradient(circle, #fff, var(--gold) 70%);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
}

.redgiant-icon {
  background: radial-gradient(circle, var(--gold), #ff4444 70%);
  box-shadow: 0 0 30px rgba(255, 68, 68, 0.5);
  width: 70px;
  height: 70px;
}

.lifecycle-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.path-steps {
  margin-top: 1rem;
}

.path-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
}

/* --- Star Types --- */
.star-types {
  margin-top: 4rem;
}

.star-visual {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.star-visual.binary {
  background: radial-gradient(circle at 35% 50%, var(--gold), transparent 50%),
              radial-gradient(circle at 65% 50%, var(--blue), transparent 50%);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.star-visual.variable {
  background: radial-gradient(circle, var(--pink), var(--purple));
  box-shadow: 0 0 20px rgba(255, 107, 157, 0.3);
  animation: pulse-star 1.5s ease-in-out infinite;
}

@keyframes pulse-star {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

.star-visual.pulsar {
  background: radial-gradient(circle, #fff, var(--blue));
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
  animation: pulsar-spin 0.5s linear infinite;
}

@keyframes pulsar-spin {
  0% { box-shadow: 10px 0 15px rgba(0, 212, 255, 0.5), -10px 0 0 transparent; }
  50% { box-shadow: 0 0 15px rgba(0, 212, 255, 0.2); }
  100% { box-shadow: -10px 0 15px rgba(0, 212, 255, 0.5), 10px 0 0 transparent; }
}

.star-visual.blackhole {
  background: radial-gradient(circle, #000 30%, var(--purple) 60%, transparent 80%);
  box-shadow: 0 0 25px rgba(123, 47, 247, 0.5);
  position: relative;
}

/* --- Galaxy Gallery --- */
.galaxy-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.galaxy-visual {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  position: relative;
}

.galaxy-visual.elliptical {
  background: radial-gradient(ellipse 60% 40% at center, rgba(255, 215, 0, 0.6), rgba(255, 215, 0, 0.1), transparent);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.2);
  border-radius: 50% / 35%;
}

.galaxy-visual.spiral {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 5%, rgba(0, 212, 255, 0.3) 30%, transparent 60%);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
  animation: galaxy-rotate 10s linear infinite;
}

.galaxy-visual.spiral::before {
  content: '';
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 2px solid rgba(0, 212, 255, 0.2);
  border-top-color: rgba(0, 212, 255, 0.5);
  border-right-color: transparent;
}

.galaxy-visual.barred-spiral {
  background: radial-gradient(circle, rgba(123, 47, 247, 0.8) 8%, rgba(123, 47, 247, 0.2) 35%, transparent 60%);
  box-shadow: 0 0 30px rgba(123, 47, 247, 0.2);
  animation: galaxy-rotate 12s linear infinite;
}

.galaxy-visual.barred-spiral::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 15%;
  right: 15%;
  height: 4px;
  background: rgba(123, 47, 247, 0.5);
  transform: translateY(-50%);
  border-radius: 2px;
}

.galaxy-visual.irregular {
  background: radial-gradient(ellipse at 40% 40%, rgba(255, 107, 157, 0.5) 10%, transparent 50%),
              radial-gradient(ellipse at 65% 60%, rgba(0, 212, 255, 0.4) 10%, transparent 40%),
              radial-gradient(ellipse at 50% 50%, rgba(255, 215, 0, 0.2) 20%, transparent 60%);
  box-shadow: 0 0 30px rgba(255, 107, 157, 0.15);
  border-radius: 40% 60% 55% 45% / 60% 40% 55% 45%;
}

@keyframes galaxy-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.galaxy-card {
  text-align: center;
}

/* --- Milky Way Facts --- */
.milky-way-facts {
  margin-bottom: 4rem;
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.fact-item {
  text-align: center;
  padding: 2rem;
}

.fact-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3rem;
}

.fact-label {
  color: var(--gray);
  font-size: 0.9rem;
}

/* --- Quasar Section --- */
.quasar-card {
  background: linear-gradient(135deg, rgba(123, 47, 247, 0.1), rgba(0, 0, 0, 0.3));
  border-color: rgba(123, 47, 247, 0.3);
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.quasar-card h3 {
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

/* --- Planet Parade --- */
.planets {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 2rem 0;
}

.planet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.3s;
}

.planet:hover {
  transform: translateY(-8px);
}

.planet span {
  font-size: 0.8rem;
  color: var(--gray);
}

.planet-sphere {
  border-radius: 50%;
  transition: box-shadow 0.3s;
}

.planet:hover .planet-sphere {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

.mercury { width: 20px; height: 20px; background: radial-gradient(circle at 35% 35%, #b5b5b5, #555); }
.venus { width: 30px; height: 30px; background: radial-gradient(circle at 35% 35%, #ffd699, #cc8833); }
.earth { width: 32px; height: 32px; background: radial-gradient(circle at 35% 35%, #4488ff, #115533); }
.mars { width: 26px; height: 26px; background: radial-gradient(circle at 35% 35%, #ff6644, #993311); }
.jupiter { width: 55px; height: 55px; background: radial-gradient(circle at 35% 35%, #ffcc88, #bb8844); }
.saturn { width: 48px; height: 48px; background: radial-gradient(circle at 35% 35%, #ffe4a0, #cc9944); box-shadow: 0 0 0 3px transparent, 0 0 0 6px rgba(204, 153, 68, 0.3), 0 0 0 10px rgba(204, 153, 68, 0.1); }
.uranus { width: 38px; height: 38px; background: radial-gradient(circle at 35% 35%, #88ddff, #4499aa); }
.neptune { width: 36px; height: 36px; background: radial-gradient(circle at 35% 35%, #4466ff, #222288); }

.planet-info-box {
  max-width: 400px;
  margin: 1rem auto 0;
  text-align: center;
  animation: fadeSlideUp 0.3s ease;
}

/* --- Solar Formation --- */
.solar-formation {
  margin-top: 4rem;
}

.formation-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.formation-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

/* --- Scientists --- */
.scientists-section {
  margin-top: 4rem;
}

.scientist-card {
  position: relative;
  overflow: hidden;
}

.scientist-title {
  color: var(--gold) !important;
  font-size: 0.85rem !important;
  margin-bottom: 0.8rem !important;
  font-weight: 600;
}

/* --- Seasons --- */
.seasons-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.earth-tilt-visual {
  display: flex;
  justify-content: center;
}

.earth-model {
  position: relative;
  width: 150px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.axis-line {
  position: absolute;
  width: 2px;
  height: 180px;
  background: linear-gradient(to bottom, var(--blue), var(--purple));
  transform: rotate(23.5deg);
  opacity: 0.7;
}

.earth-ball {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4488ff, #115533);
  box-shadow: 0 0 30px rgba(0, 136, 255, 0.3);
  position: relative;
  animation: slow-rotate 20s linear infinite;
}

.equator-line {
  position: absolute;
  top: 50%;
  left: -5%;
  right: -5%;
  height: 1px;
  background: rgba(255, 215, 0, 0.5);
  transform: translateY(-50%);
}

.tilt-label {
  position: absolute;
  top: 10px;
  right: -10px;
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 700;
}

@keyframes slow-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.seasons-explanation {
  max-width: 400px;
}

.seasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.season-card.summer { border-top: 3px solid var(--gold); }
.season-card.autumn { border-top: 3px solid #ff8844; }
.season-card.winter { border-top: 3px solid var(--blue); }
.season-card.spring { border-top: 3px solid var(--green); }

/* --- Moon Phases --- */
.phase-cycle {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.phase span {
  font-size: 0.75rem;
  color: var(--gray);
  text-align: center;
}

.moon-visual {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background: #ddd;
  box-shadow: 0 0 10px rgba(200, 200, 200, 0.2);
}

.new-moon { background: #222; box-shadow: 0 0 10px rgba(100, 100, 100, 0.2); }
.full-moon { background: radial-gradient(circle at 40% 40%, #fff, #ccc); box-shadow: 0 0 20px rgba(255, 255, 255, 0.3); }

.waxing-crescent {
  background: #222;
}
.waxing-crescent::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  background: radial-gradient(circle at 30% 40%, #fff, #ccc);
  border-radius: 0 50% 50% 0;
}

.first-quarter {
  background: #222;
}
.first-quarter::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 20% 40%, #fff, #ccc);
  border-radius: 0 50% 50% 0;
}

.waxing-gibbous {
  background: radial-gradient(circle at 40% 40%, #fff, #ccc);
}
.waxing-gibbous::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 25%;
  height: 100%;
  background: #222;
  border-radius: 50% 0 0 50%;
}

.waning-gibbous {
  background: radial-gradient(circle at 40% 40%, #fff, #ccc);
}
.waning-gibbous::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 25%;
  height: 100%;
  background: #222;
  border-radius: 0 50% 50% 0;
}

.last-quarter {
  background: #222;
}
.last-quarter::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle at 80% 40%, #fff, #ccc);
  border-radius: 50% 0 0 50%;
}

.waning-crescent {
  background: #222;
}
.waning-crescent::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: radial-gradient(circle at 70% 40%, #fff, #ccc);
  border-radius: 50% 0 0 50%;
}

/* --- Eclipses --- */
.eclipse-visual {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
}

.eclipse-visual.solar {
  background: radial-gradient(circle, #000 40%, transparent 42%);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.3);
}

.eclipse-visual.lunar {
  background: radial-gradient(circle at 40% 40%, #8B0000, #440000);
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.4);
}

.eclipse-card {
  text-align: center;
}

.eclipse-terms {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.eclipse-terms .term {
  font-size: 0.85rem;
  color: var(--gray);
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

/* --- Quiz --- */
.quiz-container {
  max-width: 700px;
  margin: 0 auto;
}

.quiz-progress {
  margin-bottom: 2rem;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 10%;
}

#quiz-counter {
  font-size: 0.9rem;
  color: var(--gray);
}

.quiz-question {
  text-align: center;
  margin-bottom: 1.5rem;
}

.quiz-question h3 {
  font-size: 1.2rem;
  line-height: 1.6;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.quiz-option {
  padding: 1rem 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
}

.quiz-option:hover {
  border-color: var(--blue);
  background: rgba(0, 212, 255, 0.1);
}

.quiz-option.correct {
  border-color: var(--green);
  background: rgba(0, 255, 136, 0.15);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.quiz-option.incorrect {
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.15);
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.2);
}

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.quiz-option.disabled.correct {
  opacity: 1;
}

.quiz-feedback {
  padding: 1rem;
  border-radius: 12px;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.quiz-feedback.correct-feedback {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: var(--green);
}

.quiz-feedback.incorrect-feedback {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid rgba(255, 68, 68, 0.3);
  color: #ff6666;
}

.quiz-btn {
  margin-top: 1.5rem;
  width: 100%;
}

/* --- Quiz Results --- */
.quiz-result {
  text-align: center;
}

.score-display {
  font-size: 4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 1rem 0;
}

#score-message {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

/* --- Footer --- */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--glass-border);
  padding: 3rem 2rem;
  text-align: center;
}

.footer-topics {
  margin-bottom: 1.5rem;
}

.footer-topics h4 {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.tag {
  padding: 0.4rem 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--gray);
}

.footer-credit {
  color: var(--gray);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.back-to-top {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  color: var(--gray);
  font-size: 0.85rem;
  transition: all 0.3s;
}

.back-to-top:hover {
  border-color: var(--blue);
  color: var(--blue);
}

/* --- Particle Theory State Flow --- */
.state-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.state-label {
  padding: 0.5rem 1.2rem;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
}

.state-arrow {
  color: var(--gray);
  font-size: 0.9rem;
}

.state-arrow small {
  display: block;
  font-size: 0.75rem;
  color: var(--gold);
}

/* --- First Nations Seasons --- */
.first-nations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.fn-season {
  padding: 1.2rem !important;
  border-top: 3px solid var(--green);
}

.fn-season h4 {
  color: var(--green);
}

/* --- Moon Phase Durations --- */
.phase-duration {
  font-size: 0.7rem;
  color: var(--blue);
  opacity: 0.8;
}

/* --- Tides --- */
.tide-list {
  list-style: none;
  margin-top: 0.8rem;
  padding: 0;
}

.tide-list li {
  padding: 0.3rem 0;
  color: var(--gray);
  font-size: 0.9rem;
}

.tide-list li::before {
  content: '~';
  margin-right: 0.5rem;
  color: var(--blue);
  font-weight: 700;
}

.tide-diagram {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
}

.spring-tide-visual {
  background: radial-gradient(circle, var(--blue) 30%, rgba(123, 47, 247, 0.3) 60%, transparent 80%);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
  animation: tide-pulse 2s ease-in-out infinite;
}

.neap-tide-visual {
  background: radial-gradient(circle, rgba(0, 212, 255, 0.4) 30%, rgba(0, 212, 255, 0.1) 60%, transparent 80%);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

@keyframes tide-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); }
  50% { transform: scale(1.15); box-shadow: 0 0 40px rgba(0, 212, 255, 0.5); }
}

/* --- Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  animation: fadeSlideUp 1s ease forwards;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 46, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 1rem;
    border-bottom: 1px solid var(--glass-border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .lifecycle-arrow {
    display: none;
  }

  .lifecycle-diagram {
    flex-direction: column;
    align-items: stretch;
  }

  .planets {
    gap: 1rem;
  }

  .seasons-diagram {
    flex-direction: column;
  }

  .content-section {
    padding: 4rem 1.2rem;
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  .phase-cycle {
    gap: 1rem;
  }

  .moon-visual {
    width: 45px;
    height: 45px;
  }
}

/* --- Diagram Annotations --- */
.diagram-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 0.25rem;
}

.diagram-annotation {
  display: block;
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-style: italic;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px dashed rgba(255, 215, 0, 0.3);
}

.diagram-caption {
  font-size: 0.8rem;
  color: var(--text-gray);
  text-align: center;
  font-style: italic;
  margin-top: 1rem;
}

.axis-annotation {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  border: none;
  padding: 0;
}

.equator-annotation {
  position: absolute;
  right: -5rem;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  border: none;
  padding: 0;
}

.earth-model {
  position: relative;
}

.tide-body-label {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  border: none;
  padding: 0;
  margin: 0;
}

.tide-diagram {
  position: relative;
}

@media (max-width: 480px) {
  .glow-text {
    font-size: 2.5rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .fact-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .fact-number {
    font-size: 1.5rem;
  }
}
