/* ============================================================
   CinqHeure22 — design-system.css (site statique www)
   Implémentation du Design System CinqHeure22 v1.0.

   Contenu :
     A. Tokens — sous-ensemble de tokens.css v1.0 (valeurs identiques).
        Le bloc tenant (white-label) est volontairement omis : la couleur
        tenant est interdite sur les pages marketing (contrat §6).
     B. Base — reset, typographie, liens, focus, conteneur.
     C. Composants partagés — boutons, en-tête, marque, menu mobile,
        cartes, alerte, horizon, pied de page, reveal.
   Les styles propres à une page restent dans le <style> de la page.

   Table de migration (ancienne variable locale → token sémantique) :
     --nuit        → --surface-inverse / --brand-anchor
     --encre       → --surface-inverse-2 ; texte encre → --text-primary
     --papier      → --surface-page
     --papier-2    → --surface-sunken / --border-subtle
     --braise      → --brand-parent / --brand-product (fond, trait)
                     --text-accent (texte d'accent : Braise sombre sur Papier)
     --braise-vive → --brand-product-hover (hover, texte d'accent sur Nuit)
     --acier       → --text-secondary en contexte inverse
     --texte       → --text-primary
     --texte-2     → --text-secondary
     #fff (titres sur Nuit) → --text-primary en contexte inverse
     #1E3049 / #24374F / #3E5474 (filets sur Nuit) → --border-subtle / --border-strong inverse
     --max 1120px  → --container-max 1200px
   ============================================================ */

/* ---------- A1. PRIMITIVES ---------- */
:root {
  --ch-nuit: #0E1B2E;
  --ch-encre: #16263F;
  --ch-papier: #F6F7F9;
  --ch-papier-2: #ECEFF3;
  --ch-texte: #22303F;
  --ch-texte-2: #5A6B7E;
  --ch-blanc: #FFFFFF;

  --ch-gris-100: #E3E7EE;
  --ch-gris-200: #CDD4DF;
  --ch-gris-300: #AEB8C8;
  --ch-gris-400: #8A97AB;
  --ch-gris-500: #6B7A90;
  --ch-gris-600: #4E5D73;
  --ch-gris-700: #364559;
  --ch-gris-800: #22303F;

  --ch-braise: #E8681C;
  --ch-braise-vive: #FF8A3D;
  --ch-braise-sombre: #A8470D;
  --ch-braise-pale: #FDEBDD;

  --ch-electrique: #0C59F2;
  --ch-electrique-vive: #3B7BFF;
  --ch-electrique-sombre: #0847C2;
  --ch-electrique-pale: #E3ECFF;

  --ch-petrole: #0F766E;
  --ch-petrole-vive: #14A08F;
  --ch-petrole-sombre: #0B5D57;
  --ch-petrole-pale: #DDF3EF;

  --ch-vert: #176B47;  --ch-vert-pale: #E1F3EA;
  --ch-ambre: #8F5600; --ch-ambre-pale: #FBEFD9;
  --ch-rouge: #C0303A; --ch-rouge-pale: #FBE4E5;
  --ch-bleu-info: #2E5F9E; --ch-bleu-info-pale: #E4ECF7;

  --font-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --text-display-1: clamp(40px, 3.2vw + 24px, 64px);
  --text-display-2: clamp(32px, 2vw + 20px, 44px);
  --text-h1: 32px;
  --text-h2: 24px;
  --text-h3: 20px;
  --text-h4: 17px;
  --text-body-lg: 18px;
  --text-body: 16px;
  --text-body-sm: 14px;
  --text-caption: 12px;
  --text-label: 12px;

  --space-0: 0; --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;
  --space-16: 64px; --space-20: 80px; --space-24: 96px; --space-32: 128px;

  --container-max: 1200px;
  --container-narrow: 760px;
  --gutter: 24px;
  --page-margin: 16px;

  --radius-xs: 4px; --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
  --radius-xl: 20px; --radius-pill: 999px;

  --shadow-1: 0 1px 2px rgba(14,27,46,.06);
  --shadow-2: 0 2px 6px rgba(14,27,46,.06), 0 1px 2px rgba(14,27,46,.04);
  --shadow-3: 0 8px 24px rgba(14,27,46,.10), 0 2px 6px rgba(14,27,46,.05);
  --shadow-4: 0 20px 48px rgba(14,27,46,.16), 0 4px 12px rgba(14,27,46,.06);

  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 320ms; --dur-enter: 260ms;
  --ease-standard: cubic-bezier(.2,.8,.2,1);
  --ease-exit: cubic-bezier(.4,0,1,1);
  --ease-spring: cubic-bezier(.34,1.3,.64,1);

  --z-sticky: 10; --z-dropdown: 30; --z-overlay: 40; --z-modal: 50; --z-toast: 60;

  --control-sm: 32px; --control-md: 40px; --control-lg: 48px;
  --icon-sm: 16px; --icon-md: 20px; --icon-lg: 24px; --icon-stroke: 1.75;

  /* Propre au site : hauteur de l'en-tête marketing (72 desktop / 56 mobile) */
  --header-h: 56px;
}
@media (min-width: 640px)  { :root { --page-margin: 24px; } }
@media (min-width: 1024px) { :root { --page-margin: 40px; --header-h: 72px; } }
@media (min-width: 1280px) { :root { --page-margin: 64px; } }

/* ---------- A2. SÉMANTIQUES (défaut = marque mère CinqHeure22) ---------- */
:root {
  --brand-parent: var(--ch-braise);
  --brand-parent-strong: var(--ch-braise-sombre);
  --brand-parent-soft: var(--ch-braise-pale);
  --brand-parent-on: var(--ch-nuit);
  --brand-anchor: var(--ch-nuit);

  --brand-product: var(--ch-braise);
  --brand-product-hover: var(--ch-braise-vive);
  --brand-product-strong: var(--ch-braise-sombre);
  --brand-product-soft: var(--ch-braise-pale);
  --brand-product-on: var(--ch-nuit);

  --surface-page: var(--ch-papier);
  --surface-card: var(--ch-blanc);
  --surface-sunken: var(--ch-papier-2);
  --surface-raised: var(--ch-blanc);
  --surface-inverse: var(--ch-nuit);
  --surface-inverse-2: var(--ch-encre);
  --surface-overlay: rgba(14,27,46,.56);

  --text-primary: var(--ch-texte);
  --text-secondary: var(--ch-texte-2);
  --text-muted: var(--ch-gris-400);
  --text-inverse: var(--ch-papier);
  --text-inverse-2: rgba(246,247,249,.72);

  --border-subtle: var(--ch-gris-100);
  --border-default: var(--ch-gris-200);
  --border-strong: var(--ch-gris-400);
  --border-inverse: rgba(246,247,249,.16);

  --feedback-success: var(--ch-vert);  --feedback-success-bg: var(--ch-vert-pale);
  --feedback-warning: var(--ch-ambre); --feedback-warning-bg: var(--ch-ambre-pale);
  --feedback-error: var(--ch-rouge);   --feedback-error-bg: var(--ch-rouge-pale);
  --feedback-info: var(--ch-bleu-info); --feedback-info-bg: var(--ch-bleu-info-pale);
}

/* ---------- A3. THÈMES PRODUIT ---------- */
[data-product="cinqheure22"] { /* identique au défaut : la marque mère est son propre produit */ }

[data-product="etincelle"] {
  --brand-product: var(--ch-electrique);
  --brand-product-hover: var(--ch-electrique-vive);
  --brand-product-strong: var(--ch-electrique-sombre);
  --brand-product-soft: var(--ch-electrique-pale);
  --brand-product-on: var(--ch-blanc);
}

[data-product="resonance"] {
  --brand-product: var(--ch-petrole);
  --brand-product-hover: var(--ch-petrole-vive);
  --brand-product-strong: var(--ch-petrole-sombre);
  --brand-product-soft: var(--ch-petrole-pale);
  --brand-product-on: var(--ch-blanc);
}

/* Contexte inversé (en-tête Nuit, héro, pied de page) */
[data-surface="inverse"] {
  --surface-page: var(--ch-nuit);
  --surface-card: var(--ch-encre);
  --surface-sunken: #0A1424;
  --text-primary: var(--ch-papier);
  --text-secondary: rgba(246,247,249,.72);
  --text-muted: rgba(246,247,249,.48);
  --border-subtle: rgba(246,247,249,.10);
  --border-default: rgba(246,247,249,.18);
  --border-strong: rgba(246,247,249,.36);
}

/* ---------- A4. ALIAS DÉPENDANTS — re-résolus dans chaque scope ---------- */
:root, [data-product], [data-surface] {
  --text-link: var(--brand-product-strong);
  --text-on-accent: var(--brand-product-on);
  --border-focus: var(--brand-product);
  --ring: 0 0 0 2px var(--surface-page), 0 0 0 4px var(--border-focus);
  --action-primary: var(--brand-product);
  --action-primary-hover: var(--brand-product-hover);
  --action-primary-on: var(--brand-product-on);
  --action-secondary-border: var(--border-strong);
  --action-secondary-on: var(--text-primary);
  --action-danger: var(--feedback-error);
  --viz-1: var(--brand-product);
  /* Extension site : texte d'accent lisible sur la surface courante
     (Braise sombre 5.5:1 sur Papier ; Braise vive 7.4:1 sur Nuit). */
  --text-accent: var(--brand-product-strong);
}
[data-surface="inverse"] {
  --text-link: var(--ch-papier);
  --border-focus: var(--ch-papier);
  --text-accent: var(--brand-product-hover);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; --dur-enter: 0ms; }
}

/* ============================================================
   B. BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--surface-page);
  overflow-x: hidden;
}
[data-surface] { background: var(--surface-page); color: var(--text-primary); }
[id] { scroll-margin-top: calc(var(--header-h) + var(--space-4)); }

h1, h2 { font-family: var(--font-display); font-weight: 700; color: var(--text-primary); text-wrap: pretty; }
h3, h4 { font-family: var(--font-body); font-weight: 600; color: var(--text-primary); text-wrap: pretty; }
h3 { font-size: var(--text-h3); line-height: 1.3; }
h4 { font-size: var(--text-h4); line-height: 1.35; }
.display-1 { font-size: var(--text-display-1); line-height: 1.02; letter-spacing: -.025em; }
.display-2 { font-size: var(--text-display-2); line-height: 1.08; letter-spacing: -.02em; }
.h1 { font-size: var(--text-h1); line-height: 1.15; letter-spacing: -.015em; }
.h2 { font-size: var(--text-h2); line-height: 1.2; letter-spacing: -.01em; font-weight: 600; }

/* Label mono : 12 / 1.2 / +.08em / uppercase / 500 */
.label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 500;
}
.eyebrow { display: block; color: var(--text-accent); margin-bottom: var(--space-4); }
.lede { font-size: var(--text-body-lg); line-height: 1.55; color: var(--text-secondary); max-width: 60ch; }

a { color: var(--text-link); text-underline-offset: 2px; text-decoration-thickness: 1px; }
::selection { background: var(--brand-product-soft); color: var(--brand-anchor); }

:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: var(--z-modal);
  background: var(--surface-card); color: var(--text-primary);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-weight: 600;
}
.skip-link:focus-visible { top: var(--space-2); }

.wrap {
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--page-margin));
  margin-inline: auto;
  padding-inline: var(--page-margin);
}
.wrap-narrow { max-width: calc(var(--container-narrow) + 2 * var(--page-margin)); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ============================================================
   C. COMPOSANTS
   ============================================================ */

/* ---- Button : 32/40/48, rayon md, Figtree 600 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-lg); padding: 0 22px;
  border-radius: var(--radius-md); border: 1px solid transparent;
  font: 600 16px/1.2 var(--font-body); text-decoration: none; text-align: center;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard);
}
.btn svg { width: var(--icon-md); height: var(--icon-md); flex: none; }
.btn-md { min-height: var(--control-md); padding: 0 18px; font-size: 15px; }
.btn-sm { min-height: var(--control-sm); padding: 0 14px; font-size: 14px; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-primary { background: var(--action-primary); color: var(--action-primary-on); }
.btn-primary:hover { background: var(--action-primary-hover); }
/* Sur Nuit : accent vif + texte Nuit (Électrique/Nuit ne passe pas en plein) */
[data-surface="inverse"] .btn-primary { background: var(--brand-product-hover); color: var(--brand-anchor); }
[data-surface="inverse"] .btn-primary:hover { background: var(--text-inverse); }

.btn-secondary {
  background: var(--surface-card); color: var(--action-secondary-on);
  border-color: var(--action-secondary-border);
}
.btn-secondary:hover { border-color: var(--text-primary); }

.btn-ghost { background: transparent; color: var(--text-primary); }
.btn-ghost:hover { background: var(--surface-sunken); }

.btns { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (max-width: 639px) {
  .btns { flex-direction: column; align-items: stretch; }
}

/* ---- Marque : lettrine « 22 » + wordmark ---- */
.brand {
  display: inline-flex; align-items: center; gap: var(--space-3);
  color: var(--text-primary); text-decoration: none; border-radius: var(--radius-sm);
}
.brand:focus-visible { outline: none; box-shadow: var(--ring); }
.lettrine {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--brand-anchor); color: var(--brand-parent);
  border: 1px solid var(--border-inverse);
  font: 700 20px/1 var(--font-display); letter-spacing: -.02em;
}
.wordmark { font: 700 22px/1 var(--font-display); letter-spacing: -.015em; }
@media (max-width: 1023px) {
  .lettrine { width: 32px; height: 32px; }
  .wordmark { font-size: 20px; }
}

/* ---- En-tête marketing : 72px (56 mobile), Nuit ---- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-6);
  height: calc(var(--header-h) - 1px); /* + bordure 1px = --header-h */
}
.site-nav { display: flex; align-items: center; gap: var(--space-8); }
.site-nav ul { display: flex; gap: var(--space-6); list-style: none; }
.site-nav ul a {
  color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 15px;
  border-radius: var(--radius-xs); transition: color var(--dur-fast) var(--ease-standard);
}
.site-nav ul a:hover { color: var(--text-primary); }
.site-nav .nav-ctas { display: flex; gap: var(--space-3); }
.header-cta { display: none; }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: transparent; border: 1px solid var(--border-default); color: var(--text-primary);
  cursor: pointer;
}
.nav-toggle svg { width: var(--icon-lg); height: var(--icon-lg); }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.nav-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.header-end { display: none; align-items: center; gap: var(--space-3); }

/* Menu mobile : overlay plein écran, liens 48px, CTA conservés */
@media (max-width: 1023px) {
  .header-end { display: flex; }
  .nav-toggle { display: inline-flex; }
  .header-cta { display: inline-flex; }
  .site-nav {
    display: none;
    position: fixed; inset: var(--header-h) 0 0 0; z-index: var(--z-overlay);
    flex-direction: column; align-items: stretch; gap: var(--space-8);
    padding: var(--space-6) var(--page-margin) var(--space-10);
    background: var(--surface-page); overflow-y: auto;
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a {
    display: flex; align-items: center; min-height: 48px;
    font-size: var(--text-body-lg); color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
  }
  .site-nav .nav-ctas { flex-direction: column; }
}
/* Très petits écrans : le CTA primaire passe uniquement dans le menu */
@media (max-width: 399px) { .header-cta { display: none; } }

/* ---- Lien de retour (pages secondaires) ---- */
.back-link {
  color: var(--text-secondary); text-decoration: none; font-size: 15px; font-weight: 500;
  border-radius: var(--radius-xs); transition: color var(--dur-fast) var(--ease-standard);
}
.back-link:hover { color: var(--text-primary); }

/* ---- Ligne d'horizon (signature CinqHeure22) ---- */
.horizon {
  height: 2px; border: 0; max-width: var(--container-max); margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--brand-parent) 20%, var(--brand-parent) 80%, transparent);
}

/* ---- Card ---- */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
}
@media (max-width: 639px) { .card { padding: var(--space-5); } }

/* Carte produit du hub : bandeau 3px à l'accent du produit (scope data-product) */
.card-product {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: var(--space-5);
  padding-top: calc(var(--space-6) + 3px);
}
.card-product::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--brand-product);
}
.product-id { display: flex; align-items: center; gap: var(--space-3); }
.product-lettrine {
  display: inline-grid; place-items: center; flex: none;
  width: 48px; height: 48px; border-radius: var(--radius-md);
  background: var(--brand-product); color: var(--brand-product-on);
  font: 700 26px/1 var(--font-display);
}
.product-name { font: 700 28px/1.05 var(--font-display); letter-spacing: -.015em; color: var(--text-primary); }
.endorsement { display: block; margin-top: 6px; color: var(--text-secondary); font-size: 11px; }
[data-surface="inverse"] .endorsement { color: var(--text-inverse-2); }

/* ---- Alert : fond feedback pâle, bordure 1px à ~35 %, icône 20 ---- */
.alert {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4); border-radius: var(--radius-md);
  font-size: var(--text-body-sm); line-height: 1.5; color: var(--text-primary);
}
.alert svg { width: var(--icon-md); height: var(--icon-md); flex: none; margin-top: 1px; }
.alert-info {
  background: var(--feedback-info-bg);
  border: 1px solid var(--border-default);
  border-color: color-mix(in srgb, var(--feedback-info) 35%, transparent);
}
.alert-info svg { color: var(--feedback-info); }

/* ---- Pied de page ---- */
.site-footer { padding: var(--space-16) 0 var(--space-8); font-size: var(--text-body-sm); }
.footer-grid {
  display: grid; gap: var(--space-10);
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
}
.footer-grid p { color: var(--text-secondary); margin-top: var(--space-4); max-width: 36ch; }
.footer-grid .label { color: var(--text-secondary); margin-bottom: var(--space-4); }
.footer-grid ul { list-style: none; display: grid; gap: var(--space-2); }
.footer-grid ul a, .footer-grid p a {
  color: var(--text-primary); text-decoration: none; border-radius: var(--radius-xs);
}
.footer-grid ul a:hover, .footer-grid p a:hover { text-decoration: underline; }
.footer-bottom {
  margin-top: var(--space-12); padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle); color: var(--text-secondary);
}
@media (max-width: 767px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

/* ---- Reveal (déplacement ≤ 16px, statique en reduced-motion) ---- */
.js .reveal {
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease-standard), transform var(--dur-slow) var(--ease-standard);
}
.js .reveal.vu { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
