/* Hallmark · genre: editorial · design-system: design.md · designed-as-app
 * theme: custom · vibe: "Bloomberg Terminal raised in Lagos" · paper: #F0E4D0 · accent: #A65D37
 * display: Space Grotesk 700 · body: Space Grotesk 400 · outlier: JetBrains Mono (data)
 * axes: light / geometric-sans / chromatic-terracotta · nav: N6 · footer: Ft7
 * contrast: pass (40-41) · tokens canon SR exacts (palette.py) — voir site/design.md
 */

:root {
  /* — Canon SR — */
  --color-paper:         #F0E4D0;   /* CREAM — fond de page */
  --color-paper-2:       #E8D9C2;   /* CREAM_DARK — cartes, élévation */
  --color-paper-3:       #DFCFB2;   /* deuxième cran */
  --color-ink:           #1B2D3A;   /* NAVY — texte courant */
  --color-ink-2:         #3D5263;   /* texte secondaire */
  --color-navy-deep:     #0F1C26;   /* NAVY_DEEP — bandes sombres, couvertures */
  --color-rule:          #CDBC9C;   /* filets hairline */
  --color-rule-2:        #DCCDAE;
  --color-muted:         #4F5E6A;   /* texte tertiaire — 5.3:1 sur cream */
  --color-accent:        #A65D37;   /* TERRACOTTA — fills, bordures, marques (UI ≥3:1) */
  --color-accent-deep:   #8F4A24;   /* terracotta texte — 5.3:1 sur cream */
  --color-accent-ink:    #F0E4D0;   /* texte sur fond accent */
  --color-data:          #D4A944;   /* GOLD — chiffres sur fond sombre UNIQUEMENT */
  --color-data-bright:   #E8C84A;   /* GOLD_BRIGHT — figure hero sur navy-deep */
  --color-terra-soft:    #C97A4F;   /* terracotta éclairci — texte data "baisse" sur sombre */
  --color-danger:        #9C3A2E;   /* erreurs sur cream */
  --color-focus:         #8F4A24;   /* ring focus sur cream (sur sombre → data-bright) */
  --color-ink-on-dark:   #EDE3D2;   /* texte sur navy-deep */
  --color-muted-on-dark: #9BAAB5;   /* texte secondaire sur navy-deep */
  --color-rule-on-dark:  #2C4254;   /* filets sur navy-deep */

  /* — Typographie — */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-data:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --text-xs:   0.8rem;
  --text-sm:   0.9rem;
  --text-base: 1.0625rem;
  --text-md:   1.25rem;
  --text-lg:   1.5625rem;
  --text-xl:   1.95rem;
  --text-2xl:  2.44rem;
  --text-3xl:  3.05rem;
  --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
  --text-figure:  clamp(4rem, 12vw, 9rem);

  /* — Espacement 4 pt — */
  --space-3xs: 0.25rem; --space-2xs: 0.5rem; --space-xs: 0.75rem;
  --space-sm: 1rem;     --space-md: 1.5rem;  --space-lg: 2rem;
  --space-xl: 3rem;     --space-2xl: 4.5rem; --space-3xl: 7rem;

  /* — Divers — */
  --rule-hair: 1px;
  --radius: 2px;
  --radius-card: 3px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-short: 220ms;
  --page-gutter: clamp(1rem, 4vw, 1.5rem);
  --ticker-duration: 80s;

  /* — Alias de compatibilité (consommés par shell.css historique + JS) —
     À retirer quand la migration contenu est terminée ; toute NOUVELLE
     règle consomme les tokens --color-* ci-dessus. */
  --bg: var(--color-paper);
  --surface: var(--color-paper-2);
  --surface-strong: var(--color-paper-3);
  --ink: var(--color-ink);
  --ink-soft: var(--color-ink-2);
  --accent: var(--color-accent-deep);
  --accent-strong: var(--color-accent);
  --gold: var(--color-accent-deep);
  --danger: var(--color-danger);
  --border: var(--color-rule);
  --border-strong: var(--color-accent);
  --mono:  var(--font-data);
  --sans:  var(--font-body);
  --serif: var(--font-body);
}

html {
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
}

html, body { overflow-x: clip; }

body {
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  margin: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-style: normal;
  letter-spacing: -0.02em;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
.ticker :focus-visible,
.hero-stat :focus-visible,
.on-dark :focus-visible {
  outline-color: var(--color-data-bright);
}

button:disabled, input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

a {
  color: var(--color-accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-thickness: 2px; }

/* Contexts non-texte : pas de soulignement */
.masthead nav a, .btn, .variant-toggle button,
.ecosystem-links a, .signal-card h4 a,
.footer-grid a, .ticker-item, .mast-nav a {
  text-decoration: none;
}
.masthead nav a:hover, .ecosystem-links a:hover, .footer-grid a:hover,
.mast-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tnum { font-variant-numeric: tabular-nums; }

/* Bilingue inline : masquer la langue inactive */
html[data-lang="fr"] [data-lang-block="en"],
html[data-lang="fr"] .lang-en { display: none !important; }
html[data-lang="en"] [data-lang-block="fr"],
html[data-lang="en"] .lang-fr { display: none !important; }
html[data-lang="fr"] [data-fr]::before { content: attr(data-fr); }
html[data-lang="en"] [data-en]::before { content: attr(data-en); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
