/* ─────────────────────────────────────────────────────────────
   shadcn/ui token bridge (issue #087)

   ADDITIVE ONLY. This file maps shadcn's expected CSS variables onto
   the existing Ralphy design tokens defined in globals.css
   (`--bg`/`--bg-1..4`, `--ink*`, the runtime `--vio*` accent, `--line*`).
   It does NOT redefine or clobber the `@theme` block or the `:root`
   token ramp in globals.css — it only adds the variable NAMES shadcn
   primitives read, pointed at our tokens.

   Imported in app/layout.tsx AFTER globals.css so these definitions
   win for the shadcn variable names without affecting legacy CSS.

   Register: pure-black surfaces, white ink, single accent driven by
   the runtime --vio var (orange on the live site, set on <html>).

   NO VISIBLE BORDERS (repo hard rule): --border / --input / --sidebar-border
   resolve to transparent. shadcn primitives default to `border` everywhere;
   pointing the token at transparent neutralizes the hairline. Separation
   comes from elevated bg-tint steps (--bg-1..4) + shadow + spacing instead.
   ───────────────────────────────────────────────────────────── */

:root {
  /* Surfaces */
  --background: var(--bg);
  --foreground: var(--ink);

  --card: var(--bg-1);
  --card-foreground: var(--ink);

  /* Popovers / dialogs / tooltips float on an elevated bg-tint step
     (NOT a hairline border) + shadow for separation. */
  --popover: var(--bg-2);
  --popover-foreground: var(--ink);

  --primary: var(--vio);
  --primary-foreground: var(--bg);

  --secondary: var(--bg-2);
  --secondary-foreground: var(--ink-2);

  --muted: var(--bg-2);
  --muted-foreground: var(--mute);

  --accent: var(--bg-3);
  --accent-foreground: var(--ink);

  --destructive: #e89094;
  --destructive-foreground: var(--bg);

  /* NO VISIBLE BORDERS — transparent so shadcn's default `border`
     utility produces no hairline. Inputs lean on --bg-2 fill instead. */
  --border: transparent;
  --input: var(--bg-2);

  /* Focus ring uses the live accent (the one allowed accent line). */
  --ring: var(--vio);

  /* shadcn radius scale (Tailwind v4 reads --radius). 14px matches the
     repo's card/term radius family. */
  --radius: 0.875rem;

  /* Chart palette — accent-led, fall back to ink tints. Only used if a
     chart primitive is added later; harmless to define now. */
  --chart-1: var(--vio);
  --chart-2: var(--vio-2);
  --chart-3: var(--ink-3);
  --chart-4: var(--mute);
  --chart-5: var(--vio-3);

  /* Sidebar tokens (shadcn sidebar primitive, if ever added) */
  --sidebar: var(--bg-1);
  --sidebar-foreground: var(--ink);
  --sidebar-primary: var(--vio);
  --sidebar-primary-foreground: var(--bg);
  --sidebar-accent: var(--bg-3);
  --sidebar-accent-foreground: var(--ink);
  --sidebar-border: transparent;
  --sidebar-ring: var(--vio);
}

/* Expose the shadcn variable names to Tailwind v4 utilities
   (bg-background, text-foreground, bg-popover, ring-ring, rounded-lg…)
   without a tailwind.config.js. Mirrors the @theme idiom already used
   in globals.css for the Ralphy tokens. */
@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);

  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}
