/* =============================================================================
   WHERE IT GOES — Base / reset / primitives
   Depends on tokens.css. Load order: tokens.css → base.css → components.css
   ============================================================================= */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Every numeric surface uses tabular figures so columns align like a ledger. */
.num, .num * { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }

h1, h2, h3, h4, p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }

button { font-family: inherit; font-size: inherit; cursor: pointer; }

::selection { background: var(--accent-soft); color: var(--ink-strong); }

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

hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-5) 0; }

/* ---- Type primitives ---------------------------------------------------- */

.kicker {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ink-faint);
}

.headline {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--ink-strong);
}

.panel-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
  color: var(--ink);
}

.lede {
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--ink-muted);
}

.meta {
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.unit {
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ink-faint);
  font-family: var(--font-ui);
}

/* Money display — the big honest figure. */
.figure {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-2xl);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  color: var(--ink-strong);
}
.figure--hero { font-size: var(--text-3xl); }
.figure--gain    { color: var(--gain-ink); }
.figure--deficit { color: var(--deficit-ink); }

/* Utility */
.muted  { color: var(--ink-muted); }
.faint  { color: var(--ink-faint); }
.right  { text-align: right; }
.nowrap { white-space: nowrap; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Reduced motion — respect it. This tool never needs to move much anyway. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
