/* =====================================================================
   MAA DIGITAL — « L'ATELIER » — Feuille de style
   Design system « Nacre & Lagon », mise en page façon apple.com.
   100% self-hosted. transform/opacity uniquement. Mobile-first.
   Auteur : Directeur Style & Responsive.
   ===================================================================== */

/* =====================================================================
   0. @FONT-FACE — polices self-hosted (aucun CDN)
   Provenance : Fraunces (SIL OFL, undercasetype/Fraunces, opsz 72pt)
                Inter (SIL OFL, rsms/inter)
   ===================================================================== */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/fraunces-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/fraunces-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/fraunces-600-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600.woff2') format('woff2');
}

/* =====================================================================
   1. DESIGN SYSTEM — variables (:root de la spec, tel quel)
   ===================================================================== */
:root {
  /* === MAA Digital — Design system « Nacre & Lagon » (aligné produit Coquille) === */
  /* Fonds */
  --encre: #07090C;            /* fond principal, noir bleuté profond */
  --encre-2: #0E1116;          /* fond secondaire de section */
  --nacre: #F4F1EA;            /* fond clair (section IA) + texte principal sur encre */
  --nacre-voile: #FBFAF6;      /* nacre plus clair, aplats */

  /* Texte */
  --ink: #F4F1EA;              /* texte principal sur fond sombre (~14:1, jamais #FFF pur) */
  --ink-2: #9AA6A3;            /* texte secondaire / atténué */
  --ink-on-nacre: #14211E;     /* texte principal sur fond nacre (contraste AAA) */
  --ink-2-on-nacre: #5B6B67;   /* texte secondaire sur nacre */

  /* Accent LAGON (primaire) */
  --lagon: #12B0A0;            /* accent principal, liens, focus, hairlines actives */
  --lagon-profond: #0E6B63;    /* aplats, dégradés profonds */
  --lagon-glow: #6FE9DB;       /* glow / rim-light / focus ring */

  /* Accent CORAIL (rare — identité / attention) */
  --corail: #E4633B;

  /* Surfaces verre & bordures */
  --verre: rgba(244,241,234,0.04);        /* fond de carte sur encre */
  --verre-bord: rgba(244,241,234,0.10);   /* bord de carte */
  --verre-reflet: rgba(244,241,234,0.22); /* reflet interne */
  --hairline: rgba(244,241,234,0.08);     /* filets de séparation */
  --hairline-nacre: rgba(20,33,30,0.10);  /* filets sur fond nacre */

  /* Dégradés signature */
  --grad-fresnel: linear-gradient(120deg, #0E6B63 0%, #6FE9DB 48%, #F4F1EA 100%); /* rim goutte / titres accent */
  --grad-lagon: linear-gradient(120deg, #12B0A0 0%, #0E6B63 100%);                /* CTA plein */
  --halo-lagon: radial-gradient(closest-side, rgba(14,107,99,0.28), rgba(14,107,99,0) 70%); /* halo sous la goutte */
  --lien-noeuds: rgba(18,176,160,0.40);   /* liaisons essaim/nœuds */

  /* Focus clavier (toujours visible) */
  --focus-ring: 0 0 0 2px var(--encre), 0 0 0 4px var(--lagon-glow);

  /* Typographie */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Liberation Sans', Arial, system-ui, sans-serif;

  /* Échelle fluide */
  --fs-hero: clamp(2.8rem, 8vw, 6.5rem);
  --fs-h2:   clamp(2rem, 5vw, 3.75rem);
  --fs-eyebrow: 0.75rem;
  --fs-body: clamp(1.05rem, 1.4vw, 1.25rem);
  --lh-body: 1.65;
  --measure: 62ch;

  /* Rythme & courbes */
  --pad-section: clamp(6rem, 14vh, 12rem);
  --ease-doux: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.7s;

  /* Rayons */
  --r-card: 18px;
  --r-pill: 999px;

  /* --- Ajouts internes (layout, non normatifs) --- */
  --wrap-max: 1200px;
  --wrap-pad: clamp(1.25rem, 5vw, 4rem);
  --header-h: 68px;
  --z-stage: 0;
  --z-content: 1;
  --z-header: 50;
  --z-progress: 60;
  --z-skip: 70;

  /* Variables pilotées par le JS (valeurs par défaut sûres) */
  --reading: 0;      /* progression de lecture 0..1 (barre du haut) */
  --mx: 0.5;         /* position souris X normalisée (tilt cartes) */
  --my: 0.5;         /* position souris Y normalisée */
  --bx: 50%;         /* halo interne CTA/email X */
  --by: 50%;         /* halo interne CTA/email Y */
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0.001s; }
}

/* =====================================================================
   2. RESET / BASE
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* offset pour ancres sous le header fixe */
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--encre);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  overflow-x: hidden;
  min-height: 100vh;
  /* couleur de fond animée lors du passage encre <-> nacre */
  transition: background-color 0.8s var(--ease-doux), color 0.8s var(--ease-doux);
}

img, picture, svg, canvas, video {
  display: block;
  max-width: 100%;
}
img, svg { height: auto; }

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul, ol { list-style: none; padding: 0; }

::selection {
  background: var(--lagon);
  color: var(--encre);
}

/* Focus clavier — toujours visible, jamais sur clic pointeur */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

/* =====================================================================
   3. UTILITAIRES DE LAYOUT
   ===================================================================== */
.wrap {
  width: 100%;
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: var(--wrap-pad);
}
.wrap--measure {
  max-width: calc(var(--measure) + 2 * var(--wrap-pad));
}

.lede {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
  max-width: var(--measure);
}

/* Eyebrow / sur-titre */
.eyebrow {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lagon);
  margin: 0;
}

/* Titres */
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; }

.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

/* Skip-link accessibilité */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: var(--z-skip);
  transform: translateY(-160%);
  padding: 0.75rem 1.25rem;
  background: var(--nacre);
  color: var(--ink-on-nacre);
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  transition: transform 0.25s var(--ease-doux);
}
.skip-link:focus-visible {
  transform: translateY(0);
}

/* =====================================================================
   4. BARRE DE PROGRESSION DE LECTURE
   ===================================================================== */
.reading-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: var(--z-progress);
  background: transparent;
  pointer-events: none;
}
.reading-progress__bar {
  display: block;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(var(--reading, 0));
  background: linear-gradient(90deg, var(--lagon-profond), var(--lagon) 45%, var(--lagon-glow));
  box-shadow: 0 0 12px rgba(111,233,219,0.5);
  will-change: transform;
}

/* =====================================================================
   5. HEADER / NAV
   ===================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  transition: background-color 0.4s var(--ease-doux),
              backdrop-filter 0.4s var(--ease-doux),
              border-color 0.4s var(--ease-doux),
              box-shadow 0.4s var(--ease-doux);
  border-bottom: 1px solid transparent;
}
/* état condensé (JS ajoute .is-condensed ou .is-scrolled au scroll > 40px) */
.site-header.is-condensed,
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--encre) 72%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom-color: var(--hairline);
  box-shadow: 0 8px 30px rgba(0,0,0,0.28);
}

.site-header__inner {
  max-width: var(--wrap-max);
  margin-inline: auto;
  padding-inline: var(--wrap-pad);
  min-height: var(--header-h);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: height 0.4s var(--ease-doux);
}
.site-header.is-condensed .site-header__inner,
.site-header.is-scrolled .site-header__inner {
  height: 58px;
  min-height: 58px;
}

/* Wordmark */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-right: auto;
}
.wordmark__mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--encre);
  background: var(--grad-lagon);
  box-shadow: 0 0 0 1px rgba(111,233,219,0.35), 0 6px 16px rgba(14,107,99,0.35);
}
.wordmark__text { white-space: nowrap; }

/* Nav desktop */
.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 2rem);
}
.site-nav__list a {
  position: relative;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink-2);
  padding: 0.4rem 0.1rem;
  transition: color 0.25s var(--ease-doux);
}
.site-nav__list a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1.5px;
  background: var(--lagon);
  transition: right 0.3s var(--ease-doux);
}
.site-nav__list a:hover,
.site-nav__list a:focus-visible { color: var(--ink); }
.site-nav__list a:hover::after,
.site-nav__list a:focus-visible::after { right: 0; }

/* Bouton nav (Nous écrire) */
.btn--nav { padding: 0.55rem 1.1rem; font-size: 0.92rem; }

/* Burger mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--verre-bord);
  background: var(--verre);
}
.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-doux), opacity 0.3s var(--ease-doux);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
}

/* Menu mobile déroulant */
.menu-mobile {
  display: none;
  border-top: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--encre) 92%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.menu-mobile:not([hidden]) { display: block; }
.menu-mobile ul {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem var(--wrap-pad) 1.5rem;
}
.menu-mobile a {
  display: block;
  padding: 0.85rem 0.5rem;
  font-size: 1.1rem;
  color: var(--ink);
  border-radius: 10px;
  transition: background-color 0.2s var(--ease-doux);
}
.menu-mobile a:hover,
.menu-mobile a:focus-visible { background: var(--verre); }
.menu-mobile .btn--full { margin-top: 0.75rem; }

/* =====================================================================
   6. BOUTONS
   ===================================================================== */
.btn {
  --btn-lift: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.85rem 1.6rem;
  border-radius: var(--r-pill);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  letter-spacing: 0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.35s var(--ease-doux),
              box-shadow 0.35s var(--ease-doux),
              background-color 0.3s var(--ease-doux),
              color 0.3s var(--ease-doux),
              border-color 0.3s var(--ease-doux);
  will-change: transform;
}

/* CTA plein lagon */
.btn--primary {
  color: var(--encre);
  background: var(--grad-lagon);
  box-shadow: 0 8px 24px rgba(14,107,99,0.35),
              inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(18,176,160,0.45),
              0 0 0 1px rgba(111,233,219,0.5),
              inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn--primary:active { transform: translateY(0); }

/* CTA fantôme (contour verre) */
.btn--ghost {
  color: var(--ink);
  background: var(--verre);
  border: 1px solid var(--verre-bord);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  transform: translateY(-2px);
  border-color: var(--lagon);
  background: rgba(18,176,160,0.08);
}
.btn--ghost:active { transform: translateY(0); }

/* Bouton nav (verre sobre) */
.btn--nav {
  color: var(--ink);
  background: var(--verre);
  border: 1px solid var(--verre-bord);
}
.btn--nav:hover,
.btn--nav:focus-visible {
  border-color: var(--lagon);
  background: rgba(18,176,160,0.10);
}

/* Bouton pleine largeur (menu mobile) */
.btn--full {
  width: 100%;
  background: var(--grad-lagon);
  color: var(--encre);
}

/* Magnétisme (JS met --mag-x/--mag-y ; défaut 0) */
.btn[data-magnetic] {
  transform: translate(var(--mag-x, 0), var(--mag-y, 0));
}
.btn[data-magnetic]:hover {
  transform: translate(var(--mag-x, 0), calc(var(--mag-y, 0) - 2px));
}

/* CTA row */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}
.cta-row--center { justify-content: center; }

/* =====================================================================
   7. COUCHE 3D UNIQUE (stage / canvas / fallback / halo)
   ===================================================================== */
.stage {
  position: fixed;
  inset: 0;
  z-index: var(--z-stage);
  pointer-events: none;
  overflow: hidden;
  /* dégradé radial lagon figé sous la goutte (visible même sans WebGL) */
  background:
    radial-gradient(120% 80% at 50% 34%, rgba(14,107,99,0.20), rgba(14,107,99,0) 60%),
    radial-gradient(90% 70% at 50% 120%, rgba(18,176,160,0.10), transparent 70%),
    var(--encre);
}
.stage__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Fallback image (affiché par défaut ; masqué quand data-webgl="on") */
.stage__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.stage__fallback img {
  width: min(90vmin, 820px);
  height: auto;
  object-fit: contain;
  opacity: 0.96;
  filter: drop-shadow(0 30px 80px rgba(14,107,99,0.4));
}
/* animation très lente autorisée si WebGL absent mais motion permis */
.stage[data-webgl="off"] .stage__fallback img {
  animation: goutte-drift 26s var(--ease-doux) infinite alternate;
}
@keyframes goutte-drift {
  from { transform: translate3d(0, -1.2%, 0) scale(1); }
  to   { transform: translate3d(0, 1.2%, 0) scale(1.015); }
}
/* Quand le WebGL prend le relais, le JS met hidden ; on renforce en CSS */
.stage[data-webgl="on"] .stage__fallback { opacity: 0; visibility: hidden; }

/* Halo radial lagon (couche supplémentaire douce) */
.stage__halo {
  position: absolute;
  left: 50%;
  top: 34%;
  width: min(120vmin, 1100px);
  height: min(120vmin, 1100px);
  transform: translate(-50%, -50%);
  background: var(--halo-lagon);
  filter: blur(10px);
  opacity: 0.8;
}

/* =====================================================================
   8. SECTIONS — rythme général façon apple.com
   ===================================================================== */
main { position: relative; z-index: var(--z-content); }

.section {
  position: relative;
  padding-block: var(--pad-section);
  min-height: 88vh;
  display: flex;
  align-items: center;
}
.section > .wrap { width: 100%; }

/* Têtes de section centrées */
.section__head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section__head--center {
  text-align: center;
  max-width: 46rem;
  margin-inline: auto;
}
.section__head--center .eyebrow { margin-inline: auto; }
.section__head--center .section__chapo,
.section__head--center .lede { margin-inline: auto; }
.section__title { margin-top: 0.75rem; }
.section__chapo { margin-top: 1.25rem; }

/* Filet de séparation entre sections sombres (hairline subtile) */
.section + .section:not(.section--nacre)::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline) 20%, var(--hairline) 80%, transparent);
}

/* =====================================================================
   9. THÈMES DE FOND (encre par défaut, nacre pour la section IA)
   La transition douce est portée par body (voir §6 IA) + par la section.
   ===================================================================== */
.section--nacre {
  background: var(--nacre);
  color: var(--ink-on-nacre);
}
.section--nacre .eyebrow { color: var(--lagon-profond); }
.section--nacre .section__title { color: var(--ink-on-nacre); }
.section--nacre .lede { color: var(--ink-2-on-nacre); }

/* =====================================================================
   10. HERO
   ===================================================================== */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  padding-top: calc(var(--header-h) + clamp(2rem, 8vh, 6rem));
  text-align: left;
}
.hero__wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 60rem;
}
/* Scrim de lisibilité : léger voile encre derrière le texte du hero (façon apple.com),
   pour garantir le contraste par-dessus la goutte 3D très lumineuse. Sans bord dur. */
.hero__wrap::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -6% -10% -8% -8%;
  background:
    radial-gradient(120% 100% at 22% 46%,
      color-mix(in srgb, var(--encre) 74%, transparent) 0%,
      color-mix(in srgb, var(--encre) 52%, transparent) 34%,
      transparent 72%);
  pointer-events: none;
}
.hero .eyebrow { margin-bottom: 1.5rem; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-hero);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.75rem;
  text-wrap: balance;
}
.hero__title .line {
  display: block;
}
/* 2e ligne du titre — accent éditorial en dégradé fresnel */
.hero__title .line:last-child {
  background: var(--grad-fresnel);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__lede {
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  color: var(--ink-2);
  max-width: 44ch;
  margin-bottom: 2.5rem;
}
.hero__cta { margin-top: 0.5rem; }

/* Indicateur de scroll */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(1.5rem, 4vh, 3rem);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-2);
}
.scroll-hint__label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.scroll-hint__line {
  width: 1px;
  height: 40px;
  background: linear-gradient(180deg, var(--lagon-glow), transparent);
  transform-origin: top center;
  animation: scroll-pulse 2.2s var(--ease-doux) infinite;
}
@keyframes scroll-pulse {
  0%   { transform: scaleY(0.2); opacity: 0.3; }
  50%  { transform: scaleY(1);   opacity: 1; }
  100% { transform: scaleY(0.2); opacity: 0.3; transform-origin: bottom center; }
}

/* =====================================================================
   11. LAYOUT SPLIT (colonne sticky + flux) — sections 2 & 5
   ===================================================================== */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.split__sticky {
  position: relative;
}
.split__flow { position: relative; }

/* =====================================================================
   12. SECTION 2 — CE QU'ON FAIT (piliers)
   ===================================================================== */
.piliers {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.5rem);
}

/* =====================================================================
   13. CARTES DE VERRE (piliers & secteurs) + tilt + spotlight
   ===================================================================== */
.card {
  position: relative;
  border-radius: var(--r-card);
  padding: clamp(1.5rem, 2.5vw, 2.25rem);
  background: var(--verre);
  border: 1px solid var(--verre-bord);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  overflow: hidden;
  isolation: isolate;
}
/* reflet interne haut de carte */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--verre-reflet), transparent);
  z-index: 2;
}

/* Bord lumineux directionnel lagon orienté vers la souris (spotlight) */
.card[data-tilt]::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    18rem 18rem at calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.5) * 100%),
    rgba(111,233,219,0.55), rgba(18,176,160,0.18) 40%, transparent 70%
  );
  /* masque pour ne garder que le contour */
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s var(--ease-doux);
  pointer-events: none;
  z-index: 3;
}
.card[data-tilt]:hover::after,
.card[data-tilt]:focus-within::after { opacity: 1; }

/* Tilt 3D — le JS écrit --mx/--my ; on dérive une rotation subtile ±5° */
.card[data-tilt] {
  transform: perspective(1000px)
    rotateY(calc((var(--mx, 0.5) - 0.5) * 10deg))
    rotateX(calc((0.5 - var(--my, 0.5)) * 10deg))
    translateZ(0);
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-doux),
              box-shadow 0.5s var(--ease-doux),
              border-color 0.4s var(--ease-doux);
  will-change: transform;
}
.card[data-tilt]:hover {
  border-color: rgba(111,233,219,0.35);
  box-shadow: 0 24px 60px rgba(0,0,0,0.35),
              0 0 0 1px rgba(18,176,160,0.15);
}

/* Pilier — typographie */
.pilier__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: var(--ink);
}
.pilier__text {
  color: var(--ink-2);
  max-width: 46ch;
}

/* =====================================================================
   14. SECTION 3 — SECTEURS (grille de cartes)
   ===================================================================== */
.secteurs__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.9rem, 2vw, 1.25rem);
  margin-top: clamp(2rem, 4vw, 3.5rem);
}
.secteur {
  min-height: 8.5rem;
  display: flex;
  align-items: flex-end;
}
.secteur__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}
/* Carte ouverte — accent lagon distinct */
.secteur--open {
  background:
    radial-gradient(120% 120% at 0% 100%, rgba(18,176,160,0.10), transparent 60%),
    var(--verre);
  border-style: dashed;
  border-color: rgba(18,176,160,0.30);
}
.secteur--open .secteur__label { color: var(--lagon-glow); }

/* =====================================================================
   15. SECTION 4 — LA DÉMARCHE (étapes + trait qui se dessine)
   ===================================================================== */
.demarche .wrap--measure { position: relative; }

.etapes {
  position: relative;
  margin-top: clamp(3rem, 6vw, 5rem);
  padding-left: clamp(3rem, 8vw, 5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 7vw, 6rem);
}

/* Trait vertical SVG */
.etapes__trace {
  position: absolute;
  left: clamp(1rem, 3vw, 1.6rem);
  top: 0.5rem;
  width: 2px;
  height: calc(100% - 1rem);
  overflow: visible;
}
.etapes__trace-base {
  stroke: var(--hairline);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.etapes__trace-draw {
  stroke: var(--lagon);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 6px rgba(111,233,219,0.6));
  /* stroke-dashoffset piloté par le JS au scroll ; défaut = non tracé */
  transition: stroke-dashoffset 0.15s linear;
}

/* Étape */
.etape {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}
.etape__num {
  position: absolute;
  left: calc(-1 * clamp(3rem, 8vw, 5rem));
  top: -0.15em;
  width: clamp(2.2rem, 6vw, 3.2rem);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  color: var(--ink-2);
  transition: color 0.5s var(--ease-doux), transform 0.5s var(--ease-doux);
}
.etape__body { grid-column: 1 / -1; }
.etape__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
  color: var(--ink);
}
.etape__text {
  color: var(--ink-2);
  max-width: var(--measure);
}
/* Étape active (JS ajoute .is-active quand elle entre dans le viewport) */
.etape.is-active .etape__num {
  color: var(--lagon-glow);
  transform: scale(1.05);
}
.etape.is-active .etape__title { color: var(--ink); }

/* =====================================================================
   16. SECTION 5 — LA COQUILLE (split inversé + mockup chat)
   ===================================================================== */
.split--reverse .coquille__intro { order: 1; }
.split--reverse .coquille__mockup-col { order: 2; }

.coquille__lede { margin-top: 1.5rem; }
.coquille__points {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 2rem;
}
.coquille__points li {
  position: relative;
  padding-left: 1.9rem;
  color: var(--ink);
  max-width: 46ch;
}
.coquille__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
  background: var(--grad-lagon);
  box-shadow: 0 0 10px rgba(111,233,219,0.5);
  transform: rotate(45deg);
}
.coquille__note {
  margin-top: 2rem;
  font-size: 0.92rem;
  color: var(--ink-2);
  font-style: italic;
  max-width: 46ch;
}

/* Mockup conversation Telegram */
.chat {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  border-radius: 22px;
  padding: 1.25rem;
  background:
    linear-gradient(180deg, rgba(14,17,22,0.85), rgba(7,9,12,0.9));
  border: 1px solid var(--verre-bord);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 40px 90px rgba(0,0,0,0.5),
              inset 0 1px 0 rgba(244,241,234,0.06);
  max-width: 30rem;
  margin-inline: auto;
}
.chat__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem 1rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 1rem;
}
.chat__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--encre);
  background: var(--grad-lagon);
  box-shadow: 0 0 0 1px rgba(111,233,219,0.35);
}
.chat__meta { display: flex; flex-direction: column; }
.chat__name { font-weight: 600; color: var(--ink); }
.chat__status { font-size: 0.78rem; color: var(--ink-2); }

.chat__thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Bulles — état initial invisible, révélées au scroll par le JS (.is-in) */
.bubble {
  --b-in: 0;
  max-width: 84%;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.45;
  opacity: var(--b-in);
  transform: translateY(calc((1 - var(--b-in)) * 12px));
  transition: opacity 0.5s var(--ease-doux), transform 0.5s var(--ease-doux);
  will-change: transform, opacity;
}
.bubble.is-in { --b-in: 1; }
/* Bulle sortante (utilisateur) — alignée à droite, ton lagon */
.bubble--out {
  align-self: flex-end;
  color: var(--encre);
  background: linear-gradient(135deg, var(--lagon-glow), var(--lagon));
  border-bottom-right-radius: 5px;
}
/* Bulle entrante (assistant) — alignée à gauche, verre sombre */
.bubble--in {
  align-self: flex-start;
  color: var(--ink);
  background: rgba(244,241,234,0.06);
  border: 1px solid var(--verre-bord);
  border-bottom-left-radius: 5px;
}

/* =====================================================================
   17. SECTION 6 — IA & AUTOMATISATION (fond nacre)
   ===================================================================== */
.ia { text-align: center; }
.ia__lede { margin-inline: auto; }

.ia__waouh {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink-on-nacre);
  max-width: 20ch;
  margin: clamp(3rem, 7vw, 5rem) auto;
  text-wrap: balance;
}
.ia__waouh::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin: 1.5rem auto 0;
  border-radius: 3px;
  background: var(--grad-lagon);
}

.ia__connecteurs { margin-top: clamp(2rem, 5vw, 4rem); }
.ia__connecteurs-title {
  color: var(--lagon-profond);
  margin-bottom: 1.5rem;
}

/* Pastilles connecteurs */
.pastilles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  max-width: 44rem;
  margin-inline: auto;
}
.pastille {
  --f: 0; /* phase d'oscillation écrite par le JS (transform sinus) */
  padding: 0.6rem 1.15rem;
  border-radius: var(--r-pill);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-on-nacre);
  background: var(--nacre-voile);
  border: 1px solid rgba(18,176,160,0.35);
  box-shadow: 0 4px 14px rgba(14,107,99,0.10);
  transform: translateY(var(--f, 0));
  transition: transform 0.3s var(--ease-doux),
              box-shadow 0.3s var(--ease-doux),
              border-color 0.3s var(--ease-doux),
              background-color 0.3s var(--ease-doux);
  will-change: transform;
}
.pastille:hover {
  transform: translateY(-3px) scale(1.04);
  border-color: var(--lagon);
  box-shadow: 0 10px 26px rgba(18,176,160,0.30);
  background: #fff;
}
.ia__closing {
  margin-top: 1.75rem;
  color: var(--ink-2-on-nacre);
  font-style: italic;
}

/* =====================================================================
   18. SECTION 7 — CONTACT
   ===================================================================== */
.contact { text-align: center; }
.contact__wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact .eyebrow { margin-inline: auto; }
.contact__lede { margin: 1.25rem auto 0; }

/* Email en très grand, halo interne qui suit le curseur */
.contact__mail {
  position: relative;
  display: inline-block;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  word-break: break-word;
  background:
    radial-gradient(14rem 14rem at var(--bx, 50%) var(--by, 50%),
      rgba(111,233,219,0.9), rgba(18,176,160,0.55) 35%, var(--ink) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: filter 0.3s var(--ease-doux);
}
.contact__mail::after {
  content: "";
  position: absolute;
  left: 0; bottom: -0.15em;
  width: 100%;
  height: 2px;
  background: var(--grad-lagon);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-doux);
}
.contact__mail:hover::after,
.contact__mail:focus-visible::after { transform: scaleX(1); }
.contact__mail:focus-visible {
  border-radius: 8px;
  box-shadow: var(--focus-ring);
}

.contact .cta-row { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

/* =====================================================================
   19. FOOTER
   ===================================================================== */
.site-footer {
  position: relative;
  z-index: var(--z-content);
  background: var(--encre-2);
  border-top: 1px solid var(--hairline);
  padding-block: clamp(3rem, 6vw, 4.5rem);
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  text-align: left;
}
.site-footer__baseline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
}
.site-footer__note,
.site-footer__legal { color: var(--ink-2); font-size: 0.92rem; }
.site-footer__mail a {
  color: var(--lagon);
  font-weight: 600;
  transition: color 0.25s var(--ease-doux);
}
.site-footer__mail a:hover,
.site-footer__mail a:focus-visible { color: var(--lagon-glow); }
.site-footer__top {
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: 0.92rem;
  transition: color 0.25s var(--ease-doux);
}
.site-footer__top:hover,
.site-footer__top:focus-visible { color: var(--ink); }

/* =====================================================================
   20. REVEALS AU SCROLL (fondu-montée + stagger)
   État initial pour [data-reveal] ; .is-revealed = état final (JS).
   Le delay est dérivé de data-reveal-delay via des sélecteurs attribut.
   ===================================================================== */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity var(--dur) var(--ease-doux),
    transform var(--dur) var(--ease-doux);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-revealed,
[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
/* Stagger par data-reveal-delay (fallback si le JS ne pose pas --reveal-delay) */
[data-reveal-delay="1"] { --reveal-delay: 80ms; }
[data-reveal-delay="2"] { --reveal-delay: 160ms; }
[data-reveal-delay="3"] { --reveal-delay: 240ms; }
[data-reveal-delay="4"] { --reveal-delay: 320ms; }
[data-reveal-delay="5"] { --reveal-delay: 400ms; }
[data-reveal-delay="6"] { --reveal-delay: 480ms; }
[data-reveal-delay="7"] { --reveal-delay: 560ms; }

/* Fallback anti-FOUC : si le JS ne s'exécute pas (pas de classe .js sur <html>),
   on n'ose pas masquer le contenu — il reste visible. */
html:not(.js) [data-reveal] {
  opacity: 1;
  transform: none;
}

/* =====================================================================
   21. RESPONSIVE — mobile-first : on monte en desktop
   ===================================================================== */

/* --- ≥ 720px : nav desktop apparaît, grilles 2 colonnes --- */
@media (min-width: 720px) {
  .secteurs__grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- ≥ 860px : passage en layout desktop (nav complète, split 2 col) --- */
@media (min-width: 860px) {
  .nav-toggle { display: none !important; }
  .menu-mobile { display: none !important; }

  /* Split : colonne sticky à gauche, flux à droite */
  .split {
    grid-template-columns: 0.9fr 1.1fr;
  }
  .split__sticky {
    position: sticky;
    top: calc(var(--header-h) + clamp(2rem, 8vh, 5rem));
    align-self: start;
  }
  /* Coquille : intro sticky à droite dans le split inversé */
  .split--reverse { grid-template-columns: 1.1fr 0.9fr; }
  .split--reverse .coquille__intro { order: 2; }
  .split--reverse .coquille__mockup-col { order: 1; }
}

/* --- < 860px : header en mode mobile (burger visible, nav cachée) --- */
@media (max-width: 859.98px) {
  .site-nav { display: none; }
  .btn--nav { display: none; }
  .nav-toggle { display: flex; }

  /* Chat : ne pas rester sticky en mono-colonne */
  .chat { position: relative; top: auto; }
}

/* --- ≥ 1024px : secteurs 3 colonnes, respirations max --- */
@media (min-width: 1024px) {
  .secteurs__grid { grid-template-columns: repeat(3, 1fr); }
  .piliers { gap: 1.5rem; }
}

/* --- < 640px : simplification (3D + typographie mobiles) --- */
@media (max-width: 639.98px) {
  :root {
    --pad-section: clamp(4rem, 12vh, 7rem);
    --wrap-pad: 1.25rem;
  }
  .section { min-height: auto; }
  .hero { padding-top: calc(var(--header-h) + 3rem); }

  /* Anti-zoom iOS : corps ≥ 16px */
  body { font-size: max(16px, var(--fs-body)); }

  /* La goutte fallback plus discrète, en haut */
  .stage__fallback img { width: min(80vmin, 480px); }
  .stage__halo { top: 26%; }

  /* CTA pleine largeur au pouce */
  .hero__cta .btn,
  .cta-row--center .btn { width: 100%; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-row--center { align-items: center; }
  .cta-row--center .btn { max-width: 22rem; }

  /* Étapes : trait plus proche */
  .etapes { padding-left: 2.5rem; }
  .etape__num { left: -2.5rem; }

  /* Bulles chat plus larges */
  .bubble { max-width: 92%; }

  /* Touch targets confortables dans la nav mobile */
  .menu-mobile a { padding-block: 1rem; }
}

/* --- Très petits écrans : wordmark compacte --- */
@media (max-width: 380px) {
  .wordmark__text { font-size: 1rem; }
}

/* =====================================================================
   22. SUPPORT TACTILE — désactive tilt/curseur perso (pas de hover fiable)
   ===================================================================== */
@media (hover: none), (pointer: coarse) {
  .card[data-tilt] {
    transform: none !important;
  }
  .card[data-tilt]::after { display: none; }
  .btn[data-magnetic] { transform: none !important; }
  .contact__mail {
    /* halo centré figé, pas de suivi curseur au doigt */
    background:
      radial-gradient(14rem 10rem at 50% 50%,
        rgba(111,233,219,0.9), rgba(18,176,160,0.55) 35%, var(--ink) 75%);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

/* =====================================================================
   23. PREFERS-REDUCED-MOTION — coupe les grosses animations
   Le contenu reste dans son état FINAL, lisible.
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  /* Reveals : état final immédiat, pas de translate */
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Coupe morphs / tilt / magnétisme / oscillations / curseur perso */
  .card[data-tilt] { transform: none !important; }
  .card[data-tilt]::after { display: none !important; }
  .btn[data-magnetic] { transform: none !important; }
  .pastille { transform: none !important; }

  /* Bulles chat : toutes visibles */
  .bubble { opacity: 1 !important; transform: none !important; }

  /* Indicateur de scroll & drift de la goutte figés */
  .scroll-hint__line { animation: none !important; opacity: 0.5; }
  .stage[data-webgl="off"] .stage__fallback img { animation: none !important; transform: none !important; }

  /* Trait de la démarche : entièrement tracé (état final) */
  .etapes__trace-draw { stroke-dashoffset: 0 !important; transition: none !important; }

  /* Barre de lecture : pas de transition (JS peut toujours poser --reading) */
  .reading-progress__bar { transition: none !important; }
}

/* =====================================================================
   24. PRINT — sobriété (au cas où)
   ===================================================================== */
@media print {
  .stage, .reading-progress, .scroll-hint, .nav-toggle, .menu-mobile { display: none !important; }
  body { background: #fff; color: #000; }
  .section { min-height: auto; padding-block: 2rem; }
}
