/* CSS 3D Cubes - Project 2026 Page */

body {
  min-height: 100vh;
  height: auto;
  width: 100%;
  overflow: hidden;
  margin-bottom: 0;
  padding-top: 45px;
  box-sizing: border-box;
}

html.embedded-project body {
  padding-top: 0;
}

html.embedded-project header.top,
html.embedded-project header.bottom {
  display: none;
}

.cubes-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100vw;
  perspective: 2000px;
  min-height: 100vh;
  align-content: start;
  padding-top: 14px;
  box-sizing: border-box;
}

/* Cube Wrapper with label */
.cube-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  perspective: 2000px;
  height: 440px;
}

.cube-link {
  display: block;
  text-decoration: none;
  color: inherit;
}


/* 3D Cube */
.cube {
  position: relative;
  width: 400px;
  height: 400px;
  transform-style: preserve-3d;
  cursor: pointer;
  will-change: transform;
}

/* Cube Faces */
.cube-face {
  position: absolute;
  width: 400px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

/* Front face */
.cube-face:nth-child(1) {
  transform: translateZ(200px);
}

/* Back face */
.cube-face:nth-child(2) {
  transform: rotateY(180deg) translateZ(200px);
}

/* Left face */
.cube-face:nth-child(3) {
  transform: rotateY(-90deg) translateZ(200px);
}

/* Right face */
.cube-face:nth-child(4) {
  transform: rotateY(90deg) translateZ(200px);
}

/* Top face */
.cube-face:nth-child(5) {
  transform: rotateX(90deg) translateZ(200px);
}

/* Bottom face */
.cube-face:nth-child(6) {
  transform: rotateX(-90deg) translateZ(200px);
}

/* Single-image wrapped texture (used on cube 2) */
.cube--wrapped .cube-face {
  background-image: var(--wrap-image) !important;
  background-size: 300% 220%;
  background-repeat: no-repeat;
}

.cube--wrapped .cube-face.front { background-position: 50% 50%; }
.cube--wrapped .cube-face.right { background-position: 86% 50%; }
.cube--wrapped .cube-face.back { background-position: 14% 50%; }
.cube--wrapped .cube-face.left { background-position: 74% 50%; }
.cube--wrapped .cube-face.top { background-position: 50% 12%; }
.cube--wrapped .cube-face.bottom { background-position: 50% 88%; }

/* Responsive Design */
@media screen and (max-width: 1024px) {
  .cubes-container {
    grid-template-columns: repeat(2, 320px);
    gap: 12px 12px;
    padding: 12px;
    justify-content: center;
  }

  .cube,
  .cube-face {
    width: 320px;
    height: 320px;
  }

  .cube-face:nth-child(1) {
    transform: translateZ(160px);
  }

  .cube-face:nth-child(2) {
    transform: rotateY(180deg) translateZ(160px);
  }

  .cube-face:nth-child(3) {
    transform: rotateY(-90deg) translateZ(160px);
  }

  .cube-face:nth-child(4) {
    transform: rotateY(90deg) translateZ(160px);
  }

  .cube-face:nth-child(5) {
    transform: rotateX(90deg) translateZ(160px);
  }

  .cube-face:nth-child(6) {
    transform: rotateX(-90deg) translateZ(160px);
  }
}

@media screen and (max-width: 768px) {
  .cubes-container {
    grid-template-columns: repeat(2, 220px);
    gap: 10px 10px;
    padding: 10px;
    justify-content: center;
  }

  .cube,
  .cube-face {
    width: 220px;
    height: 220px;
  }

  .cube-face:nth-child(1) {
    transform: translateZ(110px);
  }

  .cube-face:nth-child(2) {
    transform: rotateY(180deg) translateZ(110px);
  }

  .cube-face:nth-child(3) {
    transform: rotateY(-90deg) translateZ(110px);
  }

  .cube-face:nth-child(4) {
    transform: rotateY(90deg) translateZ(110px);
  }

  .cube-face:nth-child(5) {
    transform: rotateX(90deg) translateZ(110px);
  }

  .cube-face:nth-child(6) {
    transform: rotateX(-90deg) translateZ(110px);
  }
}

@media screen and (max-width: 480px) {
  .cubes-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .cube,
  .cube-face {
    width: 140px;
    height: 140px;
  }

  .cube-face:nth-child(1) {
    transform: translateZ(70px);
  }

  .cube-face:nth-child(2) {
    transform: rotateY(180deg) translateZ(70px);
  }

  .cube-face:nth-child(3) {
    transform: rotateY(-90deg) translateZ(70px);
  }

  .cube-face:nth-child(4) {
    transform: rotateY(90deg) translateZ(70px);
  }

  .cube-face:nth-child(5) {
    transform: rotateX(90deg) translateZ(70px);
  }

  .cube-face:nth-child(6) {
    transform: rotateX(-90deg) translateZ(70px);
  }

  .project-name {
    font-size: 14px;
    margin-top: 15px;
  }
}
