/* base.css — reset, typography, a11y (Theme.md §1, §3, §9). Token-consuming only. */

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

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 { margin: 0 0 var(--sp-3); line-height: var(--lh-tight); }
h1 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
h2 { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
h3 { font-size: var(--fs-base); font-weight: var(--fw-semibold); }

p { margin: 0 0 var(--sp-3); }

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

img { max-width: 100%; }

/* Focus — always visible, never removed (Theme §9) */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Numerals align everywhere money appears (Theme §3) */
.tabular,
.kpi-value,
.num {
  font-variant-numeric: tabular-nums;
}

code, .mono {
  font-family: var(--font-mono);
  font-size: .95em;
}

.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

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

/* Reduced motion: kill all durations; state still legible via colour (Theme §7) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--sp-2);
  top: -48px;
  z-index: var(--z-toast);
  background: var(--surface);
  color: var(--text);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--sp-2); }
