:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1a1a19;
  --muted: #6b6b66;
  --accent: #2c4a6e;
  --border: #dcdbd4;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a;
    --surface: #1c1e22;
    --text: #e9e8e3;
    --muted: #93938d;
    --accent: #8fb4dd;
    --border: #2b2d31;
  }
}

:root[data-theme="dark"] {
  --bg: #14161a;
  --surface: #1c1e22;
  --text: #e9e8e3;
  --muted: #93938d;
  --accent: #8fb4dd;
  --border: #2b2d31;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 1.125rem;
  line-height: 1.7;
}

.site-title,
.site-nav,
.data-as-at,
.kicker,
.entry-meta,
footer.site-footer {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- header / nav ---- */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.75rem 1rem 1.25rem;
}

.site-title {
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
}

main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: calc(100vh - 9rem);
}

/* ---- shared page/article header ---- */

.article-header {
  padding: 1.5rem 0 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.article-header h1 {
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  margin: 0 0 0.6rem;
}

.article-header .lede {
  font-style: italic;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.55;
  margin: 0 0 0.9rem;
}

.article-header .lede p {
  margin: 0;
}

.article-header .data-as-at {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

.article-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 2.75rem 0 1.1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.article-content p {
  margin: 0 0 1.25rem;
}

.article-content strong {
  color: var(--text);
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.4rem;
}

.article-content li {
  margin-bottom: 1.1rem;
}

.article-content li:last-child {
  margin-bottom: 0;
}

.article-content li p:last-child {
  margin-bottom: 0;
}

.article-content li strong {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.article-content a {
  color: var(--accent);
}

/* Charts are committed at whatever resolution they were generated; scale
   them down to fit narrow viewports instead of letting them overflow. */
.article-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
}

.article-content {
  overflow-wrap: break-word;
}

/* ---- homepage / article list ---- */

.index-intro {
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.index-intro h1 {
  font-size: 2.1rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
}

.index-intro p {
  color: var(--muted);
  margin: 0;
  max-width: 34rem;
}

.article-list {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
}

.article-list li {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.article-list li:first-child {
  padding-top: 0;
}

.article-list .entry-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 0.4rem;
}

.article-list .entry-title:hover {
  color: var(--accent);
}

.article-list .entry-meta {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  margin: 0 0 0.5rem;
}

.article-list .entry-summary {
  color: var(--muted);
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
}

/* ---- about page ---- */

.headshot {
  width: 10rem;
  height: 10rem;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 2px;
  float: left;
  margin: 0 1.75rem 1rem 0 !important;
}

/* clearfix, so the footer doesn't tuck up under a floated headshot */
.article-content::after {
  content: "";
  display: block;
  clear: both;
}

.disclosure {
  clear: both;
  margin-top: 2rem !important;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ---- footer ---- */

footer.site-footer {
  max-width: 42rem;
  margin: 3rem auto 0;
  padding: 1.25rem 1rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}
