:root {
  --ink: #18202a;
  --muted: #5d6672;
  --paper: #f5f6f8;
  --surface: #ffffff;
  --border: #d9dde3;
  --accent: #8f1d35;
  --accent-dark: #671326;
  --teal: #378f83;
  --orange: #dc7a19;
  --shadow: 0 12px 30px rgba(24, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-dark);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-title {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.site-nav a {
  padding: 7px 10px;
  border-radius: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: #f5e9ec;
  color: var(--accent);
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(48px, 8vw, 88px) 0 72px;
}

.page-intro {
  width: 100%;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.15;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  font-weight: 760;
  letter-spacing: -0.045em;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.025em;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.data-date {
  display: block;
  width: 100%;
  margin: 18px 0 0;
  padding: 7px 10px;
  border: 1px solid #d9c5ca;
  border-radius: 4px;
  background: #fbf5f6;
  color: #6e3542;
  font-size: 0.82rem;
  line-height: 1.45;
}

.research-question {
  margin: 28px 0 0;
  padding: 18px 20px;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
  font-size: 1.05rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 36px 0;
}

.content-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.content-card h2 {
  font-size: 1.1rem;
}

.content-card p,
.content-card ul {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.content-card ul {
  padding-left: 20px;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.chart-toolbar label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

button,
select {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #aeb5bf;
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}

button {
  cursor: pointer;
  font-weight: 700;
}

button:hover,
button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

button:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(143, 29, 53, 0.25);
  outline-offset: 2px;
}

.chart-frame {
  position: relative;
  width: 100%;
  padding: clamp(14px, 3vw, 30px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.chart-frame svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.chart-frame-narrow {
  max-width: 680px;
}

.chart-source {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.chart-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.legendTitle,
.label,
.axis,
.axis-label,
.tick text,
.circle-legend text {
  font-family: inherit;
}

.axis,
.axis-label,
.tick text,
.circle-legend text {
  fill: #4f5864;
  font-size: 11px;
}

.domain,
.tick line {
  stroke: #c9ced5;
}

.tooltip,
.donut-tip {
  z-index: 10;
}

.project-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .page-shell {
    width: min(100% - 28px, 1120px);
    padding-top: 40px;
  }

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

  .chart-frame {
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
