/* ==========================================================================
   habitat-shadcn.css — maps habitat's semantic tokens onto shadcn/ui's full
   theming variable contract (https://ui.shadcn.com/docs/theming), so any
   shadcn/ui + Tailwind project re-themes automatically under eink/camo
   modes with zero component changes — the same lightweight distribution
   model as shadcn's own "Typeset": a plain CSS file you load alongside your
   existing styles.

   Load this AFTER habitat.css (not @import, to avoid double-loading if
   habitat.css is already linked separately). No wrapper class is needed —
   both habitat's and shadcn's variables are conventionally :root-scoped.

   Token values here are plain CSS <color>s (hex / color-mix()), not the
   oklch() shadcn ships by default — that's fine, since Tailwind/shadcn's
   `bg-primary` etc. utilities just consume `var(--primary)` as a color,
   regardless of which color space produced it.

   habitat.css has no `.dark` class: its own tokens already switch under
   `prefers-color-scheme: dark` and `[data-habitat-mode]`, so this file
   needs no separate `.dark` block — dark/eink/camo all flow through
   automatically because every rule below is just `var(--habitat-*)`.

   If your project uses Tailwind v4, add the matching `@theme inline`
   block from shadcn's docs to your own globals.css so utilities like
   `bg-primary` resolve (that block lives in your app, not in this file,
   since habitat.css doesn't assume any particular build tool):

     @theme inline {
       --color-background: var(--background);
       --color-foreground: var(--foreground);
       ... (see https://ui.shadcn.com/docs/theming#default-theme-css)
     }
   ========================================================================== */

:root {
  --radius: 0.6rem; /* no radius opinion in habitat.css itself — matches
                        the modal value already used across .habitat-select
                        / .habitat-btn */

  --background: var(--habitat-bg);
  --foreground: var(--habitat-text);

  --card: var(--habitat-surface);
  --card-foreground: var(--habitat-text);
  --popover: var(--habitat-surface);
  --popover-foreground: var(--habitat-text);

  --primary: var(--habitat-accent);
  --primary-foreground: var(--habitat-bg);

  --secondary: var(--habitat-surface);
  --secondary-foreground: var(--habitat-text);

  /* No dedicated habitat token for a subtle highlight surface — synthesized
     as an interpolation between habitat.css's own 24% mark-highlight mix
     and its 16% consent-icon-background mix. */
  --muted: color-mix(in oklab, var(--habitat-text) 7%, var(--habitat-bg));
  --muted-foreground: var(--habitat-text-muted);

  --accent: color-mix(in oklab, var(--habitat-accent) 14%, var(--habitat-bg));
  --accent-foreground: var(--habitat-text);

  /* Reuses the existing status-pill recording-dot red. Unlike the core
     palette, this is a fixed color, not contrast-checked against arbitrary
     camo backgrounds the way --habitat-text/--habitat-accent are. Matches
     shadcn's own default shape: no --destructive-foreground pairing. */
  --destructive: #e0483e;

  --border: var(--habitat-border);
  --input: var(--habitat-border);
  --ring: var(--habitat-accent);

  /* shadcn ships 5 independently-hued chart colors by default; habitat has
     no such palette (deliberately — introducing new hues would break the
     "camouflage into the room" premise). Instead this is a 5-step
     monochromatic ramp derived from the room's own accent, documented here
     as an intentional design choice, not a missing feature. */
  --chart-1: var(--habitat-accent);
  --chart-2: color-mix(in oklab, var(--habitat-accent) 80%, var(--habitat-text) 20%);
  --chart-3: color-mix(in oklab, var(--habitat-accent) 60%, var(--habitat-bg) 40%);
  --chart-4: color-mix(in oklab, var(--habitat-accent) 45%, var(--habitat-text) 55%);
  --chart-5: color-mix(in oklab, var(--habitat-accent) 85%, var(--habitat-border) 15%);

  /* Sidebar is just another elevated surface in habitat's model. */
  --sidebar: var(--habitat-surface);
  --sidebar-foreground: var(--habitat-text);
  --sidebar-primary: var(--habitat-accent);
  --sidebar-primary-foreground: var(--habitat-bg);
  --sidebar-accent: color-mix(in oklab, var(--habitat-accent) 14%, var(--habitat-bg));
  --sidebar-accent-foreground: var(--habitat-text);
  --sidebar-border: var(--habitat-border);
  --sidebar-ring: var(--habitat-accent);
}
