:root {
  --fg: #1a1a1a;
  --muted: #666;
  --accent: #0057d8;
  --bg: #fdfdfd;
  --code-bg: #f4f4f4;
  --border: #eaeaea;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6e6e6;
    --muted: #999;
    --accent: #6ea8ff;
    --bg: #1a1a1a;
    --code-bg: #262626;
    --border: #333;
  }
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  font-size: 17px;
}

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

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 3rem;
}
.site-title { font-weight: 700; font-size: 1.25rem; color: var(--fg); }
.site-nav a { margin-left: 1rem; color: var(--muted); font-size: 0.95rem; }
.site-nav a:first-child { margin-left: 0; }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.4rem 0;
}
.post-list time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.9rem; flex-shrink: 0; }

.page-title { margin-bottom: 1.5rem; }
.post-title { margin-bottom: 0.25rem; }
.post-meta { color: var(--muted); font-size: 0.9rem; margin-top: 0; }

.post-content { margin-top: 2rem; }
.post-content h2 { margin-top: 2rem; }

.post-tags { margin-top: 2.5rem; color: var(--muted); font-size: 0.9rem; }
.post-tags a { color: var(--muted); }

pre, code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}
code { background: var(--code-bg); padding: 0.15em 0.35em; border-radius: 4px; }
pre { background: var(--code-bg); padding: 1rem; border-radius: 8px; overflow-x: auto; }
pre code { background: none; padding: 0; }

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

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

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

/* language switch */
.lang-switch { margin-left: 1rem; font-size: 0.95rem; white-space: nowrap; }
.lang-switch a,
.lang-switch .on { padding: 0 0.15rem; }
.lang-switch a { color: var(--muted); }
.lang-switch .on { color: var(--fg); font-weight: 600; }
.lang-switch a + a::before,
.lang-switch .on + a::before,
.lang-switch a + .on::before { content: "/"; color: var(--border); padding-right: 0.3rem; }

.post-translation { color: var(--muted); font-size: 0.9rem; margin: -0.25rem 0 1.5rem; }
.post-translation a { color: var(--accent); }

/* figures */
figure { margin: 1.75rem 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 3px;
}
figure figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-top: 0.5rem;
}

/* AI disclosure */
.ai-notice {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0.75rem 0 1.5rem;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid var(--border);
}

.post-series { color: var(--muted); font-size: 0.9rem; margin: -0.25rem 0 0.5rem; }

/* Older drafts are readable on demand, with their own version context. */
.post-history { margin: 2rem 0; padding: 1rem; border: 1px solid #8886; border-radius: .35rem; }
.post-history > summary { cursor: pointer; font-weight: 600; }
.post-history > summary:focus-visible { outline: 2px solid currentColor; outline-offset: .3rem; }
.history-context { padding: .75rem; border-left: 3px solid #888; }
.history-content { border-top: 1px solid #8886; padding-top: 1rem; }
@media print { .post-history { break-before: page; } }
