:root {
  --bg: #fdfdfc;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --link: #0366d6;
  --border: #e6e6e6;
  --code-bg: #f5f5f3;
  --max-width: 680px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #e6e6e6;
    --muted: #9a9a9a;
    --link: #6cb6ff;
    --border: #2a2a2a;
    --code-bg: #1e1e1e;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.site-header,
.content,
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}
.site-title:hover { text-decoration: none; }

.site-nav a {
  margin-left: 1.25rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:first-child { margin-left: 0; }
.site-nav a:hover,
.site-nav a.active { color: var(--text); }

.content {
  padding-bottom: 4rem;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1rem; }

ul, ol { padding-left: 1.5rem; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

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

.post-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list a {
  color: var(--text);
  text-decoration: none;
}
.post-list a:hover { text-decoration: underline; }

.post-list time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  white-space: nowrap;
}

.post-header { margin-bottom: 1.5rem; }
.post-header h1 { margin-bottom: 0.25rem; margin-top: 0; }
.post-header time { color: var(--muted); font-size: 0.9rem; }

.post-content img { max-width: 100%; height: auto; }

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

code {
  background: var(--code-bg);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer p { margin: 0; }

@media (max-width: 480px) {
  html { font-size: 16px; }
  .site-header { padding-top: 1.5rem; padding-bottom: 1.25rem; }
  .site-nav a { margin-left: 0.85rem; }
  .post-list li { flex-direction: column; gap: 0.15rem; }
}
