/* ============================================================================
   Base — reset, body defaults, typography baselines
   ============================================================================ */

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* NB: do NOT set overflow-x: hidden on <html> or <body> — iOS Safari has a
   known bug where this breaks position:fixed for descendants. Containers
   that legitimately need horizontal scroll set their own overflow-x: auto
   on the inner wrapper instead. */

body {
  font-feature-settings: "ss01", "cv11";
}

h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  outline: 0;
}
button { cursor: pointer; }

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

img, svg { display: block; max-width: 100%; }

/* tabular numerals everywhere a number lives */
.num, .stat-num, .mrr-num, table td, table th {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------- Typography helpers ---------- */
.t-display    { font-family: var(--font-display); font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-display); letter-spacing: -0.02em; }
.t-h1         { font-family: var(--font-display); font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--fw-display-strong); letter-spacing: -0.015em; }
.t-h2         { font-family: var(--font-sans); font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--fw-strong); letter-spacing: -0.01em; }
.t-h3         { font-family: var(--font-sans); font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--fw-strong); }
.t-body       { font-family: var(--font-sans); font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--fw-regular); }
.t-label      { font-family: var(--font-sans); font-size: var(--fs-small); line-height: var(--lh-small); font-weight: var(--fw-medium); color: var(--text-secondary); letter-spacing: 0.02em; }
.t-small      { font-family: var(--font-sans); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--text-tertiary); }
.t-mono-num   { font-family: var(--font-sans); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------- Scrollbars (subtle, themed) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; }

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

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

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

/* ---------- Skeleton shimmer (no spinners — per brief) ---------- */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 0%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer var(--dur-skeleton) linear infinite;
  border-radius: var(--radius-md);
}
