/*
 * BotBook identity tokens — mirror of botui/ui/suite/css/identity-tokens.css.
 *
 * Neutrals, radii, shadows, motion, type scale and font stacks are fixed;
 * only the accent family may change. Dark values are keyed by the scheme
 * attribute MkDocs Material sets on <html> (and by data-color-scheme for
 * parity with the suite). Never introduce a parallel palette here.
 *
 * Fonts are local woff2 copies from botui/ui/suite/identity/fonts/ — no CDN.
 * Source of truth: DESIGN-SYSTEM.md and the canonical identity-tokens.css.
 */

/* == Local fonts (Inter variable, Fira Sans, system mono) ================= */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/fira-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/fira-sans-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/fira-sans-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/fira-sans-latin-700-normal.woff2') format('woff2');
}

/* == Light (reference) =================================================== */
:root {
  --id-accent: #F28C28;
  --id-accent-hover: #D4751C;
  --id-accent-light: #FDB96A;
  --id-accent-text: #B45309;
  --id-accent-soft: rgb(242 140 40 / .1);
  --id-accent-glow: rgb(242 140 40 / .26);
  --id-on-accent: #2C2C2C;
  --id-paper: #FFF8F2;

  --id-ink: #2C2C2C;
  --id-text: #4B5563;
  --id-muted: #5F6673;
  --id-gray-100: #f3f4f6;
  --id-gray-200: #e5e7eb;
  --id-gray-300: #d1d5db;
  --id-gray-400: #9ca3af;
  --id-gray-500: #6b7280;

  --id-surface: rgb(255 255 255 / .9);
  --id-surface-solid: #ffffff;
  --id-line: rgb(229 231 235 / .8);
  --id-line-soft: rgb(243 244 246 / .9);
  --id-fill: rgb(243 244 246 / .8);

  --id-font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --id-font-heading: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --id-font-logo: 'Fira Sans', system-ui, sans-serif;

  --id-text-xs: 0.75rem;
  --id-text-sm: 0.75rem;
  --id-text-base: 0.875rem;
  --id-text-md: 0.9375rem;
  --id-text-lg: 1rem;
  --id-text-xl: 1.0625rem;
  --id-text-2xl: 1.25rem;
  --id-text-3xl: 1.5rem;
  --id-text-4xl: 2rem;
  --id-text-5xl: 2.25rem;

  --id-radius-hero: calc(var(--radius, 0.75rem) + 12px);
  --id-radius-card: calc(var(--radius, 0.75rem) + 8px);
  --id-radius-panel: calc(var(--radius, 0.75rem) + 6px);
  --id-radius-bar: calc(var(--radius, 0.75rem) + 4px);
  --id-radius-control: var(--radius, 0.75rem);
  --id-radius-sm: max(4px, calc(var(--radius, 0.75rem) - 4px));
  --id-radius-pill: 999px;

  --id-shadow-card: 0 1px 2px rgb(0 0 0 / .05);
  --id-shadow-card-hover: 0 8px 20px -10px rgb(0 0 0 / .12),
                          0 1px 2px rgb(0 0 0 / .05);
  --id-shadow-float: 0 10px 15px -3px rgb(0 0 0 / .04),
                     0 4px 6px -4px rgb(0 0 0 / .04);

  --id-ease: cubic-bezier(.22, 1, .36, 1);
  --id-ease-standard: cubic-bezier(.25, .1, .25, 1);
  --id-dur-fast: 150ms;
  --id-dur-normal: 200ms;
  --id-dur-medium: 350ms;
  --id-dur-slow: 450ms;
  --id-dur-glow: 20s;

  --id-space-1: 4px;
  --id-space-2: 8px;
  --id-space-3: 12px;
  --id-space-4: 16px;
  --id-space-5: 20px;
  --id-space-6: 24px;
  --id-space-8: 32px;
  --id-space-10: 40px;

  --id-danger: #dc2626;
  --id-danger-text: #b91c1c;
  --id-danger-soft: rgb(220 38 38 / .06);
  --id-danger-line: rgb(220 38 38 / .3);
  --id-danger-icon: #ef4444;
  --id-success: #22c55e;
  --id-success-text: #16a34a;
  --id-success-soft: rgb(34 197 94 / .06);
  --id-success-line: rgb(34 197 94 / .25);
  --id-warn: #d97706;
  --id-warn-text: #92400e;
  --id-warn-soft: rgb(234 179 8 / .08);
  --id-warn-bg: #fef3c7;
  --id-overlay: rgb(0 0 0 / .3);
  --id-overlay-heavy: rgb(0 0 0 / .7);

  --id-hl-keyword: var(--id-accent-text);
  --id-hl-string: #059669;
  --id-hl-comment: var(--id-gray-400);
  --id-hl-number: #d97706;
  --id-hl-function: #2563eb;
  --id-hl-attr: #0d9488;
  --id-hl-tag: #dc2626;
  --id-hl-deletion: #dc2626;
  --id-hl-deletion-bg: rgb(239 68 68 / .08);
  --id-hl-addition-bg: rgb(5 150 105 / .08);

  --id-scrollbar-thumb: var(--id-gray-300);
  --id-scale: 1;

  --id-accent-muted: color-mix(in srgb, var(--id-accent) 55%, transparent);
  --id-text-secondary: var(--id-text);
  --id-fg: var(--id-ink);
  --id-accent-rgb: 242, 140, 40;
  --id-accent-bg: var(--id-accent-soft);
  --id-border: var(--id-line);
  --id-radius: var(--id-radius-control);
  --id-surface-alt: var(--id-fill);
  --id-surface-hover: var(--id-fill);
  --id-font-mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --id-focus: 0 0 0 2px var(--id-accent-text);
}

/* == Dark palette ======================================================== */
:root[data-md-color-scheme='slate'],
:root[data-md-color-scheme='black'],
:root[data-color-scheme='dark'] {
  --id-accent: hsl(30 89% 55%);
  --id-accent-hover: color-mix(in srgb, hsl(30 89% 55%) 86%, #000);
  --id-accent-light: color-mix(in srgb, hsl(30 89% 55%) 68%, #fff);
  --id-accent-text: hsl(32 96% 72%);
  --id-accent-soft: color-mix(in srgb, hsl(30 89% 55%) 12%, transparent);
  --id-accent-glow: color-mix(in srgb, hsl(30 89% 55%) 26%, transparent);
  --id-on-accent: hsl(0 0% 17%);
  --id-paper: hsl(34 11% 12%);
  --id-ink: hsl(240 12% 91%);
  --id-text: color-mix(in srgb, hsl(240 12% 91%) 82%, hsl(34 11% 12%));
  --id-muted: hsl(226 11% 56%);
  --id-gray-100: hsl(240 15% 21%);
  --id-gray-200: color-mix(in srgb, hsl(240 12% 91%) 12%, hsl(34 11% 12%));
  --id-gray-300: color-mix(in srgb, hsl(240 12% 91%) 22%, hsl(34 11% 12%));
  --id-gray-400: color-mix(in srgb, hsl(240 12% 91%) 46%, hsl(34 11% 12%));
  --id-gray-500: color-mix(in srgb, hsl(240 12% 91%) 62%, hsl(34 11% 12%));
  --id-surface: color-mix(in srgb, hsl(240 15% 17%) 90%, transparent);
  --id-surface-solid: hsl(240 15% 17%);
  --id-line: color-mix(in srgb, hsl(240 12% 26%) 90%, transparent);
  --id-line-soft: color-mix(in srgb, hsl(240 12% 26%) 55%, transparent);
  --id-fill: color-mix(in srgb, hsl(240 15% 21%) 80%, transparent);

  --id-accent-muted: color-mix(in srgb, var(--id-accent) 55%, transparent);
  --id-text-secondary: var(--id-text);
  --id-fg: var(--id-ink);
  --id-accent-rgb: 242, 140, 40;
  --id-accent-bg: var(--id-accent-soft);
  --id-border: var(--id-line);
  --id-radius: var(--id-radius-control);
  --id-surface-alt: var(--id-fill);
  --id-surface-hover: var(--id-fill);
  --id-font-mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  --id-danger: #f87171;
  --id-danger-text: #fca5a5;
  --id-danger-soft: rgb(220 38 38 / .12);
  --id-danger-line: rgb(220 38 38 / .4);
  --id-danger-icon: #f87171;
  --id-success: #4ade80;
  --id-success-text: #86efac;
  --id-success-soft: rgb(34 197 94 / .12);
  --id-success-line: rgb(34 197 94 / .35);
  --id-warn: #fbbf24;
  --id-warn-text: #fde68a;
  --id-warn-soft: rgb(234 179 8 / .15);
  --id-warn-bg: rgb(120 80 10 / .3);
  --id-overlay: rgb(0 0 0 / .5);
  --id-overlay-heavy: rgb(0 0 0 / .8);
  --id-scrollbar-thumb: var(--id-gray-300);

  --id-hl-string: #34d399;
  --id-hl-number: #fbbf24;
  --id-hl-function: #60a5fa;
  --id-hl-attr: #2dd4bf;
  --id-hl-tag: #f87171;
  --id-hl-deletion: #f87171;
  --id-hl-deletion-bg: rgb(239 68 68 / .15);
  --id-hl-addition-bg: rgb(5 150 105 / .15);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --id-dur-glow: 0s;
  }
}
