/* Reset, page ground, typography, focus. Nothing component-specific. */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--topbar-h) + 12px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px / 1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p, ul, ol, dl, figure { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.2vw, 2.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.35; }

code {
  padding: 0.15em 0.4em;
  background: var(--inline-code-bg);
  color: var(--inline-code);
  border-radius: 3px;
  font: 0.85em var(--font-mono);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
