/*
 * Contenu vitrine — marges communes, cadre standard et cadre grand écran.
 * Padding HORIZONTAL sur le parent (.vitrine-shell ou px-4 sm:px-6 lg:px-8),
 * puis .vitrine-page__inner sans padding. La navigation, le footer et les
 * pages utilisent le même cadre fluide --vitrine-wide-max.
 *
 * overflow-x: clip (pas hidden) : coupe le débordement horizontal SANS casser
 * position:sticky (ex. rails / colonnes sticky ailleurs sur la vitrine).
 *
 * Rythme vertical : --vitrine-section-y (même valeur que la page industrielle).
 */
html,
body,
main {
  overflow-x: clip;
}

:root {
  --vitrine-gutter: 1rem;
  /* La section mobile « interface » occupe la largeur moins deux marges de
     32px sur grand écran. Partager ce cadre avec la navigation, le footer et
     les pages publiques. Borne conservée au-delà du 4K. */
  --vitrine-wide-max: clamp(96rem, calc(100vw - 4rem), 240rem);
  /* Air haut / bas des sections — source de vérité site-wide */
  --vitrine-section-y: clamp(8.5rem, 14vw, 17rem);
}

.vitrine-shell {
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  :root { --vitrine-gutter: 1.5rem; }
  .vitrine-shell {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  :root { --vitrine-gutter: 2rem; }
  .vitrine-shell {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

#site-header { padding-inline: var(--vitrine-gutter); }
#site-header > nav,
body > footer > .max-w-8xl { max-width: var(--vitrine-wide-max); }
body > footer { padding-inline: var(--vitrine-gutter); }
@media (max-width: 1279px) {
  #site-header :is([data-toggle-dark], [data-open-drawer]) { min-width: 44px; min-height: 44px; }
  #lang-toggle-mobile { min-height: 44px; }
}

/* À 320px, ménager la marque et les trois commandes sans les superposer. */
@media (max-width: 360px) {
  #site-header > nav > a { gap: .5rem; flex-shrink: 0; }
  #site-header > nav > a .font-display { font-size: 1.125rem; }
  #site-header > nav > div:last-child { gap: .375rem; flex-shrink: 0; }
  #lang-toggle-mobile { gap: .25rem; padding-inline: .5rem; }
}

.vitrine-page__inner {
  width: 100%;
  max-width: var(--vitrine-wide-max);
  margin-left: auto;
  margin-right: auto;
}

/* Ces cadres Tailwind portent aussi leur padding ; les .vitrine-shell le
   portent à l'extérieur. Les deux constructions partagent les mêmes bords. */
.vitrine-site main .max-w-8xl {
  max-width: calc(var(--vitrine-wide-max) + 2 * var(--vitrine-gutter));
  width: 100%;
}
.vitrine-site > main { padding-top: var(--site-header-height, 5rem); }
html { scroll-padding-top: calc(var(--site-header-height, 5rem) + 1rem); }

@media (min-width: 1600px) {
  :root {
    --nav-control-size: clamp(2.5rem, calc(2rem + .5vw), 3.25rem);
    --vitrine-gap: clamp(3rem, calc(1rem + 2vw), 6rem);
    --vitrine-section-y: clamp(12rem, calc(10rem + 2vw), 15rem);
  }
  #site-header :is([data-services-menu-toggle], nav > div:nth-child(2) > div > a) {
    font-size: var(--fs-nav);
    padding-inline: clamp(1.25rem, calc(.9rem + .35vw), 1.75rem);
  }
  #site-header :is(#lang-toggle, .nav-auth-cta) { font-size: var(--fs-nav); }
  #site-header :is(#lang-toggle, .nav-auth-cta, [data-toggle-dark]) { height: var(--nav-control-size); min-height: var(--nav-control-size); }
  #site-header [data-toggle-dark] { width: var(--nav-control-size); }
  #site-header > nav > a .font-display { font-size: clamp(1.5rem, calc(1rem + .5vw), 2rem); }
  #services-megamenu { width: min(calc(100vw - 2 * var(--vitrine-gutter)), clamp(52rem, calc(32rem + 16vw), 76rem)); }
  #services-megamenu .nav-svc-title { font-size: clamp(.9375rem, calc(.65rem + .25vw), 1.375rem); }
  #services-megamenu :is(.nav-svc-desc, .nav-svc-foot) { font-size: var(--fs-small); }
  .vitrine-site > footer :is(nav, .opacity-90, .truncate) { font-size: var(--fs-small); }
  .vitrine-site > footer a { font-size: var(--fs-button); }
  .vitrine-site > footer h3 { font-size: clamp(3rem, calc(2rem + 1vw), 4.5rem); }
}

/* Utilitaire explicite */
.vitrine-section {
  padding-block: var(--vitrine-section-y);
}

/*
 * Sections Tailwind (py-20 / py-24 / sm:py-32 / …) → même respiration
 * que la page logiciel scientifique & industriel.
 * !important : bat les utilitaires Tailwind chargés / responsive.
 */
main section.py-16,
main section.py-20,
main section.py-24,
main section.py-28,
main section.py-32,
main section.py-40 {
  padding-block: var(--vitrine-section-y) !important;
}

@media (min-width: 640px) {
  main section[class*="sm:py-16"],
  main section[class*="sm:py-20"],
  main section[class*="sm:py-24"],
  main section[class*="sm:py-28"],
  main section[class*="sm:py-32"],
  main section[class*="sm:py-40"] {
    padding-block: var(--vitrine-section-y) !important;
  }
}

@media (min-width: 1024px) {
  main section[class*="lg:py-20"],
  main section[class*="lg:py-24"],
  main section[class*="lg:py-28"],
  main section[class*="lg:py-32"],
  main section[class*="lg:py-40"] {
    padding-block: var(--vitrine-section-y) !important;
  }
}

@media (min-width: 1536px) {
  main section[class*="2xl:py-"] {
    padding-block: var(--vitrine-section-y) !important;
  }
}

/*
 * Héros = 1re <section> de la page (ex. À propos).
 * main a déjà le décalage nav (pt-*) → pas de gros padding au-dessus.
 */
main > section:first-of-type.py-16,
main > section:first-of-type.py-20,
main > section:first-of-type.py-24,
main > section:first-of-type.py-28,
main > section:first-of-type.py-32,
main > section:first-of-type.py-40 {
  padding-top: 0.75rem !important;
  padding-bottom: var(--vitrine-section-y) !important;
}

@media (min-width: 640px) {
  main > section:first-of-type[class*="sm:py-"] {
    padding-top: 1rem !important;
    padding-bottom: var(--vitrine-section-y) !important;
  }
}

/* Hero À propos : padding vertical géré dans apropos-hero.css (pas --vitrine-section-y) */

/*
 * Sections nommées (CSS dédiés chargés après).
 * Héros immersifs (svc-hero, desk/mob/blog hero) exclus.
 */
main :is(
  .desk-section,
  .mob-section,
  .svc-fit,
  .svc-xp,
  .svc-choix,
  .svc-methode,
  .svc-spot,
  .svc-real,
  .blog-section,
  .blog-cta-rx
) {
  padding-block: var(--vitrine-section-y) !important;
}

/* Audit 2026-10: geometric reservations contain no duplicate text nodes. */
[data-reserve]::before { content: attr(data-reserve); }
[data-current]::before { content: attr(data-current); }
#home-hero-animation { min-width: 0; }
@media (max-width: 360px) {
  #home-hero-animation { font-size: 2.15rem !important; }
}
/* ── Menu mobile plein écran (premium) ───────────────────────────────── */
.nav-m {
  --nav-m-ink: #f8fafc;
  --nav-m-muted: #94a3b8;
  --nav-m-line: rgba(148, 163, 184, 0.18);
  --nav-m-cyan: #22d3ee;
  --nav-m-orange: #f1894e;
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}
.nav-m.is-open {
  opacity: 1;
  pointer-events: auto;
}
.nav-m__panel {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  color: var(--nav-m-ink);
  background:
    radial-gradient(90% 48% at 8% -6%, rgba(34, 211, 238, 0.2), transparent 55%),
    radial-gradient(70% 42% at 100% 0%, rgba(241, 137, 78, 0.1), transparent 50%),
    radial-gradient(80% 50% at 50% 110%, rgba(56, 189, 248, 0.08), transparent 55%),
    linear-gradient(165deg, #121c30 0%, #0b1220 46%, #070c14 100%);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  padding:
    max(0.55rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    0
    max(1rem, env(safe-area-inset-left, 0px));
}
.nav-m__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 16%),
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.02) 50%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
}
.nav-m__panel::after {
  content: "";
  position: absolute;
  inset: auto -20% -18% auto;
  width: min(22rem, 70vw);
  height: min(22rem, 70vw);
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.08), transparent 68%);
  filter: blur(8px);
}
.nav-m.is-open .nav-m__panel {
  transform: translateX(0);
}
.nav-m__head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  min-height: 3.5rem;
  margin: 0.15rem 0 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.15rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-m__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  border-radius: 0.85rem;
  text-decoration: none;
  color: #fff;
}
.nav-m__brand:focus {
  outline: none;
}
.nav-m__brand:focus-visible {
  box-shadow: 0 0 0 2px #0b1220, 0 0 0 4px rgba(34, 211, 238, 0.7);
}
.nav-m__logo {
  width: 2.35rem;
  height: 2.35rem;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.28));
}
.nav-m__brand-name {
  font-family: "Genos", "Exo 2", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
}
.nav-m__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(8, 14, 24, 0.55);
  color: #cbd5e1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.nav-m__close:hover {
  color: #fff;
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.12);
  transform: rotate(90deg);
}
.nav-m__close:focus {
  outline: none;
}
.nav-m__close:focus-visible {
  box-shadow: 0 0 0 2px #0b1220, 0 0 0 4px rgba(34, 211, 238, 0.7);
}
.nav-m__close-icon {
  width: 1.15rem;
  height: 1.15rem;
}
.nav-m__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.95rem 0.15rem 0.85rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
.nav-m__nav {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0;
  padding: 0;
}
.nav-m__item--services {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.1rem;
}
.nav-m__row {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
}
.nav-m__link {
  display: flex;
  align-items: center;
  min-height: 2.85rem;
  width: 100%;
  margin: 0;
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.95rem;
  font-family: "Genos", "Exo 2", system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  color: rgba(248, 250, 252, 0.92);
  background: transparent;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.nav-m__row > .nav-m__link {
  flex: 1 1 auto;
  min-width: 0;
}
.nav-m__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.07);
}
.nav-m__link:focus {
  outline: none;
}
.nav-m__link:focus-visible {
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.55);
}
.nav-m__link.is-active {
  color: #ecfeff;
  font-weight: 700;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(34, 211, 238, 0.05) 58%, rgba(241, 137, 78, 0.06));
  border-color: rgba(34, 211, 238, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(34, 211, 238, 0.08),
    0 10px 28px rgba(8, 14, 24, 0.35);
}
.nav-m__expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  min-height: 2.85rem;
  flex-shrink: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 0.95rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(15, 23, 42, 0.35));
  color: #94a3b8;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.nav-m__expand:hover {
  color: #ecfeff;
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.1);
}
.nav-m__expand:focus {
  outline: none;
}
.nav-m__expand:focus-visible {
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.55);
}
.nav-m__expand.is-open {
  color: #a5f3fc;
  border-color: rgba(34, 211, 238, 0.35);
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.18), rgba(34, 211, 238, 0.06));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 18px rgba(34, 211, 238, 0.12);
}
.nav-m__chevron {
  width: 1.05rem;
  height: 1.05rem;
  transition: transform 0.22s ease;
}
.nav-m__expand.is-open .nav-m__chevron {
  transform: rotate(180deg);
}
.nav-m__sub {
  display: none;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0;
  padding: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 1.15rem;
  background:
    linear-gradient(165deg, rgba(18, 28, 46, 0.92), rgba(8, 14, 24, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 36px rgba(0, 0, 0, 0.28);
}
.nav-m__sub.is-open {
  display: flex;
}
.nav-m__sub-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0.55rem 0.7rem 0.55rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.85rem;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  color: #dbe4ee;
  transition:
    background-color 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}
.nav-m__sub-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  flex-shrink: 0;
  border-radius: 0.7rem;
  border: 1px solid rgba(34, 211, 238, 0.18);
  background:
    radial-gradient(circle at 30% 25%, rgba(34, 211, 238, 0.22), transparent 55%),
    linear-gradient(160deg, rgba(15, 23, 42, 0.95), rgba(8, 14, 24, 0.8));
  color: #22d3ee;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 16px rgba(34, 211, 238, 0.12);
}
.nav-m__sub-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}
.nav-m__sub-label {
  flex: 1 1 auto;
  min-width: 0;
}
.nav-m__sub-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.06);
}
.nav-m__sub-link:hover .nav-m__sub-icon {
  border-color: rgba(34, 211, 238, 0.35);
  color: #67e8f9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 20px rgba(34, 211, 238, 0.2);
}
.nav-m__sub-link:focus {
  outline: none;
}
.nav-m__sub-link:focus-visible {
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.55);
}
.nav-m__sub-link.is-active {
  color: #ecfeff;
  font-weight: 600;
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.22);
}
.nav-m__sub-link.is-active .nav-m__sub-icon {
  border-color: rgba(34, 211, 238, 0.42);
  background:
    radial-gradient(circle at 30% 25%, rgba(34, 211, 238, 0.32), transparent 55%),
    linear-gradient(160deg, rgba(14, 35, 48, 0.98), rgba(8, 14, 24, 0.85));
  color: #a5f3fc;
}
.nav-m__auth {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding:
    0.85rem 0.15rem
    max(0.85rem, env(safe-area-inset-bottom, 0px));
  background:
    linear-gradient(180deg, transparent, rgba(7, 12, 20, 0.72) 28%, rgba(7, 12, 20, 0.96));
}
.nav-m__auth::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.22) 20%, rgba(241, 137, 78, 0.18) 80%, transparent);
}
.nav-m__auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  width: 100%;
  padding: 0.75rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(241, 137, 78, 0.38);
  background:
    linear-gradient(135deg, rgba(241, 137, 78, 0.95), rgba(230, 108, 48, 0.92));
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 28px rgba(241, 137, 78, 0.28);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.nav-m__auth-arrow {
  width: 1rem;
  height: 1rem;
  opacity: 0.92;
}
.nav-m__auth-link:hover {
  border-color: rgba(255, 196, 150, 0.55);
  background:
    linear-gradient(135deg, #f5a06a, #e86a30);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 14px 32px rgba(241, 137, 78, 0.36);
  transform: translateY(-1px);
}
.nav-m__auth-link:focus {
  outline: none;
}
.nav-m__auth-link:focus-visible {
  box-shadow: 0 0 0 2px #0b1220, 0 0 0 4px rgba(34, 211, 238, 0.7);
}
body.nav-m-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .nav-m,
  .nav-m__panel,
  .nav-m__chevron,
  .nav-m__link,
  .nav-m__sub-link,
  .nav-m__auth-link,
  .nav-m__close,
  .nav-m__expand {
    transition: none;
  }
  .nav-m__auth-link:hover,
  .nav-m__close:hover {
    transform: none;
  }
}
@media (min-width: 1280px) {
  .nav-m {
    display: none !important;
  }
}
#services-megamenu {
  max-height: calc(100dvh - var(--site-header-height, 5.5rem) - 1rem); overflow-y: auto; overscroll-behavior: contain;
  /* Ancrage sur le premier lien : le centrage sur ce seul lien débordait
     à gauche au passage en navigation desktop (1280px). */
  left: 0;
  translate: 0;
  max-width: calc(100vw - 2 * var(--vitrine-gutter));
}
/* Reserve the native scrollbar from the first layout, including short SSR shells.
   Opening overlays or mounting an island must not change the text column width. */
html { scrollbar-gutter: stable; }
