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

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

body {
  background: rgb(15 23 42);
  min-height: 100vh;
}

nav {
  position: relative;
  margin: 270px auto 0;
  width: 590px;
  height: 50px;
  background: #34495e;
  border-radius: 8px;
  font-size: 0;
  box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.1);
}
nav a {
  font-size: 15px;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  line-height: 50px;
  position: relative;
  z-index: 1;
  display: inline-block;
  text-align: center;
}
nav .animation {
  position: absolute;
  height: 100%;
  top: 0;
  z-index: 0;
  background: #1abc9c;
  border-radius: 8px;
  transition: all;
  -webkit-transition: all 0.5s ease 0s;
}

a:nth-child(1) {
  width: 100px;
}

nav .start-home,
a:nth-child(1):hover ~ .animation {
  width: 100px;
  left: 0;
}

a:nth-child(2) {
  width: 110px;
}

nav .start-about,
a:nth-child(2):hover ~ .animation {
  width: 110px;
  left: 100px;
}

a:nth-child(3) {
  width: 100px;
}

nav .start-blog,
a:nth-child(3):hover ~ .animation {
  width: 100px;
  left: 210px;
}

a:nth-child(4) {
  width: 160px;
}

nav .start-portfolio,
a:nth-child(4):hover ~ .animation {
  width: 160px;
  left: 310px;
}

a:nth-child(5) {
  width: 120px;
}

nav .start-contact,
a:nth-child(5):hover ~ .animation {
  width: 120px;
  left: 470px;
}
