/* INC Innovation Center brand layer for LibreChat (vINCent).
 *
 * Injected into the prebuilt client by inc-branding.sh, after the app's own
 * stylesheet. LibreChat's REACT_APP_THEME_* variables are inlined at BUILD
 * time, so they cannot theme the registry image; overriding the CSS variables
 * the theme layer reads achieves the same thing at runtime.
 *
 * Every theme variable holds a bare "R G B" triplet (Tailwind wraps it as
 * rgb(var(--x) / alpha)). Never write hex into a --token here.
 *
 * Selectors are `html:root` / `html.dark` on purpose: one notch more specific
 * than upstream's `:root` / `html` / `.dark`, so the order in which Vite
 * appends lazy CSS chunks cannot undo the brand.
 *
 * Palette (INC 2026 theme):
 *   navy   #030D1C  3 13 28     field / darkest ramp step
 *   navy   #051835  5 24 53     gradient start
 *   blue   #1A3160  26 49 96    ramp 5
 *   blue   #426598  66 101 152  ramp 4
 *   blue   #6F8FBF  111 143 191 ramp 3
 *   blue   #8EBEE2  142 190 226 ramp 2
 *   blue   #CAE1F2  202 225 242 ramp 1
 *   cyan   #05BBED  5 187 237   signal: rules, focus, links on dark
 *   magenta#FC00B5  252 0 181   signal: one thing per view
 */

/* ------------------------------------------------------------------ */
/* 1. Base ramp: LibreChat's neutral greys, re-tinted towards INC navy. */
/*    Every semantic surface/text/border token is built from these, so  */
/*    this one block moves both light and dark mode onto the brand.     */
/* ------------------------------------------------------------------ */
html:root {
  --gray-20: 238 242 248;
  --gray-50: 245 248 252;
  --gray-100: 234 240 247;
  --gray-200: 220 229 240;
  --gray-300: 196 210 228;
  --gray-400: 142 160 189;
  --gray-500: 92 110 140;
  --gray-600: 60 78 110;
  --gray-650: 44 62 96;
  --gray-700: 30 46 78;
  --gray-800: 15 31 61;
  --gray-850: 9 24 48;
  --gray-875: 7 20 42;
  --gray-900: 3 13 28;
  --gizmo-gray-500: 142 160 189;
  --gizmo-gray-600: 92 110 140;
  --gizmo-gray-950: 3 13 28;

  --inc-navy: 3 13 28;
  --inc-navy-2: 5 24 53;
  --inc-blue-5: 26 49 96;
  --inc-blue-4: 66 101 152;
  --inc-blue-3: 111 143 191;
  --inc-blue-2: 142 190 226;
  --inc-blue-1: 202 225 242;
  --inc-cyan: 5 187 237;
  --inc-magenta: 252 0 181;
  --inc-field: linear-gradient(45deg, #051835 0%, #030d1c 77%);
  --inc-signal: linear-gradient(90deg, #05bbed 0%, #fc00b5 100%);

  /* Century Gothic is the brand face. It ships with Microsoft Office on
   * Windows/macOS; the tail keeps the geometric look where it is missing.
   * Deliberately no web-font hotlink: Google Fonts from a German site is a
   * GDPR problem, and Century Gothic is not licensed for self-hosting here. */
  --inc-font: 'Century Gothic', CenturyGothic, 'URW Gothic', 'URW Gothic L', AppleGothic,
    Futura, 'Avant Garde', 'Segoe UI', system-ui, sans-serif;
  --theme-font-family: var(--inc-font);
}

/* ------------------------------------------------------------------ */
/* 2. Light mode: white field, navy ink, blue-ramp actions             */
/*    (innovation-center.com).                                          */
/* ------------------------------------------------------------------ */
html:root {
  --brand-purple: var(--inc-magenta);
  --text-primary: var(--inc-navy);
  --link: var(--inc-blue-4);
  --link-hover: var(--inc-blue-5);
  --link-visited: 100 133 155; /* folHlink #64859B */
  --accent-primary: var(--inc-blue-4);
  --accent-primary-hover: var(--inc-blue-5);
  --ring-primary: var(--inc-cyan);
  --surface-submit: 17 45 78; /* #112D4E, the website's button navy */
  --surface-submit-hover: var(--inc-navy-2);
  --surface-active: var(--gray-200);
  --surface-overlay: var(--inc-navy);
  --status-info: var(--inc-blue-4);
  --status-info-subtle: 237 244 251;
  --status-info-border: var(--inc-blue-2);
  --status-verified: var(--inc-cyan);
  --surface-inverted: var(--inc-navy);
  --surface-inverted-hover: var(--inc-blue-5);
  --provider-azure: linear-gradient(45deg, #051835, #426598);

  /* Categorical series (active tool badges, category icons, usage meter).
   * Upstream's amber/orange/teal set clashes with the brand, so: blue-ramp
   * shades, alternating light/dark so neighbours stay distinguishable. */
  --series-1: var(--inc-blue-5);
  --series-2: var(--inc-blue-3);
  --series-3: var(--inc-blue-4);
  --series-4: var(--inc-navy-2);
  --series-5: 100 133 155;
  --series-6: 44 48 88;
  --series-7: var(--inc-blue-2);
  --series-8: 120 140 170;
}

/* ------------------------------------------------------------------ */
/* 3. Dark mode: the INC navy field (ai-navigator.de). The default.    */
/* ------------------------------------------------------------------ */
html.dark {
  --brand-purple: var(--inc-magenta);
  --presentation: var(--gray-850);
  --text-primary: 245 247 252;
  --text-secondary: var(--gray-300);
  --text-secondary-alt: var(--gray-400);
  --text-tertiary: var(--gray-400);
  --text-muted: 156 168 196;
  --link: var(--inc-cyan);
  --link-hover: 105 214 244;
  --link-visited: var(--inc-blue-2);
  --accent-primary: var(--inc-blue-2);
  --accent-primary-hover: var(--inc-blue-1);
  --ring-primary: var(--inc-cyan);
  --header-primary: var(--gray-850);
  --header-hover: var(--gray-700);
  --header-button-hover: var(--gray-700);
  --surface-primary: var(--inc-navy);
  --surface-primary-alt: 6 18 38;
  --surface-primary-contrast: 6 18 38;
  --surface-secondary: 10 24 50;
  --surface-secondary-alt: 13 30 60;
  --surface-tertiary: 19 37 71;
  --surface-tertiary-alt: 19 37 71;
  --surface-chat: 13 30 60;
  --surface-dialog: 8 21 44;
  --surface-overlay: 1 6 14;
  --surface-hover: 26 45 82;
  --surface-hover-alt: 34 56 99;
  --surface-composer-hover: 26 45 82;
  --surface-active: var(--inc-blue-5);
  --surface-active-alt: 22 40 76;
  --surface-submit: var(--inc-blue-4);
  --surface-submit-hover: 84 122 176;
  --border-light: 29 47 84;
  --border-medium: 41 62 104;
  --border-medium-alt: 41 62 104;
  --border-heavy: 66 88 130;
  --border-xheavy: var(--inc-blue-3);
  --status-info: var(--inc-blue-2);
  --status-info-subtle: 10 28 60;
  --status-info-border: var(--inc-blue-5);
  --status-verified: var(--inc-cyan);
  --surface-inverted: var(--inc-blue-1);
  --surface-inverted-hover: 255 255 255;
  --text-inverted: var(--inc-navy);
  --chart-widget-surface: 10 24 50;
  --chart-widget-stroke: 29 47 84;
  --switch-unchecked: 66 88 130;

  --series-1: var(--inc-blue-2);
  --series-2: var(--inc-blue-3);
  --series-3: var(--inc-blue-1);
  --series-4: 120 200 240;
  --series-5: 100 133 155;
  --series-6: 160 175 215;
  --series-7: 84 122 176;
  --series-8: 180 200 225;
}

/* High contrast keeps its own AAA palette: never re-tint it. */
html.high-contrast {
  --theme-font-family: var(--inc-font);
}

/* ------------------------------------------------------------------ */
/* 4. Type                                                              */
/* ------------------------------------------------------------------ */
html,
body,
.font-sans {
  font-family: var(--inc-font);
}
/* Century Gothic sets wide; a hair of negative tracking keeps long answers
 * close to the measure LibreChat was laid out for. */
.markdown,
.prose {
  letter-spacing: -0.005em;
}
code,
pre,
kbd,
samp,
.font-mono {
  font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, 'Cascadia Mono', Consolas,
    monospace;
  letter-spacing: normal;
}

/* ------------------------------------------------------------------ */
/* 5. Page field                                                        */
/* ------------------------------------------------------------------ */
.dark body,
.dark html {
  background-color: #030d1c;
}
html:not(.high-contrast) ::selection {
  background-color: rgb(var(--inc-cyan) / 0.35);
}

/* ------------------------------------------------------------------ */
/* 6. Signature details                                                 */
/* ------------------------------------------------------------------ */

/* Send button: the one place the cyan-to-magenta signal appears in the
 * chat view, so it reads as the primary action. */
html:not(.high-contrast) #send-button:not(:disabled) {
  background-image: var(--inc-signal);
  background-color: transparent;
  color: #ffffff;
  border-color: transparent;
}
html:not(.high-contrast) #send-button:not(:disabled) svg {
  color: #ffffff;
}

/* Thin cyan rule as the focus ring, as on the brand's covers. */
html:not(.high-contrast) :focus-visible {
  outline-color: rgb(var(--inc-cyan));
}

/* Scrollbars in the navy ramp. */
html.dark:not(.high-contrast) * {
  scrollbar-color: rgb(41 62 104) transparent;
}

/* ------------------------------------------------------------------ */
/* 7. Login / registration pages                                        */
/*    AuthLayout is the only screen rendering assets/logo.svg.          */
/* ------------------------------------------------------------------ */

/* Long logo, required here: nothing else on the page spells out
 * "Innovation Center". 40px tall upstream makes the wordmark unreadable. */
div:has(> img[src='assets/logo.svg']) {
  height: 5.5rem;
  margin-top: 2.5rem;
}
/* logo.svg is the white mark (dark default); light mode swaps in black. */
html:not(.dark) img[src='assets/logo.svg'] {
  content: url('inc-logo-black.svg');
}

/* Dark: the INC field with ai-navigator's faint cyan / magenta glows. */
html.dark:not(.high-contrast) .min-h-screen:has(img[src='assets/logo.svg']) {
  background:
    radial-gradient(circle at 100% 0%, rgb(var(--inc-magenta) / 0.1), transparent 45%),
    radial-gradient(circle at 0% 100%, rgb(var(--inc-cyan) / 0.1), transparent 45%),
    var(--inc-field);
}
html.dark:not(.high-contrast) .min-h-screen:has(img[src='assets/logo.svg']) main > div {
  background-color: rgb(8 21 44 / 0.88);
  border: 1px solid rgb(var(--inc-cyan) / 0.18);
  border-radius: 16px;
  padding-top: 2rem;
  padding-bottom: 2rem;
  backdrop-filter: blur(6px);
}
html:not(.dark):not(.high-contrast) .min-h-screen:has(img[src='assets/logo.svg']) main > div {
  border: 1px solid rgb(var(--gray-200));
  border-radius: 16px;
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.min-h-screen:has(img[src='assets/logo.svg']) h1 {
  font-weight: 700;
  letter-spacing: -0.01em;
}
