/* Base: reset, typography defaults, small utilities. Consumes tokens only. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: var(--text-xl); line-height: var(--leading-xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--text-lg); line-height: var(--leading-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-snug); }
h3 { font-size: var(--text-md); line-height: var(--leading-md); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-snug); }
a { color: var(--accent-text); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
svg { flex-shrink: 0; }
::selection { background: var(--accent-subtle-border); }

/* Icons: one stroke weight everywhere */
.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.icon--fill { fill: currentColor; stroke: none; }

/* Text utilities */
.text-xs { font-size: var(--text-xs); line-height: var(--leading-xs); }
.text-sm { font-size: var(--text-sm); line-height: var(--leading-sm); }
.text-md { font-size: var(--text-md); line-height: var(--leading-md); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success-text); }
.text-warning { color: var(--warning-text); }
.text-danger { color: var(--danger-text); }
.text-info { color: var(--info-text); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.tabular { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.eyebrow { font-size: var(--text-xs); line-height: var(--leading-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-tertiary); }
.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; }

/* Layout primitives */
.stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--space-4)); }
.stack--xs { --stack-gap: var(--space-1); }
.stack--sm { --stack-gap: var(--space-2); }
.stack--md { --stack-gap: var(--space-3); }
.stack--lg { --stack-gap: var(--gap); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--space-2)); }
.cluster--md { --cluster-gap: var(--space-3); }
.cluster--lg { --cluster-gap: var(--space-4); }
.split { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); }
.grid--2 { --cols: 2; }
.grid--3 { --cols: 3; }
.grid--4 { --cols: 4; }
.grid--main { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); align-items: start; }
@media (max-width: 1279px) { .grid--4 { --cols: 2; } .grid--3 { --cols: 2; } }
@media (max-width: 1023px) { .grid--main { grid-template-columns: minmax(0, 1fr); } .grid--2 { --cols: 1; } }
@media (max-width: 639px) { .grid--3 { --cols: 1; } }

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