/* =========================================================
   HERO — Scroll Media Expansion (accueil uniquement)
   Principe : conteneur haut + zone "sticky" à l'intérieur.
   Le scroll natif n'est jamais intercepté : on lit juste
   la progression du scroll pour animer des transforms.
   ========================================================= */

.hero {
  position: relative;
  height: 260vh; /* hauteur de la "course" de scroll de l'animation */
  background: linear-gradient(180deg, #ffffff 0%, #f2f9fd 55%, #ffffff 100%);
}

.hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* carte du monde en pointillés, très discrète, en arrière-plan */
.hero__worldmap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}
.hero__worldmap img {
  width: min(1400px, 145%);
  max-width: none;
  opacity: 0.8;
}

/* lignes de trajectoires très fines, décoratives */
.hero__lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}
.hero__lines svg { width: 100%; height: 100%; }

.hero__grid {
  position: relative;
  width: 100%;
  max-width: 1400px;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-h1-hero);
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
  color: var(--c-deep);
  white-space: nowrap;
  position: relative;
  z-index: 2;
  transition: transform 0.05s linear, opacity 0.05s linear;
}
.hero__word--left { text-align: right; margin-right: clamp(-1rem, -2vw, 0.5rem); }
.hero__word--right {
  text-align: left;
  margin-left: clamp(-1rem, -2vw, 0.5rem);
  background: var(--gradient-aero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__media {
  position: relative;
  z-index: 1;
  width: clamp(130px, 15vw, 250px);
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  overflow: hidden;
  /* Sur certains navigateurs mobiles, une <video> peut s'afficher dans un
     calque matériel qui ignore le clip normal (overflow:hidden) et le
     z-index, débordant sur le reste de la page et interceptant les taps
     plus bas dans le contenu. "contain: paint" force le navigateur à bien
     la clipper dans cette boîte. */
  contain: paint;
  box-shadow: 0 20px 60px rgba(8, 49, 97, 0.18);
  flex-shrink: 0;
  margin-inline: clamp(0.5rem, 2vw, 1.5rem);
  transition: transform 0.05s linear, border-radius 0.05s linear;
  will-change: transform;
}
.hero__media video,
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero__media video {
  /* Purement décorative (autoplay, muted, loop, sans contrôles) : ne doit
     jamais intercepter un tap, même si le navigateur mobile la fait
     déborder de sa boîte (voir le commentaire sur .hero__media). */
  pointer-events: none;
}
.hero__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,58,110,0.05), rgba(8,58,110,0.22));
  pointer-events: none;
}

.hero__cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1.5rem, 4vh, 2.75rem);
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  color: var(--c-ocean);
  text-transform: uppercase;
  animation: hero-cue-bob 2.6s ease-in-out infinite;
  transition: opacity 0.3s var(--ease-soft);
}

@keyframes hero-cue-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__cue { animation: none; }
}

/* --- Mobile : animation fortement simplifiée, jamais bloquante --- */
@media (max-width: 780px) {
  .hero { height: auto; }
  .hero__worldmap { display: none; }
  .hero__stage {
    position: relative;
    height: auto;
    min-height: 0;
    flex-direction: column;
    padding-block: clamp(6.5rem, 20vw, 8rem) 3.5rem;
    gap: 2rem;
    text-align: center;
  }
  .hero__grid { flex-direction: column; gap: 1.5rem; }
  .hero__word { font-size: clamp(2.1rem, 9vw, 2.8rem); text-align: center !important; margin: 0 !important; white-space: normal; }
  .hero__media {
    width: min(88vw, 420px);
    aspect-ratio: 4/3;
    transform: none !important;
    position: static;
  }
  .hero__cue { position: static; margin-top: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__word, .hero__media { transition: none !important; }
}

/* --- Texte de transition, sous le hero (section séparée) --- */
.hero-transition {
  text-align: center;
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  overflow: hidden;
}
.hero-transition p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 5rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.05;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4em;
}
.hero-transition p span {
  background: linear-gradient(100deg, var(--c-deep), var(--c-ocean), var(--c-sky), var(--c-azur), var(--c-deep));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hero-transition-sweep 7s ease-in-out infinite;
}
.hero-transition p span:nth-child(2) { animation-delay: -1.5s; }
.hero-transition p span:nth-child(3) { animation-delay: -3s; }

@keyframes hero-transition-sweep {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-transition p span {
    animation: none;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--c-ocean);
  }
}
