/*
 * carbon.css — IBM Carbon theme for Polotno (and any shadcn consumer).
 *
 * Single source of truth for the Carbon look: IBM Plex fonts + the standard
 * shadcn color tokens (--background / --foreground / --primary / …) on
 * :root (light) and .dark. The Polotno editor reads these via its tier-2
 * `var(--X, …)` chain, so importing this file re-themes the editor; a shadcn
 * app consumes the same tokens natively. Import:
 *
 *   import 'polotno/themes/carbon.css';   // editor + app
 *
 * Token format: raw color values (hex), matching Polotno's ui.css and
 * Tailwind v4 / current shadcn. Tailwind v3 shadcn apps expect HSL channel
 * triplets and will NOT consume these as-is.
 *
 * Accent is monochrome by design (--primary == --foreground); authentic
 * Carbon Blue 60 (#0f62fe) is intentionally retired to match the Polotno
 * brand. Red (#da1e28, Carbon Red 60) is kept for --destructive only.
 */

/* IBM Plex Sans — 400 / 500 / 600 / 700 (latin) */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/fontsource/fonts/ibm-plex-sans@latest/latin-400-normal.woff2')
    format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/fontsource/fonts/ibm-plex-sans@latest/latin-500-normal.woff2')
    format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/fontsource/fonts/ibm-plex-sans@latest/latin-600-normal.woff2')
    format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/fontsource/fonts/ibm-plex-sans@latest/latin-700-normal.woff2')
    format('woff2');
}

/* IBM Plex Mono — 400 / 500 (latin) */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/fontsource/fonts/ibm-plex-mono@latest/latin-400-normal.woff2')
    format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/fontsource/fonts/ibm-plex-mono@latest/latin-500-normal.woff2')
    format('woff2');
}

/* Wire the IBM Plex families into Polotno's public override hooks. Setting them
     on :root keeps this an opt-in, app-level choice; the editor reads
     var(--pn-font-sans, <system stack>) on its scoped roots. */
:root {
  --pn-font-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --pn-font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

/* Monochrome, matching the polotno-website sibling repo: black/white/gray only,
     NO blue anywhere in the UI (the website reserves blue for blog prose, which this
     app doesn't have). --primary == --foreground so every primary accent (buttons,
     links, icons, badges, focus) is monochrome and inverts per theme. Red is kept for
     `destructive` only — the one semantic color the website also keeps. Dark-first. */
:root {
  --background: #ffffff;
  --foreground: #161616; /* text + monochrome primary (inverts in .dark) */
  --card: #ffffff; /* website card (white tile) */
  --card-foreground: #161616;
  --popover: #ffffff;
  --popover-foreground: #161616;
  --primary: #161616; /* monochrome (= foreground); blue retired */
  --primary-foreground: #ffffff;
  --secondary: #f4f4f4; /* subtle light surface (gray 10) */
  --secondary-foreground: #161616;
  --muted: #f4f4f4; /* gray 10 */
  --muted-foreground: #525252; /* website light-muted (gray 70) */
  --accent: #e8e8e8; /* hover (gray 10 hover) */
  --accent-foreground: #161616;
  --destructive: #da1e28; /* danger (red) — the only retained color */
  --border: #c6c6c6; /* website card-border (gray 30) */
  --input: #c6c6c6;
  --ring: #161616; /* monochrome focus */
  /* Monochrome data-vis ramp (dark -> light grays). */
  --chart-1: #161616;
  --chart-2: #525252;
  --chart-3: #8d8d8d;
  --chart-4: #a8a8a8;
  --chart-5: #c6c6c6;
  --radius: 0;
  --sidebar: #ffffff;
  --sidebar-foreground: #161616;
  --sidebar-primary: #161616;
  --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: #e8e8e8;
  --sidebar-accent-foreground: #161616;
  --sidebar-border: #c6c6c6;
  --sidebar-ring: #161616;
}

/* dark = website brand surface (#161616). Default theme (see providers.tsx). */
.dark {
  --background: #161616; /* website --color-bg */
  --foreground: #ffffff; /* website --color-fg */
  --card: #262626; /* Carbon g100 layer-01 (gray 90) */
  --card-foreground: #ffffff;
  --popover: #262626;
  --popover-foreground: #ffffff;
  --primary: #ffffff; /* monochrome (= foreground); blue retired */
  --primary-foreground: #161616; /* contrast on the white primary surface */
  --secondary: #393939; /* visible secondary surface */
  --secondary-foreground: #ffffff;
  --muted: #262626; /* Carbon g100 layer-01 (gray 90) */
  --muted-foreground: #c6c6c6; /* Carbon g100 text-secondary (gray 30) */
  --accent: #333333; /* Carbon g100 layer-hover-01 */
  --accent-foreground: #ffffff;
  --destructive: #da1e28; /* website dashboard danger (red) */
  --border: #393939; /* website header divider (gray 80) */
  --input: #393939;
  --ring: #ffffff; /* monochrome focus */
  /* Monochrome data-vis ramp (light -> dark grays). */
  --chart-1: #ffffff;
  --chart-2: #c6c6c6;
  --chart-3: #a8a8a8;
  --chart-4: #8d8d8d;
  --chart-5: #6f6f6f;
  --sidebar: #161616;
  --sidebar-foreground: #ffffff;
  --sidebar-primary: #ffffff;
  --sidebar-primary-foreground: #161616;
  --sidebar-accent: #333333;
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: #393939;
  --sidebar-ring: #ffffff;
}
