/* ═══ RESET & BASE ═══ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --text-primary: #f5f5f7;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.35);
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --accent-green: #22c55e;
  --accent-yellow: #eab308;
  --border-subtle: rgba(255, 255, 255, 0.08);
}

html {
  scroll-behavior: smooth;
}

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

/* ═══ HERO SECTION ═══ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(239, 68, 68, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 2rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero-year-container {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 4rem;
}

.hero-year-label {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.hero-year {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent-blue);
  text-shadow: 0 0 60px rgba(59, 130, 246, 0.4);
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  animation: pulse 2s ease-in-out infinite;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(8px); }
}

/* ═══ SCROLLYTELLING LAYOUT ═══ */
.scrolly-container {
  display: flex;
  position: relative;
  min-height: 100vh;
}

/* Sticky Visualization Panel */
.sticky-viz {
  position: sticky;
  top: 0;
  left: 0;
  width: 60%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-subtle);
  overflow: hidden;
}

.viz-year-bg {
  position: absolute;
  font-size: clamp(8rem, 20vw, 16rem);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.03);
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.05em;
}

#viz {
  width: 100%;
  max-width: 640px;
  height: auto;
  aspect-ratio: 640 / 460;
}

.legend {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border-radius: 100px;
  border: 1px solid var(--border-subtle);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Scrolling Steps Panel */
.steps {
  width: 40%;
  padding: 100vh 3rem 50vh;
  display: flex;
  flex-direction: column;
  gap: 80vh;
}

.step {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  opacity: 0.3;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.step.active {
  opacity: 1;
  transform: translateY(0);
}

.step h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.step p {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.step-detail {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 1rem;
}

.step-conclusion {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(239, 68, 68, 0.1) 100%);
}

/* ═══ SVG STYLES ═══ */
.axis text {
  fill: var(--text-muted);
  font-size: 10px;
}

.axis line,
.axis path {
  stroke: rgba(255, 255, 255, 0.15);
}

.grid-line {
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 1;
}

.country-label {
  fill: var(--text-secondary);
  font-size: 9px;
  text-anchor: middle;
  pointer-events: none;
}

/* ═══ FOOTER ═══ */
.footer {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .scrolly-container {
    flex-direction: column;
  }
  
  .sticky-viz {
    width: 100%;
    height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  
  .steps {
    width: 100%;
    padding: 2rem 1.5rem 50vh;
    gap: 60vh;
  }
  
  .step {
    max-width: 100%;
  }
  
  .legend {
    bottom: 1rem;
    padding: 0.5rem 1rem;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero-year {
    font-size: 3rem;
  }
  
  .sticky-viz {
    height: 45vh;
  }
  
  .viz-year-bg {
    font-size: 6rem;
  }
  
  .step {
    padding: 1.5rem;
  }
  
  .step h2 {
    font-size: 1.25rem;
  }
}
