/*------------------------------------------------------------------
    hero.css — Slider d'accueil (remplace Revolution Slider sur index)
    Piloté par js/hero.js
-------------------------------------------------------------------*/
.nd-hero {
  --hero-ease: cubic-bezier(.77, 0, .175, 1);
  --hero-ease-out: cubic-bezier(.16, 1, .3, 1);
  --hero-duration: 7000ms;
  position: relative;
  height: clamp(540px, 86vh, 780px);
  overflow: hidden;
  background: #0b2545;
  color: #fff;
  isolation: isolate;
}
.nd-hero__slides { position: absolute; inset: 0; }

.nd-hero__slide {
  position: absolute; inset: 0;
  visibility: hidden;
}
.nd-hero__slide.is-active,
.nd-hero__slide.is-leaving { visibility: visible; }
.nd-hero__slide.is-active { z-index: 2; }
.nd-hero__slide.is-leaving { z-index: 1; }

/* Entrée : rideau diagonal (sens selon la navigation) */
.nd-hero__slide.is-entering { animation: nd-hero-wipe-next 1.25s var(--hero-ease) both; }
.nd-hero.is-reverse .nd-hero__slide.is-entering { animation-name: nd-hero-wipe-prev; }
@keyframes nd-hero-wipe-next {
  from { clip-path: polygon(115% 0, 145% 0, 130% 100%, 100% 100%); }
  to   { clip-path: polygon(-15% 0, 145% 0, 130% 100%, -30% 100%); }
}
@keyframes nd-hero-wipe-prev {
  from { clip-path: polygon(-30% 0, 0% 0, -15% 100%, -45% 100%); }
  to   { clip-path: polygon(-30% 0, 145% 0, 130% 100%, -45% 100%); }
}
/* Sortie : l'ancienne slide recule et s'assombrit */
.nd-hero__slide.is-leaving .nd-hero__bg { animation: nd-hero-recede 1.25s var(--hero-ease) forwards; }
.nd-hero.is-reverse .nd-hero__slide.is-leaving .nd-hero__bg { animation-name: nd-hero-recede-rev; }
@keyframes nd-hero-recede     { to { transform: scale(1.02) translateX(-4%); filter: brightness(.35) blur(2px); } }
@keyframes nd-hero-recede-rev { to { transform: scale(1.02) translateX(4%);  filter: brightness(.35) blur(2px); } }

/* Image de fond + Ken Burns (direction propre à chaque slide) */
.nd-hero__bg {
  position: absolute; inset: -2%;
  background-size: cover; background-position: center;
  transform: scale(1.18);
  will-change: transform;
}
.nd-hero__slide.is-active .nd-hero__bg { animation: nd-kb-left calc(var(--hero-duration) + 2500ms) linear forwards; }
.nd-hero__slide.is-active[data-pan="right"] .nd-hero__bg { animation-name: nd-kb-right; }
.nd-hero__slide.is-active[data-pan="up"] .nd-hero__bg { animation-name: nd-kb-up; }
@keyframes nd-kb-left  { from { transform: scale(1.18) translate(2%, 0); }  to { transform: scale(1.04) translate(-2%, 0); } }
@keyframes nd-kb-right { from { transform: scale(1.18) translate(-2%, 0); } to { transform: scale(1.04) translate(2%, 0); } }
@keyframes nd-kb-up    { from { transform: scale(1.2) translate(0, 2%); }   to { transform: scale(1.05) translate(0, -1.5%); } }

/* Voile pour la lisibilité + trame de points discrète */
.nd-hero__overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(rgba(255,255,255,.08) 1px, transparent 1.4px) 0 0 / 22px 22px,
    linear-gradient(100deg, rgba(8, 26, 52, .92) 0%, rgba(8, 26, 52, .72) 42%, rgba(3, 158, 227, .18) 100%);
}

/* Contenu */
.nd-hero__content {
  position: relative; z-index: 3; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding-bottom: 90px;
}
.nd-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; margin-bottom: 22px;
  font: 600 13px/1 'Poppins', sans-serif; letter-spacing: .14em; text-transform: uppercase;
  color: #bfeaff; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18); border-radius: 40px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.nd-hero__dot { width: 8px; height: 8px; border-radius: 50%; background: #25d8ed; animation: nd-hero-dot 2s infinite; }
@keyframes nd-hero-dot {
  0%   { box-shadow: 0 0 0 0 rgba(37,216,237,.7); }
  70%  { box-shadow: 0 0 0 10px rgba(37,216,237,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,216,237,0); }
}

.nd-hero .nd-hero__title {
  max-width: 780px; margin: 0 0 20px; padding: 0;
  font: 800 clamp(34px, 5.6vw, 68px)/1.08 'Poppins', sans-serif;
  letter-spacing: -.02em; color: #fff; text-transform: none;
  background: none; -webkit-text-fill-color: currentColor;
}
.nd-hero__title em {
  font-style: normal;
  background: linear-gradient(90deg, #25d8ed, #039ee3 60%, #7cc8ff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* Mots masqués (découpés par hero.js) */
.nd-hero__word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.nd-hero__word > span { display: inline-block; transform: translateY(115%) rotate(5deg); transform-origin: 0 100%; }
.nd-hero__word em { display: inline-block; }
.nd-hero__text {
  max-width: 560px; margin: 0 0 34px;
  font: 400 clamp(16px, 1.6vw, 19px)/1.6 'Poppins', sans-serif; color: rgba(255,255,255,.85);
}
.nd-hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }
.nd-hero__btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px; border-radius: 50px;
  font: 600 15px/1 'Poppins', sans-serif; text-decoration: none !important;
  transition: transform .35s var(--hero-ease-out), box-shadow .35s var(--hero-ease-out), background-color .3s, color .3s;
}
.nd-hero__btn--primary { color: #fff !important; background: linear-gradient(120deg, #039ee3, #0a6fd1); box-shadow: 0 12px 30px rgba(3,158,227,.45); }
.nd-hero__btn--primary:hover { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(3,158,227,.6); }
.nd-hero__btn--primary i { transition: transform .35s var(--hero-ease-out); }
.nd-hero__btn--primary:hover i { transform: translateX(5px); }
.nd-hero__btn--ghost { color: #fff !important; border: 1.5px solid rgba(255,255,255,.55); background: rgba(255,255,255,.04); }
.nd-hero__btn--ghost:hover { background: #fff; color: #0b2545 !important; transform: translateY(-3px); }

/* Chorégraphie du texte : état initial masqué... */
.nd-hero__eyebrow, .nd-hero__text, .nd-hero__actions { opacity: 0; transform: translateY(26px); }
/* ...puis arrivée en cascade quand la slide est affichée */
.nd-hero__slide.is-shown .nd-hero__eyebrow,
.nd-hero__slide.is-shown .nd-hero__text,
.nd-hero__slide.is-shown .nd-hero__actions {
  opacity: 1; transform: none;
  transition: opacity .9s var(--hero-ease-out), transform .9s var(--hero-ease-out);
}
.nd-hero__slide.is-shown .nd-hero__eyebrow { transition-delay: .1s; }
.nd-hero__slide.is-shown .nd-hero__word > span {
  transform: none;
  transition: transform 1.1s var(--hero-ease-out);
  transition-delay: calc(.25s + var(--i, 0) * 75ms);
}
.nd-hero__slide.is-shown .nd-hero__text { transition-delay: .75s; }
.nd-hero__slide.is-shown .nd-hero__actions { transition-delay: .95s; }
/* Sortie du texte : remonte et s'efface */
.nd-hero__slide.is-leaving .nd-hero__content { opacity: 0; transform: translateY(-30px); transition: opacity .5s ease, transform .6s var(--hero-ease); }

/* Compteur géant en contour */
.nd-hero__counter {
  position: absolute; right: 5%; top: 44%; z-index: 4;
  transform: translateY(-50%);
  font: 700 18px/1 'Poppins', sans-serif; color: rgba(255,255,255,.55);
  display: flex; align-items: baseline; gap: 8px;
  pointer-events: none;
}
.nd-hero__current {
  display: inline-block;
  font-size: clamp(56px, 8vw, 110px); font-weight: 800; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.6);
}
.nd-hero__current.is-changing { animation: nd-hero-count .8s var(--hero-ease-out); }
@keyframes nd-hero-count { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }

/* Barre de navigation : onglets avec progression + flèches */
.nd-hero__bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding-bottom: 28px; }
.nd-hero__bar-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.nd-hero__tabs { display: flex; gap: 22px; flex: 1; max-width: 760px; }
.nd-hero__tab {
  flex: 1; text-align: left; background: none; border: 0; padding: 0; cursor: pointer;
  color: rgba(255,255,255,.55); font: 500 13px/1.3 'Poppins', sans-serif;
  transition: color .3s;
}
.nd-hero__tab:hover, .nd-hero__tab.is-active { color: #fff; }
.nd-hero__tab-num { font-weight: 700; margin-right: 8px; color: #25d8ed; }
.nd-hero__tab-progress { display: block; height: 2px; margin-top: 12px; background: rgba(255,255,255,.2); overflow: hidden; border-radius: 2px; }
.nd-hero__tab-progress i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #25d8ed, #039ee3); transform: scaleX(0); transform-origin: left; }
.nd-hero__tab.is-done .nd-hero__tab-progress i { transform: scaleX(1); }
.nd-hero__tab.is-active .nd-hero__tab-progress i { animation: nd-hero-progress var(--hero-duration) linear forwards; }
.nd-hero.is-paused .nd-hero__tab.is-active .nd-hero__tab-progress i { animation-play-state: paused; }
@keyframes nd-hero-progress { to { transform: scaleX(1); } }

.nd-hero__arrows { display: flex; gap: 10px; }
.nd-hero__arrow {
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.3);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color .3s, border-color .3s, transform .35s var(--hero-ease-out);
}
.nd-hero__arrow:hover { background: #039ee3; border-color: #039ee3; transform: scale(1.08); }

/* Mobile */
@media (max-width: 767px) {
  .nd-hero { height: clamp(540px, 92vh, 660px); }
  .nd-hero__content { padding-bottom: 110px; padding-left: 22px; padding-right: 22px; }
  .nd-hero__counter { display: none; }
  .nd-hero__overlay { background: linear-gradient(180deg, rgba(8,26,52,.72), rgba(8,26,52,.92)); }
  .nd-hero__tab-label { display: none; }
  .nd-hero__tabs { gap: 12px; }
  .nd-hero__arrow { width: 44px; height: 44px; font-size: 20px; }
  .nd-hero__btn { padding: 13px 22px; font-size: 14px; }
}

/* Réduire les animations : changement simple, pas de Ken Burns ni de rideau */
@media (prefers-reduced-motion: reduce) {
  .nd-hero__slide.is-entering,
  .nd-hero__slide.is-leaving .nd-hero__bg,
  .nd-hero__slide.is-active .nd-hero__bg,
  .nd-hero__tab.is-active .nd-hero__tab-progress i { animation: none !important; }
  .nd-hero__bg { transform: none; }
  .nd-hero__word > span, .nd-hero__eyebrow, .nd-hero__text, .nd-hero__actions { transform: none !important; opacity: 1 !important; }
}
