/* ============================================================
   LydiaCheriyan.com — animations.css
   Motion: slow, deliberate, editorial
   Partners with GSAP ScrollTrigger
   ============================================================ */

/* ----------------------------------------
   KEYFRAMES
   ---------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scrollPulse {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* ----------------------------------------
   GSAP INITIAL STATES
   Elements start hidden; GSAP animates to visible.
   If JS fails, .no-js fallback shows everything.
   ---------------------------------------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  will-change: opacity, transform;
}

.animate-on-scroll--fade {
  opacity: 0;
  will-change: opacity;
}

.animate-on-scroll--left {
  opacity: 0;
  transform: translateX(-60px);
  will-change: opacity, transform;
}

.animate-on-scroll--scale {
  opacity: 0;
  transform: scale(0.92);
  will-change: opacity, transform;
}

/* No-JS fallback — everything visible */
.no-js .animate-on-scroll,
.no-js .animate-on-scroll--fade,
.no-js .animate-on-scroll--left,
.no-js .animate-on-scroll--scale {
  opacity: 1;
  transform: none;
}

/* ----------------------------------------
   HERO INITIAL STATES
   ---------------------------------------- */
.hero__tagline .word {
  opacity: 0;
  transform: translateY(30px);
  display: inline-block;
  will-change: opacity, transform;
}

.hero__sub {
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
}

.hero__malay {
  opacity: 0;
  will-change: opacity;
}

.hero__scroll-cue {
  opacity: 0;
  will-change: opacity;
}

/* No-JS hero fallback */
.no-js .hero__tagline .word,
.no-js .hero__sub,
.no-js .hero__malay,
.no-js .hero__scroll-cue {
  opacity: 1;
  transform: none;
}

/* ----------------------------------------
   PROVERB INITIAL STATES
   ---------------------------------------- */
.language__proverb .word {
  opacity: 0;
  transform: translateY(20px);
  display: inline-block;
  will-change: opacity, transform;
}

.no-js .language__proverb .word {
  opacity: 1;
  transform: none;
}

/* ----------------------------------------
   CRAFT GRID — clip-path reveal
   ---------------------------------------- */
.craft__grid-item {
  clip-path: inset(50% 50% 50% 50%);
  will-change: clip-path, opacity;
}

.no-js .craft__grid-item {
  clip-path: none;
  opacity: 1;
}

/* ----------------------------------------
   MILESTONES — stagger
   ---------------------------------------- */
.milestone {
  opacity: 0;
  transform: translateY(20px);
  will-change: opacity, transform;
}

.no-js .milestone {
  opacity: 1;
  transform: none;
}

/* ----------------------------------------
   HOVER TRANSITION TIMING
   ---------------------------------------- */
.link-hover::after,
.social-link::after {
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn::before {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.craft__grid-item img {
  transition: filter 0.7s cubic-bezier(0.65, 0, 0.35, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ----------------------------------------
   REDUCED MOTION
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll,
  .animate-on-scroll--fade,
  .animate-on-scroll--left,
  .animate-on-scroll--scale,
  .hero__tagline .word,
  .hero__sub,
  .hero__malay,
  .hero__scroll-cue,
  .language__proverb .word,
  .milestone {
    opacity: 1;
    transform: none;
  }

  .craft__grid-item {
    clip-path: none;
    opacity: 1;
  }

  .craft__grid-item:hover img { transform: none; }
}
