/* ======================================================================
   ValueSight Base — v1.0 (May 2026)
   Source of truth: docs/design/valuesight-design.md §4 (typography),
                    §9.4 (reduced motion).
   Loads after tokens.css, before styles.css.
   ====================================================================== */

/* ── §4.1 Font loading ─────────────────────────────────────────────────
   Geist is the canonical UI font. Geist Mono is the canonical numeric font.
   The design doc forbids loading Geist from Google Fonts — it isn't there.

   To enable Geist locally:
     1. Download the Geist + Geist Mono font files from https://vercel.com/font
        (or `npm pack geist` to extract the .woff2 files).
     2. Place the variable woff2 files at:
          public/fonts/Geist-Variable.woff2
          public/fonts/GeistMono-Variable.woff2
     3. The @font-face declarations below will pick them up automatically.

   Until Geist is installed locally, the browser falls back through the
   system stack defined in body { font-family }, which renders cleanly on
   macOS, iOS, Windows 11, and modern Linux desktops.
   ──────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Variable.woff2') format('woff2-variations'),
       url('/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/GeistMono-Variable.woff2') format('woff2-variations'),
       url('/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── §4.1 Font stacks (custom properties for downstream use) ──────── */
:root {
  --font-sans: 'Geist', -apple-system, 'Inter', 'Segoe UI Variable', 'Segoe UI',
               system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', 'JetBrains Mono',
               'DM Mono', Menlo, Consolas, monospace;
}

/* ── Numeric rules (§4.5) ──────────────────────────────────────────
   Tabular figures + slashed zero + stylistic set 01 (alt 6/9 in Geist Mono).
   Apply via class on numeric containers; legacy code uses inline styles
   for now and will be migrated in Track 2.
   ──────────────────────────────────────────────────────────────── */
.tnum,
[data-tnum] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero", "ss01";
}

/* ── §4.2 Type scale (utility classes) ───────────────────────────
   Apply via class to opt in. Two weights only across the system —
   400 (regular) and 500 (medium). Letter-spacing tightens at display
   sizes, relaxes at body sizes. Sentence case throughout (§4.4).
   ──────────────────────────────────────────────────────────────── */
.text-display-xl { font: 500 40px/1.1   var(--font-sans); letter-spacing: -0.025em; }
.text-display-lg { font: 500 32px/1.15  var(--font-sans); letter-spacing: -0.022em; }
.text-display-md { font: 500 24px/1.25  var(--font-sans); letter-spacing: -0.018em; }
.text-headline   { font: 500 19px/1.3   var(--font-sans); letter-spacing: -0.015em; }
.text-body-lg    { font: 400 15px/1.55  var(--font-sans); letter-spacing: -0.005em; }
.text-body       { font: 400 13px/1.45  var(--font-sans); letter-spacing: -0.003em; }
.text-body-sm    { font: 400 12px/1.4   var(--font-sans); letter-spacing: 0; }
.text-label      { font: 500 12px/1.3   var(--font-sans); letter-spacing: -0.003em; }
.text-label-sm   { font: 500 11px/1.25  var(--font-sans); letter-spacing: 0; }
.text-caption    { font: 400 11px/1.3   var(--font-sans); letter-spacing: 0; }

/* Numeric — §4.5. tabular-nums, slashed zero, alt 6/9. */
.text-mono-data,
.text-mono-data-emphasis,
.text-mono-display {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero", "ss01";
}
.text-mono-data           { font-size: 12px; font-weight: 400; line-height: 1.4; }
.text-mono-data-emphasis  { font-size: 12px; font-weight: 500; line-height: 1.4; }
.text-mono-display        { font-size: 19px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }

/* ── §10.9 Tier dot (provenance indicator) ───────────────────────
   5px diameter dot, inline 4px to the right of any sourced number
   in tables and cards. Three filled tiers + one outlined override.

   Usage:
     <span>$4,237 <i class="tier-dot tier-validated"></i></span>
     <span>$4,237 <i class="tier-dot tier-corpus"></i></span>
     <span>$4,237 <i class="tier-dot tier-inferred"></i></span>
     <span>$4,237 <i class="tier-dot tier-override"></i></span>
   ──────────────────────────────────────────────────────────────── */
.tier-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}
.tier-dot.tier-validated { background: var(--tier-validated); }
.tier-dot.tier-corpus    { background: var(--tier-corpus); }
.tier-dot.tier-inferred  { background: var(--tier-inferred); }
.tier-dot.tier-override  {
  background: transparent;
  border: 1.5px solid var(--tier-override);
  box-sizing: border-box;
}

/* ── §9.4 Reduced motion ──────────────────────────────────────────
   Honour the OS preference. Causality pulses, number tweens, panel
   slides become instant. Hover/focus transitions remain (they are
   informational and under 160ms).
   ──────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: var(--duration-fast) !important;
    scroll-behavior: auto !important;
  }
}
