@use "@styles/reset" as *;

.root {
  width: 100%;
  height: 100vh;
  display: grid;
  place-items: center;
}

.container {
  width: 100%;
  max-width: 400px;
  text-align: center;
  color: black;
  margin: 0 32px;
  position: relative;

  &:before {
    content: "";
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: #000;
    bottom: 0;
    left: 0;
    border-radius: 10px;
    animation: movingLine 2.4s infinite ease-in-out;
  }

  &_text {
    font-size: 3vw;
    line-height: 30px;
    letter-spacing: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-evenly;

    span {
      font-family: "MS Sans Serif Bold";
      animation: moveLetters 2.4s infinite ease-in-out;
      transform: translatex(0);
      position: relative;
      display: inline-block;
      opacity: 0;
      text-shadow: 0px 2px 10px rgba(46, 74, 81, 0.3);
    }

    @for $i from 1 through 7 {
      span:nth-child(#{$i}) {
        animation-delay: $i * 0.1s;
      }
    }
  }
}

@keyframes movingLine {
  0% {
    opacity: 0;
    width: 0;
  }

  33.3%,
  66% {
    opacity: 0.8;
    width: 100%;
  }

  85% {
    width: 0;
    left: initial;
    right: 0;
    opacity: 1;
  }

  100% {
    opacity: 0;
    width: 0;
  }
}

@keyframes moveLetters {
  0% {
    transform: translateX(-15vw);
    opacity: 0;
  }

  33.3%,
  66% {
    transform: translateX(0);
    opacity: 1;
  }

  100% {
    transform: translateX(15vw);
    opacity: 0;
  }
}
