/* Reset, typography and layout primitives. Colors only through tokens. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--text);
  font: 400 var(--fs-14) / var(--lh-ui) var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
svg.i { display: inline-block; width: var(--ic); height: var(--ic); flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 24px; height: 24px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent-container); color: var(--on-accent-container); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: var(--lh-tight); text-wrap: balance; }
h1 { font-size: var(--fs-32); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-20); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-16); }
p { margin: 0 0 var(--sp-3); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: var(--fs-code); }
kbd { padding: 1px var(--sp-1); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-sm); background: var(--surface); font-size: var(--fs-12); color: var(--text-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-5) 0; }
table { border-collapse: collapse; }
.num, time, .tnum { font-variant-numeric: tabular-nums; }
.brk { overflow-wrap: anywhere; }

/* focus */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

/* accessibility helpers */
.vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--sp-2); top: var(--sp-2); z-index: var(--z-skip); padding: var(--sp-2) var(--sp-4); background: var(--text); color: var(--canvas); border-radius: var(--r-pill); text-decoration: none; transform: translateY(-200%); transition: transform var(--dur) var(--ease); }
.skip:focus { transform: none; }

/* layout primitives */
.center { width: 100%; max-width: var(--max, var(--w-page)); margin-inline: auto; padding-inline: var(--sp-4); }
.stack > * + * { margin-top: var(--stack, var(--sp-4)); }
.row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--text-2); }
.quiet { color: var(--text-3); font-size: var(--fs-13); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

@media (min-width: 768px) { .center { padding-inline: var(--sp-5); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
