/* RIFF shadcn theme layer (preset b3ezY7AlC4: Maia / Mist / Lime).
   Token values are copied verbatim from a throwaway `shadcn init --preset b3ezY7AlC4`
   (Vite) generation; see DESIGN_MIGRATION_SELECTORS.md for the provenance.

   Dark mode is forced: the launchpad is dark-only, so the DARK palette lives directly
   on :root (no .dark class needed). The light values are kept under a `.light` opt-in
   only so the tokens stay complete; nothing toggles it.

   This file is loaded AFTER app.css on a migrated page. The second half re-points the
   legacy RIFF brand variables (--bg / --acid / --text / ...) at these shadcn tokens, so
   a page that links this file adopts the new palette while a page that does not (not yet
   migrated) keeps app.css's original hex untouched. When every page is migrated this
   block folds back into app.css and the old hex is deleted. */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&family=Public+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* ---- shadcn tokens (dark, the default) ---- */
  --background: oklch(0.148 0.004 228.8);
  --foreground: oklch(0.987 0.002 197.1);
  --card: oklch(0.218 0.008 223.9);
  --card-foreground: oklch(0.987 0.002 197.1);
  --popover: oklch(0.218 0.008 223.9);
  --popover-foreground: oklch(0.987 0.002 197.1);
  --primary: oklch(0.768 0.233 130.85);
  --primary-foreground: oklch(0.405 0.101 131.063);
  --secondary: oklch(0.274 0.006 286.033);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.275 0.011 216.9);
  --muted-foreground: oklch(0.723 0.014 214.4);
  /* Dark muted SURFACE under a distinct name: the legacy remap below repoints --muted
     at the light muted-foreground (app.css uses --muted as a text colour), which would
     otherwise collide with shadcn's --muted surface. components.css uses this for tab/
     segment/progress/skeleton backgrounds so they stay dark. */
  --muted-surface: oklch(0.275 0.011 216.9);
  --accent: oklch(0.768 0.233 130.85);
  --accent-foreground: oklch(0.405 0.101 131.063);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.56 0.021 213.5);
  --chart-1: oklch(0.872 0.007 219.6);
  --chart-2: oklch(0.56 0.021 213.5);
  --chart-3: oklch(0.45 0.017 213.2);
  --chart-4: oklch(0.378 0.015 216);
  --chart-5: oklch(0.275 0.011 216.9);
  --sidebar: oklch(0.218 0.008 223.9);
  --sidebar-foreground: oklch(0.987 0.002 197.1);
  --sidebar-primary: oklch(0.768 0.233 130.85);
  --sidebar-primary-foreground: oklch(0.274 0.072 132.109);
  --sidebar-accent: oklch(0.275 0.011 216.9);
  --sidebar-accent-foreground: oklch(0.987 0.002 197.1);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.56 0.021 213.5);

  /* ---- radius scale (Maia; --radius 0.625rem, buttons/inputs use 4xl = pill) ---- */
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --radius-3xl: calc(var(--radius) * 2.2);
  --radius-4xl: calc(var(--radius) * 2.6);

  /* ---- typefaces ---- */
  --font-body: "Public Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-heading: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;

  /* ---- chart literals (uPlot takes colour strings at construction, not CSS vars;
     chart.js reads these via getComputedStyle, with its own hex fallbacks) ---- */
  --chart-line: #9ae63a;
  --chart-grid: rgba(255, 255, 255, 0.07);
  --chart-axis: #8b989d;

  /* Premium near-black card surface + crisp edge, used site-wide for panels/cards.
     The shadcn Mist --card (lum 26) read as a lighter grey panel; this sits a whisper
     above --background (lum ~16) and leans on a defined border, like Pons/pump. */
  --card-surface: color-mix(in oklch, var(--background), var(--foreground) 3%);
  --card-surface-hover: color-mix(in oklch, var(--background), var(--foreground) 8%);
  --card-edge: color-mix(in oklch, var(--foreground) 13%, transparent);

  /* ====================================================================
     Legacy RIFF brand variables, re-pointed at the shadcn tokens above.
     Keeps every existing app.css selector working with the new palette,
     without editing app.css. Loaded after app.css so these win on a
     migrated page; unmigrated pages never load this file and keep the
     original hex.
     ==================================================================== */
  --bg: var(--background);
  --panel: var(--card);
  /* --card intentionally resolves to the shadcn --card above (same name, same role) */
  --card-2: color-mix(in oklch, var(--card), black 22%);   /* inset fields */
  --card-hover: color-mix(in oklch, var(--card), var(--foreground) 6%);
  --line: var(--border);
  --line-acid: color-mix(in oklch, var(--primary), transparent 68%);
  --acid: var(--primary);
  --acid-dim: color-mix(in oklch, var(--primary), transparent 84%);
  --acid-panel: color-mix(in oklch, var(--primary), black 62%);
  --text: var(--foreground);
  --muted: var(--muted-foreground);
  --dim: color-mix(in oklch, var(--muted-foreground), transparent 38%);
  --up: var(--primary);
  --down: var(--destructive);
  --on-acid: var(--primary-foreground);
  --green: var(--primary);
  --green-bright: var(--primary);
  --amber: #d9b25a;
}

/* Typography: Public Sans body, Geist headings. app.css sets `body{font:...}` with a
   shorthand; this later rule overrides only font-family, keeping its size/line-height. */
body { font-family: var(--font-body); }
h1, h2, h3, .ui-card-title { font-family: var(--font-heading); }

/* Focus ring recoloured to the shadcn ring token (app.css used --acid). */
:focus-visible { outline-color: var(--ring); }
