/* ============================================================
   animations.css — motion language carried from the booking
   widget (fadeUp / pop / stagger) plus scroll-reveal for the
   site. All share the widget's easing + the 150–300ms band.
   Every animation conveys cause/effect; none is decorative-only.
   ============================================================ */

/* ---- Widget-native keyframes (verbatim) ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop    { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin   { to { transform: rotate(360deg); } }

/* applied to a view as it appears */
.view-enter { animation: fadeUp var(--t-base) var(--ease-out) both; }

/* ---- Stagger (same cadence as the widget: ~40ms steps) ---- */
.stagger > * { animation: fadeUp var(--t-base) var(--ease-out) both; }
.stagger > *:nth-child(1){animation-delay:30ms}
.stagger > *:nth-child(2){animation-delay:70ms}
.stagger > *:nth-child(3){animation-delay:110ms}
.stagger > *:nth-child(4){animation-delay:150ms}
.stagger > *:nth-child(5){animation-delay:190ms}
.stagger > *:nth-child(6){animation-delay:230ms}
.stagger > *:nth-child(7){animation-delay:270ms}
.stagger > *:nth-child(n+8){animation-delay:300ms}

/* ---- Scroll reveal: same translate+fade as fadeUp, gated by
        IntersectionObserver in site.js (adds .is-in). Uses
        transform/opacity only (transform-performance rule). ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}
/* will-change only WHILE waiting to reveal, never after. Left on the base
   rule it kept every revealed element on its own GPU layer permanently, which
   makes text render soft/blurry at rest. Once .is-in lands we clear it so the
   element drops back to normal (sharp) text rendering. */
[data-reveal]:not(.is-in) {
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; will-change: auto; }

/* directional + scale variants for spatial continuity */
[data-reveal="left"]  { transform: translateX(-28px); }
[data-reveal="right"] { transform: translateX(28px); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal].is-in { transform: none; }

/* staggered children on reveal (grids/lists) */
[data-reveal-group].is-in > * { animation: fadeUp 560ms var(--ease-out) both; }
/* The carousel track is positioned by JS (translate3d); never let the
   reveal animation run on it, or it overwrites the marquee transform. */
[data-reveal-group].is-in > .pcar-track { animation: none !important; }
[data-reveal-group].is-in > *:nth-child(1){animation-delay:40ms}
[data-reveal-group].is-in > *:nth-child(2){animation-delay:100ms}
[data-reveal-group].is-in > *:nth-child(3){animation-delay:160ms}
[data-reveal-group].is-in > *:nth-child(4){animation-delay:220ms}
[data-reveal-group].is-in > *:nth-child(5){animation-delay:280ms}
[data-reveal-group].is-in > *:nth-child(6){animation-delay:340ms}
[data-reveal-group].is-in > *:nth-child(n+7){animation-delay:380ms}

/* loading shimmer skeleton (progressive-loading rule) */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-md);
}

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  animation: spin 0.7s linear infinite; display: inline-block;
}

/* ---- Honour reduced motion everywhere (reduced-motion rule) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .stagger > * { animation: none !important; }
}