@import url(https://fonts.googleapis.com/css?family=Raleway:400,500,800);

body {
  background-color: #333;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Raleway", Arial, sans-serif;
}

ul {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

ul li {
  position: relative;
  list-style: none;
  margin: 5px;
}

a {
  position: relative;
  display: block;
  height: 40px;
  text-decoration: none;
  padding: 5px 10px;
  font-weight: 300;
  letter-spacing: 2px;
  overflow: hidden;
}

ul li a span {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.5s;
  color: white;
  font-size: 20px;
  text-transform: capitalize;
  transition-delay: 0.5s;
}

a:hover span:nth-child(1) {
  transform: translateY(-100%);
  transition-delay: 0s;
}

a:hover span:nth-child(2) {
  transform: translateY(-100%);
  transition-delay: 0s;
}

a:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #16a085;
  transform: scaleX(0);
  transform-origin: left;
  transition: 0.5s;
}

a:hover:before {
  transform: scaleX(1);
  transform-origin: right;
  transition-delay: 0.5s;
}
