/* Kyndweb custom styles: scroll reveal & subtle card hover
   This file is loaded on top of Tailwind's generated CSS.
*/

/* Reveal animation states (legacy, still supported for now) */
.reveal-init {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(8px);
  transition:
    opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.8s cubic-bezier(0.19, 1, 0.22, 1),
    filter 0.8s cubic-bezier(0.19, 1, 0.22, 1);
  will-change: opacity, transform, filter;
}

.reveal-show {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* Direction variants adjust the initial transform only */
.reveal-dir-up.reveal-init {
  transform: translateY(16px);
}

.reveal-dir-down.reveal-init {
  transform: translateY(-16px);
}

.reveal-dir-left.reveal-init {
  transform: translateX(-16px);
}

.reveal-dir-right.reveal-init {
  transform: translateX(16px);
}

.reveal-dir-fade.reveal-init {
  transform: translateY(0);
}

/* Subtle card hover effect */
.card-hover {
  transition:
    transform 0.25s ease-out,
    border-color 0.25s ease-out,
    box-shadow 0.25s ease-out;
}

.card-hover:hover {
  transform: translateY(-2px);
  border-color: rgba(218, 165, 32, 0.4); /* gold/40 */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-init,
  .reveal-show {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

  .card-hover,
  .card-hover:hover {
    transform: none !important;
    transition: none !important;
    box-shadow: none !important;
  }
}

/* ================================
   Navigation active underline
   ================================ */

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 0.1rem;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(218, 165, 32, 0.25), rgba(218, 165, 32, 0.9));
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  transition:
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link:hover::after {
  transform: scaleX(1);
  opacity: 1;
}

.nav-link-active {
  color: #facc6b !important; /* close to Tailwind gold-300 */
}

.nav-link-active::after {
  transform: scaleX(1);
  opacity: 1;
}

/* ================================
   Premium motion system (motion.js)
   ================================ */

/* Base motion class */
.motion {
  will-change: transform, opacity, filter;
  transition-property: transform, opacity, filter;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Initial state */
.motion-init {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.985);
  filter: blur(10px);
}

/* Shown state */
.motion-shown {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

/* Variants */
.motion-fade-up.motion-init {
  transform: translate3d(0, 18px, 0) scale(0.985);
}

.motion-fade-down.motion-init {
  transform: translate3d(0, -18px, 0) scale(0.985);
}

.motion-fade-left.motion-init {
  transform: translate3d(-18px, 0, 0) scale(0.985);
}

.motion-fade-right.motion-init {
  transform: translate3d(18px, 0, 0) scale(0.985);
}

.motion-scale-in.motion-init {
  opacity: 0;
  transform: scale(0.96);
  filter: blur(8px);
}

/* Mobile tuning */
@media (max-width: 640px) {
  .motion-init {
    transform: translate3d(0, 12px, 0) scale(0.99);
    filter: blur(6px);
  }

  .motion-fade-up.motion-init {
    transform: translate3d(0, 12px, 0) scale(0.99);
  }

  .motion-fade-down.motion-init {
    transform: translate3d(0, -12px, 0) scale(0.99);
  }

  .motion-fade-left.motion-init {
    transform: translate3d(-12px, 0, 0) scale(0.99);
  }

  .motion-fade-right.motion-init {
    transform: translate3d(12px, 0, 0) scale(0.99);
  }
}

/* Reduced motion: disable animations */
@media (prefers-reduced-motion: reduce) {
  .motion,
  .motion-init,
  .motion-shown {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}


