/* La Pause — animations : page de chargement, entrée du hero, apparitions au scroll, micro-animations */

/* ---- Page de chargement ---- */
body.is-loading { overflow: hidden; }
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--vert);
  border-radius: 0 0 0 0;
  transition: translate .9s cubic-bezier(.75, 0, .2, 1), border-radius .9s cubic-bezier(.75, 0, .2, 1);
  /* Filet de sécurité : si le script ne tourne pas, l'écran disparaît quand même */
  animation: loader-fallback .6s 6s forwards;
}
.loader.done { translate: 0 -100%; border-radius: 0 0 50% 50% / 0 0 120px 120px; }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; transition: opacity .4s, scale .6s; }
.loader.done .loader-inner { opacity: 0; scale: .9; }
.loader-masc { position: relative; width: 120px; height: 190px; display: flex; align-items: flex-end; justify-content: center; }
.loader-masc img {
  position: relative;
  z-index: 1;
  height: 150px;
  transform-origin: 50% 100%;
  animation: masc-jump 1.1s cubic-bezier(.45, 0, .35, 1) infinite;
}
.loader-shadow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 90px;
  height: 12px;
  margin-left: -45px;
  border-radius: 50%;
  background: rgba(5, 20, 14, .45);
  animation: masc-shadow 1.1s cubic-bezier(.45, 0, .35, 1) infinite;
}
.steam { position: absolute; top: 0; left: 50%; width: 60px; height: 60px; margin-left: -30px; }
.steam i {
  position: absolute;
  bottom: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--or);
  opacity: 0;
  animation: steam 1.8s ease-out infinite;
}
.steam i:nth-child(1) { left: 8px; }
.steam i:nth-child(2) { left: 24px; animation-delay: .6s; }
.steam i:nth-child(3) { left: 40px; animation-delay: 1.2s; }
.loader-logo { width: 200px; height: auto; opacity: 0; animation: fade-up .8s .2s cubic-bezier(.2, .8, .2, 1) forwards; }
.loader-bar { width: 160px; height: 4px; border-radius: 4px; background: rgba(248, 241, 226, .15); overflow: hidden; opacity: 0; animation: fade-up .6s .35s forwards; }
.loader-bar span { display: block; height: 100%; width: 100%; background: var(--safran); border-radius: 4px; transform-origin: 0 50%; scale: 0 1; animation: bar-fill 1.4s .4s cubic-bezier(.3, .6, .3, 1) forwards; }
.loader.done .loader-bar span { scale: 1 1; animation: none; transition: scale .3s; }
.loader-tag { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--texte-clair); opacity: 0; animation: fade-up .6s .5s forwards; }

@keyframes masc-jump {
  0%   { translate: 0 0; scale: 1.12 .88; rotate: 0deg; }
  25%  { translate: 0 -34px; scale: .94 1.08; rotate: -8deg; }
  50%  { translate: 0 -46px; scale: 1 1; rotate: 6deg; }
  75%  { translate: 0 -8px; scale: .98 1.03; rotate: 0deg; }
  88%  { translate: 0 0; scale: 1.12 .88; }
  100% { translate: 0 0; scale: 1.12 .88; }
}
@keyframes masc-shadow {
  0%, 88%, 100% { scale: 1; opacity: .9; }
  50% { scale: .55; opacity: .4; }
}
@keyframes steam {
  0%   { opacity: 0; translate: 0 10px; scale: .5; }
  30%  { opacity: .8; }
  100% { opacity: 0; translate: 0 -40px; scale: 1.6; }
}
@keyframes bar-fill { to { scale: .85 1; } }
@keyframes fade-up { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes loader-fallback { to { opacity: 0; visibility: hidden; } }

/* ---- Entrée du hero (après la page de chargement) ---- */
.hero h1 span { transition: opacity .9s, translate 1s cubic-bezier(.2, .8, .2, 1); }
.hero h1 span:nth-child(2) { transition-delay: .12s; }
.carousel { transition: opacity 1s .25s, scale 1.2s .25s cubic-bezier(.2, .8, .2, 1); }
.hero-bottom { transition: opacity .8s .55s, translate .8s .55s cubic-bezier(.2, .8, .2, 1); }
.hero-sticker { transition: scale .7s .8s cubic-bezier(.34, 1.56, .64, 1); }
body.is-loading .hero h1 span { opacity: 0; translate: 0 70px; }
body.is-loading .carousel { opacity: 0; scale: .75; }
body.is-loading .hero-bottom { opacity: 0; translate: 0 24px; }
body.is-loading .hero-sticker { scale: 0; }

/* ---- Apparitions au scroll ---- */
[data-reveal] {
  opacity: 0;
  transition:
    opacity .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0s),
    translate .9s cubic-bezier(.2, .7, .2, 1) var(--d, 0s),
    scale .9s cubic-bezier(.2, .7, .2, 1) var(--d, 0s),
    rotate .9s cubic-bezier(.2, .7, .2, 1) var(--d, 0s);
}
[data-reveal="up"] { translate: 0 44px; }
[data-reveal="left"] { translate: -70px 0; }
[data-reveal="right"] { translate: 70px 0; }
[data-reveal="zoom"] { scale: .82; }
/* Dans le slider, pas de déplacement : l'aimantation des cartes se recalerait dessus */
[data-reveal="fade"] { transition-duration: 1s; }
[data-reveal="pop"] { scale: .6; rotate: -10deg; transition-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
[data-reveal="spin"] { scale: 0; rotate: -200deg; transition-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
[data-reveal].in { opacity: 1; translate: 0 0; scale: 1; rotate: 0deg; }

/* ---- Micro-animations en continu ---- */
.hero-sticker { animation: sticker-float 4s ease-in-out infinite; }
@keyframes sticker-float { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -9px; rotate: -8deg; } }

.bandeau img { animation: wiggle 3.2s ease-in-out infinite; }
.bandeau img.r { animation-delay: -1.6s; }
@keyframes wiggle { 0%, 100% { rotate: -7deg; translate: 0 0; } 50% { rotate: 7deg; translate: 0 -8px; } }

.merci .masc { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.merci .bulle { animation: bubble 2.6s ease-in-out infinite; transform-origin: 0 100%; }
@keyframes bubble { 0%, 70%, 100% { scale: 1; } 80% { scale: 1.14; } 90% { scale: .96; } }
.merci .deco { animation: twinkle 2.4s ease-in-out infinite; }
.merci .d2 { animation-delay: -.8s; }
.merci .d3 { animation-delay: -1.6s; }
@keyframes twinkle { 0%, 100% { scale: 1; opacity: 1; } 50% { scale: .6; opacity: .5; } }

.traiteur-box .tag img { animation: wiggle 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
.foot-bottom .addr img { animation: bob 2.8s ease-in-out infinite; }


.hero-label { transition: scale .3s; }
.hero-label.tick { animation: label-tick .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes label-tick { 0% { scale: .9; opacity: .4; } 100% { scale: 1; opacity: 1; } }

.menu-card.swap { animation: fade-up .45s cubic-bezier(.2, .8, .2, 1); }

/* ---- Survols ---- */
.btn, .header-tel { transition: background .2s, color .2s, border-color .2s, translate .25s, box-shadow .25s; }
.btn:hover, .header-tel:hover { translate: 0 -2px; }
.btn-safran:hover { box-shadow: 0 10px 22px rgba(242, 184, 75, .35); }
.sig { transition: translate .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s; }
.sig:hover { translate: 0 -6px; box-shadow: 0 18px 34px rgba(5, 20, 14, .35); }
.sig .ph img { transition: scale .6s cubic-bezier(.2, .8, .2, 1); }
.sig:hover .ph img { scale: 1.07; }
.polaroid { transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .5s; }
.polaroid:hover { transform: rotate(0deg) scale(1.04); box-shadow: 0 24px 44px rgba(29, 58, 46, .22); }
.t-plate, .t-hero { transition: rotate 1.2s cubic-bezier(.2, .8, .2, 1), scale 1.2s cubic-bezier(.2, .8, .2, 1); }
.tile:hover .t-plate { rotate: 25deg; scale: 1.06; }
.tile:hover .t-hero { scale: 1.05; }
.t-hero { animation: plate-float 7s ease-in-out infinite; }
/* Les plats du visuel traiteur flottent doucement, chacun à son rythme */
.spread .pl.in { animation: plate-float 6s ease-in-out infinite; }
.spread .p-a.in { animation-delay: -1.5s; }
.spread .p-b.in { animation-delay: -3s; }
.spread .p-c.in { animation-delay: -4.5s; }
.spread .p-d.in { animation-delay: -2.2s; }
@keyframes plate-float { 0%, 100% { rotate: 0deg; } 50% { rotate: 6deg; } }
.review { transition: translate .3s; }
.review:hover { translate: 0 -6px; }
.map-frame { transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.map-frame:hover { transform: rotate(0deg); }
.chip { transition: background .15s, color .15s, border-color .15s, scale .15s; }
.chip:active { scale: .95; }

/* ---- Moins d'animations si le visiteur l'a demandé ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .loader-logo, .loader-bar, .loader-tag { opacity: 1; }
}
