/* Cubes Animation Styles - Based on Can Tastemel's original work */

:root {
  --col-gap: 5%;
  --row-gap: 5%;
  --cube-perspective: 99999999px;
  --cube-face-border: 1px solid rgba(255, 255, 255, 0.1);
  --cube-face-bg: #060010;
}

.cubes-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  perspective: var(--cube-perspective);
}

.cubes-scene {
  display: grid;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  column-gap: var(--col-gap);
  row-gap: var(--row-gap);
  grid-auto-rows: 1fr;
}

.cube {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  transform-style: preserve-3d;
}

.cube::before {
  content: '';
  position: absolute;
  top: -36px;
  right: -36px;
  bottom: -36px;
  left: -36px;
}

.cube-face {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cube-face-bg);
  border: var(--cube-face-border);
  opacity: 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.cube-face--top {
  transform: translateY(-50%) rotateX(90deg);
}

.cube-face--bottom {
  transform: translateY(50%) rotateX(-90deg);
}

.cube-face--left {
  transform: translateX(-50%) rotateY(-90deg);
}

.cube-face--right {
  transform: translateX(50%) rotateY(90deg);
}

.cube-face--back,
.cube-face--front {
  transform: rotateY(-90deg) translateX(50%) rotateY(90deg);
}

/* Dark mode support */
[data-theme="dark"] .cube-face {
  background: rgba(15, 23, 42, 0.3);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Light mode support */
body:not([data-theme="dark"]) .cube-face {
  background: rgba(244, 246, 248, 0.1);
  border-color: rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .cubes-wrapper {
    width: 90%;
  }
}
