#my-work {
  padding: 5%;
  background-color: var(--bg-color);
  overflow-x: hidden;
}

.work-list {
  display: grid;
  grid-template-columns: 12.5rem 12.5rem 12.5rem 12.5rem 12.5rem 12.5rem 12.5rem 12.5rem;
  grid-column-gap: 2rem;
  grid-row-gap: 2rem;
  margin-top: 2rem;
}

.card {
  width: 12.5rem;
  aspect-ratio: 2/3;
  border-radius: 0.625rem;
  position: relative;
  overflow: hidden;
  margin: auto;
  opacity: 0;
  transform: translateX(6rem);
  box-shadow: 0 0 0.3rem #000;

  transition: transform .4s ease, opacity .4s ease;
}

.card:hover img {
  transform: scale(1.1);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.layer {
  width: 100%;
  height: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.6), var(--main-color));
  position: absolute;
  left: 0;
  bottom: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 .7rem;
  text-align: center;
  font-size: 0.875rem;
  transition: height 0.5s;
}

.layer h3 {
  margin: 1rem 0 1rem 0;
  font-size: 1rem;
  color: var(--white);
}

.layer p {
  color: var(--white);
  font-size: .85rem;
  text-align: left;
}

.layer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  width: 3rem;
  border-radius: 50%;
  margin-top: 1rem;
  background: #fff;
  color: var(--second-bg-color);
  text-decoration: none;
  font-size: 1.3rem;
}

.card:hover .layer {
  height: 100%;
}

#my-work button {
  margin: 1.5rem 1.5rem 2rem 0;
  padding: 0.8rem 1.8rem;
  border: .1rem solid var(--main-color);
  border-radius: .3rem;
  font-size: 1.2rem;
  font-weight: 700;
  background-color: var(--bg-color);
  color: var(--main-color);
  cursor: pointer;

  transition: box-shadow .15s ease, background-color .15s ease, color .15s ease;
}

#my-work button:hover {
  box-shadow: 0 0 1.5rem var(--main-color);
  color: var(--bg-color);
  background-color: var(--main-color);
}

#my-work .active {
  color: var(--bg-color);
  background-color: var(--main-color);
}

.title-btns-container {
  transform: translateX(7rem);
  opacity: 0;

  transition: transform 1s ease, opacity 1s ease;
}

#my-work .animate-work-title {
  transform: translateX(0);
  opacity: 1;
}


/* ----------- Code for responsive design ----------- */
@media only screen and (max-width: 2000px) {
  .work-list {
    grid-template-columns: 12.5rem 12.5rem 12.5rem 12.5rem 12.5rem 12.5rem 12.5rem;
  }
}

@media only screen and (max-width: 1770px) {
  .work-list {
    grid-template-columns: 12.5rem 12.5rem 12.5rem 12.5rem 12.5rem 12.5rem;
  }
}

@media only screen and (max-width: 1530px) {
  .work-list {
    grid-template-columns: 12.5rem 12.5rem 12.5rem 12.5rem 12.5rem;
  }
}

@media only screen and (max-width: 1275px) {
  .work-list {
    grid-template-columns: 12.5rem 12.5rem 12.5rem 12.5rem;
  }
}

@media only screen and (max-width: 1000px) {
  .work-list {
    grid-template-columns: 12.5rem 12.5rem 12.5rem;
  }
}

@media only screen and (max-width: 850px) {
  #my-work button {
    font-size: .9rem;
    margin: 1rem 1rem 0 0;
  }
}

@media only screen and (max-width: 750px) {
  .work-list {
    grid-template-columns: 12.5rem 12.5rem;
    grid-column-gap: 1rem;
    grid-row-gap: 2rem;
  }
}

@media only screen and (max-width: 720px) {
  #my-work button {
    font-size: .8rem;
    padding: .6rem .9rem;
  }
}


@media only screen and (max-width: 650px) {
  #my-work {
    padding-top: 2.5rem;
  }

  .work-list {
    grid-template-columns: repeat(auto-fit, minmax(9.4rem, 1fr));
  }

  .card {
    width: 9.4rem;
  }

  .layer h3 {
    margin: 1rem 0;
    font-size: .8rem;
  }

  .layer p {
    font-size: .65rem;
  }

  .layer a {
    height: 2.2rem;
    width: 2.2rem;
  }
}

@media only screen and (max-width: 610px) {
  #my-work {
    padding: 3rem 1.5rem 4rem 1.5rem;
  }

  #my-work button {
    font-size: .7rem;
    padding: .5rem .7rem;
  }

  .work-list {
    grid-column-gap: 0rem;
  }
}

@media only screen and (max-width: 460px) {
  #my-work {
    padding: 2.5rem 1rem 4rem 1rem;
  }

  #my-work button {
    font-size: .7rem;
    padding: .3rem .6rem;
    margin: 1rem .3rem 0 0;
  }
}
