:root {
  --ink: #101828;
  --muted: #536173;
  --subtle: #667085;
  --page: #f6f8fb;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --line: #d6dee8;
  --line-dark: #b8c2cf;
  --blue: #1d4ed8;
  --teal: #047481;
  --red: #b42318;
  --code: #0f172a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.55;
  margin: 0;
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 58px;
  justify-content: space-between;
  left: 0;
  padding: 0 34px;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 20;
}

.brand,
.nav-links,
.hero-actions {
  align-items: center;
  display: flex;
}

.brand {
  font-size: 15px;
  font-weight: 800;
  gap: 10px;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  background:
    linear-gradient(90deg, var(--blue) 0 32%, transparent 32% 42%, var(--teal) 42% 68%, transparent 68% 78%, var(--red) 78%);
  border: 1px solid var(--line-dark);
  display: inline-block;
  height: 16px;
  width: 26px;
}

.nav-links {
  gap: 22px;
}

.nav-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--blue);
}

.hero {
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  margin: 0 auto;
  max-width: 1180px;
  padding: 70px 20px 34px;
}

.hero-content {
  align-self: center;
  min-width: 0;
}

.kicker,
.section-label,
.metric-label,
.note {
  color: var(--muted);
}

.kicker,
.section-label {
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(54px, 7vw, 94px);
  letter-spacing: 0;
  line-height: 0.98;
  margin-bottom: 16px;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.6vw, 48px);
  letter-spacing: 0;
  line-height: 1.08;
  margin-bottom: 0;
}

h3 {
  font-size: 17px;
  line-height: 1.25;
  margin-bottom: 8px;
}

.paper-title {
  border-left: 4px solid var(--blue);
  color: #243247;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  padding-left: 14px;
}

.hero-copy {
  color: #344054;
  font-size: 17px;
  max-width: 660px;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 14px;
}

.action {
  background: var(--surface);
  border: 1px solid var(--line-dark);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  min-height: 40px;
  padding: 8px 14px;
  text-decoration: none;
}

.action.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.paper-meta {
  color: var(--subtle);
  font-size: 13px;
  margin-bottom: 18px;
}

.hero-facts {
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
}

.hero-facts div {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 12px;
}

.hero-facts div:last-child {
  border-right: 0;
}

.hero-facts dt {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-facts dd {
  font-size: 14px;
  font-weight: 800;
  margin: 2px 0 0;
}

.hero-figure {
  align-self: center;
  background: var(--surface);
  border: 1px solid var(--line);
  margin: 0;
  padding: 12px;
}

.hero-image {
  display: block;
  height: auto;
  width: 100%;
}

.hero-figure figcaption {
  color: var(--subtle);
  font-size: 12px;
  margin-top: 9px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 auto;
  max-width: 1180px;
  padding: 10px 20px 0;
}

.metric-strip article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-right: 0;
  min-height: 96px;
  padding: 18px;
}

.metric-strip article:last-child {
  border-right: 1px solid var(--line);
}

.metric-value,
.finding-number {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.metric-value {
  font-size: 36px;
  line-height: 1;
}

.metric-label {
  font-size: 12px;
  font-weight: 800;
}

.section {
  margin: 0 auto;
  max-width: 1180px;
  padding: 76px 20px 0;
}

.intro-grid,
.section-heading {
  display: grid;
  gap: 30px;
  grid-template-columns: 0.9fr 1.1fr;
}

.overview-copy {
  color: #344054;
  font-size: 16px;
}

.findings {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, 1fr);
}

.finding {
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 164px;
  padding: 20px;
}

.finding {
  border-top: 3px solid var(--line-dark);
}

.finding:nth-child(1) {
  border-top-color: var(--blue);
}

.finding:nth-child(2) {
  border-top-color: var(--teal);
}

.finding:nth-child(3) {
  border-top-color: var(--red);
}

.finding-number {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 12px;
}

.finding p {
  color: var(--muted);
  font-size: 14px;
}

.trajectory {
  padding-top: 64px;
}

.chart-note {
  color: var(--muted);
  font-size: 13px;
  justify-self: end;
  margin: 0;
  max-width: 360px;
  text-align: right;
}

.trajectory-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 220px;
  margin-top: 24px;
  padding: 18px;
}

.chart-frame {
  border: 1px solid var(--line);
  overflow: hidden;
}

#networth-chart {
  display: block;
  height: auto;
  width: 100%;
}

.chart-axis,
.chart-grid {
  stroke: var(--line-dark);
  vector-effect: non-scaling-stroke;
}

.chart-grid {
  opacity: 0.48;
}

.chart-label {
  fill: var(--subtle);
  font-size: 12px;
}

.chart-title-label {
  fill: #243247;
  font-size: 13px;
  font-weight: 800;
}

.chart-line {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.chart-terminal-line {
  fill: none;
  opacity: 0.55;
  stroke-dasharray: 6 5;
  stroke-linecap: round;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.chart-point {
  stroke: var(--surface);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.chart-legend {
  align-content: start;
  display: grid;
  gap: 8px;
}

.legend-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: 18px 1fr;
  padding: 0 0 8px;
}

.legend-swatch {
  display: inline-block;
  height: 3px;
  width: 18px;
}

.legend-name {
  color: #243247;
  font-size: 12px;
  font-weight: 800;
}

.legend-meta {
  color: var(--subtle);
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.section-heading {
  align-items: end;
}

.metric-select {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  justify-self: end;
}

.metric-select select {
  background: var(--surface);
  border: 1px solid var(--line-dark);
  color: var(--ink);
  font: inherit;
  margin-left: 8px;
  min-height: 38px;
  padding: 0 10px;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  margin-top: 24px;
  overflow-x: auto;
}

.leaderboard-table {
  border-collapse: collapse;
  font-size: 14px;
  min-width: 960px;
  width: 100%;
}

.leaderboard-table th,
.leaderboard-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 13px;
  text-align: left;
  vertical-align: top;
}

.leaderboard-table th {
  background: var(--surface-alt);
  color: #243247;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-table tr:last-child td {
  border-bottom: 0;
}

.score-cell {
  min-width: 190px;
}

.bar-track {
  background: #e2e8f0;
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
}

.bar-fill {
  background: var(--blue);
  display: block;
  height: 100%;
}

.type-tag {
  border: 1px solid currentColor;
  color: var(--subtle);
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  margin-top: 4px;
  padding: 0 5px;
  text-transform: uppercase;
}

.note {
  font-size: 13px;
  margin-top: 12px;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin: 0 auto;
  max-width: 1180px;
  padding: 22px 20px 36px;
}

.load-error {
  background: #fff1ec;
  border-bottom: 1px solid #e6b4a8;
  color: #7b2418;
  font-weight: 800;
  padding: 12px 20px;
}

@media (max-width: 920px) {
  .topbar {
    padding: 0 18px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 30px 20px 22px;
  }

  .paper-title {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .hero-actions {
    margin: 18px 0 12px;
  }

  .paper-meta {
    margin-bottom: 0;
  }

  .hero-facts {
    display: none;
  }

  .hero-figure figcaption {
    display: none;
  }

  .hero-facts,
  .metric-strip,
  .findings,
  .intro-grid,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .hero-facts div,
  .metric-strip article {
    border-right: 1px solid var(--line);
  }

  .hero-facts div {
    border-bottom: 1px solid var(--line);
  }

  .hero-facts div:last-child {
    border-bottom: 0;
  }

  .metric-strip article {
    border-bottom: 0;
  }

  .metric-strip article:last-child {
    border-bottom: 1px solid var(--line);
  }

  .metric-strip {
    padding-top: 6px;
  }

  .section {
    padding-top: 58px;
  }

  .metric-select,
  .chart-note {
    justify-self: start;
    justify-content: start;
    text-align: left;
  }

  .trajectory-panel {
    grid-template-columns: 1fr;
  }

  .chart-frame {
    overflow-x: auto;
  }

  #networth-chart {
    min-width: 720px;
  }

  .chart-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
