/* Root & Scroll Lock */
html.loading-lock {
  background-color: #0b0d12 !important;
  overflow: hidden !important;
}

/* Content Hide */
body > *:not(#loader-overlay) {
  opacity: 0;
  transition: opacity 0.5s ease-in;
  pointer-events: none;
}

body.is-ready > *:not(#loader-overlay) {
  opacity: 1;
  pointer-events: auto;
}

#loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background-color: #0b0d12;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

/* The Stack */
.stack-container {
  position: relative;
  width: 80px;
  height: 90px;
  transform-style: preserve-3d;
  transform: rotateX(60deg) rotateZ(45deg);
  animation: stack-float 4s ease-in-out infinite;
}

.layer {
  position: absolute;
  width: 80px;
  height: 80px;
  background-color: #d84500;
  /* Hexagon Shape */
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  transition: transform 0.3s ease;
}

/* Individual Layers with different depths and shades */
.layer:nth-child(1) {
  transform: translateZ(20px);
  background-color: #ff5200;
  opacity: 0.9;
  animation: layer-move-top 3s ease-in-out infinite;
}

.layer:nth-child(2) {
  transform: translateZ(0px);
  background-color: #d84500;
  opacity: 0.6;
}

.layer:nth-child(3) {
  transform: translateZ(-20px);
  background-color: #8a2c00;
  opacity: 0.4;
  animation: layer-move-bottom 3s ease-in-out infinite;
}

@keyframes stack-float {
  0%,
  100% {
    transform: rotateX(60deg) rotateZ(45deg) translateY(0);
  }
  50% {
    transform: rotateX(65deg) rotateZ(50deg) translateY(-10px);
  }
}

@keyframes layer-move-top {
  0%,
  100% {
    transform: translateZ(30px);
  }
  50% {
    transform: translateZ(45px);
  }
}

@keyframes layer-move-bottom {
  0%,
  100% {
    transform: translateZ(-30px);
  }
  50% {
    transform: translateZ(-45px);
  }
}

.loader-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.6s ease-out;
}
