:root {
  --bg: #f9f7f2;
  --text: #2b2a28;
  --muted: #726f82;
  --line: #e9e5dc;
  --accent: #161773;
  --code-bg: #f0ede5;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111;
    --text: #e8e7e3;
    --muted: #7d7c77;
    --line: #232322;
    --accent: #ffffff;
    --code-bg: #1b1b1a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111111;
  --text: #e8e7e3;
  --muted: #7d7c77;
  --line: #232322;
  --accent: #ffffff;
  --code-bg: #1b1b1a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0 auto;
  max-width: 700px;
  padding: 48px 20px 96px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
.prose a, .links a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.prose a:hover, .links a:hover { text-decoration-color: currentColor; }

.muted, time { color: var(--muted); }

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 72px;
  font-size: 16px;
}
.site-name {
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.site-header nav { display: flex; align-items: center; gap: 20px; }
.site-header nav a { color: var(--muted); transition: color 0.15s; }
.site-header nav a:hover { color: var(--text); }
.theme-toggle {
  display: flex;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); }

/* Post list */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.post-list a { font-size: 18px; }
.post-list li:first-child { border-top: 1px solid var(--line); }
.post-list a:hover { color: var(--muted); }
.post-list time { font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Article */
h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; margin: 0 0 8px; }
.post-header { margin-bottom: 40px; }
.post-header time { font-size: 15px; }

.prose { font-size: 18px; line-height: 1.7; }
.prose h2 { font-size: 24px; font-weight: 600; margin: 2em 0 0.5em; }
.prose h3 { font-size: 20px; font-weight: 600; margin: 1.6em 0 0.4em; }
.prose img { max-width: 100%; height: auto; border-radius: 6px; }
.prose blockquote { margin: 1.5em 0; padding-left: 16px; border-left: 2px solid var(--line); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose code { font-size: 0.88em; background: var(--code-bg); padding: 2px 5px; border-radius: 4px; }
.prose pre { background: var(--code-bg); padding: 16px; border-radius: 6px; overflow-x: auto; font-size: 15px; }
.prose pre code { background: none; padding: 0; }

.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin-bottom: 24px; }
.links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; font-size: 16px; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  color: var(--muted);
}
.post-nav a:hover { color: var(--text); }
.post-nav a:last-child { text-align: right; }
