:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --fg: #1a1a1a;
  --fg-muted: #55575c;
  --border: #dcdde0;
  --link: #0060df;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14151a;
    --fg: #eceef0;
    --fg-muted: #a6a9b0;
    --border: #34363c;
    --link: #6cb4ff;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

body > header,
main {
  max-width: 56rem;
  margin: 0 auto;
  padding-inline: 1.25rem;
}

body > header {
  padding-top: 2rem;
  margin-bottom: 2rem;
}

body.wide > header,
body.wide main {
  max-width: none;
}

main {
  padding-bottom: 5rem;
}

h1 {
  font-size: 2rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.post-date {
  display: block;
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

h2 {
  font-size: 1.375rem;
  margin: 1.5rem 0 1rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a[href^="#"] {
  text-decoration-style: dashed;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

a[href^="#"]:hover {
  text-decoration-style: solid;
  text-decoration-thickness: 0.04em;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

math {
  font-size: 1em;
}

aside {
  margin: 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.1rem 0.75em 0.75em 0.75em;
  font-size: 0.95rem;
}

aside p:last-child {
  margin-bottom: 0;
}

figure {
  margin: 1.75rem 0;
}

.chart-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.85rem;
}

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

figcaption {
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-align: center;
}

table {
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th[scope="row"] {
  font-weight: inherit;
}

.value-table td:last-child,
.value-table th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-left: 1.5rem;
}

.total-row td,
.total-row th {
  border-top: 1px solid var(--fg);
  border-bottom: none;
  font-weight: 600;
}
