/* ==========================================================================
   MATEREX BAKERY — ADVANCED MOTION, PARALLAX & VISUAL STORYTELLING ENGINE
   ========================================================================== */

/* Keyframe Animations */

@keyframes floatSmooth {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1.5deg);
  }
}

@keyframes floatDelayed {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(-1deg);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(230, 81, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(230, 81, 0, 0);
  }
}

@keyframes auraPulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.08);
  }
}

@keyframes loafMorphIn {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.92) rotate(-2deg);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
    filter: blur(0px);
  }
}

/* PARALLAX VISUAL STORYTELLING UTILITIES */

.story-section {
  position: relative;
  overflow: hidden;
}

.story-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  filter: brightness(0.9) contrast(1.05);
}

.story-section:hover .story-bg-layer {
  transform: scale(1.03);
}

/* Gradient Mask Blenders for Seamless Section Edges */
.gradient-mask-cream {
  position: relative;
}

.gradient-mask-cream::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, var(--bg-warm-cream) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.gradient-mask-cream::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--bg-warm-cream) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.gradient-mask-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, var(--dark-void) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.gradient-mask-dark::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--dark-void) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

/* Glass Story Cards */
.glass-story-card {
  position: relative;
  z-index: 3;
  background: rgba(255, 253, 249, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  box-shadow: 0 30px 60px -15px rgba(28, 25, 23, 0.15);
}

.glass-story-card-dark {
  position: relative;
  z-index: 3;
  background: rgba(28, 25, 23, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  color: #FFFFFF;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.4);
}

/* Animation Utility Classes */

.animate-float {
  animation: floatSmooth 5s ease-in-out infinite;
}

.animate-float-delayed {
  animation: floatDelayed 6s ease-in-out infinite 1s;
}

.animate-pulse-glow {
  animation: pulseGlow 2.5s infinite;
}

.hero-aura {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(230, 81, 0, 0.15) 0%, rgba(245, 158, 11, 0.08) 50%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  animation: auraPulse 4s ease-in-out infinite;
  pointer-events: none;
}


.hero-loaf-active {
  animation: loafMorphIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Indicator Dots */
.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(28, 25, 23, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-dot.is-active {
  width: 28px;
  border-radius: 999px;
  background: var(--primary-orange);
}

/* Reveal on Scroll Elements */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger Delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
  .animate-float,
  .animate-float-delayed,
  .animate-pulse-glow,
  .hero-aura,
  .story-bg-layer {
    animation: none !important;
    transform: none !important;
  }

  .reveal-on-scroll {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
