/* TPE Motion Hero 2 */
/* Le parent Elementor ne doit pas imposer de hauteur fixe (« Ajuster à l'écran ») : la séquence fait plusieurs écrans. */
.elementor-section:has(.tpemh),.elementor-section:has(.tpemh)>.elementor-container,.e-con:has(.tpemh),.e-con:has(.tpemh)>.e-con-inner{height:auto!important;max-height:none!important}

.tpemh{position:relative;height:calc(var(--tpemh-len,650)*1vh);
  --tpemh-primary:#6A2CFF;--tpemh-deep:#12063A;--tpemh-accent:#B8FF3A;--tpemh-ink:#08080C;--tpemh-on:#fff;
  --tpemh-start-text:#000;--tpemh-end-text:#fff;--tpemh-btn:#fff;--tpemh-btn-text:#000;
  --tpemh-p1:#fff;--tpemh-p2:#C77DFF;--tpemh-p3:#8F4BFF;--tpemh-p4:#F0D9FF;
  --tpemh-cardw:440px;--tpemh-pad:clamp(20px,3.6vw,56px);--tpemh-m:10px;
  --tpemh-grad:radial-gradient(90% 85% at 72% 100%,var(--tpemh-primary) 0%,transparent 72%),radial-gradient(60% 50% at 60% 78%,color-mix(in srgb,var(--tpemh-primary) 70%,#fff) 0%,transparent 70%),linear-gradient(155deg,var(--tpemh-deep) 8%,color-mix(in srgb,var(--tpemh-deep) 55%,var(--tpemh-primary)) 100%)}
.tpemh *,.tpemh *::before,.tpemh *::after{box-sizing:border-box}
.tpemh-stage{position:sticky;top:0;width:100%;height:100vh;height:100svh;overflow:hidden;color:var(--tpemh-on)}
.tpemh--fixed .tpemh-stage{position:absolute;top:0;left:0}
.tpemh--fixed.is-pinned .tpemh-stage{position:fixed}
.tpemh--fixed.is-after .tpemh-stage{top:auto;bottom:0}

/* ---------- arrière-plans ---------- */
.tpemh-bg{position:absolute;inset:0;background-size:cover;background-position:center}
.tpemh-bg-start{background-color:#fff}
.tpemh-bg-end{background-color:#000;opacity:0;will-change:opacity}
.tpemh-bg video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.tpemh-bg::after{content:"";position:absolute;inset:0}

/* ordre d'empilement : le fond sombre passe par-dessus le bandeau et les cartes */
.tpemh-mq{z-index:1}.tpemh-view{z-index:2}.tpemh-bg-end{z-index:3}.tpemh-star,.tpemh-gl{z-index:4}.tpemh-spark{z-index:5}.tpemh-big,.tpemh-lede{z-index:6}.tpemh-hint{z-index:10}

/* ---------- bandeau ---------- */
.tpemh-mq{position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);white-space:nowrap;color:var(--tpemh-start-text);font-size:clamp(44px,7vw,112px);font-weight:400;letter-spacing:-.035em;line-height:1;direction:ltr;opacity:0}
.tpemh-mq-t{display:inline-flex;animation:tpemh-mq 34s linear infinite}
.tpemh-mq span{display:inline-flex;align-items:center}
.tpemh-mq span::after{content:"";width:.2em;height:.2em;border-radius:50%;box-shadow:inset 0 0 0 .03em currentColor;margin:0 .5em}
@keyframes tpemh-mq{to{transform:translateX(-50%)}}

/* ---------- scène 3D ---------- */
.tpemh-view{position:absolute;inset:0;perspective:1500px}
.tpemh-rig{position:absolute;inset:0;transform-style:preserve-3d;will-change:transform}

/* panneau d'ouverture */
.tpemh-panel{position:absolute;inset:0;background:var(--tpemh-grad),var(--tpemh-deep);clip-path:inset(var(--tpemh-m) round 22px);will-change:transform,clip-path,opacity}
.tpemh-panel-in{position:absolute;inset:var(--tpemh-m);padding:var(--tpemh-top,clamp(70px,11vh,120px)) var(--tpemh-pad) clamp(28px,5vh,56px)}
.tpemh .tpemh-h{margin:0;padding:0;color:var(--tpemh-on);font-size:clamp(40px,6vw,100px);line-height:1.02;font-weight:400;letter-spacing:-.04em;position:relative;z-index:2}
.tpemh .tpemh-h span{display:block;opacity:.45}
.tpemh-pimg{position:absolute;left:50%;top:54%;height:66%;aspect-ratio:.72;transform:translate(-50%,-50%);border-radius:6px;overflow:hidden;background:radial-gradient(80% 60% at 50% 100%,var(--tpemh-primary),transparent 75%),var(--tpemh-ink);box-shadow:0 30px 80px rgba(0,0,0,.35);will-change:transform,opacity}
.tpemh-pimg img{width:100%;height:100%;object-fit:cover;display:block}
.tpemh-pimg-star{position:absolute;left:50%;top:50%;width:38%;transform:translate(-50%,-50%);fill:var(--tpemh-on)}
.tpemh-pfoot{position:absolute;left:var(--tpemh-pad);bottom:clamp(28px,6vh,64px);max-width:min(340px,calc(100% - 2*var(--tpemh-pad)));display:grid;gap:20px;z-index:2}
.tpemh .tpemh-pfoot p{margin:0;font-size:15px;line-height:1.5;color:var(--tpemh-on);opacity:.86}
.tpemh-btns{display:flex;gap:10px;flex-wrap:wrap}
.tpemh .tpemh-btn{display:inline-flex;align-items:center;min-height:44px;padding:0 22px;border-radius:6px;background:var(--tpemh-btn);color:var(--tpemh-btn-text);font-weight:600;font-size:14.5px;line-height:1;text-decoration:none;transition:transform .2s,filter .2s}
.tpemh .tpemh-btn--ghost{background:color-mix(in srgb,var(--tpemh-on) 16%,transparent);color:var(--tpemh-on)}
.tpemh .tpemh-btn:hover{transform:translateY(-2px);filter:brightness(1.08)}
.tpemh .tpemh-btn:focus-visible{outline:3px solid var(--tpemh-accent);outline-offset:3px}
/* arrivée du contenu au chargement */
.tpemh-h,.tpemh-pfoot,.tpemh-pimg{animation:tpemh-in .9s cubic-bezier(.2,.7,.2,1) both}
.tpemh-pimg{animation-name:tpemh-in-img;animation-delay:.1s}
.tpemh-pfoot{animation-delay:.2s}
@keyframes tpemh-in{from{opacity:0;translate:0 24px}}
@keyframes tpemh-in-img{from{opacity:0;translate:0 40px;scale:.96}}

/* carrousel : 4 cartes autour d'un axe vertical */
.tpemh-prism{position:absolute;left:50%;top:50%;width:min(var(--tpemh-cardw),62vw,54vh);width:min(var(--tpemh-cardw),62vw,54svh);aspect-ratio:.69;transform-style:preserve-3d;visibility:hidden;will-change:transform}
.tpemh-face{position:absolute;inset:0;border-radius:5.2cqw;container-type:inline-size;background:var(--tpemh-ink);background-size:cover;background-position:center;color:var(--tpemh-on);overflow:hidden}
.tpemh-prism{container-type:inline-size}
.tpemh-face[data-i="0"]{transform:rotateY(0deg) translateZ(var(--tpemh-r,280px))}
.tpemh-face[data-i="1"]{transform:rotateY(90deg) translateZ(var(--tpemh-r,280px))}
.tpemh-face[data-i="2"]{transform:rotateY(180deg) translateZ(var(--tpemh-r,280px))}
.tpemh-face[data-i="3"]{transform:rotateY(270deg) translateZ(var(--tpemh-r,280px))}
.tpemh-face-in{position:absolute;inset:0;padding:7cqw;display:flex;flex-direction:column;justify-content:space-between;backface-visibility:hidden}
.tpemh-face.has-img .tpemh-face-in{background:linear-gradient(to top,rgba(0,0,0,.72),rgba(0,0,0,.05) 60%)}
.tpemh-face-top{display:flex;justify-content:space-between;align-items:center;gap:3cqw;font-size:max(10px,3.4cqw);opacity:.9}
.tpemh-pill{padding:1.8cqw 3.6cqw;border-radius:99px;background:color-mix(in srgb,var(--tpemh-on) 16%,transparent)}
.tpemh .tpemh-face-title{margin:0;color:inherit;font-size:8.4cqw;line-height:1.1;font-weight:400;letter-spacing:-.025em}
.tpemh-face--dark{background-image:radial-gradient(90% 60% at 50% 105%,var(--tpemh-primary),transparent 70%)}
.tpemh-face--primary,.tpemh-face--star{background-image:radial-gradient(55% 40% at 50% 46%,color-mix(in srgb,var(--tpemh-primary) 45%,#fff),transparent 75%),linear-gradient(170deg,color-mix(in srgb,var(--tpemh-primary) 80%,var(--tpemh-deep)),var(--tpemh-primary))}
.tpemh-face--primary{background-color:var(--tpemh-primary)}
.tpemh-face--accent{background-color:var(--tpemh-accent);background-image:radial-gradient(75% 62% at 58% 42%,var(--tpemh-ink) 0 62%,transparent 63%),radial-gradient(45% 40% at 22% 88%,var(--tpemh-ink) 0 60%,transparent 61%)}
.tpemh-face--accent .tpemh-face-in{justify-content:center;text-align:center}
.tpemh-face--accent .tpemh-face-top{display:none}
.tpemh-face-star{position:absolute;left:50%;top:50%;width:17cqw;transform:translate(-50%,-50%);fill:var(--tpemh-on)}

/* ---------- étoile, étincelle, particules ---------- */
.tpemh-star,.tpemh-spark{position:absolute;left:50%;top:50%;width:70vmax;height:70vmax;margin:-35vmax 0 0 -35vmax;pointer-events:none;opacity:0;will-change:transform,opacity}
.tpemh-star{fill:#000}
.tpemh-spark{width:34px;height:34px;margin:-17px 0 0 -17px;fill:var(--tpemh-end-text)}
.tpemh-gl{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}

/* ---------- grand texte ---------- */
.tpemh .tpemh-big{position:absolute;margin:0;color:var(--tpemh-end-text);font-size:clamp(40px,min(13vw,25vh),230px);line-height:.92;font-weight:300;letter-spacing:-.045em;opacity:0;will-change:transform,opacity}
.tpemh-big-a{inset-inline-start:var(--tpemh-pad);top:max(12vh,min(var(--tpemh-top,0px),26vh))}
.tpemh-big-b{inset-inline-end:var(--tpemh-pad);bottom:8vh;text-align:end}
.tpemh-lede{position:absolute;inset-inline-start:var(--tpemh-pad);bottom:9vh;max-width:min(360px,calc(100% - 2*var(--tpemh-pad)));color:var(--tpemh-end-text);opacity:0;will-change:transform,opacity}
.tpemh .tpemh-lede p{margin:0;font-size:16px;line-height:1.5;color:inherit}

.tpemh-hint{position:absolute;right:var(--tpemh-pad);bottom:calc(var(--tpemh-m) + 22px);color:var(--tpemh-on);font-size:13px;font-weight:500;display:flex;align-items:center;gap:10px}
.tpemh-hint::after{content:"";width:1.5px;height:30px;background:currentColor;transform-origin:top;animation:tpemh-hint 1.8s cubic-bezier(.6,0,.2,1) infinite}
@keyframes tpemh-hint{0%{transform:scaleY(0)}55%{transform:scaleY(1)}100%{transform:scaleY(1);opacity:0}}

/* ---------- téléphone portrait ---------- */
@media (max-width:700px){
  .tpemh{--tpemh-m:6px}
  .tpemh-panel-in{padding-top:var(--tpemh-top,clamp(84px,13vh,120px))}
  .tpemh .tpemh-h{font-size:clamp(34px,11vw,56px)}
  .tpemh-pimg{top:50%;height:36%}
  .tpemh-pfoot{bottom:clamp(40px,7vh,70px)}
  .tpemh .tpemh-pfoot p{font-size:14.5px}
  .tpemh-mq{top:14%;font-size:clamp(40px,13vw,80px)}
  .tpemh-prism{top:55%}
  .tpemh .tpemh-big{font-size:clamp(40px,min(16.5vw,25vh),230px)}
  .tpemh-big-b{bottom:42vh}
  .tpemh-lede{bottom:calc(5vh + env(safe-area-inset-bottom,0px))}
  .tpemh .tpemh-lede p{font-size:15px}
  .tpemh-hint{display:none}
}
/* téléphone paysage */
@media (max-height:480px){
  .tpemh-panel-in{padding-top:var(--tpemh-top,64px)}
  .tpemh .tpemh-h{font-size:clamp(28px,5vw,44px)}
  .tpemh-pfoot{left:auto;right:var(--tpemh-pad);bottom:24px}
  .tpemh-pimg{left:42%}
  .tpemh-hint{display:none}
  .tpemh-big-a{top:max(16vh,min(var(--tpemh-top,0px),26vh))}
}
@media (prefers-reduced-motion:reduce){
  .tpemh-mq-t,.tpemh-hint::after,.tpemh-h,.tpemh-pfoot,.tpemh-pimg{animation:none}
  .tpemh .tpemh-btn{transition:none}
}
