/* Scroll-Reveal Animations (AOS-style) */
body {
  overflow-x: clip;
}

/* Slide from top */
body [data-aos="slide-down"] {
  opacity: 0;
  transform: translateY(-48px);
  transition:
    opacity 2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body [data-aos="slide-down"].aos-animate {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Slide from bottom (default 150ms delay) */
body [data-aos="slide-up"] {
  opacity: 0;
  transform: translateY(48px);
  transition:
    opacity 2s cubic-bezier(0.22, 1, 0.36, 1) 150ms,
    transform 2s cubic-bezier(0.22, 1, 0.36, 1) 150ms,
    box-shadow 0.2s ease;
  will-change: opacity, transform;
}

body [data-aos="slide-up"].aos-animate {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

/* Slide right (enters from outside left edge of screen) */
body [data-aos="slide-right"] {
  opacity: 0;
  transform: translateX(-100vw);
  transition:
    opacity 2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body [data-aos="slide-right"].aos-animate {
  opacity: 1;
  transform: translateX(0);
  will-change: auto;
}

/* Slide left (enters from outside right edge of screen) */
body [data-aos="slide-left"] {
  opacity: 0;
  transform: translateX(100vw);
  transition:
    opacity 2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body [data-aos="slide-left"].aos-animate {
  opacity: 1;
  transform: translateX(0);
  will-change: auto;
}

/* Fade */
body [data-aos="fade"] {
  opacity: 0;
  transition:
    opacity 2s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
  will-change: opacity;
}

body [data-aos="fade"].aos-animate {
  opacity: 1;
  will-change: auto;
}

/* Zoom out */
body [data-aos="zoom-out"] {
  opacity: 0;
  transform: scale(1.5);
  transition:
    opacity 2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body [data-aos="zoom-out"].aos-animate {
  opacity: 1;
  transform: scale(1);
  will-change: auto;
}

/* Flip down (AOS-style 3D hinge flip from top) */
body [data-aos="flip-down"] {
  opacity: 0;
  backface-visibility: hidden;
  transform-origin: top center;
  transform: perspective(2500px) rotateX(100deg);
  transition:
    opacity 2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body [data-aos="flip-down"].aos-animate {
  opacity: 1;
  transform: perspective(2500px) rotateX(0deg);
  will-change: auto;
}

/* AOS-style duration modifiers */
body [data-aos][data-aos-duration="1000"] {
  transition-duration: 1000ms;
}

/* AOS-style delay modifiers */
body [data-aos][data-aos-delay="0"] {
  transition-delay: 0ms;
}

body [data-aos][data-aos-delay="100"] {
  transition-delay: 100ms;
}

body [data-aos][data-aos-delay="150"] {
  transition-delay: 150ms;
}

body.no-card-animation [data-aos="fade"],
body.no-card-animation [data-aos="slide-down"],
body.no-card-animation [data-aos="slide-up"],
body.no-card-animation [data-aos="slide-left"],
body.no-card-animation [data-aos="slide-right"],
body.no-card-animation [data-aos="zoom-out"],
body.no-card-animation [data-aos="flip-down"] {
  opacity: 1 !important;
  transform: none !important;
  transition: box-shadow 0.2s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  body [data-aos="fade"],
  body [data-aos="slide-down"],
  body [data-aos="slide-up"],
  body [data-aos="slide-left"],
  body [data-aos="slide-right"],
  body [data-aos="zoom-out"],
  body [data-aos="flip-down"] {
    opacity: 1 !important;
    transform: none !important;
    transition: box-shadow 0.2s ease !important;
  }
}
