/* ==========================================================================
   site.css — Design system du site CEZAM Group
   --------------------------------------------------------------------------
   Identité : fond bleu nuit, typographie géométrique (Poppins) fidèle au
   wordmark officiel, trois couleurs d'accent — une par entité :
     Engineering → bleu circuit   (--c-eng)
     Media       → ambre créatif  (--c-media)
     CiviTech    → vert civique   (--c-civ)
   Chaque page d'entité pose data-accent sur <body> pour se colorer.
   ========================================================================== */

/* ----------------------------- Polices ---------------------------------- */
/* Auto-hébergées (conformité RGPD : aucun appel vers Google Fonts). */

@font-face {
  font-family: 'Poppins';
  src: url('/assets/fonts/Poppins-300.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('/assets/fonts/Poppins-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('/assets/fonts/Poppins-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter-var.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* ----------------------------- Variables -------------------------------- */

:root {
  --bg: #0a0d15;
  --bg-2: #0d111c;
  --surface: #121828;
  --surface-2: #182036;
  --line: rgba(148, 168, 210, 0.14);
  --text: #edf0f7;
  --muted: #9aa5bc;

  --c-eng: #4da8ff;
  --c-media: #ffb454;
  --c-civ: #3adc97;
  --accent: #8b9dc0;              /* accent neutre par défaut (accueil) */

  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  --radius: 18px;
  --header-h: 72px;
  --wrap: 1180px;
}
body[data-accent="eng"]   { --accent: var(--c-eng); }
body[data-accent="media"] { --accent: var(--c-media); }
body[data-accent="civ"]   { --accent: var(--c-civ); }

/* ------------------------------- Base ----------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; text-wrap: balance; }
p { text-wrap: pretty; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: #0a0d15; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* Ligne de preuve sociale (parcours vérifiable, pas de logos décoratifs) */
.trust-line {
  margin-top: 26px; padding-left: 18px;
  border-left: 2px solid var(--c-eng);
  color: var(--muted); font-size: 15.5px; max-width: 620px;
}
.trust-line strong { color: var(--text); }

/* Lueur qui suit le curseur (créée par site.js, souris uniquement) */
.cursor-glow {
  position: fixed; left: -170px; top: -170px; width: 340px; height: 340px;
  border-radius: 50%; pointer-events: none; z-index: 90;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 9%, transparent), transparent 65%);
  mix-blend-mode: screen;
  /* cachée au chargement : sans transform, un quart du halo serait visible
     dans le coin (0,0) — révélée par site.js au premier vrai mouvement */
  opacity: 0;
}
/* Devant la grotte (classe posée par site.js tant que le prologue est à
   l'écran) : la lueur devient une flamme de bougie ambrée */
.en-grotte .cursor-glow {
  background: radial-gradient(circle, rgba(255, 192, 96, .13), transparent 62%);
}

/* Lien d'évitement (accessibilité clavier) */
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--accent); color: #0a0d15; padding: 10px 18px;
  border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 8px; }

/* ------------------------------ Header ---------------------------------- */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  transition: background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(10, 13, 21, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.site-header .wrap {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text);
}
.brand .brand-img { width: 26px; height: auto; display: block; }
.brand-name {
  font-family: var(--font-display); font-weight: 300;
  font-size: 20px; letter-spacing: .34em; text-indent: .34em;
}
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  text-decoration: none; color: var(--muted);
  font-size: 14.5px; font-weight: 500;
  padding: 9px 14px; border-radius: 10px;
  transition: color .2s, background .2s;
}
.main-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.main-nav a.active { color: var(--text); }
.main-nav a.active::after {
  content: ''; display: block; height: 2px; margin-top: 2px;
  border-radius: 2px; background: var(--accent);
}
.main-nav a.nav-cta {
  color: #0a0d15; background: var(--text);
  font-weight: 600; margin-left: 8px;
}
.main-nav a.nav-cta:hover { background: #fff; }

/* ------------------- Sélecteur de langues (drapeaux) -------------------- */

.lang { position: relative; }
.lang-btn {
  display: flex; align-items: center; justify-content: center;
  background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 9px;
  /* cible tactile ≥ 44 px (WCAG) */
  min-width: 44px; min-height: 44px; padding: 7px 9px;
  transition: border-color .2s;
}
.lang-btn svg, .lang-menu svg { width: 24px; height: 16px; border-radius: 3px; display: block; }
.lang-btn:hover, .lang-btn:focus-visible { border-color: var(--accent); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 172px;
  background: rgba(10, 13, 21, .97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);   /* Safari/iOS */
  border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s; z-index: 120;
}
/* Ouverture : au survol/focus (souris, clavier) ET via la classe .ouvert
   posée par site.js au clic-tactile (avec aria-expanded + Échap) */
.lang:hover .lang-menu, .lang:focus-within .lang-menu, .lang.ouvert .lang-menu {
  opacity: 1; visibility: visible; transform: none;
}
.lang-menu a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14.5px;
}
.lang-menu a:hover { background: rgba(255, 255, 255, .07); }
.lang-menu a.actif { color: var(--accent); }
.lang-menu svg { width: 22px; height: 15px; }

/* Texte du bouton des portes d'entités selon la langue de la page */
:root[lang="en"] .chip::after { content: 'Enter →'; }
:root[lang="es"] .chip::after { content: 'Entrar →'; }
:root[lang="de"] .chip::after { content: 'Eintreten →'; }

/* Burger mobile */
.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; border-radius: 10px; padding: 10px;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--text); border-radius: 2px;
  margin: 5px 0; transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ------------------------------- Hero ----------------------------------- */

.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block;
}
.hero-inner { position: relative; z-index: 2; width: 100%; padding: 120px 0 80px; }
.hero-kicker {
  font-size: 13px; font-weight: 600; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 22px;
}
.hero-title {
  /* plafond 96px : au-delà, un titre crie au lieu de designer (règle Impeccable) */
  font-weight: 300; font-size: clamp(52px, 9.5vw, 96px);
  letter-spacing: .18em; text-indent: .18em; margin: 0 0 10px;
  text-align: center;
}
/* Chaque lettre de CEZAM est animée individuellement à l'arrivée */
.hero-title .lt { display: inline-block; opacity: 0; transform: translateY(30px); }
.hero-title.on .lt { opacity: 1; transform: none; transition: opacity .7s, transform .7s; }
.hero-title.on .lt:nth-child(2) { transition-delay: .07s; }
.hero-title.on .lt:nth-child(3) { transition-delay: .14s; }
.hero-title.on .lt:nth-child(4) { transition-delay: .21s; }
.hero-title.on .lt:nth-child(5) { transition-delay: .28s; }
.hero-tagline {
  text-align: center; font-family: var(--font-display); font-weight: 300;
  font-size: clamp(18px, 2.6vw, 26px); color: var(--text); margin-bottom: 14px;
}
.hero-sub {
  text-align: center; color: var(--muted); max-width: 620px;
  margin: 0 auto 42px; font-size: 17px;
}
/* Les trois entités : des PORTAILS de verre modernes — géométrie nette,
   liseré de lumière au sommet à la couleur de l'entité (écho froid des
   portes de la grotte). */
.hero-chips { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 10px; }
.chip {
  --ec: var(--accent);
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; width: 216px; min-height: 128px; padding: 26px 20px 22px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--ec) 30%, rgba(150, 190, 255, .10));
  background:
    radial-gradient(120% 90% at 50% -30%, color-mix(in srgb, var(--ec) 13%, transparent), transparent 62%),
    rgba(9, 14, 26, 0.55);
  backdrop-filter: blur(8px);
  color: var(--text); text-decoration: none; font-size: 15.5px; font-weight: 600;
  text-align: center;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.chip--eng { --ec: var(--c-eng); }
.chip--media { --ec: var(--c-media); }
.chip--civ { --ec: var(--c-civ); }
/* Liseré de lumière au sommet du portail ; il s'étire au survol */
.chip::before {
  content: ''; position: absolute; top: 0; left: 14%; right: 14%; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--ec), transparent);
  box-shadow: 0 0 18px 1px var(--ec);
  opacity: .8;
  transition: left .25s, right .25s, opacity .25s;
}
.chip:hover::before { left: 4%; right: 4%; opacity: 1; }
/* Éclat de cristal du portail */
.chip .dot {
  width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg);
  background: var(--ec); box-shadow: 0 0 14px var(--ec);
}
.chip::after {
  content: 'Entrer →';
  font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ec); opacity: .85;
}
.chip:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--ec) 75%, transparent);
  box-shadow: 0 24px 60px -24px var(--ec);
}

.hero-scroll {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 2; color: var(--muted); font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}

/* ================ Prologue : face à la grotte ===========================
   Scène photographique plein écran (grotte.webp). La section fait 300vh :
   l'image reste collée à l'écran (sticky) pendant que le défilement pilote
   un zoom vers l'entrée de la grotte (site.js, § prologue), jusqu'à ce que
   la lumière emplisse l'écran (.prologue-veil) et révèle la section
   suivante. Étoiles (canvas) et halo de l'entrée animés par-dessus.
   Sans JavaScript / mouvement réduit : simple image plein écran. */

/* Même fond bleu-noir que la section suivante (.interieur) : quand le
   voile s'éteint en fin de course, le dé-collage est invisible. */
.prologue { height: 300vh; position: relative; background: #04070f; }
.prologue-sticky {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
}
.prologue-sticky::before {
  /* voile de lisibilité en haut de la photo : le header (logo CEZAM) reste
     visible même devant la lune ou un ciel clair */
  content: ''; position: absolute; inset: 0 0 auto 0; height: 150px; z-index: 2;
  background: linear-gradient(rgba(3, 5, 10, .65), transparent);
  pointer-events: none;
}
.prologue-scene {
  position: absolute; inset: 0; will-change: transform;
  /* origine du zoom = entrée de la grotte sur la photographie
     (à recaler si l'image change — voir docs/ARCHITECTURE.md) */
  transform-origin: 66% 47%;
}
.prologue-img {
  width: 100%; height: 100%; object-fit: cover; object-position: 55% 55%;
  display: block;
}
.prologue-glow {
  /* respiration lumineuse de la porte — valeurs de REPLI sans JS
     (avec JS, placePointsChauds() repose left/top/width au pixel) */
  position: absolute; left: 66%; top: 51%; width: 14%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 176, 70, .42), rgba(255, 150, 40, .14) 45%, transparent 70%);
  filter: blur(10px); mix-blend-mode: screen;
  animation: cavebreath 4.5s ease-in-out infinite;
}
@media (max-width: 700px) {
  /* En portrait, le recadrage (object-position 52 %) déplace l'entrée de la
     grotte vers la droite de l'écran : on recale le zoom et le halo */
  .prologue-scene { transform-origin: 80% 47%; }
  .prologue-glow { left: 80%; width: 40%; }
  /* Les 3 portails s'empilent : on réserve la place du lien « Découvrir »
     (absolu, bas de section) pour qu'il ne chevauche pas le dernier */
  .hero-inner { padding-bottom: 140px; }
}
@keyframes cavebreath {
  50% { opacity: .55; transform: translate(-50%, -50%) scale(1.16); }
}


/* Aurore boréale : rideaux de lumière dérivant dans le ciel étoilé.
   Deux nappes de bandes verticales (teintes des entités : cyan, vert,
   violet) floutées, en fusion "screen", limitées au ciel par un masque.
   Seul transform est animé (règle de performance du prologue). */
.prologue-aurore {
  position: absolute; inset: 0 0 52% 0; overflow: hidden;
  pointer-events: none; mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(#000 40%, transparent 96%);
  mask-image: linear-gradient(#000 40%, transparent 96%);
}
.prologue-aurore::before, .prologue-aurore::after {
  content: ''; position: absolute; inset: -25% -35%;
  transform-origin: 50% 0;
  filter: blur(16px);
}
.prologue-aurore::before {
  background: repeating-linear-gradient(99deg,
    transparent 0 6%, rgba(64, 220, 190, .16) 8% 9.5%, transparent 12% 16%,
    rgba(122, 140, 255, .13) 18% 19%, transparent 21.5% 27%,
    rgba(58, 220, 151, .11) 29% 30%, transparent 32.5% 39%);
  animation: aurore-derive 26s ease-in-out infinite alternate;
}
.prologue-aurore::after {
  background: repeating-linear-gradient(93deg,
    transparent 0 9%, rgba(77, 168, 255, .12) 10.5% 12%, transparent 14.5% 21%,
    rgba(100, 230, 200, .10) 23% 24%, transparent 26.5% 34%);
  opacity: .75;
  animation: aurore-derive 39s ease-in-out infinite alternate-reverse;
}
@keyframes aurore-derive {
  from { transform: translateX(-5%) skewX(-7deg); }
  to { transform: translateX(5%) skewX(-13deg); }
}

/* Rayons bleus émis par la porte : canvas additif animé par site.js
   (émetteur positionné au pixel par placePointsChauds) */
.prologue-rayons {
  position: absolute; inset: 0; width: 100%; height: 100%;
  mix-blend-mode: screen; pointer-events: none;
}

/* Fil d'or : fine ligne de progression du voyage (bas de l'écran) —
   au-dessus des deux voiles pour rester lisible pendant le passage */
.prologue-fil {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; z-index: 5;
  transform-origin: left; transform: scaleX(0); pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 190, 95, 0), rgba(255, 190, 95, .85));
}
@media (prefers-reduced-motion: reduce) { .prologue-fil { display: none; } }

.prologue-caption {
  position: absolute; left: 0; right: 0; bottom: 8svh; z-index: 2;
}
.prologue-logo { width: 92px; height: auto; margin-bottom: 18px; opacity: .95; }
.prologue-wordmark {
  font-family: var(--font-display); font-weight: 300;
  font-size: 34px; letter-spacing: .38em; text-indent: .02em;
  color: var(--text); opacity: .92; margin: 0 0 12px;
  text-shadow: 0 1px 20px rgba(0, 0, 0, .6);
}
.prologue-title {
  font-family: var(--font-display); font-weight: 500; line-height: 1.12;
  font-size: clamp(34px, 4.6vw, 58px); margin: 0 0 18px; max-width: 840px;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .6);
}
.prologue-hint {
  color: var(--muted); font-size: 12.5px; letter-spacing: .2em;
  text-transform: uppercase; margin: 0;
  display: inline-flex; align-items: center; gap: 12px;
}
.prologue-hint::after {
  content: ''; width: 44px; height: 1px;
  background: linear-gradient(90deg, var(--muted), transparent);
  animation: hintline 2.2s ease-in-out infinite;
}
@keyframes hintline { 50% { transform: scaleX(.4); transform-origin: left; } }

.prologue-veil {
  /* lumière qui emplit l'écran au moment de « passer la porte » ;
     centrée sur la porte À L'ÉCRAN (--porte-x/y posées par site.js, qui
     suivent le recadrage cover — repli : 66 % 47 %, exact en paysage),
     ses bords rejoignent le fond de la section suivante (#04070f) —
     aucune couture pendant la transition */
  position: absolute; inset: 0; z-index: 3; opacity: 0; pointer-events: none;
  background: radial-gradient(75% 75% at var(--porte-x, 66%) var(--porte-y, 47%),
    rgba(255, 216, 140, .98), rgba(255, 180, 80, .85) 45%, #04070f 100%);
}
/* Second temps du passage (opacité pilotée par site.js) : la lumière
   « refroidit » — le voile bleu recouvre l'or puis s'éteint sur le
   bleu-noir de la salle intérieure (léger décalage volontaire vers la
   gauche/le haut par rapport au voile d'or). */
.prologue-veil--bleu {
  z-index: 4;
  background: radial-gradient(80% 80% at calc(var(--porte-x, 66%) - 4%) calc(var(--porte-y, 47%) - 1%),
    rgba(214, 234, 255, .98), rgba(96, 156, 255, .8) 48%, #04070f 100%);
}

/* ================== Hero intérieur (après la porte) =====================
   De l'autre côté : une salle de lumière bleutée, moderne et épurée — le
   prolongement direct des rayons bleus de la porte. La lueur principale
   descend du haut de l'écran (on vient de la traverser). */

.interieur {
  background:
    /* base STATIQUE de la salle (lueur descendue de la porte), visible
       telle quelle sans JS / en mouvement réduit. Dans le chemin animé,
       le canvas opaque (#hero-canvas, z-index 0) la recouvre et peint sa
       propre lueur (startCanvas, mode 'lumiere') : régler ces dégradés
       ne change PAS le rendu animé. */
    radial-gradient(58% 44% at 50% 16%, rgba(77, 168, 255, .13), transparent 72%),
    radial-gradient(40% 34% at 50% 24%, rgba(140, 220, 255, .06), transparent 70%),
    #04070f;
}
.interieur .hero-canvas { z-index: 0; }
/* Rais bleus résiduels : de fins fuseaux descendent du haut de l'écran,
   écho direct de l'éventail de la porte (statiques et quasi subliminaux —
   la matière vivante, c'est la poussière de lumière du canvas). */
.rais-interieur {
  position: absolute; inset: 0 0 34% 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(94deg,
    transparent 0 7%, rgba(120, 190, 255, .05) 8% 9%, transparent 10.5% 18%,
    rgba(77, 168, 255, .04) 19.5% 20.5%, transparent 22% 31%);
  /* fondu en HAUT aussi : ce calque passe au-dessus du voile de raccord
     (.interieur::before) — sans ce fondu, une micro-couture réapparaîtrait
     à la frontière avec le prologue */
  -webkit-mask-image: linear-gradient(transparent, #000 16%, transparent 88%);
  mask-image: linear-gradient(transparent, #000 16%, transparent 88%);
}
/* Vignettage froid : les bords s'éteignent dans le bleu-noir */
.interieur::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(115% 92% at 50% 52%, transparent 55%, rgba(2, 4, 10, .78) 100%);
}
.interieur::before {
  /* Raccord avec la fin du prologue : le haut de la section part du MÊME
     bleu-noir (#04070f) et laisse lueur et poussière émerger en fondu —
     sans ce voile, la lumière du canvas crée une ligne dure à la
     frontière. */
  content: ''; position: absolute; inset: 0 0 auto 0; height: 42%; z-index: 1;
  background: linear-gradient(#04070f 0%, rgba(4, 7, 15, .7) 40%, transparent 100%);
  pointer-events: none;
}
/* Le titre baigne dans la lumière bleue de la salle */
.interieur .hero-title { text-shadow: 0 0 70px rgba(77, 168, 255, .35); }
.interieur .hero-tagline { color: #cfe2ff; }
.hero-kicker { text-align: center; }

/* ===================== Bandeau défilant (marquee) ======================= */

.marquee {
  overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--bg-2); padding: 18px 0; white-space: nowrap;
}
.marquee-track { display: inline-flex; animation: marquee 36s linear infinite; }
.marquee-track span {
  font-family: var(--font-display); font-weight: 300;
  font-size: 22px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); padding-right: 12px;
}
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}
.hero-scroll::after {
  content: ''; width: 1px; height: 34px;
  background: linear-gradient(var(--muted), transparent);
  animation: scrollhint 2s infinite;
}
@keyframes scrollhint { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---------------------------- Sections ---------------------------------- */

.section { padding: 110px 0; position: relative; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-kicker {
  font-size: 12.5px; font-weight: 600; letter-spacing: .24em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.section-title { font-size: clamp(30px, 4.4vw, 46px); font-weight: 500; max-width: 760px; }
.section-lead { color: var(--muted); font-size: 18px; max-width: 680px; }

/* Apparition au défilement (classe posée par site.js) */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.on { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .1s; }
.reveal-d2 { transition-delay: .2s; }
.reveal-d3 { transition-delay: .3s; }

/* ------------------------- Chiffres clés -------------------------------- */

.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
  margin-top: 56px;
}
.stat {
  border-left: 2px solid var(--accent); padding-left: 22px;
}
.stat b {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: 42px; line-height: 1.1;
}
/* enfant DIRECT seulement : les libellés des liens .stat-produits, plus
   profonds, gardent leur propre style (un « .stat span » les griserait) */
.stat > span { color: var(--muted); font-size: 15px; }
/* Liens-logos vers les produits en ligne (sous la stat « produits ») */
.stat-produits { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; align-items: center; }
.stat-produits a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 600;
  opacity: .82; transition: opacity .25s, transform .25s;
}
.stat-produits a:hover { opacity: 1; transform: translateY(-2px); }
.stat-produits img { display: block; }

/* Bandeau clients : « Ils nous ont ouvert leurs portes » — marques passées
   en blanc (filter statique, jamais animé) pour un mur de logos uniforme */
.clients-band {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  margin-top: 30px;
}
.clients-titre {
  margin: 0; color: var(--muted); font-size: 13px;
  letter-spacing: .16em; text-transform: uppercase; font-weight: 600;
}
.clients-logos {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 34px; flex-wrap: wrap;
}
.clients-logos img {
  display: block; height: 26px; width: auto;
  filter: brightness(0) invert(1);     /* toute marque devient blanche */
  opacity: .72; transition: opacity .25s;
}
.clients-logos li:hover img { opacity: 1; }

/* ----------------------- Panneaux des entités --------------------------- */

.entities { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-top: 64px; }
.entity {
  --ec: var(--accent);
  position: relative; display: flex; flex-direction: column; gap: 16px;
  min-height: 460px; padding: 38px 32px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface) 0%, var(--bg-2) 100%);
  text-decoration: none; color: var(--text);
  overflow: hidden; isolation: isolate;
  transition: transform .35s cubic-bezier(.2, .7, .3, 1), border-color .35s, box-shadow .35s;
}
.entity--eng { --ec: var(--c-eng); }
.entity--media { --ec: var(--c-media); }
.entity--civ { --ec: var(--c-civ); }
.entity::before {
  /* halo coloré qui suit la souris (variables posées par site.js) */
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--ec) 16%, transparent), transparent 70%);
  transition: opacity .35s;
}
.entity:hover::before { opacity: 1; }
.entity::after {
  /* reflet qui balaie le panneau au survol, comme sur une facette de cristal */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .07) 50%, transparent 58%);
  transform: translateX(-130%); transition: transform .8s ease;
}
.entity:hover::after { transform: translateX(130%); }
.entity:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--ec) 55%, transparent);
  box-shadow: 0 24px 60px -30px color-mix(in srgb, var(--ec) 60%, transparent);
}
.entity-badge {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--ec) 14%, transparent);
  color: var(--ec);
}
.entity-badge svg { width: 24px; height: 24px; }
.entity-type { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.entity h3 { font-size: 26px; margin: 0; }
.entity h3 small { display: block; font-size: 15px; font-weight: 300; color: var(--ec); margin-top: 2px; letter-spacing: .04em; }
.entity p { color: var(--muted); font-size: 15.5px; flex: 0 0 auto; }
.entity ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.entity li { font-size: 14.5px; color: var(--text); padding-left: 18px; position: relative; }
.entity li::before { content: ''; position: absolute; left: 0; top: .58em; width: 8px; height: 2px; background: var(--ec); }
.entity-cta {
  margin-top: auto; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px; color: var(--ec);
}
.entity-cta::after { content: '→'; transition: transform .25s; }
.entity:hover .entity-cta::after { transform: translateX(5px); }

/* ------------------------------ Fondateur ------------------------------- */

.founder { display: grid; grid-template-columns: 300px 1fr; gap: 60px; align-items: center; margin-top: 24px; }
.founder-card {
  aspect-ratio: 3/3.4; border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(77, 168, 255, .12), transparent 50%),
    radial-gradient(120% 90% at 85% 90%, rgba(58, 220, 151, .10), transparent 55%),
    var(--surface);
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.founder-card b {
  font-family: var(--font-display); font-weight: 300;
  font-size: 84px; letter-spacing: .1em; color: var(--text);
}
/* Photographie du fondateur (remplace le monogramme) : cadrée par la
   carte, visage dans le tiers haut */
.founder-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 18%;
}
.founder-card::after {
  content: 'Fondateur'; position: absolute; bottom: 0; left: 0; right: 0;
  padding: 44px 0 18px; text-align: center;
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #d7dce6;
  /* assise sombre pour rester lisible sur la photo */
  background: linear-gradient(transparent, rgba(5, 8, 14, .82));
}
.founder-facts { list-style: none; margin: 22px 0 30px; padding: 0; display: grid; gap: 10px; }
.founder-facts li { padding-left: 24px; position: relative; color: var(--muted); }
.founder-facts li::before { content: '◆'; position: absolute; left: 0; font-size: 9px; top: .5em; color: var(--accent); }
.founder-facts li strong { color: var(--text); font-weight: 600; }

/* ------------------------------- Boutons -------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px; border-radius: 12px; border: 1px solid transparent;
  font-family: var(--font-body); font-size: 15.5px; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-primary { background: var(--text); color: #0a0d15; }
.btn-primary:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgba(255,255,255,.45); }
/* Bouton « mis en avant » : entre le fantôme et le plein — halo d'accent
   permanent, pour les liens importants qui ne sont pas l'action primaire */
.btn-en-avant {
  border: 1px solid color-mix(in srgb, var(--accent) 65%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
  box-shadow: 0 8px 30px -14px var(--accent);
}
.btn-en-avant:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -14px var(--accent);
}
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: #0a0d15; }
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px var(--accent); }

/* ------------------------------ Formulaire ------------------------------ */

.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px; margin-top: 26px; }
.contact-form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font-family: var(--font-body); font-size: 15.5px;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field textarea { min-height: 150px; resize: vertical; }
/* Honeypot : hors écran, invisible pour un humain, rempli par les robots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 13px; color: var(--muted); }
.form-note a { color: var(--accent); }
.form-status { font-size: 15px; font-weight: 600; min-height: 24px; }
.form-status.ok { color: var(--c-civ); }
.form-status.err { color: #ff7d6b; }

.contact-aside h3 { font-size: 20px; }
.contact-aside .contact-block { border-left: 2px solid var(--accent); padding-left: 20px; margin-bottom: 28px; }
.contact-aside .contact-block p { color: var(--muted); margin: 0; font-size: 15px; }

/* -------------------------------- Footer -------------------------------- */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 64px 0 34px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
.footer-brand p { color: var(--muted); font-size: 14.5px; max-width: 300px; }
/* Titres de colonnes du footer : des <p> stylés (pas des <h4> — un h4 après
   un h2 casserait la hiérarchie de titres pour les lecteurs d'écran) */
.footer-col-title { font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; font-weight: 600; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--text); text-decoration: none; font-size: 15px; opacity: .85; }
.footer-col a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom {
  border-top: 1px solid var(--line); padding-top: 26px;
  display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
  color: var(--muted); font-size: 13.5px;
}
/* padding vertical : cible tactile ≥ 24 px (WCAG 2.5.8) sur ces liens nus */
.footer-bottom a { color: var(--muted); display: inline-block; padding: 6px 2px; }

/* ======================= Pages d'entité ================================= */

.page-hero {
  position: relative; padding: calc(var(--header-h) + 90px) 0 90px;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 75% -10%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.page-hero .wrap { position: relative; z-index: 2; }
.page-hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.crumb { font-size: 13.5px; color: var(--muted); margin-bottom: 26px; display: inline-flex; gap: 8px; align-items: center; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--text); }
.crumb b { color: var(--accent); font-weight: 600; }
.page-hero h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 500; max-width: 820px; }
.page-hero h1 .thin { font-weight: 300; letter-spacing: .12em; }
.page-hero .lead { color: var(--muted); font-size: 19px; max-width: 640px; }
.page-hero .hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

/* Cartes d'expertise / d'activité */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 56px; }
.card {
  padding: 30px 26px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); transition: transform .3s, border-color .3s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.card-icon {
  width: 44px; height: 44px; border-radius: 11px; margin-bottom: 18px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent);
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 19px; }
.card p { color: var(--muted); font-size: 15px; margin: 0; }
.card ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 7px; }
.card li { font-size: 14px; color: var(--muted); padding-left: 16px; position: relative; }
.card li::before { content: ''; position: absolute; left: 0; top: .6em; width: 7px; height: 2px; background: var(--accent); }

/* Nuage de compétences / outils */
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.tag {
  padding: 8px 16px; border-radius: 999px; font-size: 14px;
  border: 1px solid var(--line); color: var(--muted); background: var(--surface);
}
.tag:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* Vitrine projet (War of Paperia, PolitObserve) */
.showcase {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center;
  margin-top: 56px; padding: 44px;
  border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(600px 300px at 10% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--surface);
}
.showcase-visual {
  border-radius: var(--radius); border: 1px solid var(--line);
  min-height: 260px; display: grid; place-items: center; overflow: hidden;
  background: var(--bg-2); position: relative;
}
.showcase h3 { font-size: 30px; }
.showcase .status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 16px;
}
.showcase .status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.showcase p { color: var(--muted); }
.showcase .actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }

/* Valeurs (CiviTech) */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 50px; }
.value { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.value b { font-family: var(--font-display); font-size: 18px; display: block; margin-bottom: 8px; }
.value p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* Bandeau CTA final */
.cta-band {
  text-align: center; padding: 90px 24px;
  background:
    radial-gradient(700px 300px at 50% 120%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--bg-2);
  border-top: 1px solid var(--line);
}
.cta-band h2 { font-size: clamp(28px, 4vw, 42px); }
.cta-band p { color: var(--muted); max-width: 560px; margin: 0 auto 34px; }

/* ============================ Épilogue ================================== */

/* Dernier regard vers la grotte avant le pied de page : la scène cadrée
   sur la montagne (l'homme est hors champ), assombrie, apaisée. */
.epilogue {
  position: relative; min-height: 46vh; overflow: hidden;
  display: grid; place-items: center; text-align: center;
  border-top: 1px solid var(--line);
}
.epilogue-scene {
  position: absolute; inset: 0;
  /* même fichier que le hero desktop (grotte-2400) : déjà en cache, zéro
     octet re-téléchargé — la version 1200 est réservée aux petits écrans */
  background: url('/assets/img/grotte-2400.webp') no-repeat;
  background-size: cover; background-position: 68% 50%;
  filter: brightness(.45) saturate(.85);
}
@media (max-width: 700px) {
  .epilogue-scene { background-image: url('/assets/img/grotte-1200.webp'); }
}
.epilogue-scene::after {
  /* l'homme est reparti : l'ombre avale le côté gauche de la scène */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, #0d111c 20%, rgba(13, 17, 28, .85) 45%, transparent 68%);
}
.epilogue::before, .epilogue::after {
  /* fondus haut et bas pour se raccorder aux sections voisines */
  content: ''; position: absolute; left: 0; right: 0; height: 34%;
  pointer-events: none; z-index: 1;
}
.epilogue::before { top: 0; background: linear-gradient(#0d111c, transparent); }
.epilogue::after { bottom: 0; background: linear-gradient(transparent, #0d111c); }
.epilogue-inner { position: relative; z-index: 2; padding: 70px 24px; }
.epilogue-titre {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(24px, 3.4vw, 36px); margin: 0 0 26px;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .7);
}

/* ========================= Pages légales ================================ */

.legal { max-width: 780px; margin: 0 auto; padding: calc(var(--header-h) + 70px) 24px 100px; }
.legal h1 { font-size: 38px; margin-bottom: 40px; }
.legal h2 { font-size: 22px; margin-top: 44px; color: var(--text); }
.legal p, .legal li { color: var(--muted); font-size: 15.5px; }
.legal a { color: var(--accent); }
.legal .updated { font-size: 13px; color: var(--muted); letter-spacing: .06em; }

/* ============================ Page 404 ================================== */

.page-404 {
  min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 24px;
}
.page-404 h1 { font-size: clamp(70px, 16vw, 160px); font-weight: 300; letter-spacing: .2em; margin: 0; }
.page-404 p { color: var(--muted); font-size: 18px; margin: 10px 0 34px; }

/* ============================ Responsive ================================ */

@media (max-width: 980px) {
  .entities { grid-template-columns: 1fr; }
  .entity { min-height: 0; }
  .founder { grid-template-columns: 1fr; gap: 36px; }
  .founder-card { max-width: 320px; }
  .contact-grid { grid-template-columns: 1fr; }
  .cards-3 { grid-template-columns: 1fr; }
  .values { grid-template-columns: 1fr; }
  .showcase { grid-template-columns: 1fr; padding: 30px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; order: 3; }
  .lang { order: 2; margin-left: auto; }
  .main-nav {
    position: fixed; top: var(--header-h); right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(10, 13, 21, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);   /* Safari/iOS */
    padding: 18px 24px 26px; border-bottom: 1px solid var(--line);
    /* en paysage mobile (hauteur réduite), le menu défile au lieu de
       pousser « Contact » hors de l'écran */
    max-height: calc(100svh - var(--header-h));
    overflow-y: auto;
    transform: translateY(-130%);
    /* visibility retarde la disparition à la fin du glissement, et rend les
       liens du menu fermé infocusables au clavier (sinon le focus "disparaît") */
    visibility: hidden;
    transition: transform .3s ease, visibility 0s linear .3s;
  }
  .main-nav.open { transform: none; visibility: visible; transition-delay: 0s; }
  .main-nav a { padding: 14px; font-size: 17px; }
  .form-row { grid-template-columns: 1fr; }
}

/* ================== Accessibilité : mouvement réduit ==================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal, .hero-title .lt { opacity: 1 !important; transform: none !important; }
}
