nav {
  position: fixed;
  z-index: 2;
  background-color: #342f2f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: auto;
  margin-left: 20px;
  overflow: hidden;
  margin-top: 12px;
  height: 50px;
  border-radius: 8px;
  font-size: 0;
}
  nav a {
    line-height: 50px;
    height: 100%;
    font-size: 15px;
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    text-decoration: none;
    text-transform: uppercase;
    text-align: center;
    color: white;
    cursor: pointer;
  }
  nav .animation {
    position: absolute;
    height: 100%;
    top: 0;
    z-index: 0;
    transition: all .5s ease 0s;
    border-radius: 8px;
  }
  nav a:nth-child(1) {
    width: 100px;
  }
  nav a:nth-child(2) {
    width: 110px;
  }
  nav a:nth-child(3) {
    width: 100px;
  }
  nav a:nth-child(4) {
    width: 100px;
  }

nav .start-home, a:nth-child(1):hover~.animation {
  width: 100px;
  left: 0;
  background-color: #31629f;
}
nav .start-about, a:nth-child(2):hover~.animation {
  width: 110px;
  left: 100px;
  background-color: #e73c3c;
}
nav .start-blog, a:nth-child(3):hover~.animation {
  width: 100px;
  left: 210px;
  background-color: #229869;
}
nav .start-portfolio, a:nth-child(4):hover~.animation {
  width: 100px;
  left: 310px;
  background-color: #9b59b6;
}

@media screen and (max-width: 875px) {
  nav {
    width: 90%;
    margin-left: 5%;
    justify-content: space-around;
  }

  nav a {
    font-size: 12px;
    padding: 0 10px;
  }

  nav a:nth-child(1),
  nav a:nth-child(2),
  nav a:nth-child(3),
  nav a:nth-child(4) {
    width: auto;
    flex: 1;
  }

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

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

  nav .start-blog, nav a:nth-child(3):hover ~ .animation {
    width: 25%;
    left: 50%;
  }

  nav .start-portfolio, nav a:nth-child(4):hover ~ .animation {
    width: 25%;
    left: 75%;
  }
}
  

span {
    color: #2BD6B4;
}