:root {
  --paper: #F7F4EF;
  --tint: #EFE7E9;
  --ink: #2E2A2B;
  --muted: #6E6668;
  --hairline: #D9D2CF;
  --aubergine: #5D2A42;
  --deep: #3E1C2C;
  --berry: #8E5A74;
  --rose: #CC8FA0;
  --mauve: #C9B1BD;
  --slate: #46708A;
  --sage: #627F64;
  --ochre: #C9A55A;
  --context: #A29A97;
  --font: "Century Gothic", "Didact Gothic", "URW Gothic", "Questrial", sans-serif;
  --chamfer: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  --octagon: polygon(29.3% 0, 70.7% 0, 100% 29.3%, 100% 70.7%, 70.7% 100%, 29.3% 100%, 0 70.7%, 0 29.3%);
}

* { box-sizing: border-box; border-radius: 0 !important; box-shadow: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

main { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.prose { max-width: 42rem; }

h1, h2, h3 { color: var(--aubergine); font-weight: 400; letter-spacing: 0.01em; line-height: 1.25; }
h1 { font-size: 2rem; margin: 1.5rem 0 0.75rem; }
h2 { font-size: 1.45rem; margin: 3rem 0 1rem; }
h2::after { content: ""; display: block; width: 3rem; height: 2px; margin-top: 0.5rem; background: var(--rose); }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }

a { color: var(--berry); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--aubergine); }

.label, nav a, th, .control-label {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

header.site {
  border-bottom: 1px solid var(--hairline);
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  max-width: 72rem;
  margin: 0 auto;
}
header.site .name { color: var(--aubergine); font-size: 1.15rem; text-decoration: none; }
header.site nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a[aria-current="page"], header.site nav a:hover { color: var(--aubergine); }

footer.site {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  border-top: 1px solid var(--aubergine);
  position: relative;
  color: var(--muted);
  font-size: 0.85rem;
}

footer.site::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 3px;
  border-top: 0.5px solid var(--mauve);
}

.kicker { color: var(--berry); }
.lead { color: var(--muted); font-size: 1.1rem; }
.note { color: var(--muted); font-size: 0.9rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.25rem; }
.card { background: var(--tint); clip-path: var(--chamfer); padding: 1.5rem; }
.card h3 { margin-top: 0; }

.numbers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2rem; margin: 1.5rem 0; }
@media (max-width: 40rem) { .numbers { grid-template-columns: 1fr; } }
.number { display: flex; gap: 1rem; align-items: center; }
.number .octagon {
  flex: 0 0 auto;
  width: 6.5rem;
  height: 6.5rem;
  clip-path: var(--octagon);
  background: var(--tint);
  color: var(--aubergine);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.number.key .octagon { background: var(--aubergine); color: var(--paper); }
.number p { margin: 0; font-size: 0.95rem; }

.compare { margin: 1rem 0 1.5rem; max-width: 46rem; }
.compare .row { display: grid; grid-template-columns: 9.5rem 1fr; gap: 0.75rem; align-items: center; margin: 0.4rem 0; }
.compare .bar { display: flex; align-items: center; }
.compare .fill { height: 1.6rem; min-width: 2px; }
.compare .value { margin-left: 0.5rem; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.95rem; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin: 1rem 0 1.5rem;
}
.control { display: flex; flex-direction: column; gap: 0.35rem; }
.control-label { color: var(--muted); }
.options { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; font-size: 0.95rem; }
.options label { display: inline-flex; gap: 0.3rem; align-items: center; cursor: pointer; }
.segmented { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--aubergine); }
.segmented button {
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: transparent;
  color: var(--aubergine);
  border: 0;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}
.segmented button { min-width: 0; }
.segmented button + button { border-left: 1px solid var(--aubergine); }
.segmented button[aria-pressed="true"] { background: var(--aubergine); color: var(--paper); }
/* Two buttons per row; the 1px gap on the aubergine background draws the dividers. */
.segmented.two-rows { display: inline-grid; grid-template-columns: repeat(2, auto); gap: 1px; background: var(--aubergine); }
.segmented.two-rows button { border-left: 0; background: var(--paper); text-align: left; }
.segmented.two-rows button[aria-pressed="true"] { background: var(--aubergine); }
@media (max-width: 40rem) { .segmented.two-rows { grid-template-columns: 1fr; } }
.export-row { display: flex; justify-content: flex-end; margin: 0.25rem 0; }
.export {
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: transparent;
  color: var(--aubergine);
  border: 1px solid var(--aubergine);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}
.export:hover { background: var(--aubergine); color: var(--paper); }
select, input[type="number"], input[type="search"] {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 0.25rem 0.4rem;
}
input[type="checkbox"] { accent-color: var(--aubergine); }

.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text { fill: var(--muted); font-family: var(--font); font-size: 12px; }
.chart .axis path, .chart .axis line { stroke: none; }
.chart .baseline { stroke: var(--ink); stroke-width: 1; }
.chart .grid line { stroke: var(--hairline); stroke-width: 1; }
.chart .direct-label { fill: var(--ink); font-family: var(--font); font-size: 12px; }
.chart-title { color: var(--aubergine); font-size: 1.05rem; margin: 0 0 0.25rem; }
.chart-sub { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.75rem; min-height: 2.8em; }
.multiples { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.5rem 2rem; }

.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.9rem; margin: 0.5rem 0; }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend i { display: inline-block; width: 0.8rem; height: 0.8rem; }

.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  color: var(--ink);
  max-width: 20rem;
  z-index: 10;
  display: none;
}
.tooltip .t-head { color: var(--aubergine); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th { color: var(--aubergine); text-align: left; font-weight: 400; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--aubergine); cursor: pointer; white-space: nowrap; }
td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--hairline); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 40rem) {
  h1 { font-size: 1.6rem; }
  .number .octagon { width: 5rem; height: 5rem; font-size: 1.15rem; }
}

.figure { color: var(--aubergine); }
dl.defs { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; font-size: 0.95rem; }
dl.defs dt { color: var(--aubergine); }
dl.defs dd { margin: 0; }
@media (max-width: 40rem) { dl.defs { grid-template-columns: 1fr; } dl.defs dd { margin-bottom: 0.5rem; } }
.multiples .chart-sub { min-height: 4.8em; }

[hidden] { display: none !important; }
.callout { border-left: 3px solid var(--aubergine); background: var(--tint); padding: 0.75rem 1rem; }
