/* ==========================================================================
   moneliza-theme.css — couche de THÈME de Moneliza Intelligence (MBI).
   Spec : SPEC-UX-THEME-MBI v1.0 (Nova, carte t_d4df9018, 30/10/2026).
   Portée : couleurs + typographie. ZÉRO modification de structure, de
   navigation ou de flux ; zéro ligne de JSX ; zéro modification du HTML.
   Source unique : CE fichier, édité à la main sous revue (aucun générateur
   dans le dépôt) ; toute variation passe par un commit sur cette branche.
   Ordre de cascade : doit être servi APRÈS /assets/index-*.css.
   ========================================================================== */

/* ── 1. Polices de la charte, AUTO-HÉBERGÉES (aucune requête externe) ───────
   Fichiers à déposer dans /app/ui/dist/theme/fonts/ par l'image (Stark) :
     Manrope-Variable.woff2            (OFL-1.1, source google/fonts/ofl/manrope)
     BricolageGrotesque-Variable.woff2 (OFL-1.1, google/fonts/ofl/bricolagegrotesque)
     JetBrainsMono-Variable.woff2      (OFL-1.1, google/fonts/ofl/jetbrainsmono)
   + les trois OFL.txt à côté. font-display:swap → jamais de texte invisible. */
@font-face {
  font-family: "Manrope";
  src: url("/theme/fonts/Manrope-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/theme/fonts/BricolageGrotesque-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/theme/fonts/JetBrainsMono-Variable.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ── 2. Jetons — mode CLAIR (« encre & papier ») ──────────────────────────
   Papier = crème de la charte (#f3ebda) ; encre = bg-card (#120a1d).
   Les échelons de gris sont des compositions d'encre sur papier, calculées
   et publiées (evidence/contrast-report.json). ───────────────────────── */
:root {
  --background: #f3ebda;
  --foreground: #120a1d;
  --card: #ffffff;
  --card-foreground: #120a1d;
  --popover: #ffffff;
  --popover-foreground: #120a1d;
  --primary: #120a1d;
  --primary-foreground: #f3ebda;
  --secondary: #120a1d0f;
  --secondary-foreground: #120a1d;
  --muted: #120a1d0a;
  --muted-foreground: #6e6353;
  --accent: #120a1d14;
  --accent-foreground: #120a1d;
  --destructive: #92465d;
  --destructive-foreground: #ffffff;
  --border: #120a1d24;
  --input: #120a1d1a;
  --ring: #120a1d;
  --mbi-field-border: #120a1d73;
  --sidebar: #e8e0d0;
  --sidebar-foreground: #120a1d;
  --sidebar-primary: #120a1d;
  --sidebar-primary-foreground: #f3ebda;
  --sidebar-accent: #dfd7c9;
  --sidebar-accent-foreground: #120a1d;
  --sidebar-border: #120a1d24;
  --sidebar-ring: #120a1d;
  --scrollbar-thumb: #120a1d47;
  --scrollbar-thumb-hover: #120a1d6b;
  --chart-1: #a87f54;
  --chart-2: #438c72;
  --chart-3: #92465d;
  --chart-4: #120a1d;
  --chart-5: #9a5e46;
}

/* ── 2 bis. Typographie (indépendante du mode) ─────────────────────────── */
:root {
  --default-font-family: "Manrope", "InterVariable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mbi-font-heading: "Bricolage Grotesque", "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── 3. Jetons — mode SOMBRE (identité de la charte, valeurs telles quelles) */
.dark, .dark-theme {
  --background: #05060d;
  --foreground: #f3ebda;
  --card: #120a1d;
  --card-foreground: #f3ebda;
  --popover: #160e23;
  --popover-foreground: #f3ebda;
  --primary: #ffef47;
  --primary-foreground: #05060d;
  --secondary: #160e23;
  --secondary-foreground: #f3ebda;
  --muted: #160e23;
  --muted-foreground: #a59783;
  --accent: #160e23;
  --accent-foreground: #f3ebda;
  --destructive: #c4607e;
  --destructive-foreground: #05060d;
  --border: #ffef471f;
  --input: #f3ebda33;
  --ring: #e6c69a;
  --sidebar: #0f0917;
  --sidebar-foreground: #f3ebda;
  --sidebar-primary: #ffef47;
  --sidebar-primary-foreground: #05060d;
  --sidebar-accent: #160e23;
  --sidebar-accent-foreground: #f3ebda;
  --sidebar-border: #ffef471f;
  --sidebar-ring: #e6c69a;
  --scrollbar-thumb: #f3ebda38;
  --scrollbar-thumb-hover: #f3ebda57;
  --chart-1: #ffef47;
  --chart-2: #5ab896;
  --chart-3: #c4607e;
  --chart-4: #a87f54;
  --chart-5: #c97c5e;
  --mbi-field-border: #f3ebda61;
}

/* ── 4. Typographie ────────────────────────────────────────────────────────
   @theme inline a CUIT les littéraux : `html{font-family:InterVariable,…}`,
   `.font-sans{…}`, `.font-mono{…}`. Un simple override de variable ne suffit
   donc pas pour ces trois sélecteurs — d'où les règles explicites ci-dessous. */
html, body {
  font-family: var(--default-font-family);
}
.font-sans {
  font-family: var(--default-font-family);
}
.font-mono,
code, pre, kbd, samp {
  font-family: var(--font-mono);
}
h1, h2, h3 {
  font-family: var(--mbi-font-heading);
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* ── 5. Champs : 1.4.11 exige 3:1 pour la frontière d'un contrôle ─────────
   --input reste discret (il sert aussi de FOND dans 5 règles) ; la bordure
   visible des champs est portée par ce jeton dédié, mesuré 3,0:1 minimum. */
input:not([type="hidden"]), textarea, select {
  border-color: var(--mbi-field-border);
}

/* ── 6. Focus visible : garde-fou indépendant des classes utilitaires ─────
   L'anneau de la charte (or doux) sur fond nuit ; encre sur papier. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ── 7. Barres de défilement (jetons déjà consommés par l'app) ──────────── */
* {
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
