/* Animations CSS for ibericonogueira.com */

/* Scroll-based reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-delay-1 {
  transition-delay: 0.2s;
}

.reveal-delay-2 {
  transition-delay: 0.4s;
}

.reveal-delay-3 {
  transition-delay: 0.6s;
}

/* Image stacking/upward reveal effect */
.image-stack {
  position: relative;
  overflow: hidden;
}

.image-stack__item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateY(100px);
  transition: opacity 1s ease, transform 1s ease;
}

.image-stack__item.active {
  opacity: 1;
  transform: translateY(0);
}

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

/* Text fade-in animation */
.text-fade-in {
  opacity: 0;
  animation: textFadeIn 1.5s forwards;
}

@keyframes textFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Staggered text reveal */
.staggered-text span {
  /* display: inline-block; */ /* Removed to allow block display for hero title lines */
  opacity: 0;
  transform: translateY(20px);
}

.staggered-text.active span {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Generate transition delays for staggered text */
.staggered-text span:nth-child(1) { transition-delay: 0.1s; }
.staggered-text span:nth-child(2) { transition-delay: 0.15s; }
.staggered-text span:nth-child(3) { transition-delay: 0.2s; }
.staggered-text span:nth-child(4) { transition-delay: 0.25s; }
.staggered-text span:nth-child(5) { transition-delay: 0.3s; }
.staggered-text span:nth-child(6) { transition-delay: 0.35s; }
.staggered-text span:nth-child(7) { transition-delay: 0.4s; }
.staggered-text span:nth-child(8) { transition-delay: 0.45s; }
.staggered-text span:nth-child(9) { transition-delay: 0.5s; }
.staggered-text span:nth-child(10) { transition-delay: 0.55s; }
.staggered-text span:nth-child(11) { transition-delay: 0.6s; }
.staggered-text span:nth-child(12) { transition-delay: 0.65s; }
.staggered-text span:nth-child(13) { transition-delay: 0.7s; }
.staggered-text span:nth-child(14) { transition-delay: 0.75s; }
.staggered-text span:nth-child(15) { transition-delay: 0.8s; }
.staggered-text span:nth-child(16) { transition-delay: 0.85s; }
.staggered-text span:nth-child(17) { transition-delay: 0.9s; }
.staggered-text span:nth-child(18) { transition-delay: 0.95s; }
.staggered-text span:nth-child(19) { transition-delay: 1s; }
.staggered-text span:nth-child(20) { transition-delay: 1.05s; }

/* Hover effects */
.hover-lift {
  transition: transform 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* Page transitions */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  z-index: 9999;
  transform: translateY(100%);
}

.page-transition.active {
  transform: translateY(0);
  transition: transform 0.5s ease;
}

.page-transition.exit {
  transform: translateY(-100%);
  transition: transform 0.5s ease 0.3s;
}

/* Loading animation */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--background-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loader__spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Cursor effects */
.custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, background-color 0.3s;
}

.custom-cursor.active {
  width: 50px;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.1);
}

/* Scroll progress indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--accent-color);
  z-index: 9998;
  transition: width 0.1s;
}
