/* ═══════════════════════════════════════════════════════
   Forty Services — feuille de style
   Charte : marine #1B3A6B, cyan #29A8DF, blanc, gris clair
   ═══════════════════════════════════════════════════════ */

:root {
  --marine: #1B3A6B;
  --marine-fonce: #142D54;
  --cyan: #29A8DF;
  --blanc: #FFFFFF;
  --gris-fond: #F4F7FA;
  --gris-texte: #33404F;
  --gris-doux: #5B6B7E;
  --vert-wa: #2E9E5B;
  --bordure: #DEE5EE;
  --bleu-clair: #C9D6E8;
  --radius: 8px;
  --police-titre: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --police-texte: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Les ancres s'arrêtent sous l'en-tête collant, pas derrière */
#accueil, #services, #equipe, #faq, #engagements, #references, #deroulement, #contact {
  scroll-margin-top: 78px;
}

html, body { overflow-x: hidden; }

body {
  font-family: var(--police-texte);
  color: var(--gris-texte);
  background: var(--blanc);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--marine); line-height: 1.18; font-family: var(--police-titre); }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.06; }
h2 { font-size: clamp(1.65rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -0.025em; }
h3 { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.01em; }

a { color: var(--cyan); }

/* Focus clavier bien visible */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.conteneur { max-width: 1140px; margin: 0 auto; padding: 0 26px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 13px 30px;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn-devis { background: var(--cyan); color: var(--blanc); }
.btn-appel { background: var(--marine); color: var(--blanc); }
.btn-wa { background: var(--vert-wa); color: var(--blanc); }
.btn-contour { background: var(--blanc); color: var(--marine); border: 1.5px solid var(--bordure); }
.btn-contour:hover { border-color: var(--cyan); filter: none; }
.btn-appel-clair { background: var(--blanc); color: var(--marine); }
.btn svg { flex-shrink: 0; }

/* ---------- En-tête ---------- */
header {
  background: var(--marine);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.09);
}
.barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 13px;
  padding-bottom: 13px;
}
.logo { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.logo-texte {
  color: var(--blanc);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: 1.2px;
  line-height: 1.1;
}
.logo-texte span { color: var(--cyan); }
nav { display: flex; gap: 30px; }
nav a {
  color: var(--bleu-clair);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.97rem;
  transition: color 0.15s ease;
}
nav a:hover { color: var(--blanc); }
.barre .btn { min-height: 44px; padding: 8px 20px; font-size: 0.96rem; }

.bouton-menu { display: none; background: none; border: none; padding: 10px; cursor: pointer; }
.i-croix { display: none; }
.bouton-menu[aria-expanded="true"] .i-barres { display: none; }
.bouton-menu[aria-expanded="true"] .i-croix { display: inline; }
.nav-appel { display: none; }
@media (max-width: 920px) {
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--marine);
    flex-direction: column;
    gap: 0;
    padding: 2px 26px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 24px rgba(20, 45, 84, 0.35);
  }
  nav.ouvert { display: flex; }
  nav a { padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .bouton-menu { display: block; }
  .barre .btn-appel-clair { display: none; }
  .nav-appel {
    display: block;
    color: var(--cyan);
    font-weight: 800;
    border-bottom: none;
  }
}

/* ---------- Héros ---------- */
.heros {
  background: var(--marine);
  background-image:
    radial-gradient(ellipse 900px 520px at 78% -10%, rgba(41, 168, 223, 0.2), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
  color: var(--blanc);
  position: relative;
  overflow: hidden;
}
/* Le quadrillage s'estompe vers le bas, avant la vague */
.heros::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: linear-gradient(to top, var(--marine), transparent);
  pointer-events: none;
}
.heros > * { position: relative; z-index: 1; }


/* Entrée en scène échelonnée */
@keyframes monte { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.heros h1, .heros-texte p, .heros-actions, .scene-cadre, .heros-reassurance {
  animation: monte 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.heros-texte p { animation-delay: 0.1s; }
.heros-actions { animation-delay: 0.2s; }
.scene-cadre { animation-delay: 0.3s; }
.heros-reassurance { animation-delay: 0.4s; }
@media (prefers-reduced-motion: reduce) {
  .heros h1, .heros-texte p, .heros-actions, .scene-cadre, .heros-reassurance { animation: none; }
}
.heros-grille {
  display: grid;
  grid-template-columns: minmax(0, 520px);
  gap: 0;
  min-height: 480px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 8px;
}
.heros h1 { color: var(--blanc); font-size: clamp(1.9rem, 3.7vw, 2.85rem); line-height: 1.1; }
.heros-texte .heros-accroche {
  margin: 20px 0 0;
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  letter-spacing: -0.01em;
  color: var(--cyan);
}
.heros-texte .heros-intro { margin: 10px 0 28px; max-width: 450px; }
.heros-texte h1 { max-width: 520px; }
.heros h1 span {
  color: var(--cyan);
  background: linear-gradient(var(--cyan), var(--cyan)) 0 100% / 100% 4px no-repeat;
  padding-bottom: 4px;
}
.heros-texte p {
  max-width: 520px;
  margin: 20px 0 30px;
  font-size: 1.14rem;
  color: var(--bleu-clair);
}
.heros-actions { display: flex; flex-wrap: wrap; gap: 14px; }


/* ---------- Scène 3D plein écran de l'accueil ---------- */
.heros > .scene-vue {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* la scène s'estompe vers la gauche pour laisser respirer le texte */
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 54%);
  mask-image: linear-gradient(90deg, transparent 30%, #000 54%);
}
.scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.scene-canvas.pret { opacity: 1; }
.scene-canvas.pret.fondu { opacity: 0; transition-duration: 0.25s; }
.heros.sans-3d > .scene-vue { display: none; }
/* ordinateur : l'image fixe de la scène s'affiche immédiatement ; la 3D se fond par-dessus dès qu'elle est prête,
   puis l'image s'efface. Sans 3D (WebGL absent, animations réduites…), l'image reste. */
/* L'image fixe suit la même règle de taille et de position que la caméra 3D (batiment3d.js, placer / ajuster) :
   --u = hauteur de l'accueil / éloignement k, avec k = bornes(1,1 ; 2,56 × hauteur / largeur ; 2,4) ; le centre de la vue 3D est à 73 % / 33 %.
   Tout est exprimé en multiples de --u : la bascule vers la 3D ne fait ni saut ni changement de taille, quel que soit l'écran.
   (constantes calées sur l'emprise mesurée de la scène 3D à 1265 × 858 px) */
@media (min-width: 921px) {
  .heros > .scene-vue { container-type: size; }
  .heros > .scene-vue::before {
    content: "";
    position: absolute;
    /* repli (navigateurs sans unités de conteneur) : valeurs pour ~1280 px de large */
    width: 72.7%; aspect-ratio: 4 / 3; left: 36.6%; top: -7.8%;
    --u: clamp(41.667cqh, 39.0625cqw, 90.909cqh);
    width: calc(var(--u) * 1.862);
    left: calc(73cqw + var(--u) * -0.9323);
    top: calc(33cqh + var(--u) * -0.7084);
    background: var(--poster, url(/images/scene-0.webp)) center / 100% 100% no-repeat;
    opacity: 1;
    transition: opacity 0.5s ease 0.9s;
  }
  .heros.scene-ok > .scene-vue::before { opacity: 0; }
  .heros.sans-3d > .scene-vue { display: block; }
}

/* Panneau de contrôle vitré : métiers à gauche, fiche et devis à droite */
.scene-cadre {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(14, 32, 66, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.scene-choix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.choix {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 78px;
  padding: 10px 8px;
  border: none;
  background: rgba(14, 32, 66, 0.55);
  color: var(--bleu-clair);
  font-family: var(--police-texte);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.choix svg { flex-shrink: 0; }
.choix:hover { color: var(--blanc); background: rgba(27, 58, 107, 0.9); }
.choix.actif { background: var(--cyan); color: var(--blanc); }
.choix.actif svg { stroke: var(--blanc); }

.scene-fiche {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  color: var(--blanc);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}
.sf-titre {
  display: block;
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
}
.sf-titre { color: #FFFFFF; }
.sf-desc { font-size: 0.84rem; line-height: 1.45; color: #F2F6FC; }
.sf-cta {
  display: inline-flex; align-items: center; gap: 8px;
  flex-shrink: 0;
  background: var(--vert-wa);
  color: var(--blanc);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 16px;
  border-radius: 7px;
  text-decoration: none;
  white-space: nowrap;
}
.sf-cta:hover { filter: brightness(1.08); }
.scene-fiche.maj .sf-texte { animation: monte 0.35s ease both; }

/* Téléphone et petite tablette : titre, devis, sélecteurs, scène, fiche, réassurance — l'ensemble forme une seule carte */
@media (max-width: 920px) {
  .heros { display: flex; flex-direction: column; }
  .heros > .conteneur { width: 100%; }
  .heros > .heros-grille { order: 1; }
  /* le panneau est « dissous » pour que sélecteurs, scène et fiche s'ordonnent librement */
  .heros > .heros-panneau, .scene-cadre { display: contents; }
  .heros > .scene-vue::before { display: none; }
  .heros .scene-choix {
    order: 2;
    grid-template-columns: 1fr 1fr;
    margin: 6px 18px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
  }
  .heros > .scene-vue {
    order: 3;
    position: relative;
    inset: auto;
    height: 296px;
    margin: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    background: url(/images/scene-0.webp) center / contain no-repeat, radial-gradient(ellipse at 50% 55%, rgba(41, 168, 223, 0.16), rgba(14, 32, 66, 0.35) 70%);
    -webkit-mask-image: none;
    mask-image: none;
    overflow: hidden;
  }
  .heros.sans-3d > .scene-vue {
    display: block;
    background: var(--poster, url(/images/scene-0.webp)) center / contain no-repeat, radial-gradient(ellipse at 50% 55%, rgba(41, 168, 223, 0.16), rgba(14, 32, 66, 0.35) 70%);
  }
  .heros.scene-ok > .scene-vue { background-image: radial-gradient(ellipse at 50% 55%, rgba(41, 168, 223, 0.16), rgba(14, 32, 66, 0.35) 70%); }
  /* le conteneur « dissous » ne doit rien peindre ni flouter (certains navigateurs mobiles appliquent encore son fond ou son flou) */
  .heros .scene-cadre { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .heros .scene-fiche {
    order: 4;
    position: relative;
    z-index: 2;
    margin: 0 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 14px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 0 14px 14px;
    background: #0E2042;
  }
  /* titre et description : blanc pur, pleine opacité, aucune animation ni transition */
  .heros .sf-titre, .heros .sf-desc { color: #FFFFFF; -webkit-text-fill-color: #FFFFFF; opacity: 1; animation: none; transition: none; }
  .heros > .heros-bandeau { order: 5; }
  .heros > .vague { order: 6; }
  .choix { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 48px; gap: 8px; padding: 6px 10px; font-size: 0.82rem; }
  .sf-titre { font-size: 1.1rem; margin-bottom: 4px; }
  .sf-desc { font-size: 0.93rem; line-height: 1.5; }
  .sf-cta { display: none; }
  .heros-reassurance { margin-top: 14px; }
  /* .scene-cadre et .heros-panneau sont en display: contents : leur fondu d'entrée est supprimé (Safari mobile peut l'appliquer au contenu et le laisser pâle) */
  .heros .scene-cadre, .heros .heros-panneau, .scene-fiche.maj .sf-texte, .heros .scene-fiche, .heros .scene-choix { animation: none; opacity: 1; transform: none; }
}
@media (max-width: 380px) {
  .heros > .scene-vue { height: 268px; margin: 0 14px; }
  .heros .scene-choix { margin: 6px 14px 0; }
  .heros .scene-fiche { margin: 0 14px; }
}
/* téléphone : moins de vide entre la vague et « Nos services », photo d'équipe moins haute */
@media (max-width: 700px) {
  #services { padding-top: 26px; }
  .equipe-grille .equipe-photo { max-height: 320px; }
  .equipe-grille .equipe-photo img { max-height: 320px; object-position: center 33%; }
}

/* ---------- Questions fréquentes ---------- */
.faq { max-width: 820px; margin-top: 36px; display: grid; gap: 12px; }
.faq details {
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  padding: 0 20px;
  transition: border-color 0.18s ease;
}
.faq details[open] { border-color: var(--cyan); }
.faq summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding: 18px 30px 18px 0;
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 1.04rem;
  color: var(--marine);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--cyan);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq p { padding: 0 0 18px; color: var(--gris-doux); font-size: 0.97rem; }

/* Réassurance sur une ligne */
.heros-reassurance {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 34px;
  margin-top: 26px;
  padding: 22px 0 56px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--bleu-clair);
  font-weight: 600;
  font-size: 0.95rem;
}
.heros-reassurance li { display: flex; align-items: center; gap: 9px; }
.heros-reassurance svg { flex-shrink: 0; }

@media (max-width: 920px) {
  .heros-grille { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; padding-bottom: 8px; min-height: 0; }
}

/* ---------- Vagues signature (double couche) ---------- */
.vague { display: block; width: 100%; height: 90px; margin-top: -1px; }
@media (max-width: 700px) { .vague { height: 56px; } }

/* ---------- Sections ---------- */
section { padding: 84px 0; }
.tete-section { max-width: 700px; }
.sur-titre {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.sur-titre::before { content: ""; width: 26px; height: 2.5px; background: var(--cyan); border-radius: 2px; }
.tete-section .accroche-section { color: var(--marine); font-family: var(--police-titre); font-weight: 800; font-size: 1.15rem; }
.tete-section p { margin-top: 16px; color: var(--gris-doux); font-size: 1.06rem; }

/* ---------- Services ---------- */
.grille-services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 48px;
  counter-reset: svc;
}
.carte {
  position: relative;
  counter-increment: svc;
  display: flex;
  flex-direction: column;
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  padding: 30px 26px 26px;
  transition: border-color 0.18s ease;
}
.carte::after {
  content: "0" counter(svc);
  position: absolute;
  top: 20px; right: 22px;
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 1px;
  color: var(--bordure);
  transition: color 0.18s ease;
}
.carte:hover { border-color: var(--cyan); }
.carte:hover::after { color: var(--cyan); }

/* Inclinaison 3D pilotée par main.js (--rx, --ry) + reflet suivant le curseur (--gx, --gy) */
.grille-services { perspective: 1100px; }
.carte.revele.visible {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: opacity 0.6s ease, border-color 0.18s ease, transform 0.18s ease-out;
  will-change: transform;
}
.carte::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle 180px at var(--gx, 50%) var(--gy, 50%), rgba(41, 168, 223, 0.14), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.carte:hover::before { opacity: 1; }
.carte-3d { display: none; }
@media (min-width: 921px) {
  .avec-3d .carte .icone { display: none; }
  .avec-3d .carte-3d {
    display: block;
    width: 100px;
    height: 100px;
    margin: -10px 0 4px -14px;
  }
}
@media (max-width: 920px) {
  .avec-3d .carte .carte-tete .icone { display: none; }
  .avec-3d .carte-3d { display: block; width: 84px; height: 84px; margin: -8px 0 2px -10px; }
}
@media (max-width: 700px) {
  .avec-3d .carte-3d { width: 72px; height: 72px; margin: -8px 0 -8px -8px; flex-shrink: 0; }
}
.carte:hover .carte-tete { transform: translateZ(34px); }
.carte-tete { transition: transform 0.2s ease-out; }
.carte:hover::after { transform: translateZ(20px); }
.carte .icone {
  width: 60px; height: 60px;
  border-radius: var(--radius);
  background: rgba(41, 168, 223, 0.1);
  color: var(--cyan);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.18s ease;
}
.carte:hover .icone { background: rgba(41, 168, 223, 0.2); transform: scale(1.05); }
.carte-tete { margin-bottom: 12px; }
.carte-tete .icone { margin-bottom: 18px; }
.carte h3 { margin-bottom: 0; }
.carte p { font-size: 0.97rem; color: var(--gris-doux); }
.carte .lien-wa {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  font-size: 0.92rem; font-weight: 700;
  color: var(--marine); text-decoration: none;
  transition: color 0.15s ease;
}
.carte .lien-wa svg { color: var(--vert-wa); }
.carte .lien-wa:hover { color: var(--vert-wa); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Équipe ---------- */
.equipe-grille {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: center;
}
.equipe-photo {
  position: relative;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--bordure);
  max-height: 500px;
}
.equipe-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(to top, rgba(20, 45, 84, 0.35), transparent 45%);
  pointer-events: none;
}
.equipe-photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 500px;
  object-fit: cover;
  object-position: center 30%;
}
.equipe-texte p { margin-top: 16px; color: var(--gris-doux); font-size: 1.06rem; max-width: 480px; }
.equipe-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 26px;
  max-width: 460px;
}
.equipe-stats > div {
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.equipe-stats strong {
  display: block;
  font-family: var(--police-titre);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--marine);
  line-height: 1.1;
  margin-bottom: 4px;
}
.equipe-stats span { font-size: 0.9rem; color: var(--gris-doux); line-height: 1.45; display: block; }
@media (max-width: 920px) {
  .equipe-grille { grid-template-columns: 1fr; gap: 36px; }
  .equipe-photo { max-height: 420px; }
  .equipe-photo img { max-height: 420px; }
}

/* ---------- Engagements ---------- */
.fond-gris { background: var(--gris-fond); }
.grille-engagements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
  margin-top: 48px;
}
.engagement {
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color 0.18s ease;
}
.engagement:hover { border-color: var(--cyan); }
.engagement svg { flex-shrink: 0; margin-top: 2px; }
.engagement h3 { font-size: 1.04rem; margin-bottom: 6px; }
.engagement p { font-size: 0.94rem; color: var(--gris-doux); }

/* ---------- Références ---------- */
/* Cartes des références mises en avant : sobres, compactes, contenu centré */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.grille-ref-cartes {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 32px;
}
.ref-carte {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  min-width: 0;
}
/* Zone des marques : 56 px de haut, contenu centré. Chaque logo garde ses proportions et sa hauteur propre. */
.ref-zone { display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; }
.ref-zone img { display: block; height: var(--h, 48px); width: auto; max-width: 100%; object-fit: contain; }
/* Fond marine uniquement pour le logo blanc de Melliber */
.ref-zone--sombre { width: auto; max-width: 100%; align-self: center; padding: 4px 12px; background: var(--marine-fonce); border-radius: 6px; }
/* Logo qui écrit déjà le nom (pas de nom dessous) : la zone occupe l'espace libre, le logo y est centré, les prestations restent alignées en bas */
.ref-zone--libre { flex: 1; height: auto; min-height: 56px; }
.ref-nom { font-size: 0.92rem; line-height: 1.25; overflow-wrap: anywhere; }
/* Client sans logo : son nom en texte, sans symbole inventé */
.ref-wordmark { font-size: 24px; font-weight: 600; line-height: 1; white-space: nowrap; color: var(--marine); letter-spacing: 0; }
/* Prestations alignées au même niveau dans toutes les cartes */
.ref-prestations { margin-top: auto; font-size: 0.84rem; font-weight: 600; line-height: 1.35; color: var(--gris-doux); }
@media (max-width: 1000px) {
  .grille-ref-cartes { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 359px) {
  .grille-ref-cartes { grid-template-columns: 1fr; }
}
.ref-autres-titre {
  margin-top: 32px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gris-doux);
}
/* Autres références : pastilles blanches, largeur adaptée au nom, retours à la ligne naturels */
.ref-autres { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.ref-autres li {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.93rem;
  line-height: 1.2;
  color: var(--marine);
}
.ref-autres img { display: block; height: 22px; width: auto; }

/* ---------- Processus ---------- */
.grille-etapes {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
  margin-top: 52px;
  position: relative;
}
.grille-etapes::before {
  content: "";
  position: absolute;
  top: 21px; left: 12.5%; right: 12.5%;
  height: 2px;
  background: rgba(41, 168, 223, 0.5);
  transform-origin: left center;
  transition: transform 1.2s ease;
}
.grille-etapes.anime::before { transform: scaleX(0); }
.grille-etapes.anime.trace::before { transform: scaleX(1); }
.etape { position: relative; text-align: center; padding: 0 10px; }
.etape .numero {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--marine);
  color: var(--blanc);
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 14px;
  border: 4px solid var(--blanc);
  box-shadow: 0 0 0 2px var(--cyan);
}
.etape .etape-icone { display: flex; justify-content: center; margin-bottom: 10px; }
.etape h3 { margin-bottom: 8px; }
.etape p { font-size: 0.96rem; color: var(--gris-doux); }
@media (max-width: 760px) {
  .grille-etapes { grid-template-columns: 1fr; gap: 30px; }
  /* ligne verticale : un segment par étape, du centre d'un cercle au centre du suivant ; elle s'arrête au centre du cercle 4 */
  .grille-etapes::before { display: none; }
  .etape:not(:last-child)::after {
    content: "";
    position: absolute;
    z-index: 0;
    left: 21px; top: 22px;
    width: 2px;
    height: calc(100% + 30px);
    background: rgba(41, 168, 223, 0.5);
    transform-origin: center top;
    transition: transform 0.45s ease calc(var(--delai, 0s) * 4);
  }
  .etape .numero { z-index: 1; }
  .grille-etapes.anime .etape::after { transform: scaleY(0); }
  .grille-etapes.anime.trace .etape::after { transform: scaleY(1); }
  .etape { text-align: left; padding: 0; display: grid; grid-template-columns: 44px 1fr; gap: 16px; }
  .etape .numero { margin-bottom: 0; }
  .etape .etape-icone { justify-content: flex-start; margin-bottom: 6px; }
  .etape div h3 { margin-top: 2px; }
}

/* ---------- Contact ---------- */
.contact {
  background-color: var(--marine);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--blanc);
  position: relative;
  overflow: hidden;
}
.contact::after {
  content: "";
  position: absolute;
  right: -140px; bottom: -140px;
  width: 420px; height: 420px;
  border-radius: 50%;
  border: 60px solid rgba(41, 168, 223, 0.07);
  pointer-events: none;
}
.contact .sur-titre::before { background: var(--cyan); }
.contact h2 { color: var(--blanc); }
.contact .tete-section p { color: var(--bleu-clair); }
.contact-grille {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 56px;
  align-items: start;
  position: relative;
  z-index: 1;
}
.contact-lignes { margin-top: 36px; display: grid; gap: 16px; font-size: 1rem; }
.contact-lignes > div { display: flex; gap: 13px; align-items: flex-start; }
.contact-lignes svg { flex-shrink: 0; margin-top: 3px; }
.contact-lignes a { color: var(--blanc); font-weight: 700; text-decoration: none; }
.contact-lignes a:hover { color: var(--cyan); }
.contact-lignes .etiquette { display: block; font-size: 0.82rem; letter-spacing: 1px; text-transform: uppercase; color: #8FA5C4; font-weight: 700; margin-bottom: 2px; }

.panneau-devis {
  background: var(--blanc);
  border-radius: 10px;
  padding: 34px 32px;
  color: var(--gris-texte);
}
.panneau-devis h3 { font-size: 1.35rem; margin-bottom: 8px; }
.panneau-devis > p { font-size: 0.97rem; color: var(--gris-doux); margin-bottom: 24px; }
.panneau-devis .btn { width: 100%; margin-bottom: 12px; }
.panneau-devis .note { font-size: 0.87rem; color: var(--gris-doux); text-align: center; margin: 14px 0 0; }
.btn-wa-panneau { background: var(--vert-wa); color: var(--blanc); }

@media (max-width: 920px) {
  .contact-grille { grid-template-columns: 1fr; gap: 46px; }
}

/* ---------- Pied de page ---------- */
footer { background: var(--marine-fonce); color: #B9C8DD; font-size: 0.93rem; }
.pied-haut {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
  padding: 52px 0 40px;
}
.pied-haut h4 { color: var(--blanc); font-size: 0.95rem; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 16px; }
.pied-haut ul { list-style: none; display: grid; gap: 9px; }
.pied-haut a { color: #D3DEEE; text-decoration: none; }
.pied-haut a:hover { color: var(--blanc); }
.pied-marque { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.pied-marque .nom { color: var(--blanc); font-weight: 800; letter-spacing: 1px; line-height: 1.1; }
.pied-marque .nom span { color: var(--cyan); }
.pied-bas {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: 0.87rem;
}
@media (max-width: 760px) { .pied-haut { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- WhatsApp flottant ---------- */
.wa-flottant {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 60;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--vert-wa);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(20, 45, 84, 0.32);
  text-decoration: none;
  transition: transform 0.15s ease;
}
.wa-flottant:hover { transform: scale(1.06); }

/* ---------- Barre d'action mobile (masquée sur grand écran) ---------- */
.barre-mobile { display: none; }

/* ---------- Apparition douce ---------- */
.revele {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--delai, 0s);
}
.revele.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .revele { opacity: 1; transform: none; transition: none; }
}

/* ═══════════════════════════════════════════════════════
   Optimisation mobile — écrans jusqu'à 700 px
   ═══════════════════════════════════════════════════════ */
@media (max-width: 700px) {
  .conteneur { padding: 0 18px; }
  section { padding: 48px 0; }
  h1 { font-size: 1.58rem; }
  .heros h1 { font-size: 1.55rem; }
  h2 { font-size: 1.45rem; }
  .vague { height: 44px; }

  /* En-tête plus fin */
  .barre { padding-top: 10px; padding-bottom: 10px; }
  .logo-texte { font-size: 1.05rem; }

  .heros-grille { padding-top: 26px; padding-bottom: 4px; gap: 0; }
  .heros-texte p { font-size: 0.98rem; margin: 12px 0 18px; }
  .heros-texte .heros-accroche { font-size: 1.12rem; margin: 10px 0 0; }
  .heros-texte .heros-intro { font-size: 0.96rem; margin: 8px 0 16px; }
  .heros-actions { gap: 10px; }
  .heros-actions .btn { width: 100%; }
  /* Le bouton d'appel du héros est retiré : la barre fixe en bas fait ce travail */
  .heros-actions .btn-appel-clair { display: none; }
  .heros-reassurance { font-size: 0.88rem; gap: 8px 20px; padding: 20px 0 36px; }

  /* Services : icône et titre côte à côte, cartes légères */
  .tete-section p { font-size: 0.99rem; margin-top: 14px; }
  .grille-services { margin-top: 28px; gap: 12px; }
  .carte { padding: 18px 16px; }
  .carte::after { display: none; }
  .carte-tete { display: flex; align-items: center; gap: 13px; margin-bottom: 10px; }
  .carte-tete .icone { width: 44px; height: 44px; margin-bottom: 0; }
  .carte p { font-size: 0.93rem; }
  .carte .lien-wa { font-size: 0.88rem; padding-top: 12px; }

  /* Engagements : cartes compactes, une colonne */
  .grille-engagements { grid-template-columns: 1fr; margin-top: 26px; gap: 12px; }
  .engagement { padding: 16px; gap: 12px; }
  .engagement h3 { margin-bottom: 3px; }
  .engagement p { font-size: 0.93rem; }
  .grille-etapes { margin-top: 30px; }

  /* Équipe */
  .equipe-grille { gap: 26px; }
  .equipe-texte p { font-size: 1rem; }
  .equipe-stats { gap: 10px; margin-top: 20px; }
  .equipe-stats > div { padding: 14px 16px; }
  .equipe-stats strong { font-size: 1.45rem; }
  .equipe-stats span { font-size: 0.84rem; }

  /* Références */
  .grille-ref-cartes { gap: 10px; margin-top: 24px; }
  .ref-carte { padding: 12px 10px 10px; gap: 6px; }
  .ref-nom { font-size: 0.86rem; }
  .ref-prestations { font-size: 0.8rem; }
  .ref-autres-titre { margin-top: 26px; }
  .ref-autres { gap: 10px; margin-top: 12px; }
  .ref-autres li { padding: 0 14px; font-size: 0.88rem; }

  /* Contact : panneau devis compact */
  .contact-grille { gap: 36px; }
  .contact-lignes { margin-top: 26px; gap: 14px; font-size: 0.96rem; }
  .panneau-devis { padding: 26px 20px; }
  .panneau-devis h3 { font-size: 1.22rem; }

  /* Pied de page */
  .pied-haut { padding: 36px 0 24px; gap: 26px; }
  .pied-bas { padding: 14px 0 12px; }
  footer { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }

  /* Barre d'action fixe en bas : appel + WhatsApp sous le pouce */
  .wa-flottant { display: none; }
  .barre-mobile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 70;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--marine);
    box-shadow: 0 -4px 16px rgba(20, 45, 84, 0.18);
  }
  .barre-mobile a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 800;
    font-size: 0.93rem;
    text-decoration: none;
    color: var(--blanc);
  }
  .bm-appel { background: var(--marine); }
  .bm-wa { background: var(--vert-wa); }
}

/* Téléphones courants (jusqu'à 430 px) : texte d'accueil compact pour que le devis apparaisse vite */
@media (max-width: 430px) {
  .heros h1 { font-size: 1.45rem; }
  .heros-texte .heros-accroche { font-size: 1.05rem; }
  .heros-texte .heros-intro { font-size: 0.92rem; }
}

/* Très petits écrans (moins de 380 px) */
@media (max-width: 380px) {
  body { font-size: 16px; }
  .heros h1 { font-size: 1.42rem; }
  .heros-texte .heros-accroche { font-size: 1.02rem; }
  .heros-texte .heros-intro { font-size: 0.9rem; }
  .barre-mobile a { font-size: 0.84rem; gap: 5px; padding: 0 4px; }
  .barre-mobile svg { width: 17px; height: 17px; }
  .conteneur { padding: 0 14px; }
  .logo-texte { font-size: 1.02rem; }
  .equipe-stats { grid-template-columns: 1fr; }
}

/* ---------- Page 404 ---------- */
.page-404 {
  background: var(--marine);
  color: var(--blanc);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.page-404 h1 { color: var(--blanc); font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 26px 0 10px; }
.page-404 p { color: var(--bleu-clair); max-width: 440px; margin-bottom: 30px; }

/* ---------- Page mentions légales ---------- */
.page-legal { background: var(--blanc); }
.legal-entete { background: var(--marine); }
.legal-entete .barre { padding-top: 10px; padding-bottom: 10px; }
.legal-retour { color: #D3DEEE; font-weight: 600; font-size: 0.95rem; text-decoration: none; padding: 10px 0; }
.legal-retour:hover { color: var(--blanc); }
.legal { max-width: 760px; padding-top: 44px; padding-bottom: 72px; }
.legal h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 22px; }
.legal h2 { font-size: 1.15rem; margin: 30px 0 8px; }
.legal p { color: var(--gris-doux); line-height: 1.65; margin-bottom: 12px; }
.legal a { color: var(--marine); }
.legal-maj { font-size: 0.86rem; margin-top: 34px; }
.pied-bas a { color: #D3DEEE; }
