/*
 * Canonical BIMerge OKLCH tokens — single source of truth (Story 5.3 / Story 5.1).
 * Consumed by the Tailwind build (application.tailwind.css `@import`) AND the ERB
 * admin layout (`stylesheet_link_tag "tokens"`).
 *
 * Visual language: bright light theme per shared design spec.
 */

/* ---- Typography (new — replaces the system-font-only stack) ---- */
:root {
  --font-ui: "Hanken Grotesk", "Hanken Grotesk Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", var(--font-ui);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Metric-matched fallback: prevents text reflow when the Hanken Grotesk webfont
   (loaded display=swap) swaps in over the system fallback on full-page nav.
   Overrides generated from the real font metrics via Capsize — size-adjust
   matches advance widths (kills the horizontal shift the nav labels showed),
   ascent/descent match the line box (kills any vertical shift). */
@font-face {
  font-family: "Hanken Grotesk Fallback";
  src: local('Arial'), local('ArialMT');
  ascent-override: 99.0668%;
  descent-override: 30.0173%;
  line-gap-override: 0%;
  size-adjust: 100.9419%;
}

/* Same treatment for Inter, which the CLIENT surfaces use (see the .client-ui token
   override in application.tailwind.css). Overrides measured from the real faces in
   Chrome — Inter x-height 54.59 vs Arial 51.86 at 100px gives size-adjust 105.2642%;
   ascent/descent derived from Inter's 97/24 font bounding box against that adjust —
   rather than copied from a metrics table that may not match the shipped version. */
@font-face {
  font-family: "Inter Fallback";
  src: local('Arial'), local('ArialMT');
  ascent-override: 92.1491%;
  descent-override: 22.7998%;
  line-gap-override: 0%;
  size-adjust: 105.2642%;
}

html { font-family: var(--font-ui); }

:root {
  /* Brand */
  --primary: oklch(25% .04 195);
  --primary-rgb: 26, 47, 58;
  --primary-foreground: oklch(98% 0 0);

  /* Sidebar brand */
  --sidebar-primary: oklch(30% .04 195);
  --sidebar-primary-foreground: oklch(98% 0 0);

  /* Charts */
  --chart-1: oklch(82% .17 85);
  --chart-2: oklch(30% .04 195);
  --chart-3: oklch(35% .05 195);
  --chart-4: oklch(25% .04 195);
  --chart-5: oklch(20% .03 195);

  /* Geometry */
  --radius: .5rem;

  /* Surfaces */
  --background: oklch(100% 0 0);
  --foreground: oklch(20% .02 195);
  --card: oklch(100% 0 0);
  --card-foreground: oklch(20% .02 195);
  --popover: oklch(100% 0 0);
  --popover-foreground: oklch(20% .02 195);

  /* Secondary / muted */
  --secondary: oklch(96% .005 195);
  --secondary-foreground: oklch(25% .04 195);
  --muted: oklch(96% .005 195);
  --muted-foreground: oklch(50% .02 195);
  --elevated: oklch(98% .004 210);

  /* Accent */
  --accent: oklch(82% .17 85);
  --accent-rgb: 254, 211, 43;
  --accent-foreground: oklch(15% .03 195);

  /* Signal + success — reserved meanings */
  --signal: oklch(80% .14 78);
  --signal-foreground: oklch(22% .04 60);
  --success: oklch(72% .15 165);
  --success-foreground: oklch(20% .04 165);

  /* Destructive */
  --destructive: oklch(57.7% .245 27.325);
  --destructive-foreground: oklch(98.5% 0 0);

  /* Lines & focus */
  --border: oklch(90% .008 195);
  --input: oklch(90% .008 195);
  --ring: oklch(82% .17 85);

  /* Sidebar surfaces */
  --sidebar: oklch(25% .04 195);
  --sidebar-foreground: oklch(95% 0 0);
  --sidebar-accent: oklch(30% .04 195);
  --sidebar-accent-foreground: oklch(98% 0 0);
  --sidebar-border: oklch(35% .04 195);
  --sidebar-ring: oklch(82% .17 85);
}
