/* Premium ease — style Fuzen : out-quart, reveals, transitions */

:root {
  --cem-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; }

/* Body fade-in au chargement */
body { opacity: 0; transition: opacity .6s var(--cem-ease); }
body.cem-loaded { opacity: 1; }

/* View Transitions API — fade doux entre pages */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .45s;
  animation-timing-function: var(--cem-ease);
}
@keyframes vt-fade-out { to   { opacity: 0; } }
@keyframes vt-fade-in  { from { opacity: 0; } }
::view-transition-old(root) { animation-name: vt-fade-out; }
::view-transition-new(root) { animation-name: vt-fade-in; }

/* Fallback pour navigateurs sans View Transitions */
body.cem-leaving { opacity: 0; transition: opacity .3s ease; }

/* Transitions globales */
a, button, .Bouton, .rounded-corners, .shadow, img.svg {
  transition: transform .25s var(--cem-ease),
              box-shadow .3s var(--cem-ease),
              opacity .25s ease,
              background-color .25s ease,
              color .25s ease,
              filter .25s ease !important;
}

/* Hover boutons */
.Bouton:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}
.shadow.rounded-corners:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(11,29,58,.15) !important;
}

/* Icônes sociales */
a[href*="instagram"],
a[href*="linkedin"],
a[href*="facebook"] {
  opacity: .9;
  transition: opacity .2s, transform .25s var(--cem-ease) !important;
}
a[href*="instagram"]:hover,
a[href*="linkedin"]:hover,
a[href*="facebook"]:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* Logos header/footer */
#u105:hover, #u1037:hover { transform: scale(1.03); }

/* ======= Reveal-on-scroll — masquage seulement si .cem-js (fail-safe sans JS) ======= */
.cem-js .sr {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--cem-ease), transform .7s var(--cem-ease);
  will-change: opacity, transform;
}
.cem-js .sr.in {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger — enfants directs */
.cem-stagger > .sr.in:nth-child(1) { transition-delay: .05s; }
.cem-stagger > .sr.in:nth-child(2) { transition-delay: .12s; }
.cem-stagger > .sr.in:nth-child(3) { transition-delay: .19s; }
.cem-stagger > .sr.in:nth-child(4) { transition-delay: .26s; }
.cem-stagger > .sr.in:nth-child(5) { transition-delay: .33s; }

/* ======= Hero : rise-in séquencé au chargement ======= */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
body.cem-loaded #u294-13,
body.cem-loaded #u336-4,
body.cem-loaded #u257-4,
body.cem-loaded #u254-4,
body.cem-loaded #u241-4,
body.cem-loaded #u245,
body.cem-loaded #u246,
body.cem-loaded #u247,
body.cem-loaded #u105 {
  animation: rise-in .8s var(--cem-ease) both;
}
body.cem-loaded #u105    { animation-delay: .05s; }
body.cem-loaded #u336-4  { animation-delay: .12s; }
body.cem-loaded #u257-4  { animation-delay: .20s; }
body.cem-loaded #u254-4  { animation-delay: .27s; }
body.cem-loaded #u241-4  { animation-delay: .34s; }
body.cem-loaded #u245    { animation-delay: .41s; }
body.cem-loaded #u246    { animation-delay: .46s; }
body.cem-loaded #u247    { animation-delay: .51s; }
body.cem-loaded #u294-13 { animation-delay: .25s; }

/* Chatbot FAB — float + ping discret */
.cem-chat-fab { animation: cem-fab-float 3.8s ease-in-out infinite; }
.cem-chat-fab::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(11,29,58,.32);
  animation: cem-fab-ping 2.8s cubic-bezier(0,0,.2,1) infinite;
  pointer-events: none;
}
@keyframes cem-fab-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@keyframes cem-fab-ping {
  0%        { transform: scale(1);   opacity: .55; }
  80%, 100% { transform: scale(1.55); opacity: 0; }
}

/* Images : zoom subtil au hover du parent */
.clip_frame img {
  transition: transform .7s var(--cem-ease) !important;
}
.rounded-corners:hover .clip_frame img,
.shadow:hover .clip_frame img,
.shadow.rounded-corners:hover img {
  transform: scale(1.04);
}

/* Liens textuels : underline animé */
a[href^="mailto"] {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size .5s var(--cem-ease);
}
a[href^="mailto"]:hover { background-size: 100% 1px; }

/* Accordéon CSE : flèche qui pivote */
.AccordionPanelTab img.svg {
  transition: transform .4s var(--cem-ease) !important;
}
.AccordionPanelOpen .AccordionPanelTab img.svg {
  transform: rotate(90deg);
}

/* ===== Nav d'accueil modernisée (remplace la nav Muse pixel-positionnée) ===== */
/* Masque l'ancienne nav Muse (logo, tagline, 4 boutons, 3 réseaux) */
#u105, #u336-4, #u257-4, #u254-4, #u258-4, #u241-4, #u245, #u246, #u247 { display: none !important; }

.cem-lnav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 20px clamp(20px, 4vw, 52px) 40px;
  background: linear-gradient(180deg, rgba(8,21,38,.5) 0%, rgba(8,21,38,.18) 55%, rgba(8,21,38,0) 100%);
  font-family: '__SF Pro Display_5', 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  pointer-events: none;
}
.cem-lnav-inner {
  max-width: 1320px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.cem-lnav a, .cem-lnav button { pointer-events: auto; }
/* Le menu déroulant et sa passerelle doivent capter le survol (sinon il se ferme avant le clic) */
.cem-lnav-dd, .cem-lnav-dd-menu { pointer-events: auto; }

.cem-lnav-logo { display: flex; align-items: center; gap: 13px; text-decoration: none; }
.cem-lnav-logo img { height: 48px; width: auto; display: block; }
.cem-lnav-logo span { color: #fff; font-size: 13px; font-weight: 500; opacity: .92; white-space: nowrap; letter-spacing: .01em; }

.cem-lnav-links { display: flex; align-items: center; gap: 10px; }
.cem-lnav-links > a, .cem-lnav-dd-btn {
  color: #fff; font-size: 15px; font-weight: 600; text-decoration: none;
  padding: 9px 20px; border: 1px solid rgba(255,255,255,.5); border-radius: 999px;
  background: rgba(255,255,255,.05); cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .25s var(--cem-ease), border-color .25s var(--cem-ease), transform .25s var(--cem-ease);
}
.cem-lnav-links > a:hover, .cem-lnav-dd-btn:hover {
  background: rgba(255,255,255,.18); border-color: #fff; transform: translateY(-1px);
}

/* Dropdown Outils */
.cem-lnav-dd { position: relative; display: inline-flex; }
.cem-lnav-dd-btn::after { content: "▾"; font-size: .8em; opacity: .85; }
.cem-lnav-dd-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  min-width: 248px; background: #0b1d3a; border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 8px; box-shadow: 0 22px 50px rgba(8,21,38,.5); z-index: 1001;
}
/* passerelle large : comble l'espace bouton↔menu pour ne jamais perdre le survol */
.cem-lnav-dd-menu::before { content: ""; position: absolute; top: -16px; left: -20px; right: -20px; height: 16px; }
.cem-lnav-dd:hover .cem-lnav-dd-menu,
.cem-lnav-dd:focus-within .cem-lnav-dd-menu { display: block; }
.cem-lnav-dd-menu a, .cem-lnav-dd-menu .cem-lnav-soon {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: 9px; font-size: 14px; font-weight: 500;
  color: #fff; text-decoration: none; white-space: nowrap; transition: background .2s ease;
}
.cem-lnav-dd-menu a:hover { background: rgba(255,255,255,.12); }
.cem-lnav-dd-menu .cem-lnav-soon { color: rgba(255,255,255,.5); cursor: default; }
.cem-lnav-dd-menu .cem-lnav-soon em {
  font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  color: #8fb9e0; background: rgba(143,185,224,.16); padding: 2px 7px; border-radius: 999px;
}

/* Réseaux sociaux */
.cem-lnav-socials { display: inline-flex; align-items: center; gap: 15px; margin-left: 12px; }
.cem-lnav-socials a {
  display: inline-flex; align-items: center; justify-content: center; opacity: .9;
  transition: opacity .25s var(--cem-ease), transform .25s var(--cem-ease);
}
.cem-lnav-socials a:hover { opacity: 1; transform: translateY(-2px); }
.cem-lnav-socials img { width: 19px; height: 19px; display: block; }

/* Responsive : sous 1000px on resserre, sous 760px on réduit (desktop Muse uniquement) */
@media (max-width: 1080px) {
  .cem-lnav-logo span { display: none; }
  .cem-lnav-links { gap: 7px; }
  .cem-lnav-links > a, .cem-lnav-dd-btn { padding: 8px 15px; font-size: 14px; }
}
@media (max-width: 860px) {
  .cem-lnav-socials { display: none; }
}

/* Barre de liens utiles / légaux en bas de l'accueil et de la page CSE */
.cem-subbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  padding: 22px 16px 30px;
  background: #081526;
  font-family: davis-sans, "Helvetica Neue", Arial, sans-serif;
}
.cem-subbar a {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  letter-spacing: .02em;
  text-decoration: none;
  transition: color .25s var(--cem-ease);
  position: relative;
}
.cem-subbar a:hover { color: #fff; }
.cem-subbar a:not(:last-child)::after {
  content: "·";
  position: absolute;
  right: -16px;
  color: rgba(255,255,255,.3);
}
@media (max-width: 560px) {
  .cem-subbar { gap: 6px 18px; }
  .cem-subbar a:not(:last-child)::after { display: none; }
}

/* Chatbot CEM — widget Elfsight hébergé (.elf.site) en iframe bas-droite.
   Lanceur CEM natif visible ; clic = ouverture de la conversation. Fond transparent. */
.cem-chatbot {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 420px;
  height: 700px;
  max-width: 100vw;
  max-height: 100vh;
  border: 0;
  background: transparent;
  z-index: 9998;
  color-scheme: light;
}
@media (max-width: 480px) {
  .cem-chatbot { width: 100vw; }
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, body {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
