* {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}
body {
  height: 100vh;
  background: #000000;
}
.container {
  height: 60vh;
  width: 30vw;
  position: absolute;
  top: 50vh;
  left: 50vw;
  transform: translate(-50%, -50%);
  perspective: 1000px;
}
.box {
  height: 250px;
  width: 250px;
  position: absolute;
  top: 100px;
  left: 100px;
  /* transform: rotate(-90deg); */
  transform-style: preserve-3d;
  /* transform: rotateY(130deg); */
  animation: animate 5s infinite;
}
@keyframes animate {
  0% {
    transform: rotateX(45deg) rotateY(-45deg);
  }
  25% {
    transform: rotateX(-45deg) rotateY(-45deg);
  }
  50% {
    transform: rotateX(45deg) rotateY(-45deg);
  }
  75% {
    transform: rotateX(-45deg) rotateY(45deg);
  }
  100% {
    transform: rotateX(45deg) rotateY(-45deg);
  }
}
.card {
  height: 250px;
  width: 250px;
  text-align: center;
  padding: 100px 0;
  color: white;
  background-color: black;
  border: 2px solid black;
  font-size: 32px;
  box-sizing: border-box;
  position: absolute;
  transition: all 1s;
}
#front {
  transform: translateZ(125px);
  background-image: url("./react.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}
#back {
  transform: translateZ(-125px);
  background-image: url("./tailwind.png ");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}
#left {
  right: 125px;
  transform: rotateY(-90deg);
  background-image: url("./typescript.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

#right {
  left: 125px;
  transform: rotateY(90deg);
  background-image: url("./mongo.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-color: #ffffff;
}

#top {
  bottom: 125px;
  transform: rotateX(90deg);
  background-image: url("./node.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  background-color: #ffffff;
}

#bottom {
  top: 125px;
  transform: rotateX(-90deg);
  background-image: url("./figma.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  background-color: #ffffff;
}

.box:hover #front {
  transform: translateZ(180px) rotate(360deg);
}
.box:hover #back {
  transform: translateZ(-180px) rotate(360deg);
}

.box:hover #left {
  right: 180px;
}

.box:hover #right {
  left: 180px;
}

.box:hover #top {
  bottom: 180px;
}

.box:hover #bottom {
  top: 180px;
}
