* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

a {
  position: relative;
  padding: 20px 40px;
  font-size: 24px;
  font-weight: bold;
  color: #262626;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 2px;
}

span:nth-child(1),
span:nth-child(3) {
  position: absolute;
  width: 100%;
  height: 3px;
  background: #262626;
}

span:nth-child(1) {
  top: 0;
  left: 0;
  transform: scaleX(0);
  transform-origin: left;
}

a:hover span:nth-child(1) {
  transform: scaleX(1);
  transition: 0.2s;
}

span:nth-child(3) {
  bottom: 0;
  left: 0;
  transform: scaleX(0);
  transform-origin: right;
}

a:hover span:nth-child(3) {
  transform: scaleX(1);
  transition: 0.2s;
  transition-delay: 0.4s;
}

span:nth-child(2),
span:nth-child(4) {
  position: absolute;
  width: 3px;
  height: 100%;
  background: #262626;
}

span:nth-child(2) {
  top: 0;
  right: 0;
  transform: scaleY(0);
  transform-origin: top;
}

a:hover span:nth-child(2) {
  transform: scaleY(1);
  transition: 0.2s;
  transition-delay: 0.2s;
}

span:nth-child(4) {
  top: 0;
  left: 0;
  transform: scaleY(0);
  transform-origin: bottom;
}

a:hover span:nth-child(4) {
  transform: scaleY(1);
  transition: 0.2s;
  transition-delay: 0.6s;
}

a:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #262626;
  transform: scale(0);
  z-index: -1;
  transform-origin: top left;
}

a:hover:before {
  transform: scale(1);
  transition: 0.5s;
  transition-delay: 0.8s;
}

a:hover {
  color: #fff;
  transition: 0.2s;
  transition-delay: 0.8s;
}

a:after {
  content: "\f303";
  font-family: fontAwesome;
  position: absolute;
  top: -22px;
  left: 0;
  color: #262626;
}

a:hover:after {
  animation: draw 1s linear forwards;
}

@keyframes draw {
  0% {
    top: -22px;
    left: 0;
  }
  20% {
    top: -22px;
    left: 100%;
  }
  40% {
    top: calc(100% - 22px);
    left: 100%;
  }
  60% {
    top: calc(100% - 22px);
    left: 0;
  }
  80% {
    top: -22px;
    left: 0;
  }
  100% {
    top: calc(100% - 22px);
    left: 100%;
  }
}
