/* == SCROLLYTELLING EMA FUITES == */

/* Fond dynamique */
body {
  transition: background-color 0.8s ease;
}

/* ── Hero parallaxe ─────────────────────────────────────────────────────────── */
.hero-scroll {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--page-bg, var(--darker-bg, #040f1c));
  transition: background-color 1s ease;
}

.parallax-layer {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.layer-bg {
  background: linear-gradient(180deg, #040f1c 0%, #041520 40%, #071a2e 100%);
  z-index: 0;
}

.layer-canvas  { z-index: 1; pointer-events: none; }
.layer-bubbles { z-index: 2; pointer-events: none; }
.layer-sonar   { z-index: 3; pointer-events: none; }
.layer-drops   { z-index: 4; pointer-events: none; }

/* Groupe sonar positionné à droite du hero */
.sonar-group {
  position: absolute;
  right: 8%;
  top: 50%;
  translate: 0 -50%;
}

/* Contenu hero : position relative pour rester dans le flux */
.layer-content {
  position: relative !important;
  z-index: 5;
  padding: 0 5%;
  max-width: 800px;
  margin: 0 auto;
  will-change: auto;
}

/* ── Bulles flottantes ───────────────────────────────────────────────────────── */
@keyframes bubbleFloat {
  0%, 100% { transform: translateY(0)     scale(1);    }
  50%       { transform: translateY(-18px) scale(1.04); }
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%,
    rgba(0, 184, 148, 0.45),
    rgba(0, 184, 148, 0.15) 60%,
    transparent 100%
  );
  border: 1px solid rgba(0, 184, 148, 0.35);
  animation: bubbleFloat var(--duration, 8s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  box-shadow: 0 0 20px rgba(0, 184, 148, 0.15),
              inset 0 0 15px rgba(0, 184, 148, 0.08);
}

/* ── Ondes sonar ─────────────────────────────────────────────────────────────── */
.sonar-ring {
  position: absolute;
  width: 80px;
  height: 80px;
  left: 50%;
  top: 50%;
  translate: -50% -50%;   /* centrage — propriété CSS individuelle, n'interfère pas avec scale */
  border-radius: 50%;
  border: 1.5px solid var(--accent, #00b894);
  opacity: 0;
  animation: sonarExpand 3s ease-out infinite;
}
.ring-1 { animation-delay: 0s;     }
.ring-2 { animation-delay: 0.75s;  }
.ring-3 { animation-delay: 1.5s;   }
.ring-4 { animation-delay: 2.25s;  }

@keyframes sonarExpand {
  0%   { scale: 1; opacity: 0.6; }
  100% { scale: 3; opacity: 0;   }
}

/* ── Gouttelettes dérivantes ─────────────────────────────────────────────────── */
@keyframes dropFloat {
  0%, 100% { transform: translateY(0)     rotate(0deg);  }
  33%       { transform: translateY(-20px) rotate(5deg);  }
  66%       { transform: translateY(10px)  rotate(-3deg); }
}

.drop {
  position: absolute;
  border-radius: 50% 50% 60% 60% / 45% 45% 55% 55%;
  background: rgba(0, 184, 148, 0.18);
  border: 1px solid rgba(0, 184, 148, 0.30);
  animation: dropFloat var(--duration, 7s) var(--delay, 0s) ease-in-out infinite;
}

/* ── Scroll indicator ────────────────────────────────────────────────────────── */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.scroll-indicator span {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-muted, #8db8d8);
  text-transform: uppercase;
}
/* Mouse-scroll indicator */
.scroll-arrow {
  width: 20px;
  height: 30px;
  border: 1.5px solid var(--text-muted, #8db8d8);
  border-radius: 10px;
  position: relative;
}
.scroll-arrow::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--accent, #00b894);
  border-radius: 2px;
  animation: scrollBounce 1.5s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%   { transform: translateX(-50%) translateY(0);    opacity: 1; }
  100% { transform: translateX(-50%) translateY(12px); opacity: 0; }
}

/* ── Ticker horizontal ───────────────────────────────────────────────────────── */
.ticker-wrap {
  overflow: hidden;
  background: var(--accent, #00b894);
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.ticker-track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  animation: ticker 25s linear infinite;
  will-change: transform;
}
.ticker-track span {
  font-family: var(--font-heading, sans-serif);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--darker-bg, #040f1c);
}
.ticker-dot { color: rgba(4,15,28,0.4) !important; }
@keyframes ticker {
  from { transform: translateX(0);    }
  to   { transform: translateX(-50%); }
}

/* ── Section Journey — sticky scrollytelling (layout 2 colonnes) ──────────── */
.scrollytelling-journey {
  position: relative;
  background: var(--page-bg, var(--darker-bg, #040f1c));
  transition: background-color 1s ease;
}

.journey-layout {
  display: flex;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
}

/* Colonne gauche : steps scrollants */
.journey-steps {
  flex: 1 1 50%;
  position: relative;
  z-index: 10;
}

/* Colonne droite : visuel sticky */
.journey-sticky {
  flex: 1 1 50%;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
  pointer-events: none;
}

/* Le visuel remplit tout le conteneur sticky et centre son contenu */
.journey-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Canvas scan thermique */
#journeyCanvas {
  border-radius: 12px;
  border: 1px solid rgba(0,184,148,0.2);
  box-shadow: 0 0 40px rgba(0,184,148,0.15), 0 0 80px rgba(0,184,148,0.06);
  max-width: min(460px, 85%);
  max-height: min(460px, 85%);
  width:  min(460px, 85%);
  height: min(460px, 85%);
}

/* Textes des étapes journey */
.journey-step {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 6% 6rem 8%;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.journey-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.journey-step__content {
  max-width: 480px;
}

.journey-step__number {
  font-size: 5rem;
  font-weight: 800;
  color: var(--accent, #00b894);
  opacity: 0.18;
  line-height: 1;
  margin-bottom: -0.8rem;
  font-family: var(--font-heading, sans-serif);
}

.journey-step__title {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 700;
  color: var(--text-main, #f0f8ff);
  margin-bottom: 1rem;
  font-family: var(--font-heading, sans-serif);
  line-height: 1.25;
}

.journey-step__text {
  color: var(--text-muted, #8db8d8);
  font-size: 1.15rem;
  line-height: 1.75;
}

.journey-step__tag {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 7px 18px;
  border: 1px solid var(--accent, #00b894);
  border-radius: 20px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--accent, #00b894);
  text-transform: uppercase;
  background: rgba(0,184,148,0.06);
}

/* ── Split words animation (pilotée par le scroll) ──────────────────────────── */
.split-words .word {
  display: inline-block;
  overflow: hidden;
}
.split-words .word-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Responsive mobile ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .journey-layout  { flex-direction: column; }
  .journey-sticky  {
    position: relative;
    height: 60vw;
    min-height: 280px;
    width: 100%;
    flex: none;
    order: -1; /* visuel en premier sur mobile */
  }
  .journey-steps { flex: none; width: 100%; }
  .journey-step  { min-height: auto; padding: 3rem 6%; opacity: 1; transform: none; }
  .journey-step__number { font-size: 3.5rem; }
  .sonar-ring { width: 50px; height: 50px; }
  #journeyCanvas { max-width: 280px; max-height: 280px; width: 280px; height: 280px; }

  /* Bulles et gouttes masquées sur mobile */
  .layer-bubbles .bubble,
  .layer-drops .drop { display: none; }

  /* Ticker plus rapide sur mobile */
  .ticker-track { animation-duration: 15s; }
}

/* ── prefers-reduced-motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  /* Animations désactivées */
  .ticker-track        { animation: none; }
  .sonar-ring          { animation: none; opacity: 0.2; }
  .scroll-arrow::after { animation: none; }
  .bubble              { animation: none; }
  .drop                { animation: none; }

  /* Transitions désactivées */
  body,
  .hero-scroll,
  .scrollytelling-journey { transition: none; }

  /* Parallaxe figée */
  .parallax-layer { will-change: auto; }

  /* Split-words — mots visibles d'emblée */
  .split-words .word-inner { transform: translateY(0) !important; transition: none; }

  /* Journey steps — visibles sans transition */
  .journey-step { opacity: 1; transform: none; transition: none; }
}
