/* RAMAYCHA — animations du site public.
   Toutes les animations sont désactivées si le visiteur a demandé « réduire les animations ». */
@keyframes rIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes rZoom { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes rDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes rDrawCheck { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes rFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes rFloatX { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-6px, 8px); } }
@keyframes rDrift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-30px, 14px, 0) scale(1.04); } }
@keyframes rMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes rBlink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
@keyframes rPulse { 0% { box-shadow: 0 0 0 0 rgba(240,80,154,.55); } 80%, 100% { box-shadow: 0 0 0 16px rgba(240,80,154,0); } }
@keyframes rRing { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes rGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rPop { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: none; } }
@keyframes rPanel { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Bandeau magenta défilant */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; width: max-content; animation: rMarquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; gap: 30px; padding-right: 30px; white-space: nowrap; }

/* Micro-interactions */
.wa-float { transition: transform .25s; }
.wa-float:hover { transform: scale(1.08); }
.wa-float::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #D81B72; z-index: -1; animation: rRing 2.4s ease-out infinite; }
.site a svg, .site button svg { transition: transform .25s; }
.site a:hover > svg:has(path[d="M5 12h14M13 6l6 6-6 6"]), .site button:hover > svg:has(path[d="M5 12h14M13 6l6 6-6 6"]) { transform: translateX(4px); }
.services-list a { transition: transform .2s; }
.services-list a:active { transform: scale(.98); }
.home-works figure img, .work-grid img { transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.home-works figure:hover img, .work-grid article:hover img { transform: scale(1.05); }
.pill:active, .chip span:active { transform: scale(.96); }

@media (prefers-reduced-motion: no-preference) {
  /* Hero : entrée en cascade */
  .hero-title, .hero-lead, .hero-ctas, .hero-pillars { animation: rIn .9s cubic-bezier(.2,.7,.2,1) both; }
  .hero-title { animation-delay: .05s; }
  .hero-lead { animation-delay: .26s; }
  .hero-ctas { animation-delay: .38s; }
  .hero-pillars { animation-delay: .5s; }
  .hero-portrait { animation: rZoom 1.1s cubic-bezier(.2,.7,.2,1) .2s both; }
  .hero-r-path { stroke-dasharray: 1; animation: rDraw 1.8s cubic-bezier(.65,0,.35,1) .1s both; }
  .hero-card { animation: rIn .9s cubic-bezier(.2,.7,.2,1) .8s both, rFloat 6s ease-in-out 1.8s infinite; }
  .a-steps span { transform-origin: left; animation: rGrowX .6s ease-out both; }
  .a-steps span:nth-child(1) { animation-delay: 1.2s; }
  .a-steps span:nth-child(2) { animation-delay: 1.4s; }
  .a-steps span:nth-child(3) { animation-delay: 1.6s; }
  .a-steps span:nth-child(4) { animation-delay: 1.8s; }
  header > svg:first-child { animation: rDrift 16s ease-in-out infinite alternate; }
  .page-head > * { animation: rIn .8s cubic-bezier(.2,.7,.2,1) both; }
  .page-head > *:nth-child(2) { animation-delay: .1s; }
  .page-head > *:nth-child(3) { animation-delay: .2s; }

  /* Apparition au défilement (classe .is-in posée par site.js) */
  html.js [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity .8s cubic-bezier(.2,.7,.2,1) var(--d, 0ms), transform .8s cubic-bezier(.2,.7,.2,1) var(--d, 0ms); }
  html.js [data-reveal="zoom"] { transform: scale(.94); }
  html.js [data-reveal="left"] { transform: translateX(-40px); }
  html.js [data-reveal="right"] { transform: translateX(40px); }
  html.js [data-reveal].is-in { opacity: 1; transform: none; }
  html.js .card-hover[data-reveal].is-in:hover { transform: translateY(-4px); }

  /* Illustrations des cartes services */
  html.js .a-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .is-in .a-draw { animation: rDraw 1.6s cubic-bezier(.65,0,.35,1) calc(var(--d, 0ms) + .3s) both; }
  .card-hover:hover .a-draw { animation: rDraw 1.2s cubic-bezier(.65,0,.35,1) both; }
  html.js .a-pop { opacity: 0; }
  .is-in .a-pop { animation: rPop .5s cubic-bezier(.2,.7,.2,1) both; }
  .is-in .a-pop:nth-child(1) { animation-delay: calc(var(--d, 0ms) + .35s); }
  .is-in .a-pop:nth-child(2) { animation-delay: calc(var(--d, 0ms) + .45s); }
  .is-in .a-pop:nth-child(3) { animation-delay: calc(var(--d, 0ms) + .55s); }
  .is-in .a-pop:nth-child(4) { animation-delay: calc(var(--d, 0ms) + .65s); }
  html.js .a-bar, html.js .a-grow-x { transform: scaleX(0); transform-origin: left; }
  .is-in .a-bar { animation: rGrowX .7s cubic-bezier(.2,.7,.2,1) both; }
  .is-in .a-bar:nth-of-type(1) { animation-delay: calc(var(--d, 0ms) + .3s); }
  .is-in .a-bar:nth-of-type(2) { animation-delay: calc(var(--d, 0ms) + .45s); }
  .is-in .a-bar:nth-of-type(3) { animation-delay: calc(var(--d, 0ms) + .6s); }
  .is-in .a-bar:nth-of-type(4) { animation-delay: calc(var(--d, 0ms) + .75s); }
  .is-in .a-grow-x { animation: rGrowX 2.4s ease-out calc(var(--d, 0ms) + .3s) both; }
  .a-float { animation: rFloat 6s ease-in-out infinite; transform-box: fill-box; }
  .a-float-alt { animation-duration: 5s; animation-delay: -2s; }
  .a-blink { animation: rBlink 1.2s steps(2, jump-none) infinite; }
  .a-pulse { animation: rPulse 2s ease-out infinite; }

  /* Changement de profil et filtres */
  .aud-panel.is-anim { animation: rPanel .5s cubic-bezier(.2,.7,.2,1) both; }
  .aud-panel.is-anim .aud-body > * { animation: rPanel .5s cubic-bezier(.2,.7,.2,1) .12s both; }
  .work-grid article.is-anim { animation: rZoom .45s cubic-bezier(.2,.7,.2,1) var(--d, 0ms) both; }

  /* Confirmation d'envoi du formulaire */
  .contact-card [role="status"] > span:first-child { animation: rPop .6s cubic-bezier(.2,.7,.2,1) both; }
  .contact-card [role="status"] > span:first-child svg path { stroke-dasharray: 30; animation: rDrawCheck .6s ease-out .4s both; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; width: 100%; flex-wrap: wrap; justify-content: center; }
  .marquee-group { flex-wrap: wrap; justify-content: center; white-space: normal; padding: 0 32px; }
  .marquee-group[aria-hidden] { display: none; }
  .wa-float::after { display: none; }
}

/* Fond de la boucle du R (hero) : apparaît avec le portrait */
@media (prefers-reduced-motion: no-preference) {
  .hero-r-fill { animation: rFade 1s ease .2s both; }
}
@keyframes rFade { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .hero-r-fillet { animation: rFade .3s ease .75s both; } /* quand le tracé du R atteint le coin */
}
