/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes checkmark {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes shooting-star {
  0% {
    transform: translateX(0) translateY(0) rotate(45deg);
    opacity: 1;
  }

  100% {
    transform: translateX(-1000px) translateY(1000px) rotate(45deg);
    opacity: 0;
  }
}

/* Animation Mixins */
@mixin fade-animation($direction: 'up', $distance: 20px) {
  @keyframes fade-#{$direction} {
    from {
      opacity: 0;
      transform: translate#{if($direction == 'up', 'Y', 'X')}(-#{$distance});
    }

    to {
      opacity: 1;
      transform: translate#{if($direction == 'up', 'Y', 'X')}(0);
    }
  }
}

@mixin scale-animation($scale: 1.2) {
  @keyframes scale {
    0% {
      transform: scale(0);
    }

    50% {
      transform: scale($scale);
    }

    100% {
      transform: scale(1);
    }
  }
}

/* Using mixins */
@include fade-animation('up', 20px);
@include scale-animation(1.2);

/* Typewriter Animation */
.typed-cursor {
  opacity: 1;
  animation: typedjsBlink 0.7s infinite;
  color: var(--primary-color);
  font-weight: bold;
  display: inline-block;
  width: 2px;
  height: 1em;
  background-color: var(--primary-color);
  margin-left: 2px;
  vertical-align: middle;
}

@keyframes typedjsBlink {
  50% {
    opacity: 0.0;
  }
}

.typed-fade-out {
  opacity: 0;
  animation: 0;
  transition: opacity .25s;
}

.typed-cursor.typed-cursor--blink {
  animation: typedjsBlink 0.7s infinite;
  -webkit-animation: typedjsBlink 0.7s infinite;
}

.hero h1 {
  min-height: 1.2em;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--primary-color);
  animation:
    typing 2s steps(40, end),
    blink .75s step-end infinite;
  margin: 0 auto;
  width: 100%;
}

.typewriter-container {
  display: inline-block;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* Shooting Stars */
.shooting-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: shooting-star 3s infinite;
  z-index: 1;
}

/* Particles Background */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
  background: var(--background);
  opacity: 0.5;
}