/* Variables et base — chargé en premier */
/* Academic site — blue-dominant, two-column layout */

:root {
  --bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #1e40af;
  --accent-light: #3b82f6;
  --accent-soft: #dbeafe;
  --border: #e2e8f0;
  --tag-bg: #eff6ff;
  --tag-text: #1e40af;
  --header-border: #e2e8f0;
  --content-max: 1200px;
  --page-padding-x: 2rem;
  /* Fixed header clearance on small screens (single-row bar; keep in sync with scroll-margin) */
  --site-header-offset-mobile: 4.5rem;
  /* Police script informatique (monospace) pour titres et cohérence du site */
  --font-script: ui-monospace, "Cascadia Code", "Source Code Pro", "Fira Code", Menlo, monospace;
  /* CharlesGPT — token cycle (light UI: dark text on pastel) */
  --chat-token-0-bg: #eff6ff;
  --chat-token-1-bg: #fdf2f8;
  --chat-token-2-bg: #ecfdf3;
  --chat-token-3-bg: #fefce8;
  --chat-token-4-bg: #f9f5ff;
  --chat-token-5-bg: #fff7ed;
  --chat-token-unsure-0-bg: #7dd3fc;
  --chat-token-unsure-1-bg: #f9a8d4;
  --chat-token-unsure-2-bg: #86efac;
  --chat-token-unsure-3-bg: #fde047;
  --chat-token-unsure-4-bg: #d8b4fe;
  --chat-token-unsure-5-bg: #fdba74;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #60a5fa;
  --accent-light: #93c5fd;
  --accent-soft: #1e3a5f;
  --border: #334155;
  --tag-bg: #1e3a5f;
  --tag-text: #93c5fd;
  --header-border: #334155;
  /* CharlesGPT — token cycle (dark UI: light text on saturated dark chips) */
  --chat-token-0-bg: #1e3a5f;
  --chat-token-1-bg: #4a1942;
  --chat-token-2-bg: #14532d;
  --chat-token-3-bg: #422006;
  --chat-token-4-bg: #2e1065;
  --chat-token-5-bg: #431407;
  --chat-token-unsure-0-bg: #075985;
  --chat-token-unsure-1-bg: #9d174d;
  --chat-token-unsure-2-bg: #166534;
  --chat-token-unsure-3-bg: #a16207;
  --chat-token-unsure-4-bg: #5b21b6;
  --chat-token-unsure-5-bg: #9a3412;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-script), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
