:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b7280;
  --accent: #4f46e5;
  --border: #e5e7eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --fg: #e5e7eb;
    --muted: #9ca3af;
    --accent: #818cf8;
    --border: #1f2937;
  }
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  font-size: 16px;
}

header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

h2 {
  font-size: 1.25rem;
  margin: 2.5rem 0 0.75rem;
  line-height: 1.3;
}

h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

p, ul, ol { margin: 0 0 1rem; }

ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }

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

a:hover { text-decoration-thickness: 2px; }

.effective {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.toc {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
}

.toc ol { margin: 0; padding-left: 1.25rem; }
.toc li { margin-bottom: 0.25rem; }

.note {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
}

.note p:last-child { margin-bottom: 0; }

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

footer a { color: var(--muted); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
