/* ==========================================================================
   FoodSkout - High-Performance Scroll Animation System (60 FPS, GPU-Accelerated)
   ========================================================================== */

/* 1. Global Viewport Scroll Progress Line */
#scrollProgressBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #d94e34 0%, #d97706 50%, #276749 100%);
  z-index: 99999;
  pointer-events: none;
  transition: width 0.08s ease-out;
  box-shadow: 0 1px 4px rgba(217, 78, 52, 0.4);
}

/* 2. Scroll-Triggered Entrance Reveals */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

[data-reveal="fade"] {
  transform: translate3d(0, 0, 0);
  transition: opacity 0.9s ease;
}

[data-reveal="scale-up"] {
  transform: translate3d(0, 30px, 0) scale(0.95);
}

[data-reveal="left"] {
  transform: translate3d(-40px, 0, 0);
}

[data-reveal="right"] {
  transform: translate3d(40px, 0, 0);
}

/* Revealed State */
[data-reveal].revealed {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* In GSAP-driven mode, allow GSAP full transform/opacity control without transition conflicts */
body.gsap-active [data-reveal] {
  transition: none !important;
  opacity: 1;
  transform: none;
}

body.gsap-active #scrollProgressBar {
  transition: none !important;
}

/* Stagger Delays for Cards & Grids */
[data-stagger] > *:nth-child(1) { transition-delay: 0.05s; }
[data-stagger] > *:nth-child(2) { transition-delay: 0.14s; }
[data-stagger] > *:nth-child(3) { transition-delay: 0.23s; }
[data-stagger] > *:nth-child(4) { transition-delay: 0.32s; }
[data-stagger] > *:nth-child(5) { transition-delay: 0.41s; }
[data-stagger] > *:nth-child(6) { transition-delay: 0.50s; }

/* 3. Parallax Media Elements */
[data-parallax] {
  will-change: transform;
  transition: transform 0.1s cubic-bezier(0, 0, 0.2, 1);
}

/* 4. Recipe Card Subtle Hover Elevation */
.recipe-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.recipe-card:hover {
  transform: translate3d(0, -6px, 0);
  box-shadow: 0 16px 24px -6px rgba(0, 0, 0, 0.08), 0 6px 10px -4px rgba(0, 0, 0, 0.04);
}

.recipe-card-img {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.recipe-card:hover .recipe-card-img {
  transform: scale(1.04);
}

/* 5. Floating Back-to-Top Indicator Pill */
#backToTopBtn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--dark-heading);
  border: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, color 0.2s ease;
}

#backToTopBtn.visible {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
}

#backToTopBtn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translate3d(0, -3px, 0);
}
