/* ==========================================================================
   animations.css — luxury motion, never gaming motion
   Scroll reveals use keyframes with `backwards` fill, so hover transforms
   on the same elements keep working once the reveal has finished.
   ========================================================================== */

/* ---------- Keyframes ---------- */
@keyframes rv-up    { from { opacity: 0; transform: translate3d(0, 2.25rem, 0); } }
@keyframes rv-fade  { from { opacity: 0; } }
@keyframes rv-left  { from { opacity: 0; transform: translate3d(calc(var(--dir) * -3rem), 0, 0); } }
@keyframes rv-right { from { opacity: 0; transform: translate3d(calc(var(--dir) * 3rem), 0, 0); } }
@keyframes rv-scale { from { opacity: 0; transform: scale(0.92); } }
@keyframes rv-clip  { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes img-settle { from { transform: scale(1.35); } }

@keyframes line-draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes line-draw-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes arch-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes outline-in { from { opacity: 0; scale: 0.94; } to { opacity: 1; scale: 1; } }
@keyframes pop-in { from { opacity: 0; scale: 0.4; } to { opacity: 1; scale: 1; } }
@keyframes chip-in { from { opacity: 0; translate: 0 1rem; } to { opacity: 1; translate: 0 0; } }
@keyframes float-y { from { transform: translate3d(0, -7px, 0); } to { transform: translate3d(0, 9px, 0); } }
@keyframes glow-drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(calc(var(--dir) * -9vmax), 7vmax, 0) scale(1.12); } }
@keyframes particle {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  12%  { opacity: var(--o, 0.55); }
  88%  { opacity: var(--o, 0.55); }
  100% { transform: translate3d(var(--dx, 24px), -85vh, 0); opacity: 0; }
}
@keyframes scroll-cue { 0% { transform: translateY(-110%); } 60%, 100% { transform: translateY(260%); } }
@keyframes marquee { to { transform: translateX(calc(var(--dir) * -50%)); } }
@keyframes wa-in { from { opacity: 0; transform: translateY(1.5rem) scale(0.5); } }
@keyframes wa-pulse { 0% { transform: scale(1); opacity: 0.8; } 70%, 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Scroll reveals (JS-gated: content stays visible without JS) ---------- */
.js [data-reveal] { opacity: 0; }
.js [data-reveal].is-in { opacity: 1; animation: var(--rv, rv-up) 1.05s var(--ease) var(--d, 0s) backwards; }
.js [data-reveal="fade"].is-in  { --rv: rv-fade; animation-duration: 1.3s; }
.js [data-reveal="left"].is-in  { --rv: rv-left; }
.js [data-reveal="right"].is-in { --rv: rv-right; }
.js [data-reveal="scale"].is-in { --rv: rv-scale; }
.js [data-reveal="clip"] { opacity: 0; transform: translateY(22px) scale(0.985); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.js [data-reveal="clip"].is-in { opacity: 1; transform: none; }
.js [data-reveal="clip"].is-in img { animation: img-settle 2s var(--ease) var(--d, 0s) backwards; }

/* ---------- Split words (headline mask reveal) ---------- */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-block: 0.16em; margin-block: -0.16em; }
.w > span { display: inline-block; }
.js [data-split] .w > span { transform: translateY(125%); transition: transform 1.15s var(--ease) calc(var(--d, 0s) + var(--wi, 0) * 60ms); }
.js [data-split].is-in .w > span { transform: none; }

@keyframes hero-frame-clip {
  from {
    clip-path: inset(100% 0 0 0 round clamp(8.5rem, 17vw, 15.5rem) clamp(8.5rem, 17vw, 15.5rem) 1.85rem 1.85rem);
    opacity: 0.2;
    transform: translateY(18px) scale(0.985);
  }
  to {
    clip-path: inset(0 0 0 0 round clamp(8.5rem, 17vw, 15.5rem) clamp(8.5rem, 17vw, 15.5rem) 1.85rem 1.85rem);
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes hero-outline-in {
  from { opacity: 0; transform: translate3d(calc(var(--dir) * 0.9rem), var(--py2, 0px), 0) scale(0.95); }
  to { opacity: 1; transform: translate3d(calc(var(--dir) * 0.9rem), var(--py2, 0px), 0) scale(1); }
}
@keyframes deco-draw-x {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ---------- Hero entrance (starts when curtain lifts: html.is-ready) ---------- */
.hero__glow, .hero__glow--secondary { animation: glow-drift 26s ease-in-out infinite alternate; }
.hero__glow--secondary { animation-duration: 34s; animation-direction: alternate-reverse; }

.js .hero__ambient-line { transform: scaleX(0); transform-origin: var(--origin-start); }
.js.is-ready .hero__ambient-line { animation: line-draw-x 1.8s var(--ease-io) 0.2s forwards; }

.js .hero__frame {
  clip-path: inset(100% 0 0 0 round clamp(8.5rem, 17vw, 15.5rem) clamp(8.5rem, 17vw, 15.5rem) 1.85rem 1.85rem);
  opacity: 0;
}
.js.is-ready .hero__frame {
  animation: hero-frame-clip 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}

.js .hero__outline { opacity: 0; }
.js.is-ready .hero__outline { animation: hero-outline-in 1.1s var(--ease) 0.7s forwards; }

.js .hero__eyebrow-line { transform: scaleX(0); transform-origin: var(--origin-start); }
.js.is-ready .hero__eyebrow-line { animation: deco-draw-x 0.8s var(--ease) 0.3s forwards; }

.js .hero__deco-line { transform: scaleX(0); transform-origin: var(--origin-start); }
.js.is-ready .hero__deco-line { animation: deco-draw-x 0.9s var(--ease) 0.85s forwards; }

.hero__scroll i::after { animation: scroll-cue 2.4s var(--ease-io) infinite; }

/* ---------- Marquee ---------- */
.marquee__track { animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ---------- Floating WhatsApp ---------- */
.js .wa-float { opacity: 0; transform: translateY(1.5rem) scale(0.5); pointer-events: none; }
.js.is-ready .wa-float { opacity: 1; transform: none; pointer-events: auto; animation: wa-in 0.9s var(--ease) 2.2s backwards; }
.wa-float__ring { animation: wa-pulse 4s ease-out 4.5s infinite; }
.wa-float:hover .wa-float__ring { animation-play-state: paused; opacity: 0; }

/* ---------- Page transition curtain ---------- */
@keyframes curtain-out { from { transform: translateY(0); } to { transform: translateY(-101%); } }
@keyframes curtain-in  { from { transform: translateY(101%); } to { transform: translateY(0); } }
@keyframes curtain-logo { from { opacity: 0; transform: scale(0.82) rotate(-8deg); } to { opacity: 1; transform: none; } }

.curtain {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--black);
  pointer-events: none;
  visibility: hidden;
  border-radius: 0 0 50% 50% / 0 0 7vh 7vh;
}
.curtain__logo { width: 5.5rem; height: 5.5rem; opacity: 0; }
html.js-transition .curtain { visibility: visible; pointer-events: auto; animation: curtain-failsafe 0s linear 4s forwards; }
html.js-transition .curtain__logo { animation: curtain-logo 0.7s var(--ease) 0.05s forwards; }
html.js-transition.is-ready .curtain { animation: curtain-out 0.85s var(--ease-io) 0.12s forwards; }
html.js-transition.is-ready .curtain__logo { animation: none; opacity: 0; transition: opacity 0.25s; }
.curtain.is-leaving { visibility: visible; pointer-events: auto; animation: curtain-in 0.5s var(--ease-io) forwards; }
.curtain.is-leaving .curtain__logo { animation: curtain-logo 0.55s var(--ease) 0.12s forwards; }
html.js-transition.is-ready .curtain.is-leaving { animation: curtain-in 0.5s var(--ease-io) forwards; }
@keyframes curtain-failsafe { to { visibility: hidden; } }
.curtain.is-done { display: none; }

/* ---------- Language switch cross-fade ---------- */
main, .site-footer { transition: opacity 0.35s ease; }
html.lang-switching main, html.lang-switching .site-footer { opacity: 0; transition-duration: 0.2s; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js [data-reveal], .js [data-reveal="clip"] { opacity: 1; clip-path: none; }
  .js [data-split] .w > span { transform: none; }
  .js .hero__frame { clip-path: none; opacity: 1; transform: none; }
  .js .hero__outline { opacity: 1; }
  .js .hero__ambient-line, .js .hero__eyebrow-line, .js .hero__deco-line { transform: none; }
  .js .wa-float { opacity: 1; transform: none; pointer-events: auto; }
  .particle, .hero__glow, .hero__glow--secondary, .marquee__track, .hero__float { animation: none !important; }
  .particle { display: none; }
  .tl__bar, .process__step::before, .price-flow li::after { transform: scaleX(1); }
  .curtain { display: none !important; }
}
