@import url("https://fonts.googleapis.com/css2?family=Epilogue:wght@500&display=swap");

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Epilogue, sans-serif;
  background-color: #090909;
  color: white;
  height: 100vh;
  display: grid;
  place-items: center;
}

.title {
  font-size: 4rem;
  font-weight: bold;
}

.title span {
  --duration: 2s;
  display: block;
  position: relative;
  overflow: hidden;
  margin-block: 4px;
  color: transparent;
  animation: reveal 1s calc(var(--delay) + var(--duration)) forwards;
}

.title span::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #1d59ac;
  transform: scaleX(0);
  transform-origin: left;
  animation: slideIn var(--duration) var(--delay) forwards,
    slideOut 1s calc(var(--delay) + var(--duration)) forwards;
}

@keyframes reveal {
  to {
    color: white;
  }
}

@keyframes slideIn {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(105%);
  }
}
