.section {
  display: flex;
  justify-content: center;
  padding-left: 30px;
  padding-right: 100px;
  box-sizing: border-box;
}

.wall {
  display: flex;
  flex-direction: column;
  max-width: 100vw;
}

.v-boxes {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  margin-bottom: 20px;
}

.v-boxes:not(:first-child) {
  margin-top: -100px;
  margin-right: -50px;
}

.second {
  margin-left: 75px;
  margin-top: 0;
}

.skills {
  margin-left: 75px;
  margin-top: 0;
}

.third {
  margin-left: 150px;
  margin-top: 0;
}

.forth {
  margin-left: 225px;
  margin-top: 0;
}

.box {
  width: 100px;
  height: 100px;
  transform: rotate(45deg);
  margin: 25px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0; /* Prevent shrinking on small screens */
}

.box:hover:not(.link) > .box-face,
.box:hover:not(.link) > .box-back {
  transform: translateZ(100px) rotateX(180deg);
  background-color: transparent !important;
}

.box:hover:not(.link) > .box-face > .box-text {
  opacity: 0;
}

.box:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

.box.link > .box-face {
  background-color: #323232;
  border: 1px solid #323232;
  box-sizing: border-box;
  transition: background-color 0.5s;
}

.box.link .box-text {
  color: #efefef;
  transition: color 0.5s;
}

/* Box faces */
.box-face,
.box-back {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100px;
  height: 100px;
  background-color: #dedede;
  transform: rotate(90deg);
  transform-style: preserve-3d;
  transition:
    transform 1s,
    background-color 0s 0.3s;
}

.box-face .box-text,
.box-back .box-text {
  line-height: 100px;
  text-align: center;
  font-size: 40px;
  color: #bababa;
  transform: rotate(-135deg);
  transition: opacity 0s linear 0.3s;
}

.box-back {
  z-index: 0;
  background-image: linear-gradient(#fff, #efefef);
}

.box-back .box-text {
  font-size: 8px;
  color: #636363;
  transform: rotate(-135deg) rotateY(180deg);
}

.box-text img {
  max-width: 100px;
  max-height: 55px;
  filter: grayscale(100%) saturate(0);
  opacity: 0.5;
}

/* Tooltip */
.tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 10px;
  left: 35px;
  width: 80px;
  font-size: 8px;
  color: #000;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.8);
  padding: 5px 0;
  z-index: 1000;
  transform: rotate(-45deg);
  transition:
    visibility 0s linear 0.3s,
    opacity 1s linear 0.3s;
}

.tooltip:after {
  position: absolute;
  top: -5px;
  left: 35px;
  content: " ";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid black;
}

/* RESPONSIVE */

@media (max-width: 768px) {
  .section {
    padding-left: 10px;
    padding-right: 10px;
  }
  .wall {
    max-width: 100vw;
  }
  .v-boxes {
    flex-wrap: wrap; /* allow wrapping on smaller screens */
    justify-content: center;
    margin-top: 10px !important;
    margin-right: 0 !important;
  }
  .v-boxes.skills,
  .v-boxes.second,
  .v-boxes.third,
  .v-boxes.forth {
    margin-left: 0 !important;
  }
  .box {
    margin: 30px;
    width: 80px;
    height: 80px;
  }
  .box-face,
  .box-back {
    width: 80px;
    height: 80px;
  }
  .box-face .box-text {
    line-height: 80px;
    font-size: 32px;
  }
  .box-back .box-text {
    font-size: 6px;
    line-height: 80px;
  }
  .tooltip {
    left: 25px;
    width: 70px;
    font-size: 7px;
    text-align: center;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .skills {
    flex-wrap: nowrap !important;
    justify-content: center;
  }
  .skills > .box {
    width: 60px; /* original was around 100px */
    height: 50px; /* adjust if you have height set */
    font-size: 12px; /* reduce font size */
    padding: 5px 3px; /* smaller padding */
    margin: 0 -2px; /* smaller margin between boxes */
    box-sizing: border-box;
  }

  .skills > .box:first-child,
  .skills > .box:last-child {
    width: 20px; /* smaller empty boxes */
    height: 50px;
    margin: 0 6px;
    background-color: transparent !important;
    box-shadow: none !important;
  }

  .skills > .box .box-text i {
    font-size: 14px; /* reduce letter size */
    font-weight: bold;
    color: #000;
  }
}
