:root {
  --bg: #ffffff;
  --surface: #f5f6f8;
  --text: #1c1f24;
  --muted: #5b6370;
  --border: #e3e6eb;
  --accent: #3b5bdb;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --surface: #1b1e24;
    --text: #e8eaee;
    --muted: #9aa2ae;
    --border: #2b2f37;
    --accent: #8ea6ff;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

header {
  border-bottom: 1px solid var(--border);
}

header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}

.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }

nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.95rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--text); }

main { padding: 48px 0 64px; }

h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 1.35rem; margin: 48px 0 12px; }
h3 { font-size: 1.05rem; margin: 24px 0 8px; }

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

.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.card h3 { margin-top: 0; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.note { color: var(--muted); font-size: 0.95rem; }

.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
.toc ul { margin: 0; padding-left: 20px; }

footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
footer .wrap { padding-top: 24px; padding-bottom: 32px; }
footer p { margin: 4px 0; }
