/* Reset + base. Lean modern reset. */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, svg, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--t-fast) ease;
}
a:hover { color: var(--brand); }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

p, li { color: var(--text); }
small { font-size: var(--fs-xs); color: var(--text-muted); }
code, kbd { font-family: var(--font-mono); font-size: 0.92em; }

::selection { background: var(--brand-soft); color: var(--text); }

/* scrollbars (subtle dark) */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
*::-webkit-scrollbar-track { background: transparent; }

/* utility */
.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;
}
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-brand { color: var(--brand); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.font-mono    { font-family: var(--font-mono); }

.stack    { display: flex; flex-direction: column; gap: var(--space-3); }
.stack-2  { display: flex; flex-direction: column; gap: var(--space-2); }
.stack-4  { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-5  { display: flex; flex-direction: column; gap: var(--space-5); }
.row      { display: flex; align-items: center; gap: var(--space-3); }
.row-2    { display: flex; align-items: center; gap: var(--space-2); }
.row-4    { display: flex; align-items: center; gap: var(--space-4); }
.row-wrap { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.spacer   { flex: 1; }
.grow     { flex: 1; min-width: 0; }
