html {
  scroll-behavior: smooth;
}

/* Animation base classes */
.fade-in,
.slide-left,
.slide-right {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.slide-left {
  transform: translateX(-40px);
}

.slide-right {
  transform: translateX(40px);
}

.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* Parallax background */
.parallax-bg {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

/* Hover lift effect */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Pulse animation */
@keyframes gentlePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 209, 0, 0.4);
  }
  50% {
    transform: scale(1.07);
    box-shadow: 0 0 12px 4px rgba(255, 209, 0, 0.3);
  }
}

.pulse-on-view.visible {
  animation: gentlePulse 3s infinite ease-in-out;
}

.pulse-on-view.hover-lift:hover {
  animation: none;
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Scroll to top button */
#scrollTopBtn {
  opacity: 0;
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #ffd100;
  color: #000;
  border-radius: 9999px;
  padding: 10px 14px;
  font-size: 1.5rem;
  cursor: pointer;
  border: none;
  z-index: 50;
  transition: opacity 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

#scrollTopBtn.show {
  opacity: 1;
  animation: gentlePulse 2.8s infinite ease-in-out;
}

#scrollTopBtn:hover {
  background-color: #000;
  color: #ffd100;
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

#scrollTopBtn::after {
  content: "Back to top";
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #000;
  color: #ffd100;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s;
}

#scrollTopBtn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

@media (max-width: 640px) {
  #scrollTopBtn {
    font-size: 1.25rem;
    padding: 8px 10px;
    bottom: 20px;
    right: 20px;
  }
  #scrollTopBtn::after {
    font-size: 0.65rem;
    padding: 3px 6px;
    bottom: 110%;
  }
}

/* Horizontal scroll animation for brand showcase */
@keyframes scroll-horizontal {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-35%);
  }
}

.animate-scroll-horizontal {
  display: flex;
  animation: scroll-horizontal 40s linear infinite;
  width: calc(200% + 2rem);
  will-change: transform;
}

.animate-scroll-horizontal:hover {
  animation-play-state: paused;
}

.animate-scroll-horizontal img {
  object-fit: cover;
  height: 16rem;
  width: 100%;
}

/* Accessibility and reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


.no-js .fade-in,
.no-js .slide-left,
.no-js .slide-right {
  opacity: 1 !important;
  transform: none !important;
}
