:root {
  --bg: #faf9f5;
  --fg: #1f2326;
  --muted: #5d666d;
  --line: #dcd9cf;
  --code-bg: #f1efe8;
  --accent: #2f5d4e;
  --accent-hover: #1d3f34;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141719;
    --fg: #dfe4e8;
    --muted: #8f9aa2;
    --line: #292f34;
    --code-bg: #1c2024;
    --accent: #7fb39f;
    --accent-hover: #a5cfc0;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0 auto;
  max-width: 44rem;
  padding: 2.25rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.62;
}

header.site-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.9rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
}

.brand {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand a {
  color: var(--fg);
  text-decoration: none;
}

nav a {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88rem;
  margin-left: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

nav a:first-child { margin-left: 0; }
nav a:hover, nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

a {
  color: var(--accent);
  text-underline-offset: 0.16em;
}
a:hover { color: var(--accent-hover); }

h1 {
  font-size: 1.45rem;
  line-height: 1.3;
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
}

h2 {
  font-size: 1.12rem;
  margin: 2rem 0 0.65rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 0.98rem;
  margin: 1.5rem 0 0.45rem;
}

p { margin: 0 0 1rem; }

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

.meta {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  margin-bottom: 1.5rem;
}

ul.post-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 2rem;
}

ul.post-list li {
  display: grid;
  grid-template-columns: 6.75rem 1fr;
  gap: 0.75rem;
  padding: 0.42rem 0;
  border-bottom: 1px dashed var(--line);
  align-items: baseline;
}

ul.post-list time {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 520px) {
  ul.post-list li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

code, pre {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
}

code {
  background: var(--code-bg);
  padding: 0.12rem 0.32rem;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  line-height: 1.45;
  margin: 0.9rem 0 1.25rem;
}

pre code {
  background: none;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}

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

th {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

td.num, th.num {
  text-align: right;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

footer.site-foot {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
}
