/* Moriveda Premium Animation Classes & Keyframes */

/* Reveal masks */
.reveal-wrapper {
  overflow: hidden;
  display: inline-block;
  vertical-align: bottom;
}

.reveal-text {
  display: inline-block;
  transform: translateY(110%);
}

.fade-up-trigger {
  opacity: 0;
  transform: translateY(30px);
}

.fade-in-trigger {
  opacity: 0;
}

/* Hero floating animation */
@keyframes floatAnimation {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(1deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

.floating-product {
  animation: floatAnimation 6s ease-in-out infinite;
}

/* Floating leaf particles */
@keyframes driftLeft {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.7;
  }
  100% {
    transform: translate(-100px, -600px) rotate(360deg) scale(1);
    opacity: 0;
  }
}

@keyframes driftRight {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 0;
  }
  15% {
    opacity: 0.6;
  }
  85% {
    opacity: 0.6;
  }
  100% {
    transform: translate(120px, -700px) rotate(-180deg) scale(0.7);
    opacity: 0;
  }
}

.leaf-particle {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
}

.leaf-particle-left {
  animation: driftLeft 15s linear infinite;
}

.leaf-particle-right {
  animation: driftRight 18s linear infinite;
}

/* Stripe-style background gradient shift */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero-bg-gradient {
  background: var(--gradient-hero);
  background-size: 300% 300%;
  animation: gradientShift 15s ease infinite;
}

/* Scrollytelling visual transitions */
.scrollytelling-container {
  position: relative;
  height: 400vh; /* Pinned for 4 sections of scroll */
  background-color: var(--bg-primary);
}

.scrollytelling-sticky {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 6rem;
  align-items: center;
  overflow: hidden;
  background-color: var(--bg-primary);
  padding: 0 8%;
}

.scrollytelling-visual {
  position: relative;
  width: 100%;
  height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.scrollytelling-content-layer {
  position: relative;
  width: 100%;
  height: 60vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  z-index: 20;
}

.scrolly-text {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.5vw, 3rem);
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(30px);
  position: absolute;
  width: 100%;
  text-align: left;
  line-height: 1.3;
}

.scrolly-text.active {
  opacity: 1;
  transform: translateY(0);
}

.visual-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.visual-image.active {
  opacity: 1;
}

/* Horizontal Scroll for Benefits */
.horizontal-scroll-section {
  position: relative;
  overflow: hidden;
}

.horizontal-scroll-container {
  display: flex;
  flex-wrap: nowrap;
  width: 300vw; /* 3 screens wide */
  height: 100vh;
  will-change: transform;
}

.horizontal-slide {
  width: 100vw;
  height: 100vh;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 100px 8% 5% 8%; /* Account for fixed header top clearance */
  background: var(--cream);
  box-sizing: border-box;
}

.horizontal-slide .container {
  width: 100%;
  flex-shrink: 0;
}

.horizontal-slide h2 {
  font-size: clamp(1.8rem, 3vw, 2.8rem) !important;
  line-height: 1.25 !important;
  margin-bottom: 1.2rem !important;
}

.slide-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.slide-visual img {
  max-height: 52vh;
  width: auto;
  object-fit: cover;
  border-radius: 24px;
}

/* 3D hover effects */
.tilt-card {
  transform-style: preserve-3d;
  transform: perspective(1000px);
}

.tilt-content {
  transform: translateZ(50px);
}

/* Magnetic button helper */
.btn-magnetic {
  display: inline-flex;
}

/* Accessibility / Reduced Motion Fallbacks */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
  
  .reveal-text {
    transform: none !important;
  }
  
  .fade-up-trigger {
    opacity: 1 !important;
    transform: none !important;
  }
  
  .floating-product {
    animation: none !important;
  }
  
  .leaf-particle {
    display: none !important;
  }
  
  .horizontal-scroll-container {
    display: block !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .horizontal-slide {
    width: 100% !important;
    height: auto !important;
    padding: 3rem 1rem !important;
  }
}
