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

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

body {
  font-family: "Poppins", sans-serif;
  min-height: 100vh;
  background-color: #051215;
  display: grid;
  place-items: center;
  color: white;
}

.btn {
  all: unset;
  font-size: 18px;
  padding: 0.8rem 3rem;
  background-color: #fefefe;
  color: black;
  line-height: 1.5;
  font-weight: 600;
  border: 2px solid white;
  border-radius: 1000px;
  position: relative;
  overflow: hidden;
  z-index: 0;
  cursor: pointer;
}

.btn::before,
.btn::after {
  content: "";
  position: absolute;
  background: #000;
  background: hsl(191, 80%, 43%);
  width: 100%;
  height: 102%;
  pointer-events: none;
  transform: skew(30deg) translateY(0);
  transition: transform 0.3s ease;
  z-index: -1;
}
.btn::before {
  --direction: 1;
  top: -103%;
  left: -70%;
}
.btn::after {
  --direction: -1;
  top: 102%;
  left: 69%;
}

.btn:hover::before,
.btn:hover::after {
  transform: skew(30deg) translateY(calc(var(--direction) * 100%));
}

.text-container {
  display: block;
  overflow: hidden;
  position: relative;
}
.text {
  display: block;
  transition: 0.3s;
}
.btn:hover .text:nth-child(1) {
  color: white;
  translate: 0 80%;
}

.text:nth-child(2) {
  color: white;
  position: absolute;
  inset: 0;
  translate: 0 -80%;
}
.btn:hover .text:nth-child(2) {
  transition-delay: 0.1s;
  translate: 0 0;
}
