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

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/1.5 var(--font);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: .01em; }
h1 { font-size: var(--fs-h1); line-height: 1.05; }
h2 { font-size: var(--fs-title); line-height: 1.1; }
h3 { font-size: var(--fs-base); font-weight: 600; line-height: 1.4; }

a { color: var(--accent-hover); text-decoration: none; }
a:hover { color: var(--text); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

code, kbd, pre, .mono { font-family: var(--mono); font-size: var(--fs-xs); }
pre { margin: 0; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-ctl); }
[tabindex="-1"]:focus-visible { outline: none; }

::selection { background: var(--accent-line); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border: 2px solid transparent; background-clip: padding-box; border-radius: var(--r-card); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); border: 2px solid transparent; background-clip: padding-box; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--s3); top: -48px; z-index: 100;
  padding: var(--s2) var(--s3); border-radius: var(--r-ctl);
  background: var(--accent); color: var(--on-accent);
}
.skip-link:focus { top: var(--s3); }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.secondary { color: var(--text-2); }
.danger-text { color: var(--danger); }
.warn-text { color: var(--warning); }
.small { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: var(--s2); }
.row-wrap { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--s5); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s3); }

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