/* =====================================================================
   pm-product.css — couche commune des pages produits (formations)
   Animations au scroll, compteurs, barre de progression, CTA mobile,
   parcours en étapes, galerie photo. Chargée par formation-*.html.
   Toutes les animations sont coupées si l'utilisateur demande moins
   de mouvement (prefers-reduced-motion) ou si le JS ne se charge pas.
   ===================================================================== */

:root {
  --pm-ease: cubic-bezier(.22, 1, .36, 1);
  --pm-ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

/* ---------- Apparition au scroll ---------- */
html.pm-motion [data-pm-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(.985);
  filter: blur(6px);
  transition:
    opacity .9s var(--pm-ease) var(--pm-d, 0ms),
    transform .9s var(--pm-ease) var(--pm-d, 0ms),
    filter .9s var(--pm-ease) var(--pm-d, 0ms);
  will-change: opacity, transform;
}
html.pm-motion [data-pm-reveal="fade"] { transform: none; }
html.pm-motion [data-pm-reveal="left"] { transform: translate3d(-36px, 0, 0); }
html.pm-motion [data-pm-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Titres : mots qui montent un par un */
.pm-split .pm-w {
  display: inline-block;
  vertical-align: top;
  overflow: hidden;
  /* marge invisible pour ne pas rogner les lettres en italique ni les jambages */
  padding: 0 .1em .12em;
  margin: 0 -.1em -.12em;
}
.pm-split .pm-w > span { display: inline-block; }
html.pm-motion .pm-split .pm-w > span {
  transform: translate3d(0, 105%, 0) rotate(4deg);
  transform-origin: 0 100%;
  transition: transform 1s var(--pm-ease) calc(var(--pm-i, 0) * 45ms + var(--pm-d, 0ms));
}
html.pm-motion .pm-split.is-in .pm-w > span { transform: none; }

/* ---------- Barre de progression de lecture ---------- */
.pm-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 1001;
  pointer-events: none;
  background: linear-gradient(90deg, var(--orange), #FFB088);
  transform-origin: 0 50%;
  transform: scaleX(var(--pm-p, 0));
  box-shadow: 0 0 12px rgba(255, 104, 51, .55);
}

/* ---------- Lumière qui suit le curseur sur les cartes ---------- */
.pm-spot { position: relative; isolation: isolate; }
.pm-spot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 104, 51, .14), transparent 45%);
  z-index: 1;
}
.pm-spot:hover::after { opacity: 1; }
html.pm-motion .pm-lift {
  transition: transform .5s var(--pm-ease), box-shadow .5s var(--pm-ease), border-color .3s ease;
}
html.pm-motion .pm-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -24px rgba(14, 14, 15, .28);
}

/* Carte du hero qui s'incline légèrement */
html.pm-motion .pm-tilt {
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .6s var(--pm-ease);
  transform-style: preserve-3d;
}

/* ---------- Grain + halo animé dans les sections sombres ---------- */
.pm-grain { position: relative; }
.pm-grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
.pm-aurora {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 120%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(40% 35% at 20% 30%, rgba(255, 104, 51, .22), transparent 70%),
    radial-gradient(30% 30% at 80% 20%, rgba(255, 176, 136, .12), transparent 70%);
  filter: blur(20px);
}
html.pm-motion .pm-aurora { animation: pmAurora 18s var(--pm-ease-in-out) infinite alternate; }
@keyframes pmAurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(4%, 3%, 0) scale(1.08); }
  100% { transform: translate3d(-3%, -2%, 0) scale(1.02); }
}

/* =====================================================================
   Parcours en étapes
   ===================================================================== */
.pm-journey-section {
  position: relative;
  padding: 120px 0;
  background: var(--ink-950);
  color: #fff;
  overflow: hidden;
}
.pm-journey-section .section-title { color: #fff; }
.pm-journey-section .section-intro { color: rgba(255, 255, 255, .62); }
.pm-journey-section .section-eyebrow { position: relative; z-index: 1; }
.pm-journey-section .container { position: relative; z-index: 1; }

.pm-journey {
  --pm-jp: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 72px;
  counter-reset: step;
  list-style: none;
  padding: 0;
}
.pm-journey::before,
.pm-journey::after {
  content: "";
  position: absolute;
  top: 27px;
  left: 28px;
  right: 28px;
  height: 2px;
  border-radius: 2px;
}
.pm-journey::before { background: rgba(255, 255, 255, .1); z-index: 0; }
.pm-journey::after {
  background: linear-gradient(90deg, var(--orange), #FFB088);
  transform-origin: 0 50%;
  transform: scaleX(var(--pm-jp));
  box-shadow: 0 0 18px rgba(255, 104, 51, .6);
  z-index: 0;
}
/* Chaque étape passe au-dessus de la ligne (l'animation d'apparition crée un contexte d'empilement). */
.pm-step { position: relative; z-index: 1; }
.pm-step-dot {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink-900);
  border: 1px solid rgba(255, 255, 255, .14);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 13px;
  letter-spacing: .06em;
  color: rgba(255, 255, 255, .7);
  transition: background .5s var(--pm-ease), border-color .5s var(--pm-ease), color .5s var(--pm-ease), box-shadow .5s var(--pm-ease);
}
.pm-step.is-on .pm-step-dot {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(255, 104, 51, .16), 0 10px 30px -6px rgba(255, 104, 51, .7);
}
.pm-step-when {
  margin-top: 22px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--orange);
}
.pm-step-title {
  margin: 8px 0 8px;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #fff;
}
.pm-step-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .62);
}
.pm-journey-cta {
  margin-top: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px;
  border-radius: var(--radius-xl, 20px);
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .03);
  backdrop-filter: blur(8px);
}
.pm-journey-cta p { margin: 0; color: rgba(255, 255, 255, .78); font-size: 15px; }
.pm-journey-cta strong { color: #fff; }

@media (max-width: 960px) {
  .pm-journey { grid-template-columns: 1fr; gap: 0; margin-top: 48px; }
  .pm-journey::before,
  .pm-journey::after { top: 28px; bottom: 28px; left: 27px; right: auto; width: 2px; height: auto; }
  .pm-journey::after { transform-origin: 50% 0; transform: scaleY(var(--pm-jp)); }
  .pm-step { display: grid; grid-template-columns: 56px 1fr; column-gap: 20px; padding-bottom: 36px; }
  .pm-step:last-child { padding-bottom: 0; }
  .pm-step-dot { grid-row: span 3; }
  .pm-step-when { margin-top: 4px; }
  .pm-journey-cta { flex-direction: column; align-items: flex-start; }
  .pm-journey-section { padding: 88px 0; }
}

/* =====================================================================
   Galerie photo « la communauté »
   ===================================================================== */
.pm-gallery-section {
  padding: 120px 0;
  background: var(--bone, #F4EFE6);
  overflow: hidden;
}
.pm-gallery {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  grid-template-rows: 260px 260px;
  gap: 16px;
  margin-top: 56px;
}
.pm-gallery figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-xl, 20px);
  background: var(--ink-200);
}
.pm-gallery figure:first-child { grid-row: span 2; }
.pm-gallery img {
  width: 100%;
  height: 118%;
  object-fit: cover;
  display: block;
  transform: translate3d(0, var(--pm-py, 0px), 0) scale(1.02);
  transition: scale .9s var(--pm-ease);
}
.pm-gallery figure:hover img { scale: 1.04; }
.pm-gallery figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 7px 12px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(14, 14, 15, .62);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12px;
  letter-spacing: .01em;
}
.pm-gallery-note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-500);
}
@media (max-width: 960px) {
  .pm-gallery-section { padding: 88px 0; }
  .pm-gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 220px 160px 160px;
    gap: 10px;
    margin-top: 40px;
  }
  .pm-gallery figure:first-child { grid-column: span 2; grid-row: auto; }
}

/* =====================================================================
   CTA collant sur mobile
   ===================================================================== */
.pm-sticky-cta {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border-radius: var(--radius-pill, 999px);
  background: rgba(14, 14, 15, .88);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .5);
  transform: translate3d(0, 140%, 0);
  transition: transform .55s var(--pm-ease);
}
.pm-sticky-cta.is-on { transform: none; }
.pm-sticky-cta-text { flex: 1; min-width: 0; color: #fff; font-size: 13px; line-height: 1.3; }
.pm-sticky-cta-text small { display: block; color: rgba(255, 255, 255, .55); font-size: 11px; }
.pm-sticky-cta a {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: var(--radius-pill, 999px);
  background: var(--orange);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
@media (max-width: 760px) {
  .pm-sticky-cta { display: flex; }
}

/* ---------- Moins de mouvement demandé : tout s'affiche, rien ne bouge ---------- */
@media (prefers-reduced-motion: reduce) {
  .pm-progress, .pm-aurora { display: none; }
  .pm-gallery img { transform: none; height: 100%; }
}
