:root {
  --text: #1a1a1a;
  --muted: #767676;
  --link: #0b5fbf;
  --border: #e6e6e6;
  --bg: #ffffff;
  --code-bg: #f6f6f6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e8e8;
    --muted: #9a9a9a;
    --link: #6db1ff;
    --border: #2c2c2c;
    --bg: #141414;
    --code-bg: #1f1f1f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 42rem;
  padding: 0 1.25rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header { padding: 2.5rem 0 2rem; }
.site-header nav { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; }
.site-title { font-weight: 700; font-size: 1.125rem; color: var(--text); }
.nav-links a { margin-left: 1.25rem; color: var(--muted); font-size: 0.9375rem; }
.nav-links a:hover { color: var(--link); text-decoration: none; }

/* Headings */
h1 { font-size: 1.75rem; line-height: 1.25; margin: 0 0 0.5rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.0625rem; margin: 1.5rem 0 0.5rem; }

/* Home intro */
.intro { margin-bottom: 2.5rem; }
.intro p { font-size: 1.125rem; }

/* Post lists */
.post-list ul { list-style: none; padding: 0; margin: 0; }
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.4rem 0;
}
.post-list time { color: var(--muted); font-size: 0.875rem; white-space: nowrap; }
.more { margin-top: 1rem; }

/* Single post */
.post-header { margin: 1rem 0 2rem; }
.post-header time { color: var(--muted); font-size: 0.9375rem; }
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
}
.post-body figure { margin: 1.5rem 0; }
.post-body figcaption { color: var(--muted); font-size: 0.875rem; text-align: center; margin-top: 0.5rem; }
.post-body blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
.post-body code {
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
  font-size: 0.875em;
}
.post-body pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}
.post-body pre code { background: none; padding: 0; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* Work / portfolio */
.work-item { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.work-item:last-child { border-bottom: none; }
.work-item h2 { margin: 0 0 0.25rem; }
.work-meta { color: var(--muted); font-size: 0.875rem; margin: 0 0 0.5rem; }

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer a { color: var(--muted); text-decoration: underline; }

/* Tables */
table { border-collapse: collapse; width: 100%; margin: 1.5rem 0; font-size: 0.9375rem; }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
