:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #666666;
  --line: #dddddd;
  --link: #0645ad;
  --code-bg: #f5f5f5;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text: #eeeeee;
    --muted: #aaaaaa;
    --line: #333333;
    --link: #8ab4f8;
    --code-bg: #1f1f1f;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 16px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.site-header,
.site-footer,
.site-main {
  width: min(100% - 2rem, 760px);
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.site-title,
.site-nav a,
.back-link,
.post-footer a {
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
}

.site-title {
  font-weight: 700;
}

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

.site-main {
  padding: 2rem 0 4rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1rem 0 2rem;
}

.hero {
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.post h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
}

.hero p {
  color: var(--muted);
  margin: 0.5rem 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

.archive {
  margin: 0;
  padding: 0;
}

.archive-year {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.25rem;
}

.archive-card {
  display: grid;
  gap: 0.25rem 1rem;
  grid-template-columns: 4rem 1fr auto;
  margin-left: 1rem;
  padding: 0.45rem 0;
}

.archive-date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.archive-title {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.archive-source {
  color: var(--muted);
  font-size: 0.85rem;
}

.post-header {
  margin-bottom: 2rem;
}

.post-body {
  max-width: 72ch;
}

.post-body h2 {
  border-bottom: 1px solid var(--line);
  font-size: 1.5rem;
  line-height: 1.25;
  margin-top: 2.5rem;
  padding-bottom: 0.25rem;
}

.post-body img,
.post-body video {
  max-width: 100%;
}

.post-body blockquote {
  border-left: 3px solid var(--line);
  color: var(--muted);
  margin-left: 0;
  padding-left: 1rem;
}

code,
pre {
  background: var(--code-bg);
}

code {
  font-size: 0.92em;
  padding: 0.1rem 0.25rem;
}

pre {
  overflow-x: auto;
  padding: 1rem;
}

pre code {
  padding: 0;
}

.post-footer {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1rem;
}

@media (max-width: 680px) {
  .site-header,
  .archive-card {
    display: block;
  }

  .site-nav {
    margin-top: 0.25rem;
  }
}
