/* ============================================================
   BASE — reset, typography, utilities
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background var(--t), color var(--t);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { display: block; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

h1 { font-size: 22px; font-weight: 750; letter-spacing: -.4px; }
h2 { font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; }
h3 { font-size: 14px; font-weight: 700; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-xs); }

/* --- Scrollbar --- */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* --- Icons --- */
.icon {
  width: 18px; height: 18px;
  stroke: currentColor; stroke-width: 1.7; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 15px; height: 15px; }
.icon-xs { width: 12px; height: 12px; }
.icon-lg { width: 22px; height: 22px; }

/* --- Text utilities --- */
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.t-xs { font-size: 11.5px; }
.t-sm { font-size: 12.5px; }
.t-lg { font-size: 16px; }
.bold { font-weight: 700; }
.semi { font-weight: 650; }
.upper { text-transform: uppercase; letter-spacing: .09em; font-size: 11px; font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }

/* --- Layout utilities --- */
.row { display: flex; align-items: center; gap: var(--space-3); }
.row-sm { display: flex; align-items: center; gap: var(--space-2); }
.col { display: flex; flex-direction: column; gap: var(--space-3); }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.hide { display: none !important; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }

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

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