/* ==========================================================================
   IMPEL FASHION — ANIMATIONS
   Keyframes + motion-state classes. Durations/easing follow 07_UI_UX.md §8:
   0.6–1.1s, power2.out / expo.out — never bounce, never elastic.
   GSAP drives most reveal timing via JS (see assets/js/), but every motion
   also has a CSS-only definition here so the site still animates gracefully
   if a script fails to load, and so transitions stay declared in one place.
   ========================================================================== */

/* ---------------------------------------------------------------------- */
/* Loading screen                                                         */
/* ---------------------------------------------------------------------- */
.loader {
  position: fixed; inset: 0; z-index: var(--z-loader);
  background:
    radial-gradient(50% 60% at 20% 15%, rgba(46,143,224,0.28) 0%, transparent 70%),
    radial-gradient(45% 55% at 85% 85%, rgba(47,217,200,0.22) 0%, transparent 70%),
    var(--color-navy);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: var(--space-4);
  transition: opacity var(--dur-slow) var(--ease-out), visibility var(--dur-slow) var(--ease-out);
  overflow: hidden;
}
/* Faint drifting grid, same "network" texture used sitewide */
.loader::before {
  content: '';
  position: absolute; inset: 0;
  opacity: 0.05;
  background-image:
    linear-gradient(rgba(244,243,240,0.7) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244,243,240,0.7) 1px, transparent 1px);
  background-size: 56px 56px;
  animation: grid-drift 36s linear infinite;
}
.loader__logo-wrap { position: relative; display: flex; align-items: center; justify-content: center; }
.loader__ring {
  position: absolute; width: 140px; height: 140px;
  border-radius: 50%;
  border: 1px solid var(--color-cyan);
  opacity: 0;
  animation: loader-ring 2.2s var(--ease-out-soft) infinite;
}
.loader__ring:nth-child(2) { animation-delay: 0.6s; }
.loader__logo {
  position: relative; z-index: 1;
  width: 80px; height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.4));
  animation: loader-pulse 1.8s var(--ease-out-soft) infinite;
}
.loader__tagline {
  color: var(--color-text-on-dark-muted);
  font-size: var(--fs-small);
  letter-spacing: 0.08em;
  opacity: 0;
  animation: loader-fade-in 0.8s var(--ease-out) 0.4s forwards;
}
.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
body.is-loading { overflow: hidden; }

@keyframes loader-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.96); }
}
@keyframes loader-ring {
  0%   { width: 100px; height: 100px; opacity: 0.7; }
  100% { width: 200px; height: 200px; opacity: 0; }
}
@keyframes loader-fade-in {
  to { opacity: 1; }
}

/* ---------------------------------------------------------------------- */
/* Hero slideshow — crossfade + slow Ken Burns (see 03_Hero_Section_      */
/* Recommendation.md §0.1). JS toggles .is-active / .is-prev; CSS owns    */
/* the actual transition curve so timing lives in exactly one place.     */
/* ---------------------------------------------------------------------- */
.hero__slide {
  transition: opacity 0.6s var(--ease-out-soft);
}
.hero__slide img {
  transform: scale(1);
  transition: transform 2.6s linear;
}
.hero__slide.is-active {
  opacity: 1;
  z-index: 1;
}
.hero__slide.is-active img {
  transform: scale(1.05);
}

/* Tier-2 rotating category label, positioned per-slide by JS via
   data-position on .hero__text ("left" | "right" | "bottom-left") */
.hero__pill {
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

/* Fixed hero copy: gentle staged entrance on first paint only */
.hero__label,
.hero__title,
.hero__subtitle,
.hero__ctas {
  opacity: 0;
  transform: translateY(20px);
  animation: hero-in var(--dur-slow) var(--ease-out) forwards;
}
.hero__label { animation-delay: 0.3s; }
.hero__title { animation-delay: 0.45s; }
.hero__subtitle { animation-delay: 0.6s; }
.hero__ctas { animation-delay: 0.75s; }

@keyframes hero-in {
  to { opacity: 1; transform: translateY(0); }
}

.hero__scroll-cue { animation: scrollcue-fade 1s var(--ease-out) 1.4s both; }
@keyframes scrollcue-fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .hero__slide img { transition: none; }
  .hero__slide.is-active img { transform: none; }
  .hero__label, .hero__title, .hero__subtitle, .hero__ctas {
    opacity: 1; transform: none; animation: none;
  }
}

/* ---------------------------------------------------------------------- */
/* Export-map route lines (Trust bar) — dashed stroke draw + soft loop    */
/* ---------------------------------------------------------------------- */
.route-line {
  fill: none;
  stroke: var(--color-gold);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 6 6;
  opacity: 0.7;
  stroke-dashoffset: 1000;
  animation: route-draw 3.5s var(--ease-out-soft) forwards, route-drift 40s linear infinite;
}
.route-line:nth-child(2) { animation-delay: 0.3s, 0s; }
.route-line:nth-child(3) { animation-delay: 0.6s, 0s; }
.route-line:nth-child(4) { animation-delay: 0.9s, 0s; }
.route-line:nth-child(5) { animation-delay: 1.2s, 0s; }

.route-dot {
  fill: var(--color-gold);
  animation: route-dot-pulse 2.4s var(--ease-out-soft) infinite;
}

@keyframes route-draw { to { stroke-dashoffset: 0; } }
@keyframes route-drift { to { stroke-dashoffset: -1000; } }
@keyframes route-dot-pulse {
  0%, 100% { opacity: 0.6; r: 3; }
  50% { opacity: 1; r: 4.5; }
}

/* ---------------------------------------------------------------------- */
/* Scroll reveal (JS/ScrollTrigger adds .is-visible; base state in        */
/* style.css .reveal). Stagger delay is set inline per-child by JS via   */
/* --reveal-delay so markup stays clean.                                 */
/* ---------------------------------------------------------------------- */
.reveal {
  transition: opacity 0.8s var(--ease-out) var(--reveal-delay, 0s),
              transform 0.8s var(--ease-out) var(--reveal-delay, 0s);
}

/* ---------------------------------------------------------------------- */
/* FAQ accordion answer open/close (JS sets inline max-height via GSAP;   */
/* this transition is the graceful no-JS fallback using [open] semantics) */
/* ---------------------------------------------------------------------- */
.faq__answer { transition: height var(--dur-base) var(--ease-out); }

/* ---------------------------------------------------------------------- */
/* Card image slow zoom on hover (see style.css .card__media img)         */
/* — declared here for discoverability, value lives with the component   */
/* ---------------------------------------------------------------------- */

/* ---------------------------------------------------------------------- */
/* Generic fade/slide-up utility for elements not using ScrollTrigger    */
/* ---------------------------------------------------------------------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up var(--dur-base) var(--ease-out) both; }

/* Spin for any loading affordance reused outside the main loader */
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------- */
/* Floating quick-contact stack (see style.css .fab-stack) — WhatsApp     */
/* halo pulse, expanding + fading outward.                                */
/* ---------------------------------------------------------------------- */
@keyframes fab-pulse {
  0%   { transform: scale(0.9); opacity: 0.7; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}
