:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --rule: #e4e1da;
  --accent: #2f5d50;
  --code-bg: #f1efe9;
  --measure: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141513;
    --surface: #1b1d1a;
    --text: #e9e7e1;
    --muted: #a09e96;
    --rule: #2c2f2b;
    --accent: #8fc3ae;
    --code-bg: #232621;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

header.site {
  border-bottom: 1px solid var(--rule);
  padding: 1.75rem 0 1.1rem;
  margin-bottom: 3rem;
}

header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
}

.brand {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}

.brand span { color: var(--muted); font-weight: 400; }

nav.main {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
  font-size: 0.93rem;
}

nav.main a {
  color: var(--muted);
  text-decoration: none;
}

nav.main a:hover,
nav.main a[aria-current="page"] { color: var(--text); }

nav.main a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

main { padding-bottom: 2rem; }

h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.35;
  margin: 2.4rem 0 0.75rem;
}

h3 { font-size: 1.02rem; margin: 1.8rem 0 0.5rem; }

p { margin: 0 0 1.1rem; }

a { color: var(--accent); text-underline-offset: 3px; }

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 2.2rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.meta {
  font-size: 0.86rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

ul.posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul.posts li {
  border-top: 1px solid var(--rule);
  padding: 1.1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  align-items: baseline;
}

ul.posts li:last-child { border-bottom: 1px solid var(--rule); }

ul.posts a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

ul.posts a:hover { text-decoration: underline; }

ul.posts .summary {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

ul.posts time {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  min-width: 6.5rem;
}

article header { margin-bottom: 2rem; }

article p + p { margin-top: 0; }

blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
}

pre {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.5;
}

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

p code, li code {
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

footer.site {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding: 1.5rem 0 3rem;
  font-size: 0.86rem;
  color: var(--muted);
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

footer.site a { color: var(--muted); }

footer.site .right { margin-left: auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.25rem 1.35rem;
  margin: 1.6rem 0;
}

.card h2 { margin-top: 0; }

@media (max-width: 34rem) {
  body { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  nav.main { margin-left: 0; }
  ul.posts time { min-width: 0; flex-basis: 100%; }
}
