:root {
  --fg: #1a1a1a;
  --bg: #fdfdfd;
  --muted: #666;
  --accent: #0a66c2;
  --border: #e5e5e5;
  --code-bg: #f4f4f4;
  --max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e8e8;
    --bg: #141414;
    --muted: #999;
    --accent: #4a9eff;
    --border: #2a2a2a;
    --code-bg: #1f1f1f;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg);
}

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

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.site-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--fg);
}
.site-nav a {
  margin-left: 1.25rem;
  color: var(--muted);
}
.site-nav a.active { color: var(--fg); }

/* Main */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Footer */
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.site-footer-nav a { color: var(--muted); }

/* Static pages (about, privacy, disclaimer, contact) */
.page-header { margin-bottom: 2rem; }
.page-header h1 { margin-top: 0; margin-bottom: 0; }

/* Hero (homepage) */
.hero h1 { font-size: 2rem; margin-top: 0; }
.hero p { color: var(--muted); }

/* Post list */
.post-list { list-style: none; padding: 0; }
.post-list li {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.post-list time {
  flex-shrink: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

/* Post */
.post-header h1 { margin-bottom: 0.25rem; }
.post-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }
.post-category { margin-left: 0.5rem; color: var(--muted); }
.post-tags a { margin-left: 0.5rem; color: var(--muted); }
.post-content h2 { margin-top: 2.5rem; }
.post-content h3 { margin-top: 2rem; }
.post-content img { max-width: 100%; height: auto; }
.post-content figure {
  margin: 1.75rem 0;
}
.post-content figure picture,
.post-content figure img { display: block; }
.post-content figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}
.post-content code {
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
}
.post-content pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.875rem;
}
.post-content pre code { background: none; padding: 0; }
.post-content blockquote {
  border-left: 3px solid var(--border);
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  color: var(--muted);
}

/* Post nav */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}
.post-nav .next { margin-left: auto; }
