/* CanAI Cloud · shared design tokens */
/* Manrope is self hosted so the public, guest and operator surfaces render the
   same Cyrillic shapes without a third party request. The mono face remains a
   functional companion for IDs, logs and other fixed width data. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/manrope-variable.ttf") format("truetype");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("public/fonts/jetbrains-mono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("public/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
[data-theme="dark"] {
  color-scheme: dark;
  /* Flat graphite surfaces keep hierarchy legible without a glass gradient. */
  --bg: #181818;
  --surface: #1f1f1f;
  --surface-solid: #1f1f1f;
  --surface-2: #181818;
  --surface-3: #272727;
  --canvas-bg: #181818;
  --dot-grid: rgba(255, 255, 255, 0.08);
  --border: #383838;
  --border-strong: #555555;
  --text: #f6f7f8;
  --text-2: #c2c2c2;
  --text-3: #929292;
  --accent: #d33f21;
  --accent-hover: #bd3518;
  --accent-press: #a52e14;
  --accent-ink: #ffffff;
  --accent-soft: rgba(211, 63, 33, 0.16);
  --accent-soft-border: rgba(211, 63, 33, 0.42);
  --accent-text: #ff987f;
  --danger: #ff7065;
  --danger-soft: rgba(255, 112, 101, 0.14);
  --warn-text: #f0b65b;
  --warn-soft: rgba(240, 182, 91, 0.14);
  --warn-border: rgba(240, 182, 91, 0.3);
  --ok: #65c18c;
  --ok-soft: rgba(101, 193, 140, 0.14);
  --ok-border: rgba(101, 193, 140, 0.3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 22px 64px rgba(0, 0, 0, 0.46);
  --material-thin: rgba(31, 31, 31, 0.82);
  --material-regular: rgba(31, 31, 31, 0.94);
  --material-thick: rgba(31, 31, 31, 0.98);
  --scrim: rgba(0, 0, 0, 0.58);
  --topbar-bg: rgba(24, 24, 24, 0.94);
}

:root {
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Type scale: 12 / 14 / 16 / 18 / 20 / 24 / 30 / 36 / 48 / 60. */
  --text-micro: 12px;
  --text-secondary: 12px;
  --text-control: 14px;
  --text-body: 14px;
  --text-panel-title: 16px;
  --text-title-sm: 16px;
  --text-title: 18px;
  --text-title-lg: 20px;
  --text-title-xl: 24px;
  --text-display: 30px;
  --text-display-lg: 36px;
  --text-hero: 48px;
  --text-hero-lg: 60px;

  /* Spacing scale: 2 / 4 / 8 / 12 / 16 / 24 / 32 / 40 / 48 / 64 / 80 / 96. */
  --space-0: 0;
  --space-25: 2px;
  --space-50: 4px;
  --space-75: 8px;
  --space-100: 12px;
  --space-200: 16px;
  --space-300: 24px;
  --space-400: 32px;
  --space-500: 40px;
  --space-600: 48px;
  --space-700: 64px;
  --space-800: 80px;
  --space-900: 96px;
  /* Existing names are kept as compatibility aliases for the admin surface. */
  --space-1: var(--space-50);
  --space-2: var(--space-75);
  --space-3: var(--space-100);
  --space-4: var(--space-200);
  --space-5: var(--space-300);
  --space-3xs: var(--space-50);
  --space-2xs: var(--space-75);
  --space-xs: var(--space-100);
  --space-sm: var(--space-200);
  --space-md: var(--space-300);
  --space-lg: var(--space-400);
  --space-xl: var(--space-600);
  --space-2xl: var(--space-800);

  --text-xs: var(--text-secondary);
  --text-sm: var(--text-body);
  --text-md: var(--text-title-sm);
  --text-lg: var(--text-title);
  --text-xl: var(--text-display);

  --control-h-mini: 32px;
  --control-h-compact: 36px;
  --control-h-standard: 40px;
  --control-h-emphasis: 44px;
  --control-height: var(--control-h-standard);

  --radius-panel: 16px;
  --radius-control: 8px;
  --radius-compact: 8px;
  --radius-pill: var(--radius-compact);
  --radius-input: var(--radius-control);
  --radius-card: var(--radius-panel);
  --rule-thin: 1px;

  --tracking-label: 0.06em;
  --word-spacing-ui: 0.06em;
  --line-body: 1.5em;
  --line-reserved: 1.5em;
  --state-disabled: 0.55;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --spring-ui: linear(0, 0.2 7%, 0.48 16%, 0.7 27%, 0.85 41%, 0.94 57%, 0.985 76%, 1);
  --dur-active: 80ms;
  --dur-short: 220ms;
  --dur-medium: 360ms;

  /* Semantic roles used throughout the existing HTML and admin code. */
  --color-paper: var(--bg);
  --color-paper-2: var(--surface-2);
  --color-surface: var(--surface-solid);
  --color-ink: var(--text);
  --color-ink-2: var(--text-2);
  --color-muted: var(--text-3);
  --color-rule: var(--border);
  --color-accent: var(--accent);
  --color-accent-ink: var(--accent-ink);
  --color-good: var(--ok);
  --color-warn-bg: var(--warn-soft);
  --color-calm-bg: var(--surface-3);
  --color-accent-text: var(--accent-text);
  --color-focus: var(--accent-text);
  --color-shadow: rgba(0, 0, 0, 0.46);
  --color-backdrop: var(--scrim);
}

button,
input,
select,
textarea {
  min-height: var(--control-height);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f0f1f2;
  --surface-3: #e5e7e9;
  --canvas-bg: #f0f1f2;
  --dot-grid: rgba(24, 24, 24, 0.1);
  --border: #d9dcdf;
  --border-strong: #b9bec3;
  --text: #181818;
  --text-2: #565a61;
  --text-3: #6b7079;
  --accent: #d33f21;
  --accent-hover: #bd3518;
  --accent-press: #a52e14;
  --accent-ink: #ffffff;
  --accent-soft: #fcebe6;
  --accent-soft-border: #f2b8ab;
  --accent-text: #a8321e;
  --danger: #b83225;
  --danger-soft: #fbeae7;
  --warn-text: #8a5a12;
  --warn-soft: #fbf1df;
  --warn-border: #efd9ac;
  --ok: #157f4e;
  --ok-soft: #eaf6ee;
  --ok-border: #cbead7;
  --shadow-sm: 0 1px 2px rgba(20, 22, 26, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 22, 26, 0.1);
  --shadow-lg: 0 18px 48px rgba(20, 22, 26, 0.16);
  --material-thin: rgba(255, 255, 255, 0.86);
  --material-regular: rgba(255, 255, 255, 0.94);
  --material-thick: rgba(255, 255, 255, 0.98);
  --scrim: rgba(24, 24, 24, 0.34);
  --topbar-bg: rgba(246, 247, 248, 0.94);
  --color-shadow: rgba(20, 22, 26, 0.16);
}
