/* =====================================================================
 * Nexus ReGen — shadcn/ui theme
 * ---------------------------------------------------------------------
 * Drop this file into your shadcn/ui project's `app/globals.css`
 * (replacing the default `:root` and `.dark` blocks). It maps the
 * canonical Nexus brand palette onto every CSS variable shadcn's
 * components consume.
 *
 * Format
 *   - Values are in `oklch()` to match shadcn's current convention
 *     (the project switched from raw HSL → oklch in mid‑2025).
 *   - Numbers were derived from the canonical hex values in
 *     `brand.nexusregen.com` `<style>:root { ... }` via a
 *     sRGB → linear → Oklab → OKLCh conversion. Hex equivalents
 *     are listed in the comment above each variable.
 *
 * Mapping intent
 *   - `--primary` is **Penn Blue 600 (#121541)** — the navy that
 *     anchors the entire identity, used on buttons, links and
 *     emphasis surfaces. In dark mode we step it up to brand‑200
 *     so it stays legible against a brand‑950 canvas.
 *   - `--accent` is **Aureolin 400 (#F7EC33)** — our signature
 *     yellow. Because pure aureolin would burn against light
 *     surfaces, the *accent surface* (--accent) is the soft
 *     accent‑50/accent‑800 wash; aureolin itself shows up via
 *     `--ring` and `--chart-2`.
 *   - `--destructive` is **Signal Red (#FF331F)** — the brand's
 *     designated alert red.
 *   - Neutrals (background / foreground / muted / border / input)
 *     use the Untitled UI neutral ramp from the brand tokens.
 *   - `--radius` is `0.5rem` (= 8px = `--r-lg`) to match the
 *     default Card and Button radius across the design system.
 *
 * Sidebar tokens are mapped to the brand surfaces so navigation
 * chrome reads as Nexus immediately, even before any component
 * customisation.
 *
 * Charts use a five‑step ramp tuned for legibility on both light
 * and dark canvases:
 *   1. Penn Blue (brand)         2. Aureolin (accent)
 *   3. Dodger Blue (data blue)   4. Success green
 *   5. Warning amber
 *
 * Source palette (from index.html):
 *   brand-600  #121541   accent-400 #F7EC33   signal-red #FF331F
 *   brand-50   #F1F2F9   accent-50  #FEF8B8   dodger-blue #1E96FC
 *   neutral-25 #FCFCFD   neutral-900 #101828  success-500 #17B26A
 *   neutral-100 #F2F4F7  neutral-300 #D0D5DD  warning-500 #F79009
 *
 * Last reviewed: May 2026
 * ===================================================================== */

:root {
  /* Corner radius — 0.5rem ≈ 8px, our default `--r-lg`. Card / Button
     / Input / Popover all derive their radii from this base. */
  --radius: 0.5rem;

  /* Surfaces — paper white canvas with neutral-25 softness.
     `--background` is the page; `--card` / `--popover` lift one step. */
  --background: oklch(1.0000 0 0);                   /* #FFFFFF */
  --foreground: oklch(0.2099 0.0341 263.44);         /* neutral-900 #101828 */

  --card: oklch(1.0000 0 0);                          /* #FFFFFF */
  --card-foreground: oklch(0.2099 0.0341 263.44);     /* neutral-900 */

  --popover: oklch(1.0000 0 0);                       /* #FFFFFF */
  --popover-foreground: oklch(0.2099 0.0341 263.44);  /* neutral-900 */

  /* Primary — Penn Blue 600. The brand. */
  --primary: oklch(0.2248 0.0822 274.68);             /* brand-600 #121541 */
  --primary-foreground: oklch(0.9913 0.0013 286.38);  /* neutral-25 #FCFCFD */

  /* Secondary — neutral-100 wash, used for low-emphasis buttons
     and inputs. Pairs with neutral-900 text. */
  --secondary: oklch(0.9665 0.0045 258.32);           /* neutral-100 #F2F4F7 */
  --secondary-foreground: oklch(0.2099 0.0341 263.44);/* neutral-900 */

  /* Muted — same surface as secondary; foreground steps darker
     so muted text is still readable (WCAG AA on white). */
  --muted: oklch(0.9665 0.0045 258.32);               /* neutral-100 #F2F4F7 */
  --muted-foreground: oklch(0.4422 0.0355 257.79);    /* neutral-600 #475467 */

  /* Accent surface — soft accent-50 wash (NOT pure aureolin).
     Pure aureolin on a light surface fails contrast and is
     reserved for `--ring` and chart-2. The accent-foreground
     keeps brand-700 navy so hover states still feel Nexus. */
  --accent: oklch(0.9687 0.0815 103.30);              /* accent-50 #FEF8B8 */
  --accent-foreground: oklch(0.1975 0.0696 275.59);   /* brand-700 #0E1034 */

  /* Destructive — Signal Red. Single-token (no -foreground)
     in current shadcn; component baked-in. */
  --destructive: oklch(0.6474 0.2390 30.20);          /* signal-red #FF331F */

  /* Borders / inputs — neutral-200 keeps surfaces calm. */
  --border: oklch(0.9427 0.0058 264.53);              /* neutral-200 #EAECF0 */
  --input: oklch(0.9427 0.0058 264.53);               /* neutral-200 */
  /* Focus ring — aureolin. High-visibility, on-brand, distinct
     from the destructive red so users can tell focus from error. */
  --ring: oklch(0.9232 0.1854 105.86);                /* accent-400 #F7EC33 */

  /* Chart palette — 5 steps tuned for legibility on light. */
  --chart-1: oklch(0.2248 0.0822 274.68);             /* brand-600 — Penn Blue */
  --chart-2: oklch(0.9232 0.1854 105.86);             /* accent-400 — Aureolin */
  --chart-3: oklch(0.6632 0.1802 250.61);             /* dodger-blue #1E96FC */
  --chart-4: oklch(0.6731 0.1596 155.59);             /* success-500 #17B26A */
  --chart-5: oklch(0.7469 0.1701 62.11);              /* warning-500 #F79009 */

  /* Sidebar — Penn Blue chrome with paper text, the canonical
     Nexus app shell. Use this as-is for product navigation. */
  --sidebar: oklch(0.2248 0.0822 274.68);             /* brand-600 #121541 */
  --sidebar-foreground: oklch(0.9050 0.0137 277.05);  /* brand-100 #DDDFE9 */
  --sidebar-primary: oklch(0.9232 0.1854 105.86);     /* accent-400 (active item) */
  --sidebar-primary-foreground: oklch(0.1975 0.0696 275.59); /* brand-700 */
  --sidebar-accent: oklch(0.1975 0.0696 275.59);      /* brand-700 (hover) */
  --sidebar-accent-foreground: oklch(1.0000 0 0);     /* white */
  --sidebar-border: oklch(0.1975 0.0696 275.59);      /* brand-700 */
  --sidebar-ring: oklch(0.9232 0.1854 105.86);        /* accent-400 */
}

.dark {
  /* Dark canvas — brand-950 (the deepest navy in the ramp).
     Foreground is brand-50 so paragraphs read as ink-on-paper
     even after inversion. */
  --background: oklch(0.1128 0.0269 274.45);          /* brand-950 #03040E */
  --foreground: oklch(0.9624 0.0094 279.69);          /* brand-50 #F1F2F9 */

  /* Cards / popovers lift one step out of the canvas to brand-900,
     mirroring our app surfaces. */
  --card: oklch(0.1463 0.0430 274.53);                /* brand-900 #06081C */
  --card-foreground: oklch(0.9624 0.0094 279.69);     /* brand-50 */

  --popover: oklch(0.1463 0.0430 274.53);             /* brand-900 */
  --popover-foreground: oklch(0.9624 0.0094 279.69);  /* brand-50 */

  /* Primary in dark — step up from brand-600 to brand-200 so the
     button reads as a confident lighter shape on the navy canvas.
     Foreground returns to deep brand-700 ink. */
  --primary: oklch(0.7865 0.0411 280.74);             /* brand-200 #B4B7D4 */
  --primary-foreground: oklch(0.1975 0.0696 275.59);  /* brand-700 #0E1034 */

  /* Secondary / muted — brand-800, one step above the card
     surface; muted-foreground at brand-200 stays AA. */
  --secondary: oklch(0.1727 0.0565 275.69);           /* brand-800 #0A0C28 */
  --secondary-foreground: oklch(0.9624 0.0094 279.69);/* brand-50 */

  --muted: oklch(0.1727 0.0565 275.69);               /* brand-800 */
  --muted-foreground: oklch(0.7865 0.0411 280.74);    /* brand-200 */

  /* Accent — on dark we use real aureolin as the accent surface
     because dark navy provides the contrast aureolin needs. */
  --accent: oklch(0.9232 0.1854 105.86);              /* accent-400 #F7EC33 */
  --accent-foreground: oklch(0.1463 0.0430 274.53);   /* brand-900 */

  /* Destructive — same Signal Red, slightly nudged via the
     surrounding luminance; no token change needed. */
  --destructive: oklch(0.6474 0.2390 30.20);          /* signal-red #FF331F */

  /* Borders / inputs — brand-700 separates surfaces without
     adding too much contrast in low-light viewing. */
  --border: oklch(0.1975 0.0696 275.59);              /* brand-700 #0E1034 */
  --input: oklch(0.1975 0.0696 275.59);               /* brand-700 */
  --ring: oklch(0.9232 0.1854 105.86);                /* accent-400 — aureolin */

  /* Chart palette — same hues, lifted lightness for dark legibility.
     chart-1 swaps to brand-200 so brand data reads as foreground;
     accent and supporting hues keep their light-mode values. */
  --chart-1: oklch(0.7865 0.0411 280.74);             /* brand-200 */
  --chart-2: oklch(0.9232 0.1854 105.86);             /* accent-400 */
  --chart-3: oklch(0.6632 0.1802 250.61);             /* dodger-blue */
  --chart-4: oklch(0.6731 0.1596 155.59);             /* success-500 */
  --chart-5: oklch(0.7469 0.1701 62.11);              /* warning-500 */

  /* Sidebar in dark — slightly lifted off canvas so it reads as
     a chrome layer rather than blending into the background. */
  --sidebar: oklch(0.1463 0.0430 274.53);             /* brand-900 */
  --sidebar-foreground: oklch(0.9050 0.0137 277.05);  /* brand-100 */
  --sidebar-primary: oklch(0.9232 0.1854 105.86);     /* accent-400 */
  --sidebar-primary-foreground: oklch(0.1463 0.0430 274.53); /* brand-900 */
  --sidebar-accent: oklch(0.1727 0.0565 275.69);      /* brand-800 */
  --sidebar-accent-foreground: oklch(0.9624 0.0094 279.69); /* brand-50 */
  --sidebar-border: oklch(0.1975 0.0696 275.59);      /* brand-700 */
  --sidebar-ring: oklch(0.9232 0.1854 105.86);        /* accent-400 */
}
