/*═══════════════════════════════════════════════════════════
  IK'ART — mouvement (chargé sur toutes les pages publiques, après mobile.css)
  Amélioration progressive : rien n'est caché sans JS (.js posé en tête,
  .rv posé par _navjs) ; filet CSS à 2,5 s si _navjs ne tourne pas.
═══════════════════════════════════════════════════════════*/
:root{--ease-spring:cubic-bezier(.34,1.4,.64,1);--t-rise:.6s;--stagger:70ms}

/* Navigation entre pages : fondu .2s, l'en-tête / la barre mobile / l'assistant restent en place */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:.2s;animation-timing-function:var(--ease)}
.hdr{view-transition-name:hdr}
.mbar{view-transition-name:mbar}
.ikbot{view-transition-name:ikbot}

/* `translate`/`scale` et non `transform` : les survols gardent transform pour eux */
@keyframes rise{from{opacity:0;translate:0 12px}}
@keyframes lift{from{translate:0 12px}}
@keyframes pop{from{opacity:0;translate:0 8px;scale:.96}}
@keyframes reveal-failsafe{to{opacity:1}}

/* Apparition au défilement — --i posé par _navjs = rang dans le lot, plafonné à 6 (420 ms) */
.js .reveal:not(.in){opacity:0}
.js:not(.rv) .reveal:not(.in){animation:reveal-failsafe 0s 2.5s forwards}
.js .reveal.in{animation:rise var(--t-rise) var(--ease) calc(min(var(--i,0),6) * var(--stagger)) backwards}

/* Entrée des en-têtes au chargement (motif « band » d'ekoKAMA), pur CSS : finit toujours visible.
   Le h1 ne fait que monter (pas de fondu) pour ne pas retarder le LCP. */
.js :is(.pagehd>.wrap,.intro)>*{animation:rise var(--t-rise) var(--ease) backwards}
.js :is(.pagehd>.wrap,.intro)>h1{animation-name:lift}
.js :is(.pagehd>.wrap,.intro)>:nth-child(2){animation-delay:.06s}
.js :is(.pagehd>.wrap,.intro)>:nth-child(3){animation-delay:.12s}
.js :is(.pagehd>.wrap,.intro)>:nth-child(4){animation-delay:.18s}
.js :is(.pagehd>.wrap,.intro)>:nth-child(n+5){animation-delay:.24s}

/* Micro-interactions */
.btn:active:not(:disabled){scale:.98}
.arr{flex:none;transition:translate .25s var(--ease)}
html[dir="rtl"] .arr{scale:-1 1}
.proj-media img,.post-img img,.gal img{transition:scale .6s var(--ease)}
@media (hover:hover){
  .btn:hover .arr,a:hover>.arr{translate:3px 0}
  html[dir="rtl"] :is(.btn,a):hover .arr{translate:-3px 0}
  .proj:hover .proj-media img,.post:hover .post-img img,.gal figure:hover img{scale:1.04}
}
.ikbot[data-open="true"] .ikbot-panel{animation:pop .22s var(--ease) both;transform-origin:bottom right}
html[dir="rtl"] .ikbot[data-open="true"] .ikbot-panel{transform-origin:bottom left}

/* Mouvement réduit : tout atterrit sur son état final */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-delay:0s!important;
    animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
  @view-transition{navigation:none}
  .js .reveal:not(.in){opacity:1}
  .btn:active:not(:disabled){scale:none}
}
@media print{
  .js .reveal{opacity:1!important}
  *{animation:none!important}
}
