/* Modern Parallax Scroll Effects */

/* Enhanced Smooth scrolling for the entire page */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  /* `clip`, not `hidden`: an axis set to `hidden` turns the body into a scroll
     container and computes the other axis to `auto`, which makes every
     `position: sticky` descendant resolve against a scrollport that never
     scrolls — the sticky site header stops sticking. `clip` clips exactly the
     same way without creating that scroll container. */
  overflow-x: clip;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scroll-padding-top: 80px;
}

/* Smooth scrolling momentum for mobile devices */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Optimize scroll performance */
.parallax-section,
.parallax-bg,
.parallax-content {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
}

/* Parallax Container */
.parallax-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Parallax Background Layer */
.parallax-bg {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  background-size: cover;
  background-position: center;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  z-index: 0;
}

/* Parallax Content Overlay */
.parallax-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%);
  z-index: 1;
}

/* Parallax Content */
.parallax-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Parallax Text Animation */
.parallax-title {
  font-size: 4rem;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(50px);
  animation: fadeInUp 1s ease forwards;
  text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

.parallax-subtitle {
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 30px;
  opacity: 0;
  transform: translateY(50px);
  animation: fadeInUp 1s ease 0.3s forwards;
  text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.5);
  font-weight: 300;
  letter-spacing: 1px;
}

.parallax-description {
  font-size: 1.2rem;
  color: #f0f0f0;
  max-width: 800px;
  margin: 0 auto 40px;
  opacity: 0;
  transform: translateY(50px);
  animation: fadeInUp 1s ease 0.6s forwards;
  line-height: 1.8;
}

/* Fade In Up Animation */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Floating Elements */
.parallax-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Parallax Cards */
.parallax-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 60px;
  padding: 0 20px;
}

.parallax-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: translateY(0);
  opacity: 0;
  animation: fadeInUp 1s ease forwards;
}

.parallax-card:nth-child(1) { animation-delay: 0.8s; }
.parallax-card:nth-child(2) { animation-delay: 1s; }
.parallax-card:nth-child(3) { animation-delay: 1.2s; }

.parallax-card:hover {
  transform: translateY(-15px) scale(1.05);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.parallax-card-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  color: #ffffff;
  display: inline-block;
  transition: transform 0.3s ease;
}

.parallax-card:hover .parallax-card-icon {
  transform: scale(1.2) rotate(360deg);
}

.parallax-card h3 {
  color: #ffffff;
  font-size: 1.8rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.parallax-card p {
  color: #e0e0e0;
  font-size: 1rem;
  line-height: 1.6;
}

/* Wave Effect */
.parallax-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  z-index: 2;
}

.parallax-wave svg {
  width: 100%;
  height: 100%;
}

/* Particles Background */
.parallax-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: bounce 2s infinite;
}

.scroll-indicator span {
  display: block;
  width: 30px;
  height: 50px;
  border: 2px solid #ffffff;
  border-radius: 25px;
  position: relative;
}

.scroll-indicator span::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  background: #ffffff;
  border-radius: 50%;
  animation: scrollWheel 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

@keyframes scrollWheel {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Modern Button Styles */
.parallax-btn {
  display: inline-block;
  padding: 15px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, #4b67e6 0%, #764ba2 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.parallax-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  transition: left 0.3s ease;
  z-index: -1;
}

.parallax-btn:hover::before {
  left: 0;
}

.parallax-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
  color: #ffffff;
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .parallax-title {
    font-size: 2.5rem;
  }
  
  .parallax-subtitle {
    font-size: 1.2rem;
  }
  
  .parallax-description {
    font-size: 1rem;
  }
  
  .parallax-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .parallax-card {
    padding: 30px 20px;
  }
}

@media (max-width: 480px) {
  .parallax-title {
    font-size: 2rem;
  }
  
  .parallax-subtitle {
    font-size: 1rem;
  }
  
  .parallax-btn {
    padding: 12px 30px;
    font-size: 1rem;
  }
}

/* Glassmorphism Effect */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Reveal on Scroll Animation

   `.reveal` used to start at `opacity: 0` and wait for client JS to add
   `.active`. This file is render-blocking while that JS is not, so every
   `.reveal` block on the page stayed blank until hydration finished — the
   blank sections that appeared on a cold load and went away on reload.
   Section entrances are now owned by the `.ha-scroll-reveal` system in
   ClientUiEffects, which adds its own hidden state from JS and therefore
   cannot strand content. These rules are kept inert so any remaining
   `.active` toggles are harmless. */
.reveal,
.reveal.active {
  opacity: 1;
  transform: none;
}

/* Parallax Speed Classes */
.parallax-slow { transform: translateY(calc(var(--scroll) * 0.3px)); }
.parallax-medium { transform: translateY(calc(var(--scroll) * 0.5px)); }
.parallax-fast { transform: translateY(calc(var(--scroll) * 0.8px)); }
