/* ==========================================================================
   Aiqbee Hive — design tokens (Command Hive, light theme)
   Single source of truth for colour, type, spacing, radii and elevation.
   Templates and components reference these variables only — never hex.
   Contrast ratios noted are against the surface they are used on (WCAG 2.2).
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/vendor/inter-5.3.0/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/vendor/jetbrains-mono-5.3.0/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/vendor/jetbrains-mono-5.3.0/jetbrains-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  /* --- Brand: ember (from the Aiqbee logo) --- */
  --ember-50: #FFF5F0;
  --ember-100: #FFEFE8;
  --ember-200: #FFD2C2;
  --ember-400: #FF8A63;
  --ember-500: #FF6B3D;   /* brand; accents, indicators, focus — not text */
  --ember-600: #E8602C;   /* logo glyph */
  --ember-700: #C74E23;   /* primary button bg: 4.62:1 with white */
  --ember-800: #B0431C;   /* primary hover */
  --ember-text: #B8461C;  /* accent text: 5.34:1 on white, 4.77:1 on ember-100 */

  /* --- Ink (rail, graph canvas, code) --- */
  --ink-950: #070B14;
  --ink-900: #0B1220;
  --ink-800: #111A2E;
  --ink-700: #1A2540;
  --ink-600: #26324F;
  --ink-text: #D5DCEA;    /* 12.3:1 on ink-900 */
  --ink-muted: #9AA6BE;   /* 7.6:1 on ink-900 */

  /* --- Complementary palette --- */
  --teal-500: #14B8A6;  --teal-50: #E3F6F3;  --teal-text: #0B7468;
  --iris-500: #7C6CF6;  --iris-50: #EEEBFE;  --iris-text: #5847D6;
  --azure-500: #3B9EFF; --azure-50: #E7F1FF; --azure-text: #1B63BD;
  --honey-500: #F5B13D; --honey-50: #FEF4E2; --honey-text: #8A5A08;
  --rose-500: #F2557A;  --rose-50: #FDE8EE;  --rose-text: #B42347;
  --sage-500: #8DBF5A;  --sage-50: #EEF6E6;  --sage-text: #4C7426;

  /* Neuron type colours (graph, chips, lists) — index = type order mod 7 */
  --type-0: var(--ember-500);
  --type-1: var(--teal-500);
  --type-2: var(--iris-500);
  --type-3: var(--honey-500);
  --type-4: var(--rose-500);
  --type-5: var(--azure-500);
  --type-6: var(--sage-500);

  /* --- Neutrals / surfaces --- */
  --bg: #EEF1F6;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --surface-3: #EEF2F8;
  --border: #E2E7EF;
  --border-strong: #CDD5E1;
  --text: #0E1626;
  --text-2: #3A4559;     /* 9.65:1 on white */
  --muted: #5B677D;      /* 5.7:1 on white, 5.0:1 on --bg */
  --chip: #EEF2F8;

  /* --- Status --- */
  --success: #0E7C5A;  --success-50: #E3F4EC;
  --warning: #B45309;  --warning-50: #FEF3E2;
  --danger: #C2261D;   --danger-50: #FDE9E7;
  --info: #1F6FD1;     --info-50: #E7F1FF;

  /* --- Semantic aliases --- */
  --accent: var(--ember-700);
  --accent-soft: var(--ember-100);
  --accent-text: var(--ember-text);
  --focus-ring: 0 0 0 3px rgba(255, 107, 61, 0.45);

  /* --- Type --- */
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  /* Simplified Chinese: the vendored Inter is Latin-only, so Latin runs keep Inter
     and Han characters fall through to the OS's own Simplified Chinese UI font.
     System fonts only: no CJK web font is vendored or downloaded (several MB, and
     the UI must work offline). Listed explicitly so browsers don't pick a Japanese
     or Traditional face for the unified Han code points. */
  --font-zh-hans: "Inter", "Segoe UI Variable", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC",
    "WenQuanYi Micro Hei", system-ui, -apple-system, sans-serif;
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 26px;
  --fs-3xl: 30px;

  /* --- Space / radius / elevation --- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-pill: 999px;
  --elev-1: 0 1px 2px rgba(11, 18, 32, 0.05);
  --elev-2: 0 1px 2px rgba(11, 18, 32, 0.05), 0 10px 28px rgba(11, 18, 32, 0.07);
  --elev-3: 0 24px 60px rgba(11, 18, 32, 0.22);

  /* --- Layout --- */
  --rail-w: 76px;
  --topbar-h: 60px;
  --bottom-nav-h: 68px;
  --content-max: 1480px;

  /* --- Motion --- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 120ms;
  --t-med: 200ms;

  /* --- Bootstrap bridge (pages still using Bootstrap utilities inherit the theme) --- */
  --bs-body-font-family: var(--font);
  --bs-body-font-size: var(--fs-base);
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--border);
  --bs-primary: var(--ember-700);
  --bs-primary-rgb: 199, 78, 35;
  --bs-link-color: var(--ember-text);
  --bs-link-color-rgb: 184, 70, 28;
  --bs-link-hover-color: var(--ember-800);
  --bs-secondary-color: var(--muted);
  --bs-border-radius: var(--r-md);
  --bs-border-radius-lg: var(--r-lg);
  --bs-emphasis-color: var(--text);
}

/* <html lang="zh-Hans"> switches the whole UI; the switcher's own 简体中文 label
   carries lang="zh-Hans" so it renders in a Chinese face on every page. */
:root:lang(zh-Hans) { --font: var(--font-zh-hans); }
.lang-item:lang(zh-Hans) { font-family: var(--font-zh-hans); }

@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 0ms; --t-med: 0ms; }
}
