/* =========================================================
   NEX6 — Surcouche « site animé » (PROTOTYPE hors production)
   S'ajoute à css/style.css sans le modifier. Utilise uniquement
   les variables de la DA existante (aucune nouvelle couleur).
   ========================================================= */

/* Les sections à fond plein laissent transparaître la scène (léger verre dépoli) */
.has-3d .why {
  background: rgba(13, 20, 32, 0.72);
  backdrop-filter: blur(6px);
}

/* ---------- Scène 3D enfermée dans la carte « Qui sommes-nous » ---------- */
.intro-visual { position: relative; overflow: hidden; }
.intro-visual .intro-svg { position: relative; z-index: 1; }
.orb3d { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- Barre de progression du scroll ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 200;
  transform-origin: 0 50%;
  transform: scaleX(var(--sp, 0));
  background: var(--gradient-primary);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
  pointer-events: none;
}

/* ---------- Hero : bloc recentré, contenu aligné à gauche ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - 76px);
  display: flex;
  align-items: center;
}
/* La flèche « scroll » (bas du hero) ne doit pas toucher les indicateurs : le haut cède 32 px au bas */
@media (min-width: 761px) and (min-height: 641px) {
  .hero { padding-top: clamp(48px, 9vw, 108px); padding-bottom: calc(var(--space-2xl) + 32px); }
}
/* Bloc recentré dans l'accueil (marges extérieures égales, .container centre déjà) ; contenu aligné à gauche, bord de départ commun */
.hero-inner { max-width: calc(792px + 2 * var(--space-md)); width: 100%; }
.hero-inner > * { max-width: 680px; }
.hero-inner > h1 { max-width: 792px; }
.hero-inner > .hero-lead { max-width: 640px; }
/* Largeurs étroites : le bloc occupe déjà toute la largeur utile, ses éléments la remplissent (marges égales) */
@media (max-width: 900px) {
  .hero-inner > *, .hero-inner > h1, .hero-inner > .hero-lead { max-width: none; }
}
.hero-inner {
  transform: translate3d(0, calc(var(--hp, 0) * -36px), 0);
  opacity: calc(1 - var(--hp, 0) * 0.7);
  will-change: transform, opacity;
}

.kicker.is-typing::after {
  content: '';
  display: inline-block;
  width: 0.55em; height: 1em;
  margin-left: 4px;
  vertical-align: -0.12em;
  background: var(--neon-cyan);
  animation: blink 0.9s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Indicateur « scroll » */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.scroll-cue:hover { color: var(--neon-cyan); }
.scroll-cue-line {
  width: 1px; height: 44px;
  background: linear-gradient(var(--neon-cyan), transparent);
  transform-origin: top;
  animation: cue 2s var(--ease) infinite;
}
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-height: 640px), (max-width: 760px) { .scroll-cue { display: none; } }

/* ---------- Bandeau défilant ---------- */
.marquee {
  overflow: hidden;
  padding: 14px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: rgba(13, 20, 32, 0.55);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 48s linear infinite; }
.marquee-track span {
  position: relative;
  padding: 0 32px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.marquee-track span::after {
  content: '//';
  position: absolute;
  right: -7px;
  color: var(--neon-cyan);
  opacity: 0.6;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Inclinaison 3D des cartes (classe posée par ui-fx.js) ---------- */
.tilt { --rx: 0deg; --ry: 0deg; --lift: 0px; --mx: 50%; --my: 50%; transform-style: preserve-3d; }
.tilt[data-reveal].in-view {
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
}
.tilt.is-hover[data-reveal].in-view {
  transition: transform 0.14s ease-out, opacity 0.6s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.tilt:hover { --lift: -4px; }
.tilt::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(0, 240, 255, 0.13), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
  z-index: 0;
}
.tilt:hover::after { opacity: 1; }
.intro-visual.tilt:hover, .process-step.tilt:hover { box-shadow: var(--shadow-glow-cyan); border-color: var(--border-strong); }
.service-icon { transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.service-card:hover .service-icon { transform: translateZ(30px) scale(1.08); box-shadow: 0 0 18px rgba(0, 240, 255, 0.35); }

/* ---------- Animations d'illustrations ---------- */
.spin-slow { transform-box: fill-box; transform-origin: center; animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Section méthode ---------- */
.process-track {
  --prog: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  padding: 28px 0 0;
  margin: 0;
  list-style: none;
}
.process-track::before,
.process-track::after {
  content: '';
  position: absolute;
  top: 11px;
  left: var(--line-a, 12.5%);
  width: var(--line-w, 75%);
  height: 2px;
  border-radius: 2px;
}
.process-track::before { background: var(--border-soft); }
.process-track::after {
  background: var(--gradient-primary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  transform-origin: 0 50%;
  transform: scaleX(var(--prog));
}

.process-step {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.process-step::before {
  content: '';
  position: absolute;
  top: -22px;
  left: 50%;
  width: 12px; height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: var(--bg-0);
  border: 2px solid var(--border-soft);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease);
}
.process-step.is-lit { border-color: var(--border-strong); }
.process-step.is-lit::before {
  border-color: var(--neon-cyan);
  background: var(--neon-cyan);
  box-shadow: 0 0 14px var(--neon-cyan);
}
.process-step > * { position: relative; z-index: 1; }
.process-step h3 { margin-bottom: 6px; font-size: 1.05rem; }
.process-step p { margin: 0; font-size: 0.92rem; }
.process-num {
  display: block;
  margin-bottom: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--neon-violet);
}
.process-viz {
  height: 112px;
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: radial-gradient(circle at 50% 60%, rgba(0, 240, 255, 0.07), transparent 70%), rgba(255, 255, 255, 0.015);
  display: flex;
  align-items: center;
  justify-content: center;
}
.process-viz svg { width: 100%; height: 92px; overflow: visible; }

.radar-sweep { transform-box: view-box; transform-origin: 60px 45px; animation: spin 4.5s linear infinite; }
.blip { animation: blip 4.5s ease-in-out infinite; }
.blip--d { animation-delay: -2.2s; }
@keyframes blip { 0%, 100% { opacity: 0.15; } 40% { opacity: 1; } }
.road { animation: dash 2.4s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -16; } }
.pulse-dot { transform-box: fill-box; transform-origin: center; animation: ping 2.2s ease-out infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(2.6); opacity: 0; } }
.layer { animation: layerBob 3.2s ease-in-out infinite; }
.layer--2 { animation-delay: -0.5s; }
.layer--3 { animation-delay: -1s; }
@keyframes layerBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.deploy-arrow { animation: layerBob 1.6s ease-in-out infinite; }
.ecg { animation: ecg 3s ease-in-out infinite; }
@keyframes ecg { 0% { stroke-dashoffset: 120; } 55%, 100% { stroke-dashoffset: 0; } }

@media (max-width: 980px) {
  .process-track { grid-template-columns: repeat(2, 1fr); padding: 0; }
  .process-track::before, .process-track::after, .process-step::before { display: none; }
}
@media (max-width: 760px) {
  .process-track { grid-template-columns: 1fr; padding: 0 0 0 36px; }
  .process-track::before, .process-track::after, .process-step::before { display: block; }
  .process-track::before, .process-track::after { top: var(--line-a, 12px); left: 5px; width: 2px; height: var(--line-w, calc(100% - 24px)); }
  .process-track::after { transform-origin: 50% 0; transform: scaleY(var(--prog)); }
  .process-step::before { top: 6px; left: -36px; margin-left: 0; }
}

/* ---------- À propos : constellation ---------- */
.about-grid--viz {
  max-width: 1180px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-xl);
  align-items: center;
}
.about-viz {
  position: relative;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.04), rgba(123, 97, 255, 0.03));
  padding: var(--space-md);
}
.constellation { width: 100%; height: auto; overflow: visible; }
.const-links path { animation: dash 1.6s linear infinite; }
.const-node > g { animation: nodeFloat 6s ease-in-out infinite; }
@keyframes nodeFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.const-node > g:nth-child(2) { animation-delay: -1.2s; }
.const-node > g:nth-child(3) { animation-delay: -2.4s; }
.const-node > g:nth-child(4) { animation-delay: -3.6s; }
.const-node > g:nth-child(5) { animation-delay: -4.8s; }
.const-node > g:nth-child(6) { animation-delay: -6s; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.viz-stage { position: relative; transform-style: preserve-3d; }
/* Logo : centré par construction (même bloc que le SVG dont le hub est au centre du viewBox) */
.const-logo {
  position: absolute;
  inset: 0; margin: auto; /* centrage sans transform : la perspective s'applique autour du vrai centre */
  width: 84px; height: 63.8px;
  transform: perspective(420px) rotateY(calc(var(--px, 0) * 22deg)) rotateX(calc(var(--py, 0) * -22deg)) translateZ(30px);
  transition: transform 0.18s ease-out;
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.5));
  animation: logoBreath 4.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes logoBreath {
  0%, 100% { scale: 1; translate: 0 1.5px; filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.45)); }
  50% { scale: 1.07; translate: 0 -1.5px; filter: drop-shadow(0 0 26px rgba(0, 240, 255, 0.9)); }
}
/* Ondes émises depuis le logo, en cascade */
.wave { transform-box: fill-box; transform-origin: center; opacity: 0; animation: wave 4.8s ease-out infinite; }
.wave--2 { animation-delay: 1.6s; }
.wave--3 { animation-delay: 3.2s; }
@keyframes wave { 0% { transform: scale(0.75); opacity: 0.7; } 100% { transform: scale(2.4); opacity: 0; } }
/* Particules en orbite autour du hub */
.hub-spin { transform-box: view-box; transform-origin: 230px 200px; animation: spin 16s linear infinite; }
.hub-spin--rev { animation-duration: 26s; animation-direction: reverse; }
.spin-rev { transform-box: fill-box; transform-origin: center; animation: spin 30s linear infinite reverse; }
@media (max-width: 980px) {
  .about-grid--viz { grid-template-columns: 1fr; }
  .about-viz { max-width: 460px; margin: 0 auto; width: 100%; }
}

/* ---------- Mouvement réduit : tout est figé, tout reste lisible ---------- */
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .scroll-cue-line,
  .spin-slow, .radar-sweep, .blip, .road, .pulse-dot, .layer, .deploy-arrow, .ecg,
  .const-links path, .const-node > g, .const-logo, .wave, .hub-spin, .spin-rev, .kicker.is-typing::after { animation: none !important; }
  .ecg { stroke-dashoffset: 0; }
  .hero-inner { transform: none; opacity: 1; }
  .tilt[data-reveal].in-view { transform: none; }
  .tilt::after { display: none; }
}
