:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #5f5b53;
  --line: #e6e2d9;
  --accent: #5b3fd6;
  --accent-soft: #efeafd;
  --maxw: 44rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141312;
    --surface: #1c1b19;
    --text: #ece9e2;
    --muted: #a8a397;
    --line: #2f2d29;
    --accent: #a995ff;
    --accent-soft: #25203d;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }

header.site {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.75rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em;
  color: var(--text); text-decoration: none;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; }
nav.site { display: flex; gap: 1rem; font-size: .95rem; flex-wrap: wrap; }
nav.site a { color: var(--muted); text-decoration: none; }
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--text); }

main { padding: 2.5rem 0 3.5rem; }
h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5rem; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 2.25rem 0 .5rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .35rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin: .25rem 0; }
.lede { font-size: 1.15rem; color: var(--muted); }
.meta { color: var(--muted); font-size: .92rem; }
.note {
  background: var(--accent-soft); border-radius: 10px;
  padding: .9rem 1.1rem; margin: 1.25rem 0;
}
.note p:last-child { margin-bottom: 0; }
table { width: 100%; border-collapse: collapse; margin: .5rem 0 1.25rem; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
th { font-weight: 600; }
.table-scroll { overflow-x: auto; }
.toc { border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1.1rem; background: var(--surface); }
.toc ol { margin: 0; padding-left: 1.2rem; }

footer.site {
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .9rem; padding: 1.5rem 0 2.5rem;
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: space-between; }
footer.site a { color: var(--muted); }
@media (max-width: 480px) {
  body { font-size: 16px; }
  h1 { font-size: 1.65rem; }
  main { padding-top: 1.75rem; }
}
