/*
 * ADI Suite theme layer for ADI Chat (D-040, docs/architecture/brand-theming.md
 * in adi-suite). Plain CSS outside the Vite build, so vendor CSS can be
 * rebuilt or updated without merging: it only adds suite tokens, fonts, the
 * "adi." wordmark and the app switcher, and maps the vendor primary colour.
 * Selectors are doubled (:root:root) because the branding partial is included
 * before the Vite stylesheet in some layouts.
 */
:root:root {
  --adi-bg: #F6F7FA; --adi-card: #FFFFFF; --adi-text: #0E0E13; --adi-text-2: #474A59;
  --adi-muted: #595C6B; --adi-line: #D4D6E5; --adi-accent: #382BEB; --adi-accent-text: #2A1FB8;
  --adi-tint: #EDEEFB; --adi-on-accent: #FFFFFF;
  --adi-ok: #0A6F78; --adi-err: #B42F26; --adi-warn: #8A5A00;
  --adi-r: 14px;
  --adi-font-display: "Archivo", system-ui, sans-serif;
  --adi-font-text: "Instrument Sans", system-ui, sans-serif;
  --adi-font-mono: "IBM Plex Mono", ui-monospace, monospace;
}
:root:root.dark, :root:root[data-theme="dark"] {
  --adi-bg: #0B0B10; --adi-card: #15151D; --adi-text: #EDEEF5; --adi-text-2: #C3C5D3;
  --adi-muted: #A3A6B8; --adi-line: #2A2B38; --adi-accent: #7C73FF; --adi-accent-text: #A39CFF;
  --adi-tint: #1C1A40; --adi-on-accent: #0B0B10;
  --adi-ok: #3CC3A0; --adi-err: #FF8A80; --adi-warn: #E8B64C;
}

/* Fonts: Archivo for headings, Instrument Sans for text, IBM Plex Mono for numbers/labels */
html body { font-family: var(--adi-font-text); }
html body :is(h1, h2, h3) { font-family: var(--adi-font-display); letter-spacing: -0.02em; }
html body :is(code, kbd, pre, .font-mono) { font-family: var(--adi-font-mono); }

/* Wordmark "adi. chat" */
:where(.adi-wordmark) { display: inline-flex; }
.adi-wordmark { align-items: baseline; gap: 6px; color: var(--adi-text); line-height: 1; white-space: nowrap; }
.adi-wordmark b { font-family: var(--adi-font-display); font-weight: 800; font-stretch: 118%; letter-spacing: -0.05em; font-size: 26px; }
.adi-wordmark b i { font-style: normal; color: var(--adi-accent); }
.adi-wordmark > span { font-family: var(--adi-font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; color: var(--adi-text-2); }
.adi-wordmark--compact b { font-size: 22px; }


/* App switcher (static list until ADI Hub serves it) */
.adi-switcher { position: relative; }
.adi-switcher__btn { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; border-radius: 10px; color: var(--adi-text-2); }
.adi-switcher__btn:hover, .adi-switcher__btn[aria-expanded="true"] { background: var(--adi-tint); color: var(--adi-accent-text); }
.adi-switcher__pop {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 60; width: 320px;
  background: var(--adi-card); border: 1px solid var(--adi-line); border-radius: var(--adi-r);
  box-shadow: 0 12px 40px rgba(14, 14, 19, .18); padding: 12px;
}
.adi-switcher__title { margin: 2px 6px 10px; font: 500 11px/1.4 var(--adi-font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--adi-muted); }
.adi-switcher__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0; padding: 0; list-style: none; }
.adi-switcher__app {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px;
  border-radius: 12px; font-size: 13px; text-align: center; color: var(--adi-text); text-decoration: none;
}
a.adi-switcher__app:hover, .adi-switcher__app[aria-current="true"] { background: var(--adi-tint); color: var(--adi-accent-text); }
.adi-switcher__ic {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  font: 800 15px var(--adi-font-display); font-stretch: 118%; letter-spacing: -0.05em;
  background: var(--adi-accent); color: var(--adi-on-accent);
}
.adi-switcher__app--off { color: var(--adi-muted); }
.adi-switcher__app--off .adi-switcher__ic { background: var(--adi-line); color: var(--adi-muted); }
.adi-switcher__app small { font: 11px var(--adi-font-mono); color: var(--adi-muted); }
@media (max-width: 640px) {
  .adi-switcher__pop { position: fixed; inset-inline: 8px; top: 64px; width: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .adi-switcher__pop { animation: adi-pop .18s cubic-bezier(.22, 1, .36, 1); }
  @keyframes adi-pop { from { opacity: 0; transform: translateY(-4px); } }
}
