/* ================================
   Hero Keyword Animations
   Animated background keywords for hero section
   ================================ */

/* Ensure proper z-index layering for hero elements */
.hero::before {
  z-index: 0;
}

.hero-keywords {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  z-index: 2 !important;
}

.keyword {
  position: absolute;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  animation-fill-mode: both;
  text-shadow: 0 0 20px rgba(70, 130, 180, 0.3);
}

/* Keyframe Animation - Soft Fade In/Out */
@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  15% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  85% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
}

/* Individual Keyword Positioning and Timing */
/* One-time cycle - keywords appear once and fade out */

.keyword-1 {
  top: 15%;
  left: 8%;
  font-size: 1.7rem;
  animation: fadeInOut 6s ease-in-out 1.5s 1;
}

.keyword-2 {
  bottom: 30%;
  right: 12%;
  font-size: 1.4rem;
  animation: fadeInOut 5s ease-in-out 2.5s 1;
}

.keyword-3 {
  top: 40%;
  right: 8%;
  font-size: 1.5rem;
  animation: fadeInOut 7s ease-in-out 3s 1;
}

.keyword-4 {
  bottom: 20%;
  left: 15%;
  font-size: 1.3rem;
  animation: fadeInOut 5.5s ease-in-out 4s 1;
}

.keyword-5 {
  top: 20%;
  right: 15%;
  font-size: 1.6rem;
  animation: fadeInOut 6.5s ease-in-out 4.5s 1;
}

.keyword-6 {
  bottom: 35%;
  left: 10%;
  font-size: 1.4rem;
  animation: fadeInOut 5s ease-in-out 5.5s 1;
}

.keyword-7 {
  top: 35%;
  left: 12%;
  font-size: 1.8rem;
  animation: fadeInOut 7s ease-in-out 6s 1;
}

.keyword-8 {
  bottom: 25%;
  right: 18%;
  font-size: 1.3rem;
  animation: fadeInOut 5.5s ease-in-out 7s 1;
}

.keyword-9 {
  top: 18%;
  left: 10%;
  font-size: 1.4rem;
  animation: fadeInOut 6s ease-in-out 7.5s 1;
}

.keyword-10 {
  bottom: 32%;
  right: 10%;
  font-size: 1.6rem;
  animation: fadeInOut 6.5s ease-in-out 8.5s 1;
}

.keyword-11 {
  top: 42%;
  right: 14%;
  font-size: 1.5rem;
  animation: fadeInOut 5s ease-in-out 9s 1;
}

.keyword-12 {
  bottom: 28%;
  left: 18%;
  font-size: 1.4rem;
  animation: fadeInOut 7s ease-in-out 10s 1;
}

.keyword-13 {
  top: 22%;
  right: 8%;
  font-size: 1.3rem;
  animation: fadeInOut 5.5s ease-in-out 10.5s 1;
}

.keyword-14 {
  bottom: 38%;
  left: 15%;
  font-size: 1.6rem;
  animation: fadeInOut 6s ease-in-out 11.5s 1;
}

.keyword-15 {
  top: 38%;
  left: 8%;
  font-size: 1.7rem;
  animation: fadeInOut 6.5s ease-in-out 12s 1;
}

.keyword-16 {
  bottom: 22%;
  right: 15%;
  font-size: 1.4rem;
  animation: fadeInOut 5s ease-in-out 13s 1;
}

.keyword-17 {
  top: 16%;
  right: 12%;
  font-size: 1.8rem;
  animation: fadeInOut 7s ease-in-out 13.5s 1;
}

.keyword-18 {
  bottom: 34%;
  left: 12%;
  font-size: 1.3rem;
  animation: fadeInOut 5.5s ease-in-out 14.5s 1;
}

.keyword-19 {
  top: 45%;
  right: 10%;
  font-size: 1.5rem;
  animation: fadeInOut 6s ease-in-out 15s 1;
}

.keyword-20 {
  bottom: 26%;
  left: 8%;
  font-size: 1.6rem;
  animation: fadeInOut 6.5s ease-in-out 16s 1;
}

.keyword-21 {
  top: 24%;
  left: 16%;
  font-size: 1.4rem;
  animation: fadeInOut 5s ease-in-out 16.5s 1;
}

.keyword-22 {
  bottom: 36%;
  right: 12%;
  font-size: 1.5rem;
  animation: fadeInOut 7s ease-in-out 17.5s 1;
}

.keyword-23 {
  top: 36%;
  right: 16%;
  font-size: 1.7rem;
  animation: fadeInOut 5.5s ease-in-out 18s 1;
}

.keyword-24 {
  bottom: 24%;
  left: 14%;
  font-size: 1.6rem;
  animation: fadeInOut 6s ease-in-out 19s 1;
}

.keyword-25 {
  top: 52%;
  right: 22%;
  font-size: 1.5rem;
  animation: fadeInOut 6.5s ease-in-out 20s 1;
}

.keyword-26 {
  bottom: 18%;
  right: 28%;
  font-size: 1.6rem;
  animation: fadeInOut 6s ease-in-out 21s 1;
}

/* CTA Button Border Trace Animation - Draws attention after keywords finish */
.hero .btn-primary {
  position: relative;
  overflow: visible;
}

.hero .btn-primary::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 6px;
  border: 3px solid white;
  opacity: 0;
  pointer-events: none;
  clip-path: polygon(0 0, 0 0, 0 0, 0 0);
  animation: traceBorder 1.2s ease-in-out 11s 1, traceBorder 1.2s ease-in-out 22s 1;
}

@keyframes traceBorder {
  0% {
    opacity: 1;
    clip-path: polygon(0 0, 0 0, 0 0, 0 0);
  }
  25% {
    opacity: 1;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
  }
  50% {
    opacity: 1;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
  }
  75% {
    opacity: 1;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
  90% {
    opacity: 1;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
  100% {
    opacity: 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

/* Mobile Responsiveness - Reduce density and size on smaller screens */
@media (max-width: 768px) {
  /* Hide some keywords on mobile to reduce clutter */
  .keyword-3,
  .keyword-5,
  .keyword-8,
  .keyword-11,
  .keyword-25,
  .keyword-26 {
    display: none;
  }

  /* Reduce font sizes for remaining keywords */
  .keyword {
    font-size: 1rem !important;
  }

  .keyword-1,
  .keyword-4,
  .keyword-7,
  .keyword-10 {
    font-size: 1.2rem !important;
  }

  /* Adjust positioning for mobile */
  .keyword-1 {
    top: 12%;
    left: 5%;
  }

  .keyword-2 {
    top: 22%;
    left: 10%;
  }

  .keyword-4 {
    top: 15%;
    right: 8%;
  }

  .keyword-6 {
    top: 48%;
    right: 10%;
  }

  .keyword-7 {
    bottom: 28%;
    left: 8%;
  }

  .keyword-9 {
    bottom: 18%;
    left: 12%;
  }

  .keyword-10 {
    bottom: 32%;
    right: 5%;
  }

  .keyword-12 {
    bottom: 40%;
    right: 3%;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .keyword {
    font-size: 0.9em;
  }
}

/* Accessibility - Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .keyword {
    animation: none;
    opacity: 0.15;
  }
}
