/* хэдэр */

#menu a:last-child {
  font-weight: 700;
}

.nav_menu.active {
  z-index: 3;
}

#projects {
  padding: 4.2vw 4vw 0;
  display: flex;
  flex-direction: row;
}

.frame {
  margin-right: 1.5vw;
  position: relative;
}

.first_content,
.second_content {
  position: absolute;
  top: 0.9vw;
  left: 0.9vw;
  width: 43.4vw;
  height: 41.6vw;
  overflow: hidden;
}

.info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 2.7vw 2vw;
}

h3 {
  font-size: 2.2em;
  font-weight: 700;
  margin-bottom: 1.4vw;
  line-height: 4.5vw;
}

.info p {
  line-height: 2.5vw;
  margin-bottom: 2vw;
}

.frame img {
  width: 45.2vw;
  height: 43.5vw;
}

.first_content::before,
.second_content::before {
  content: '';
  background-repeat: no-repeat;
  position: absolute;
  top: 0px;
  right: 0px;
  bottom: 0px;
  left: 0px;
  opacity: 0;
}

/* первый блок */

.first_content::before {
  background-image: url('../images/garden_mushroom.png'),
    url('../images/garden_plant.png'), url('../images/garden_flower.png'),
    url('../images/garden_mushroom2.png');
  background-size: 25vw, 23vw, 18vw, 22vw;
}

.first_content:hover::before {
  animation: left_floating 8s forwards ease-in-out;
}

@keyframes left_floating {
  0% {
    background-position: right 25vw bottom 18vw, left 5vw top 20vw,
      left 20vw bottom 27vw, left 25vw top 18vw;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    background-position: left 42vw bottom 8vw, right 20vw bottom 40vw,
      left 23vw top 43vw, right 40vw top 18vw;
    opacity: 1;
  }
}

.frame a {
  width: 30vw;
  position: absolute;
  bottom: 9vw;
  left: 3vw;
}

/* второй блок */

.second_content::before {
  background-image: url('../images/ad_ball.png'), url('../images/ad_jug.png'),
    url('../images/ad_mushroom.png'), url('../images/ad_insect.png');
  background-size: 23vw, 24vw, 25vw, 25vw;
}

.second_content:hover::before {
  animation: right_floating 8s forwards ease-in-out;
}

@keyframes right_floating {
  0% {
    background-position: right 25vw top 20vw, left 20vw bottom 19vw,
      right 21vw bottom 20vw, left 19vw top 21vw;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    background-position: left 42vw bottom 18vw, right 40vw top 10vw,
      left 23vw top 38vw, right 20vw bottom 42vw;
    opacity: 1;
  }
}

@media only screen and (min-width: 360px) and (max-width: 767px) {
  #projects {
    flex-direction: column;
    gap: 2vw;
  }

  .frame img {
    width: 100%;
    height: 100%;
  }

  .info {
    width: 89%;
    margin: 6vw 4.5vw;
  }

  .first_content,
  .second_content {
    height: 95%;
    top: 2vw;
    left: 2vw;
    width: 96%;
  }

  h3 {
    font-size: 3.5em;
    margin-bottom: 3vw;
    line-height: inherit;
  }

  .info p {
    line-height: 5vw;
    margin-bottom: 2vw;
  }

  .frame a {
    top: 55vw;
    left: 6.8vw;
    height: 8vw;
    width: 45vw;
  }

  .first_content::before {
    background-size: 60vw, 55vw, 38vw, 50vw;
    height: 100%;
  }

  @keyframes left_floating {
    0% {
      background-position: right 60vw bottom 36vw, left 10vw top 40vw,
        left 40vw bottom 54vw, left 50vw top 20vw;
      opacity: 0;
    }
    10% {
      opacity: 1;
    }
    100% {
      background-position: left 90vw bottom 16vw, right 30vw bottom 80vw,
        left 40vw top 86vw, right 80vw top 36vw;
      opacity: 1;
    }
  }

  .second_content::before {
    background-size: 50vw, 55vw, 60vw, 60vw;
  }

  .frame {
    margin-right: 1.5vw;
  }

  @keyframes right_floating {
    0% {
      background-position: right 40vw top 60vw, left 30vw bottom 68vw,
        right 41vw bottom 50vw, left 25vw top 61vw;
      opacity: 0;
    }
    10% {
      opacity: 1;
    }
    100% {
      background-position: left 20vw bottom 85vw, right 10vw top 80vw,
        left 100vw top 40vw, right 40vw bottom 83vw;
      opacity: 1;
    }
  }
}

@media only screen and (min-width: 768px) and (max-width: 1023px) {
  .frame:nth-child(2) a {
    bottom: 6.5vw;
  }
}
