/* ==========================================================================
   Socle commun des 5 vitrines — mise en page, composants, animations.
   Chaque site redéfinit les variables de marque dans son propre site.css.
   ========================================================================== */

:root {
  --brand: #333;          /* couleur principale */
  --brand-2: #555;        /* couleur secondaire */
  --accent: #e0a030;      /* touche d'accent */
  --ink: #1c1c1c;         /* texte */
  --muted: #5a5a5a;       /* texte secondaire (contraste AA sur --bg) */
  --bg: #ffffff;
  --surface: #f6f4f0;     /* fonds de cartes / sections alternées */
  --line: #e4e0d9;
  --on-brand: #ffffff;    /* texte sur --brand */
  --dark: #161616;        /* sections sombres */
  --on-dark: #f5f3ef;
  --on-dark-muted: #c9c4bb;

  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 68px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.07);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.06), 0 24px 48px rgba(0,0,0,.12);
  --ease: cubic-bezier(.2,.7,.2,1);

  /* Polices système : zéro téléchargement, lisible en 3G, fonctionne en Chine */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(64px, 10vw, 120px) 0; position: relative; }
.section--alt { background: var(--surface); }
.section--dark { background: var(--dark); color: var(--on-dark); }
.section--dark .lead, .section--dark .muted { color: var(--on-dark-muted); }
.section--brand { background: var(--brand); color: var(--on-brand); }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--accent); }
.section--dark .eyebrow, .section--brand .eyebrow, .hero .eyebrow { color: var(--accent); }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.split { display: grid; gap: clamp(32px, 6vw, 72px); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: 1.05fr 1fr; } .split--rev > :first-child { order: 2; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: var(--header-bg, rgba(255,255,255,.86));
  color: var(--header-ink, var(--ink));
  -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .3s, border-color .3s, background .3s;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(0,0,0,.08); border-bottom-color: var(--header-line, var(--line)); }
.site-header .container { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: .02em; flex-shrink: 0; }
.brand svg { width: 38px; height: 38px; }
.brand span { font-size: 1.05rem; white-space: nowrap; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) {
  text-decoration: none; font-size: .95rem; font-weight: 600; padding: 8px 12px; border-radius: 999px;
  color: inherit; opacity: .82; transition: opacity .2s, background .2s;
}
.nav a:not(.btn):hover, .nav a.is-active { opacity: 1; background: var(--nav-hover, rgba(0,0,0,.06)); }
.header-tools { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; margin-left: auto;
  position: relative;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  position: absolute; left: 11px; width: 22px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s;
  content: "";
}
.nav-toggle span { top: 21px; }
.nav-toggle span::before { left: 0; top: -7px; }
.nav-toggle span::after { left: 0; top: 7px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1020px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--menu-bg, #fff); color: var(--menu-ink, var(--ink)); padding: 12px var(--gutter) 24px;
    box-shadow: 0 24px 40px rgba(0,0,0,.15);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: transform .3s var(--ease), opacity .25s, visibility .3s;
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  }
  .nav a:not(.btn) { padding: 14px 12px; font-size: 1.05rem; border-radius: 10px; }
  .nav .btn { margin-top: 10px; justify-content: center; }
  .nav-open .nav { transform: none; opacity: 1; visibility: visible; }
  .header-tools { margin-left: 0; }
}

/* ---------- Language switch ---------- */
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--lang-bg, rgba(0,0,0,.06)); }
.lang-switch button {
  border: 0; background: transparent; padding: 6px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  min-width: 36px; min-height: 32px; opacity: .75;
}
.lang-switch button[aria-pressed="true"] { background: var(--lang-active-bg, #fff); color: var(--lang-active-ink, var(--ink)); opacity: 1; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em; justify-content: center;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  font-weight: 700; font-size: 1rem; text-decoration: none; line-height: 1.1; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn--accent { background: var(--accent); color: var(--on-accent, #1c1c1c); }
.btn--ghost { border-color: currentColor; background: transparent; }
.btn--light { background: #fff; color: var(--ink); }
.btn--sm { min-height: 38px; padding: 8px 16px; font-size: .9rem; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.ext::after { content: " ↗"; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 110px) 0 clamp(64px, 10vw, 120px); }
.hero h1 { max-width: 15ch; }
.hero .lead { max-width: 56ch; margin-bottom: 28px; }
.hero-grid { display: grid; gap: clamp(32px, 6vw, 64px); align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.1fr 1fr; } }
.hero-visual { position: relative; }

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg, #fff); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 2.6vw, 30px); position: relative;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.card p:last-child { margin-bottom: 0; }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand);
}
.card .icon svg { width: 28px; height: 28px; }
.section--dark .card { --card-bg: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); color: var(--on-dark); }
.section--dark .card p { color: var(--on-dark-muted); }
.section--dark .card .icon { background: rgba(255,255,255,.08); color: var(--accent); }
.card-link { display: inline-flex; gap: .4em; margin-top: 12px; font-weight: 700; color: var(--brand); text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.section--dark .card-link { color: var(--accent); }

.tag {
  display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--ink);
}
.section--dark .tag { color: var(--on-dark); }
.soon::after {
  content: attr(data-soon); margin-left: .5em; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 25%, transparent); vertical-align: middle;
}

/* ---------- Stats ---------- */
.stats { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.stat { padding: 22px; border-radius: var(--radius); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.stat b { display: block; font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; line-height: 1; margin-bottom: 8px; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat span { font-size: .95rem; opacity: .85; }

/* ---------- Steps (parcours animé) ---------- */
.steps { list-style: none; display: grid; gap: 18px; counter-reset: step; position: relative; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(var(--n, 4), 1fr); } }
.step { position: relative; padding: 24px 20px 22px; border-radius: var(--radius); background: var(--card-bg, #fff); border: 1px solid var(--line); }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: var(--on-brand); font-weight: 800; font-size: .95rem; margin-bottom: 14px;
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 14%, transparent);
}
.step h3 { margin-bottom: .35em; }
.step p { color: var(--muted); margin: 0; font-size: .97rem; }
.section--dark .step { --card-bg: rgba(255,255,255,.04); border-color: rgba(255,255,255,.1); }
.section--dark .step p { color: var(--on-dark-muted); }
/* Ligne de progression qui se remplit au scroll */
.steps-track { position: absolute; left: 42px; top: 46px; bottom: 46px; width: 3px; border-radius: 3px; background: var(--line); z-index: 0; }
.steps-track i { position: absolute; inset: 0; transform-origin: top; transform: scaleY(0); background: linear-gradient(var(--brand), var(--accent)); border-radius: 3px; transition: transform 1.6s var(--ease); }
@media (min-width: 900px) {
  .steps-track { left: 40px; right: 40px; top: 46px; bottom: auto; width: auto; height: 3px; }
  .steps-track i { transform-origin: left; transform: scaleX(0); }
}
.steps.is-in .steps-track i { transform: none; }
.steps > li { z-index: 1; }

/* ---------- Personas / parcours utilisateurs ---------- */
.journey { border-radius: var(--radius); padding: 26px; background: var(--card-bg, #fff); border: 1px solid var(--line); }
.journey h3 { display: flex; align-items: center; gap: 10px; }
.journey ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.journey li { display: flex; gap: 12px; align-items: flex-start; font-size: .97rem; color: var(--muted); }
.journey li::before {
  content: ""; flex: 0 0 10px; height: 10px; margin-top: .5em; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent);
}

/* ---------- Phases (feuille de route) ---------- */
.phases { list-style: none; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.phase { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card-bg, #fff); position: relative; overflow: hidden; }
.phase::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); opacity: .35; }
.phase.is-current::before { opacity: 1; background: var(--accent); }
.phase small { display: block; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .75rem; color: var(--brand); margin-bottom: 6px; }
.phase p { margin: 0; color: var(--muted); }

/* ---------- Accordéon (FAQ) ---------- */
.faq { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-bg, #fff); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 52px 18px 20px; font-weight: 700; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; transition: transform .3s var(--ease); color: var(--brand);
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details > div { padding: 0 20px 18px; color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band { border-radius: calc(var(--radius) * 1.4); padding: clamp(32px, 6vw, 64px); background: var(--brand); color: var(--on-brand); position: relative; overflow: hidden; }
.cta-band h2 { max-width: 22ch; }
.cta-band p { max-width: 60ch; opacity: .9; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg, var(--dark)); color: var(--on-dark-muted); padding: 56px 0 28px; font-size: .95rem; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-bottom: 40px; }
.footer-grid h4 { color: var(--on-dark); font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.footer-grid ul { list-style: none; display: grid; gap: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 22px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.programme { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.programme a { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); font-size: .85rem; }
.programme a[aria-current] { background: rgba(255,255,255,.12); }

/* ---------- Animations d'apparition au scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal--left { transform: translateX(-36px); }
.js .reveal--right { transform: translateX(36px); }
.js .reveal--scale { transform: scale(.94); }
.js .reveal.is-in { opacity: 1; transform: none; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.float { animation: float 6s ease-in-out infinite; }
.live-dot { position: relative; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #2fbf71; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: pulse 1.8s ease-out infinite; }

/* Texte des boutons de marque */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 30s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
}

/* ---------- Pages légales ---------- */
.legal { max-width: 780px; }
.legal h2 { font-size: 1.4rem; margin-top: 2em; }
