/*
 * Prajna skin — applied layer (W4 BrowserBridge).
 *
 * Consumes the token socket (tokens.css) and maps it onto the *renderer's own*
 * skin variables. The renderer already has a first-class skin system
 * (apps/desktop/src/themes): `DesktopThemeColors` + typography are written
 * straight to CSS vars, and its own type file states:
 *
 *     "Everything else (layout, sizing, radius, line-height) lives in styles.css"
 *
 * So a skin is colour + type by construction. That is how this file honours the
 * hard rule — **restyle, never re-space**: it declares NO spacing, sizing,
 * radius, line-height or layout property. Only colour vars and font stacks.
 *
 * Applied by the shell over the UNMODIFIED renderer (zero upstream deltas), so
 * it carries to the desktop wrapper too — one skin, two wrappers (DESIGN.md).
 *
 * Design authority: DESIGN.md — "quiet premium intelligence".
 *   - neutral monochrome base, warm-free; dark is the renderer's home mood
 *   - ONE signature accent, deep indigo #4338CA, used sparingly
 *   - accent ONLY for primary buttons, active/focus, links, small badges and
 *     the working cue — NEVER as a background, never a gradient
 *   - platform-native type, restrained
 *   - WCAG AA contrast floor
 *
 * Note on `--color-accent`: in this renderer "accent" is the subtle *hover
 * surface*, not the brand colour. Painting it indigo would make the accent a
 * background — exactly what DESIGN.md forbids. The brand indigo goes to
 * `midground` / `ring` / `composer-ring`, which the renderer documents as the
 * brand-accent stroke (focus rings, streaming cursor, active pills, selection).
 */

/* ---------- LIGHT: near-black on warm-free white ---------- */
:root {
  --color-background: #ffffff !important;
  --color-foreground: #0a0a0a !important;

  --color-card: #ffffff !important;
  --color-card-foreground: #0a0a0a !important;
  --color-popover: #ffffff !important;
  --color-popover-foreground: #0a0a0a !important;

  /* Quiet neutral surfaces — no accent tint. */
  --color-muted: #f4f4f5 !important;
  --color-muted-foreground: #6e6e73 !important;
  --color-secondary: #f4f4f5 !important;
  --color-secondary-foreground: #0a0a0a !important;
  --color-accent: #f0f0f1 !important; /* hover surface, deliberately neutral */
  --color-accent-foreground: #0a0a0a !important;

  --color-border: #e4e4e7 !important;
  --color-input: #e4e4e7 !important;

  /* The one signature accent. */
  --color-primary: #4338ca !important;
  --color-primary-foreground: #ffffff !important;
  --color-ring: #4338ca !important;
  --color-midground: #4338ca !important;
  --color-midground-foreground: #ffffff !important;
  --dt-composer-ring: #4338ca !important;

  --color-destructive: #b3261e !important;
  --color-destructive-foreground: #ffffff !important;

  --color-sidebar: #fafafa !important;
  --color-sidebar-foreground: #0a0a0a !important;
  --color-sidebar-border: #e4e4e7 !important;
  --color-sidebar-accent: #f0f0f1 !important;
  --color-sidebar-accent-foreground: #0a0a0a !important;
  --color-sidebar-primary: #4338ca !important;

  /* Re-seed the renderer's derivation inputs so nothing re-tints surfaces
     blue. Colour only — the mix knobs are ratios, not spacing. */
  --theme-foreground: #0a0a0a !important;
  --theme-primary: #4338ca !important;
  --theme-midground: #4338ca !important;
  --theme-background-seed: #ffffff !important;
  --theme-sidebar-seed: #fafafa !important;
  --theme-card-seed: #ffffff !important;
  --theme-elevated-seed: #ffffff !important;
  --theme-neutral-chrome: #f4f4f5 !important;
  --theme-neutral-sidebar: #fafafa !important;
  --theme-neutral-card: #ffffff !important;
  /* Keep the accent OUT of surfaces (DESIGN: never backgrounds). */
  --theme-mix-chrome: 100% !important;
  --theme-mix-sidebar: 100% !important;
  --theme-mix-card: 0% !important;
  --theme-mix-elevated: 0% !important;
  --theme-mix-bubble: 0% !important;
  --theme-bubble-seed: #f4f4f5 !important;
}

/* ---------- DARK: soft neutral surfaces (the renderer's home mood) ---------- */
:root.dark {
  --color-background: #111111 !important;
  --color-foreground: #f2f2f7 !important;

  --color-card: #1c1c1e !important;
  --color-card-foreground: #f2f2f7 !important;
  --color-popover: #1c1c1e !important;
  --color-popover-foreground: #f2f2f7 !important;

  --color-muted: #1c1c1e !important;
  --color-muted-foreground: #98989d !important;
  --color-secondary: #1c1c1e !important;
  --color-secondary-foreground: #f2f2f7 !important;
  --color-accent: #242426 !important; /* neutral hover surface */
  --color-accent-foreground: #f2f2f7 !important;

  --color-border: #2c2c2e !important;
  --color-input: #2c2c2e !important;

  /* Same signature accent; the stroke/text variant is lightened only enough to
     clear AA on dark — same hue, not a second colour. */
  --color-primary: #4338ca !important;
  --color-primary-foreground: #ffffff !important;
  --color-ring: #6366f1 !important;
  --color-midground: #6366f1 !important;
  --color-midground-foreground: #ffffff !important;
  --dt-composer-ring: #6366f1 !important;

  --color-destructive: #e75e78 !important;
  --color-destructive-foreground: #0a0a0a !important;

  --color-sidebar: #0d0d0e !important;
  --color-sidebar-foreground: #f2f2f7 !important;
  --color-sidebar-border: #2c2c2e !important;
  --color-sidebar-accent: #242426 !important;
  --color-sidebar-accent-foreground: #f2f2f7 !important;
  --color-sidebar-primary: #6366f1 !important;

  --theme-foreground: #f2f2f7 !important;
  --theme-primary: #4338ca !important;
  --theme-midground: #6366f1 !important;
  --theme-neutral-chrome: #111111 !important;
  --theme-neutral-sidebar: #0d0d0e !important;
  --theme-neutral-card: #1c1c1e !important;
  --theme-mix-chrome: 100% !important;
  --theme-mix-card: 0% !important;
  --theme-mix-elevated: 0% !important;
  --theme-mix-bubble: 0% !important;
}

/* ---------- Typography: platform-native, restrained ---------- */
:root {
  --dt-font-sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui,
    Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Noto Color Emoji", emoji !important;
  --dt-font-mono:
    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace,
    "Apple Color Emoji", "Segoe UI Emoji", emoji !important;
}
