:root {
  --bg: #f7f7fb;
  --panel: #ffffff;
  --text: #1b1a22;
  --muted: #5d5b6b;
  --line: #e4e2ee;
  --accent: #6d3fe0;
  --accent-soft: #efe9fd;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0c12;
    --panel: #16141f;
    --text: #ecebf3;
    --muted: #a6a3b8;
    --line: #2a2738;
    --accent: #a78bfa;
    --accent-soft: #221c38;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

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

header.site {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); text-decoration: none; }
.brand svg { flex: none; }
nav.site { display: flex; gap: 18px; font-size: 15px; }
nav.site a { color: var(--muted); text-decoration: none; }
nav.site a[aria-current="page"], nav.site a:hover { color: var(--text); }

main { padding: 40px 0 56px; }
h1 { font-size: clamp(28px, 5vw, 36px); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 21px; margin: 40px 0 10px; line-height: 1.3; }
h3 { font-size: 17px; margin: 24px 0 6px; }
p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 22px; }
li { margin: 4px 0; }
.lead { font-size: 18px; color: var(--muted); max-width: 62ch; }
.meta { color: var(--muted); font-size: 14px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; margin: 18px 0;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 18px 0; }
.grid .card { margin: 0; }
.grid h3 { margin-top: 0; }
.note { background: var(--accent-soft); border-color: transparent; }

code { font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; }
.table-scroll { overflow-x: auto; }

.lang { display: inline-flex; gap: 8px; font-size: 14px; margin-bottom: 18px; }
.lang a { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }

footer.site { border-top: 1px solid var(--line); padding: 22px 0 32px; color: var(--muted); font-size: 14px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
