:root {
  --bg: hsl(0 0% 7%);
  --bg-elevated: hsl(0 0% 10%);
  --fg: hsl(0 0% 96%);
  --muted: hsl(0 5% 62%);
  --primary: hsl(0 62% 45%);
  --primary-light: hsl(0 72% 60%);
  --accent: hsl(28 80% 56%);
  --accent-soft: hsl(28 75% 48%);
  --card: hsl(0 0% 12% / 0.72);
  --border: hsl(0 8% 22%);
  --radius: 1rem;
  --shadow: 0 24px 80px hsl(0 0% 2% / 0.55);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -8%, hsl(0 62% 34% / 0.42), transparent 55%),
    radial-gradient(circle at 85% 8%, hsl(18 70% 42% / 0.12), transparent 40%),
    linear-gradient(to bottom, hsl(0 48% 14% / 0.55), transparent 46%);
  z-index: -1;
}

img,
canvas {
  max-width: 100%;
}

a {
  color: var(--primary-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.lang-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: inline-flex;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: hsl(0 0% 10% / 0.88);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.lang-switch button {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-switch button.is-active {
  background: var(--primary);
  color: white;
}

.lang-switch button:hover:not(.is-active) {
  color: var(--fg);
}

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid hsl(0 62% 45% / 0.35);
  border-radius: 999px;
  background: hsl(0 62% 45% / 0.12);
  color: hsl(0 72% 78%);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-title {
  margin: 1.25rem 0 0.5rem;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.hero-title .accent {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  max-width: 38rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
}

.hero-meta {
  margin-top: 1.25rem;
  color: hsl(0 5% 74%);
  font-size: 0.95rem;
}

.scroll-cue {
  margin-top: 3rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scroll-cue span {
  width: 1px;
  height: 3rem;
  background: linear-gradient(to bottom, var(--primary-light), transparent);
  animation: pulse-line 2s ease-in-out infinite;
}

@keyframes pulse-line {
  0%,
  100% {
    opacity: 0.35;
    transform: scaleY(0.85);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

section {
  padding: 4.5rem 0;
}

.section-label {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.section-lead {
  max-width: 42rem;
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.05rem;
}

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

.glass-card {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.kpi-value {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.kpi-label {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.chart-grid {
  display: grid;
  gap: 1.25rem;
}

.chart-grid.two-col {
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .chart-grid.two-col {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: stretch;
  }
}

.chart-card {
  padding: 1.35rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 0.15rem);
  background: linear-gradient(180deg, hsl(0 0% 13% / 0.9), hsl(0 0% 10% / 0.85));
  box-shadow: var(--shadow);
}

.chart-card h3 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.chart-wrap {
  position: relative;
  min-height: 280px;
}

.chart-wrap.tall {
  min-height: 360px;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.callout {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0.5rem;
  background: hsl(28 80% 56% / 0.08);
  color: hsl(28 80% 78%);
  font-size: 0.95rem;
}

.event-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-top: 0.85rem;
  padding: 0 0.25rem;
}

.event-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: hsl(0 0% 88%);
  font-size: 0.85rem;
}

.event-legend-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.disclaimer-note {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--primary-light);
  border-radius: 0.5rem;
  background: hsl(0 62% 45% / 0.08);
  color: hsl(0 0% 88%);
  font-size: 0.92rem;
  max-width: 42rem;
}

.headline-stat {
  margin: 0 0 1rem;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  color: hsl(0 0% 92%);
}

.callout-card {
  padding: 1.6rem;
  border: 1px solid hsl(0 62% 45% / 0.3);
  border-radius: calc(var(--radius) + 0.15rem);
  background: linear-gradient(135deg, hsl(0 62% 45% / 0.12), hsl(28 80% 56% / 0.06));
  margin-bottom: 1.25rem;
}

.callout-card .lead-stat {
  margin: 0;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  line-height: 1.6;
  color: hsl(0 0% 92%);
}

.callout-card strong {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.footer {
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-weight: 600;
}

.footer-cta:hover {
  background: var(--primary-light);
  text-decoration: none;
}

.sources-block + .sources-block {
  margin-top: 1.25rem;
}

.heatmap-scroll {
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.heatmap-grid {
  display: grid;
  gap: 0.35rem;
  min-width: max-content;
}

.heatmap-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  border-radius: 0.35rem;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.heatmap-corner {
  background: transparent;
}

.heatmap-year {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.68rem;
}

.heatmap-row-label {
  display: flex;
  align-items: center;
  padding-right: 0.5rem;
  color: hsl(0 0% 88%);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.heatmap-value {
  color: hsl(0 0% 10%);
  font-weight: 600;
  cursor: default;
}

.heatmap-legend {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.source-notes {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.source-notes p {
  margin: 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--primary-light);
  border-radius: 0.5rem;
  background: hsl(0 62% 45% / 0.08);
  color: hsl(0 0% 88%);
  font-size: 0.92rem;
}

.source-notes strong {
  color: var(--fg);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.error-banner {
  margin: 1rem auto;
  padding: 1rem 1.25rem;
  max-width: 40rem;
  border: 1px solid hsl(0 70% 45% / 0.4);
  border-radius: var(--radius);
  background: hsl(0 70% 45% / 0.12);
  color: hsl(0 70% 78%);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-cue span {
    animation: none;
  }
}
