* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #212121;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  gap: 50px;
  flex-wrap: wrap;
  padding: 30px;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  z-index: -999;
  animation: twinkle 2s infinite linear, move 100s infinite linear;
}
@keyframes twinkle {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes move {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-100px, -100px);
  }
}

.card {
  position: relative;
  height: 300px;
  width: 230px;
}

.card .boxshadow {
  position: absolute;
  height: 100%;
  width: 100%;
  transform: scale(0.8);
  box-shadow: rgba(147, 147, 147, 1) 0px 30px 70px 0px;
  transition: all 0.5s ease;
}

.card .main {
  width: 230px;
  height: 300px;
  overflow: hidden;
  background: linear-gradient(
    0deg,
    rgb(147, 147, 147) 0%,
    rgba(147, 147, 147, 1) 60%,
    rgb(147, 147, 147) 100%
  );
  position: relative;
  clip-path: polygon(
    0 0,
    100% 0,
    100% 40px,
    100% calc(100% - 40px),
    calc(100% - 40px) 100%,
    40px 100%,
    0 calc(100% - 40px)
  );
  box-shadow: rgba(147, 147, 147, 1) 0px 7px 29px 0px;
  transition: all 0.3s ease;
}

.top {
  position: absolute;
  top: 0px;
  left: 0;
  width: 0px;
  height: 0px;
  z-index: 2;
  border-top: 115px solid black;
  border-left: 115px solid transparent;
  border-right: 115px solid transparent;
  transition: all 0.5s ease;
}

.side {
  position: absolute;
  width: 100%;
  top: 0;
  transform: translateX(-50%);
  height: 101%;
  background: black;
  clip-path: polygon(0% 0%, 50% 0, 95% 45%, 100% 100%, 0% 100%);
  transition: all 0.5s ease 0.6s;
}

.left {
  left: 0;
}
.right {
  right: 0;
  transform: translateX(50%) scale(-1, 1);
}

.title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 90px;
  font-weight: bold;
  font-size: 25px;
  opacity: 0;
  z-index: -1;
  transition: all 0.2s ease;
}

.button-container {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.button {
  position: absolute;
  transform: translateX(-50%);
  padding: 5px 10px;
  clip-path: polygon(0 0, 100% 0, 81% 100%, 21% 100%);
  background: black;
  border: none;
  color: white;
  display: grid;
  cursor: pointer;
  z-index: 2;
  place-content: center;
  transition: all 0.5s ease;
}

.button:nth-child(1) {
  bottom: 300px;
  transition-delay: 0.4s;
}
.button:nth-child(2) {
  bottom: 300px;
  transition-delay: 0.6s;
}
.button:nth-child(3) {
  bottom: 300px;
  transition-delay: 0.8s;
}

.card:hover .button:nth-child(1) {
  bottom: 120px;
  transition-delay: 0.8s;
}
.card:hover .button:nth-child(2) {
  bottom: 80px;
  transition-delay: 0.6s;
}
.card:hover .button:nth-child(3) {
  bottom: 40px;
  transition-delay: 0.4s;
}

.button.active {
  left: calc(50% - 30px);
}

.span {
  position: absolute;
  left: 55%;
  transform: translateX(-50%) translateY(10px);
  padding: 5px 4px 5px 8px;
  clip-path: polygon(0 100%, 100% 86%, 107% 0, 13% 0);
  font-size: 10px;
  background: black;
  border: none;
  color: white;
  display: inline-block;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  place-content: center;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.span.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0px);
  pointer-events: auto;
}
span:hover {
  border: 1.5px solid rgba(103, 144, 255, 0.856);
}
a:nth-of-type(1) .span {
  left: calc(55% + 3px);
}
a:nth-of-type(2) .span {
  left: calc(55% + 0.6px);
}
a:nth-of-type(3) .span {
  left: calc(55% + 0.6px);
}

.hologram {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: url("pfp.png") no-repeat center center;
  background-size: cover;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s ease, opacity 0.5s ease;
  z-index: 10;
  animation: floating 3s ease-in-out infinite;
}

.beam {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 0px;
  height: 50px;
  background: linear-gradient(
    to top,
    rgba(147, 147, 147, 0.6) 0%,
    rgba(147, 147, 147, 0.3) 60%,
    rgba(147, 147, 147, 0) 100%
  );
  opacity: 0;
  transition: opacity 0.5s ease, height 0.5s ease;
  z-index: 5;
}

.card:hover .beam {
  width: 70px;
  opacity: 1;
  height: 100px;
  clip-path: polygon(0% 0%, 50% 100%, 100% 0%);
}

@keyframes floating {
  0% {
    transform: translateX(-50%) translateY(0px) scale(1);
  }
  50% {
    transform: translateX(-50%) translateY(-10px) scale(1.05);
  }
  100% {
    transform: translateX(-50%) translateY(0px) scale(1);
  }
}

.card:hover .hologram {
  opacity: 1;
}
.card:hover .main {
  transform: scale(1.05) perspective(800px) rotateX(8deg);
}
.card:hover .top {
  top: -50px;
}
.card:hover .left {
  left: -50px;
}
.card:hover .right {
  right: -50px;
}
.card:hover .title {
  opacity: 1;
  transition-delay: 1.3s;
}
.card.fade-out {
  opacity: 0;
  transition: opacity 1.2s ease;
}

.interactive-star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  pointer-events: none;
  opacity: 1;
  z-index: -999;
  animation: fallAndFade 1s ease-out forwards;
}

@keyframes fallAndFade {
  0% {
    opacity: 1;
    transform: translate(0px, 0px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--x, 0px), var(--y, 40px)) scale(1.2);
  }
}
