/* ========================================
   BASE.CSS — Resets, foundations, utilities
   ======================================== */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1;
  scroll-behavior: smooth;
}

/* CRITICAL: Body scrolls normally — NOT a fixed dashboard */
body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  /* NO overflow: hidden — page scrolls normally */
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

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

/* ---- Tabular numbers for all data ---- */
.data, .mono, td, .kpi-value, .stat-value, .price, [data-num] {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums lining-nums;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* ---- Selection ---- */
::selection { background: var(--accent-muted); color: var(--text-primary); }

/* ---- Focus ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Utility classes ---- */
.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;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.container-wide {
  width: 100%;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

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

/* ---- Button reset ---- */
button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* ---- Image reset ---- */
img, svg { display: block; max-width: 100%; }

/* ---- Table reset ---- */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; }

/* ---- Performance ---- */
.content-auto > * {
  content-visibility: auto;
  contain-intrinsic-size: 0 60px;
}
