/* ==========================================================================
   Nulectrics — Animations
   Gradient border button, hover effects, link animations
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Animated Gradient Border Button (Nav Contact)
   -------------------------------------------------------------------------- */

.nu-gradient-btn {
  position: relative;
  display: inline-block;
  transition: all 1s ease-in-out;
}

.nu-gradient-btn__link {
  display: block;
  font-family: var(--nu-font);
  font-weight: var(--nu-fw-bold);
  font-size: var(--nu-fs-body);
  padding: 7px 19px;
  background-color: #000;
  border: none;
  color: var(--nu-white);
  text-align: center;
  text-decoration: none;
  transition: background-color 0.2s ease-in-out;
  width: 160px;
  position: relative;
  z-index: 1;
}

.nu-gradient-btn__link:hover {
  background-color: #121212;
  text-decoration: none;
  color: var(--nu-white);
  transition: background-color 2s ease-in-out;
}

.nu-gradient-btn__bg {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 100%;
  height: calc(100% + 4px);
  background: linear-gradient(90deg, #000 0%, #000 16.43%, #119F6B 33%, #87CC9F 68.23%, #17B5B7 100%);
  background-size: 600% 600%;
  z-index: 0;
  transform: translate(-1px, -1px);
  transition: all 1s ease-in-out;
  animation-duration: 1300ms;
  animation-name: nu-gradient-out;
}

.nu-gradient-btn:hover .nu-gradient-btn__bg {
  background: linear-gradient(90deg, #FF8038 0%, #FF0099 13.43%, #00EBEB 68.23%, #DB00FF 100%);
  background-size: 600% 600%;
  transition: all 0.1s ease-in;
  animation-duration: 32s;
  animation-name: nu-gradient-in;
}

@keyframes nu-gradient-in {
  0% { background-position: 0% 50%; }
  2% { background-position: 53% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes nu-gradient-out {
  0% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Mobile */
@media (max-width: 767px) {
  .nu-gradient-btn__link {
    font-size: var(--nu-fs-body);
    padding: 5px 12px;
    width: 100px;
  }
}

/* --------------------------------------------------------------------------
   2. Footer Link Hover Animation
   -------------------------------------------------------------------------- */

.nu-link-animated {
  background-image: linear-gradient(45deg, var(--nu-gradient-green-end), var(--nu-gradient-green-start));
  background-position: 100% 100%;
  background-size: 100% 2px;
  background-repeat: no-repeat;
  display: inline;
  padding-bottom: 5px;
  transition: background-size 0.3s ease-in-out;
}

.nu-link-animated:hover {
  animation: nu-link-hover 0.8s ease-in-out forwards;
  text-decoration: none;
}

@keyframes nu-link-hover {
  0% {
    background-position: 100% 100%;
    background-size: 100% 2px;
  }
  50% {
    background-position: 100% 100%;
    background-size: 0 2px;
  }
  51% {
    background-position: 0 100%;
    background-size: 0 2px;
  }
  100% {
    background-position: 0 100%;
    background-size: 100% 2px;
  }
}

/* --------------------------------------------------------------------------
   3. Fade-in on scroll (progressive enhancement)
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .nu-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  }

  .nu-fade-in--visible {
    opacity: 1;
    transform: translateY(0);
  }
}

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