:root {
  color-scheme: dark light;
  --bg: #0a0a0a;
  --surface: #1a1a1a;
  --text: #f5f5f5;
  --subtle: #8a8a8a;
  --accent: #4a9eff;
  --line: #2a2a2a;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --text: #0a0a0a;
    --subtle: #666;
    --accent: #0066cc;
    --line: #e2e2e2;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 42rem;
  padding: 2rem 1rem 4rem;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 "SF Pro Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: var(--accent); text-underline-offset: 0.15em; }
h1, h2, h3, h4 { line-height: 1.25; margin: 2rem 0 0.75rem; text-wrap: balance; }
h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
img, svg, video { max-width: 100%; height: auto; }
img[src$=".svg"] { background: #fff; padding: 0.5rem; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

header.site, footer.site { color: var(--subtle); font-size: 0.95rem; }
header.site { margin-bottom: 3rem; }
header.site a { color: var(--text); font-weight: 600; text-decoration: none; }
footer.site { margin-top: 4rem; border-top: 1px solid var(--line); padding-top: 1rem; }

.meta, time, figcaption { color: var(--subtle); font-size: 0.9rem; }
article > header { margin-bottom: 2rem; }
nav { margin-top: 3rem; }

ol { list-style: none; padding: 0; }
main > ol li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
main > ol time { white-space: nowrap; }

code, pre { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0.1em 0.3em; }
pre { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1rem; overflow-x: auto; line-height: 1.5; }
figure { margin: 1.5rem 0; }

blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--accent); color: var(--subtle); }
table { border-collapse: collapse; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--line); padding: 0.4rem 0.6rem; text-align: left; }
math[display="block"] { margin: 1.25rem 0; overflow-x: auto; }
