.relative {
  position: relative;
  height: 50px;
}

/* #region Leaf Effect on Page */
.leaf {
  position: absolute;
  animation-name: fall;
  animation-duration: 15s;
  /* Smooth easing */
  animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
  animation-iteration-count: infinite;
  top: -30px;
  left: 0;
  opacity: 100;
}

.leaf:nth-child(1) {
  left: 5%;
  animation-delay: 0.2s;
}

.leaf:nth-child(2) {
  left: 10%;
  animation-delay: .8s;
}

.leaf:nth-child(3) {
  left: 25%;
  animation-delay: 0s;
}

.leaf:nth-child(4) {
  left: 35%;
  animation-delay: 0.6s;
}

.leaf:nth-child(5) {
  left: 50%;
  animation-delay: 0.4s;
}

.leaf:nth-child(6) {
  left: 60%;
  animation-delay: 1.3s;
}

.leaf:nth-child(7) {
  left: 75%;
  animation-delay: 0.7s;
}

.leaf:nth-child(8) {
  left: 85%;
  animation-delay: 1.7s;
}

.leaf:nth-child(9) {
  left: 90%;
  animation-delay: 0.6s;
}

.leaf:nth-child(10) {
  left: 95%;
  animation-delay: 0.2s;
}

@keyframes fall {
  to {
    transform: translateY(100vh) rotate(360deg);
    /* Fall to bottom and rotate */
    opacity: 0;
    /* Fade out */
  }
}

/* #endregion Leaf */

/* #region prepare-css-animations.html Activity: Part 1 — loading icon using animation */

.loader {
  margin: 2rem;
  width: 50px;
  height: 50px;
  border: 5px solid transparent;
  border-color: #999 transparent #999 transparent;
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
  box-shadow: 0 0 2rem rgb(0 0 255 / 40%);
}

.loader::after {
  content: '⚙️';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.25);
  }
}

/* #endregion Activity: Part 1 */

/* #region Activity: Part 2 — loading icon using transition */
.loader-t {
  margin: 2rem;
  width: 50px;
  height: 50px;
  border: 5px solid transparent;
  border-color: #999 transparent #999 transparent;
  border-radius: 50%;
  transition: transform 1.5s linear;
  box-shadow: 0 0 2rem rgb(0 0 255 / 40%);
}

.loader-t::after {
  content: '⚙️'; 
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 1.5s ease-in-out;
  font-size: 2rem;
}

.loader-t:hover {
  transform: rotate(360deg); /* Rotate on hover */
}

.loader-t:hover::after {
  transform: translate(-50%, -50%) scale(1.5); /* Scale on hover */
}

/* #endregion Activity: Part 2 */