:root {
  --text: #1a1a1a;
  --muted: #666;
  --bg: #fdfdfc;
  --rule: #e2e2e0;
  --accent: #1d4ed8;
  --error: #b42318;
  --error-bg: #fef3f2;
  --measure: 65ch;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

body {
  margin: 0;
  padding: 0 1rem 4rem;
}

main,
.site-header {
  max-width: var(--measure);
  margin: 0 auto;
}

.site-header {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
  font-weight: 600;
}

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

.site-header a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 2em 0 0.5em;
}

h1 {
  font-size: 2.2rem;
  margin-top: 0;
}

.meta,
time {
  color: var(--muted);
  font-size: 0.9rem;
}

img {
  max-width: 100%;
  height: auto;
}

blockquote {
  margin: 1.5em 0;
  padding-left: 1em;
  border-left: 3px solid var(--rule);
  color: var(--muted);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: 1em;
  background: #f4f4f2;
}

/* Tables: scroll horizontally rather than overflow the measure. */
table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  margin: 1.5em 0;
}

th,
td {
  padding: 0.4em 0.8em;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

th {
  border-bottom-width: 2px;
}

td[align="right"],
th[align="right"] {
  text-align: right;
}

.footnotes {
  margin-top: 3em;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--muted);
}

/* Index */
.article-list {
  list-style: none;
  padding: 0;
}

.article-item {
  margin-bottom: 1.5em;
}

.article-item > a {
  font-size: 1.2rem;
  font-weight: 600;
}

.article-item time {
  display: block;
}

.article-item p {
  margin: 0.25em 0 0;
}

.badge {
  display: inline-block;
  padding: 0 0.5em;
  border: 1px solid var(--muted);
  border-radius: 3px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  vertical-align: middle;
}

.badge-error {
  border-color: var(--error);
  color: var(--error);
}

/* Errors */
.error,
.article-item .error-message {
  color: var(--error);
}

.error {
  padding: 0.75em 1em;
  margin-bottom: 2em;
  border-left: 4px solid var(--error);
  background: var(--error-bg);
}

.error p {
  margin: 0.25em 0 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Charts */
.chart {
  position: relative;
  margin: 2em 0;
}

.chart figcaption {
  font-weight: 600;
  margin-bottom: 0.5em;
}

.chart-svg {
  display: block;
  overflow: visible;
  font-variant-numeric: tabular-nums;
}

.axis text {
  fill: var(--muted);
  font-size: 0.75rem;
}

.axis .domain,
.axis-x .tick line {
  stroke: var(--muted);
}

.axis-y .tick line {
  stroke: var(--rule);
}

.line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.dot {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 2;
  pointer-events: none;
}

.bar,
.point {
  fill: var(--accent);
}

.bar.active {
  fill: #1e3a8a;
}

.overlay {
  fill: transparent;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  padding: 0.3em 0.6em;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg);
  box-shadow: 0 1px 4px rgb(0 0 0 / 12%);
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
}

.chart-error {
  margin: 2em 0;
  padding: 0.75em 1em;
  border-left: 4px solid var(--error);
  background: var(--error-bg);
  color: var(--error);
}

.chart-error p {
  margin: 0.25em 0 0;
}
