/* Custom styles that sit alongside Tailwind's utility classes */

html {
  scroll-behavior: smooth;
}

/* Rotating greeting in the hero */
#greeting {
  display: inline-block;
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}

#greeting.is-fading {
  opacity: 0;
  transform: translateY(0.25em);
}

/* Waving hand on the "Say hello" button */
#wave {
  display: inline-block;
  transform-origin: 70% 70%;
}

#wave.is-waving {
  animation: wave 900ms ease-in-out;
}

@keyframes wave {
  0%,
  100% {
    transform: rotate(0deg);
  }
  20% {
    transform: rotate(14deg);
  }
  40% {
    transform: rotate(-8deg);
  }
  60% {
    transform: rotate(14deg);
  }
  80% {
    transform: rotate(-4deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #greeting {
    transition: none;
  }

  #wave.is-waving {
    animation: none;
  }
}
