/* Next App — couche d'animation (DA claire conservée). Transform / opacity / clip-path seulement. */
:root{
  --ease-out:cubic-bezier(0.23,1,0.32,1);
  --ease-in-out:cubic-bezier(0.77,0,0.175,1);
  --demo-cycle:4800ms;
}

/* ---------- Entrées en cascade (classe posée par motion.js : sans script, tout est visible) ---------- */
.na-reveal{opacity:0;transform:translateY(24px);transition:opacity .7s var(--ease-out),transform .8s var(--ease-out);transition-delay:calc(var(--i,0)*70ms)}
.na-reveal.in{opacity:1;transform:none}

/* Héros au chargement */
.na-hero-in{opacity:0;transform:translateY(20px);animation:naHeroIn .9s var(--ease-out) forwards;animation-delay:calc(var(--i,0)*90ms + 80ms)}
@keyframes naHeroIn{to{opacity:1;transform:none}}
#next-preview .na-stage.na-hero-in{transform:translateY(28px) scale(.98)}

/* ---------- Boutons et liens : retour au clic / survol ---------- */
#next-preview .na-cta{transition:background-color .2s ease,transform .14s var(--ease-out)}
#next-preview .na-cta:active{transform:scale(.97)}
#next-preview .na-textlink{transition:opacity .2s ease}
#next-preview .na-switch button{transition:background-color .2s ease,color .2s ease,transform .14s var(--ease-out)}
#next-preview .na-switch button:active{transform:scale(.96)}
@media (hover:hover) and (pointer:fine){
  #next-preview .na-cta:hover{transform:translateY(-1px)}
  #next-preview .na-textlink:hover{opacity:.65}
  #next-preview .na-solution{transition:transform .35s var(--ease-out)}
  #next-preview .na-solution:hover{transform:translateY(-4px)}
}

/* ---------- Module démo du héros ---------- */
/* barre de progression sous l'onglet actif pendant le défilement automatique */
#next-preview .na-switch button{position:relative;overflow:hidden}
#next-preview .na-switch.na-auto button[aria-pressed=true]::after{content:"";position:absolute;left:12px;right:12px;bottom:6px;height:2px;background:#006699;transform-origin:left;animation:naProgress var(--demo-cycle) linear forwards}
@keyframes naProgress{from{transform:scaleX(0)}to{transform:scaleX(1)}}

/* vue qui entre */
#next-preview .na-view.na-enter{animation:naViewIn .6s var(--ease-out) both}
@keyframes naViewIn{from{opacity:0;transform:translateY(18px) scale(.97)}}

/* Site web : la carte « prochaine étape » arrive après le navigateur */
#next-preview .na-view.na-enter .na-float{animation:naPop .5s var(--ease-out) .35s both}
@keyframes naPop{from{opacity:0;transform:translateY(10px) rotate(3deg) scale(.95)}to{opacity:1;transform:rotate(3deg)}}
#next-preview .na-view.na-enter .na-minibody h3,#next-preview .na-view.na-enter .na-minibody p,#next-preview .na-view.na-enter .na-mini-button{animation:naUp .5s var(--ease-out) both}
#next-preview .na-view.na-enter .na-minibody p{animation-delay:.08s}
#next-preview .na-view.na-enter .na-mini-button{animation-delay:.16s}
@keyframes naUp{from{opacity:0;transform:translateY(10px)}}

/* Application : les lignes du téléphone arrivent une par une */
#next-preview .na-view.na-enter .na-phone-row{animation:naUp .45s var(--ease-out) both}
#next-preview .na-view.na-enter .na-phone-row:nth-of-type(1){animation-delay:.2s}
#next-preview .na-view.na-enter .na-phone-row:nth-of-type(2){animation-delay:.28s}
#next-preview .na-view.na-enter .na-phone-row:nth-of-type(3){animation-delay:.36s}

/* Power BI : les barres poussent puis respirent */
#next-preview .na-view.na-enter .na-bivis span{animation:naBarIn .8s var(--ease-out) both,na-grow 3s ease-in-out .9s infinite alternate}
#next-preview .na-view.na-enter .na-bivis span:nth-child(2){animation-delay:.06s,1.3s}
#next-preview .na-view.na-enter .na-bivis span:nth-child(3){animation-delay:.12s,.9s}
#next-preview .na-view.na-enter .na-bivis span:nth-child(4){animation-delay:.18s,1.3s}
#next-preview .na-view.na-enter .na-bivis span:nth-child(5){animation-delay:.24s,.9s}
#next-preview .na-view.na-enter .na-bivis span:nth-child(6){animation-delay:.3s,1.3s}
@keyframes naBarIn{from{transform:scaleY(.04)}}

/* ERP : les modules se synchronisent l'un après l'autre */
#next-preview .na-view.na-enter .na-erp-modules>div{animation:naUp .45s var(--ease-out) both}
#next-preview .na-view.na-enter .na-erp-modules>div:nth-child(2){animation-delay:.1s}
#next-preview .na-view.na-enter .na-erp-modules>div:nth-child(3){animation-delay:.2s}
#next-preview .na-erp-modules>div{position:relative}
#next-preview .na-erp-modules>div::after{content:"";position:absolute;inset:0;border-radius:inherit;background:#006699;opacity:0;pointer-events:none}
#next-preview .na-view:not([hidden]) .na-erp-modules>div::after{animation:naSync 2.4s ease-in-out 1s infinite}
#next-preview .na-view:not([hidden]) .na-erp-modules>div:nth-child(2)::after{animation-delay:1.4s}
#next-preview .na-view:not([hidden]) .na-erp-modules>div:nth-child(3)::after{animation-delay:1.8s}
@keyframes naSync{0%,60%,100%{opacity:0}20%{opacity:.12}}

/* ---------- Solutions métier : schéma vivant ---------- */
#next-preview .na-flow.na-live .na-flow-node{opacity:0;transform:translateY(12px) scale(.96);transition:opacity .5s var(--ease-out),transform .6s var(--ease-out)}
#next-preview .na-flow.na-live .na-connector{transform:scaleX(0);transform-origin:left;transition:transform .6s var(--ease-in-out)}
#next-preview .na-flow.na-live .na-connector::after{opacity:0}
#next-preview .na-flow.na-live.in .na-flow-node{opacity:1;transform:none}
#next-preview .na-flow.na-live.in .na-flow-stack:first-child .na-flow-node:nth-child(1){transition-delay:0s}
#next-preview .na-flow.na-live.in .na-flow-stack:first-child .na-flow-node:nth-child(2){transition-delay:.08s}
#next-preview .na-flow.na-live.in .na-connector{transform:none;transition-delay:.3s}
#next-preview .na-flow.na-live.in .na-connector~.na-connector{transition-delay:.55s}
#next-preview .na-flow.na-live.in>.na-flow-node.center{transition-delay:.2s}
#next-preview .na-flow.na-live.in .na-flow-stack:last-child .na-flow-node:nth-child(1){transition-delay:.7s}
#next-preview .na-flow.na-live.in .na-flow-stack:last-child .na-flow-node:nth-child(2){transition-delay:.78s}
#next-preview .na-flow.na-live.in .na-connector::after{opacity:1;transition:opacity .3s ease 1s}
/* second sens de circulation : les données reviennent */
#next-preview .na-flow .na-connector~.na-connector::after{animation-direction:reverse;animation-delay:1.4s}
/* le noyau central bat doucement */
#next-preview .na-flow-node.center{position:relative}
#next-preview .na-flow-node.center::before{content:"";position:absolute;inset:-6px;border-radius:16px;border:2px solid #006699;opacity:0;pointer-events:none}
#next-preview .na-flow.in .na-flow-node.center::before{animation:naRing 2.8s var(--ease-out) 1.2s infinite}
@keyframes naRing{0%{opacity:.5;transform:scale(.92)}70%,100%{opacity:0;transform:scale(1.18)}}
/* nœud survolé / actif */
#next-preview .na-flow-node[data-hot]{transition:transform .2s var(--ease-out),background-color .3s ease,color .3s ease}
#next-preview .na-flow-node.is-hot{background:#006699;color:#fff;transform:translateY(-2px)}

/* Barres Power BI de la carte : données « en direct » pilotées par motion.js */
#next-preview .na-solution .na-bivis.na-live span{animation:none;height:100%;transform:scaleY(var(--v,.1));transition:transform .9s var(--ease-in-out)}
#next-preview .na-solution .na-bivis.na-live:not(.in) span{transform:scaleY(.04)}

/* ---------- Site Express : étapes et coches ---------- */
#next-preview .na-steps.na-live span{opacity:.35;transition:opacity .4s ease,background-color .4s ease}
#next-preview .na-steps.na-live.in span{opacity:1}
#next-preview .na-steps.na-live.in span:nth-of-type(2){transition-delay:.25s}
#next-preview .na-steps.na-live.in span:nth-of-type(3){transition-delay:.5s}
#next-preview .na-included.na-live span{opacity:0;transform:translateX(-8px);transition:opacity .4s var(--ease-out),transform .5s var(--ease-out);transition-delay:calc(var(--i,0)*60ms + .4s)}
#next-preview .na-included.na-live.in span{opacity:1;transform:none}

/* ---------- Besançon : un point parcourt chaque orbite ---------- */
#next-preview .na-orbit{animation:naOrbit 26s linear infinite}
#next-preview .na-orbit.two{animation-duration:38s;animation-direction:reverse}
#next-preview .na-orbit.three{animation-duration:54s}
#next-preview .na-orbit::after{content:"";position:absolute;top:-4px;left:50%;width:8px;height:8px;margin-left:-4px;border-radius:50%;background:#006699}
@keyframes naOrbit{from{transform:rotateX(55deg) rotate(-30deg)}to{transform:rotateX(55deg) rotate(330deg)}}

/* ---------- Mouvement réduit : on garde les fondus, on retire les déplacements ---------- */
@media (prefers-reduced-motion:reduce){
  .na-reveal,.na-hero-in{transform:none!important;transition:opacity .3s ease;animation-name:naFade}
  @keyframes naFade{from{opacity:0}to{opacity:1}}
  #next-preview .na-view.na-enter,#next-preview .na-view.na-enter *{animation:none!important}
  #next-preview .na-switch.na-auto button::after{display:none}
  #next-preview .na-orbit,#next-preview .na-connector::after,#next-preview .na-flow-node.center::before,#next-preview .na-erp-modules>div::after,#next-preview .na-bivis span{animation:none!important}
  #next-preview .na-flow.na-live .na-flow-node,#next-preview .na-flow.na-live .na-connector,#next-preview .na-included.na-live span{transform:none!important}
  #next-preview .na-solution .na-bivis.na-live span{transition:none}
}

/* =====================  « ENVOYER DU LOURD »  ===================== */

/* Barre de progression de lecture */
.na-progress{position:fixed;left:0;top:0;height:3px;width:100%;background:#006699;transform-origin:left;transform:scaleX(0);z-index:100;pointer-events:none}

/* Titres : chaque ligne se dévoile derrière un masque */
.na-line{display:block;overflow:hidden;padding-bottom:.08em;margin-bottom:-.08em}
.na-line>span{display:block;transform:translateY(105%);transition:transform 1s var(--ease-out);transition-delay:calc(var(--l,0)*110ms)}
.na-split.in .na-line>span{transform:none}
/* soulignement dessiné sous « Le prochain pas. » */
#next-preview h1 em{position:relative;display:inline-block}
#next-preview h1 em svg{position:absolute;left:0;bottom:-.12em;width:100%;height:.22em;overflow:visible}
#next-preview h1 em path{fill:none;stroke:#006699;stroke-width:5;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset 1.1s var(--ease-in-out) .9s}
#next-preview h1.in em path{stroke-dashoffset:0}

/* Démo : profondeur 3D qui suit la souris */
#next-preview .na-stage{transform-style:preserve-3d;transition:transform .5s var(--ease-out)}
#next-preview .na-stage.na-tilt{transform:perspective(1100px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg))}
#next-preview .na-stage.na-tilt .na-view{transform-style:preserve-3d}
#next-preview .na-stage.na-tilt .na-browser{transform:rotate(-3deg) translateZ(30px)}
#next-preview .na-stage.na-tilt .na-float{transform:rotate(3deg) translateZ(90px)}
#next-preview .na-stage.na-tilt .na-phone{transform:rotate(5deg) translateZ(60px)}
#next-preview .na-stage.na-tilt .na-dash{transform:rotate(-3deg) translateZ(40px)}
@keyframes naPop{from{opacity:0;transform:translateY(10px) rotate(3deg) scale(.95) translateZ(90px)}to{opacity:1;transform:rotate(3deg) translateZ(90px)}}

/* Démo Site web : l'adresse se tape, un curseur vient cliquer sur le bouton */
#next-preview .na-bar span.na-typing::after{content:"";display:inline-block;width:1px;height:1em;background:currentColor;margin-left:1px;vertical-align:-2px;animation:naCaret .8s steps(1) infinite}
@keyframes naCaret{50%{opacity:0}}
#next-preview .na-browser{position:relative}
#next-preview .na-fakecursor{position:absolute;left:0;top:0;width:18px;height:22px;pointer-events:none;opacity:0;z-index:3;transform:translate(var(--cx0),var(--cy0))}
#next-preview .na-view.na-enter .na-fakecursor{animation:naCursor 2.4s var(--ease-in-out) 1.1s both}
@keyframes naCursor{0%{opacity:0;transform:translate(var(--cx0),var(--cy0))}15%{opacity:1}60%{transform:translate(var(--cx1),var(--cy1))}66%{transform:translate(var(--cx1),var(--cy1)) scale(.85)}72%{transform:translate(var(--cx1),var(--cy1)) scale(1)}90%{opacity:1}100%{opacity:0;transform:translate(var(--cx1),var(--cy1))}}
#next-preview .na-view.na-enter .na-mini-button{animation:naUp .5s var(--ease-out) .16s both,naPress 2.4s var(--ease-in-out) 1.1s both}
@keyframes naPress{0%,62%{transform:none;background:#006699}66%{transform:scale(.94);background:#004d73}74%,100%{transform:none;background:#006699}}

/* Défilé des outils */
#next-preview .na-marquee{flex:1;overflow:hidden;min-width:0;-webkit-mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent);mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent)}
#next-preview .na-marquee-track{display:flex;gap:56px;width:max-content;animation:naMarquee 28s linear infinite;align-items:center}
#next-preview .na-marquee:hover .na-marquee-track{animation-play-state:paused}
@keyframes naMarquee{to{transform:translateX(-50%)}}

/* Carte Site Express : halo qui suit la souris */
#next-preview .na-express{isolation:isolate}
#next-preview .na-express::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:0;transition:opacity .4s ease;background:radial-gradient(420px circle at var(--mx,50%) var(--my,50%),rgba(0,102,153,.38),transparent 70%)}
#next-preview .na-express:hover::before{opacity:1}
#next-preview .na-steps .na-ready{position:relative}
#next-preview .na-steps.in .na-ready::after{content:"";position:absolute;inset:-4px;border-radius:7px;border:2px solid #4fa3cf;opacity:0;animation:naRing 2.4s var(--ease-out) 1.2s infinite}

/* Réalisations : parallaxe dans le cadre */
#next-preview .na-realshot img{height:114%;will-change:transform;transform:translateY(var(--py,0%))}
@media (hover:hover) and (pointer:fine){
  #next-preview .na-realshot{transition:transform .4s var(--ease-out),box-shadow .2s}
  #next-preview .na-realshot:hover{transform:translateY(-4px)}
}

/* Bouton aimanté */
#next-preview .na-magnet{transition:transform .35s var(--ease-out),background-color .2s ease}

@media (prefers-reduced-motion:reduce){
  .na-line>span{transform:none!important;transition:none}
  #next-preview h1 em path{stroke-dashoffset:0;transition:none}
  #next-preview .na-stage.na-tilt{transform:none}
  #next-preview .na-fakecursor{display:none}
  #next-preview .na-marquee-track{animation:none;flex-wrap:wrap}
  #next-preview .na-realshot img{transform:none;height:100%}
  .na-progress{display:none}
}
