:root {
  --bg: #f3f5f8; --surface: #ffffff; --fg: #0d1321; --muted: #3a4256; --line: #c9d0dd;
  --accent: #17309a; --last: #434a5e; --current: #17309a; --next: #064a3b; --warn: #7a1f0a;
  --slab-last: #e4e7ee; --slab-current: #dfe6ff; --slab-next: #d9f2ea; --slab-warn: #fde4dc;
  --display: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f19; --surface: #131a29; --fg: #f2f4f8; --muted: #c3c9d6; --line: #2a3448;
    --accent: #9fb3ff; --last: #b9c0d0; --current: #9fb3ff; --next: #7fe0c4; --warn: #ffb59e;
    --slab-last: #1c2333; --slab-current: #1a2550; --slab-next: #10332b; --slab-warn: #3a1a12;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f19; --surface: #131a29; --fg: #f2f4f8; --muted: #c3c9d6; --line: #2a3448;
  --accent: #9fb3ff; --last: #b9c0d0; --current: #9fb3ff; --next: #7fe0c4; --warn: #ffb59e;
  --slab-last: #1c2333; --slab-current: #1a2550; --slab-next: #10332b; --slab-warn: #3a1a12;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.skip { position: absolute; left: -999px; top: 0; background: var(--fg); color: var(--bg); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 16px; }
.wrap { max-width: 70rem; margin: 0 auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
code { font-family: var(--mono); font-size: 0.9em; }
h1, h2, h3 { text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 700; font-size: 1.75rem; margin: 0 0 1rem; letter-spacing: -0.01em; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.logo { display: inline-flex; align-items: center; gap: 0.6rem; font: 700 1.15rem var(--display); color: var(--fg); text-decoration: none; }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.nav a { color: var(--fg); text-decoration: none; font-weight: 500; }
.nav a:hover { text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; font: 600 1rem var(--body); padding: 0.7rem 1.15rem; min-height: 44px; border-radius: 8px; cursor: pointer; border: 2px solid var(--fg); background: var(--fg); color: var(--bg); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--fg); }
.btn.small { min-height: 40px; padding: 0.45rem 0.9rem; font-size: 0.9375rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
section { padding-block: 3rem; border-top: 1px solid var(--line); }
.prose { max-width: 42rem; color: var(--muted); }
.prose p { margin: 0 0 1rem; }

.byline { display: inline-flex; align-items: center; gap: 0.5rem; font: 500 0.9375rem var(--mono); color: var(--muted); }
.byline a { color: var(--fg); font-weight: 600; }

footer.site { padding-block: 2rem 3rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; font: 400 0.9375rem var(--mono); color: var(--muted); }

@media (max-width: 760px) {
  .nav .hide-sm { display: none; }
}
