@charset "UTF-8";
@property --blur {
  syntax: "<length>";
  initial-value: 0;
  inherits: true;
}
@property --brightness {
  syntax: "<number>";
  initial-value: 0;
  inherits: true;
}
@property --rotationY {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: true;
}
:root {
  --shape: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

body {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  background: url("https://assets.codepen.io/907471/DALL%C2%B7E+2024-11-07+22.19.21+-+A+very+dark%2C+hyper-futuristic+abstract+image+with+a+central+vanishing+point+and+a+high-tech+aesthetic.+The+color+palette+is+dominated+by+deep+blacks%2C+.webp") no-repeat center center, var(--color-surface);
  background-size: cover;
  color: var(--color-primary);
  font-family: "Helvetica Neue", monospace;
  font-weight: bold;
  font-size: 20vmin;
  margin: 0;
  perspective: 32rem;
  position: relative;
  overflow: hidden;
}
body:after {
  content: "";
  -webkit-backdrop-filter: blur(1.5rem);
          backdrop-filter: blur(1.5rem);
  -webkit-mask: radial-gradient(circle, transparent 50%, black 75%);
          mask: radial-gradient(circle, transparent 50%, black 75%);
  z-index: 1;
  pointer-events: none;
  position: absolute;
  inset: 0;
  width: 100dvw;
  height: 100dvh;
}

.container {
  position: relative;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  -webkit-animation: rotate 6s linear infinite;
          animation: rotate 6s linear infinite;
  transform: rotate3d(0, 1, 0, var(--rotationY));
  will-change: transform;
  --distance: 3vmin;
}

.left,
.right {
  position: absolute;
  width: calc(var(--distance) * 4);
  height: 28vmin;
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(0.3rem);
          backdrop-filter: blur(0.3rem);
}

.right.top {
  transform: rotateY(90deg) rotateX(45deg) translateZ(14vmin);
}

.right.bottom {
  transform: rotateY(-90deg) rotateX(45deg) translateZ(-14vmin);
}

.left.bottom {
  transform: rotateY(90deg) rotateX(45deg) translateZ(-14vmin);
}

.left.top {
  transform: rotateY(90deg) rotateX(-45deg) translateZ(-14vmin);
}

.front,
.back {
  position: absolute;
  transform-style: preserve-3d;
  width: 40vmin;
  aspect-ratio: 1;
  background: rgba(5, 5, 5, 0.1);
  -webkit-backdrop-filter: blur(var(--blur)) brightness(var(--brightness)) invert(1) saturate(0.9);
          backdrop-filter: blur(var(--blur)) brightness(var(--brightness)) invert(1) saturate(0.9);
  -webkit-clip-path: var(--shape);
          clip-path: var(--shape);
  transform: translateZ(calc(var(--distance) * 2));
  box-shadow: inset 0 0 10rem rgba(255, 255, 5, 0.05);
}

.front:after {
  position: absolute;
  inset: 1rem;
  -webkit-clip-path: var(--shape);
          clip-path: var(--shape);
  background: rgba(255, 255, 255, 0.05);
  opacity: 0.8;
  display: grid;
  place-items: center;
  content: "☢︎";
  transform-style: preserve-3d;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
}

.back {
  transform: translateZ(calc(var(--distance) * 1));
  box-shadow: inset 1rem 0 20rem rgba(222, 5, 25, 0.3);
}
.back:nth-child(2) {
  transform: translateZ(calc(var(--distance) * 0));
  box-shadow: inset 1rem 4rem 5rem rgba(2, 55, 205, 0.35);
}
.back:nth-child(3) {
  transform: translateZ(calc(var(--distance) * -1));
  box-shadow: inset 4rem 0rem 5rem rgba(255, 200, 2, 0.3);
}
.back:nth-child(4) {
  transform: translateZ(calc(var(--distance) * -2));
  box-shadow: inset -1rem -4rem 5rem rgba(25, 5, 255, 0.2);
}
.back:nth-child(4):after {
  position: absolute;
  inset: 1rem;
  -webkit-clip-path: var(--shape);
          clip-path: var(--shape);
  background: rgba(255, 255, 255, 0.05);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.1);
  opacity: 0.6;
  display: grid;
  place-items: center;
  content: "☢︎";
  z-index: -1;
}

@-webkit-keyframes rotate {
  from {
    --rotationY: 0deg;
    --blur: 0.2vmin;
    --brightness: 1.2;
  }
  15%, 35%, 65%, 85% {
    --blur: 0.2vmin;
    --brightness: 1.2;
  }
  25%, 75% {
    --blur: 5vmin;
    --brightness: 3.35;
  }
  to {
    --rotationY: 360deg;
    --blur: 0.2vmin;
    --brightness: 1.2;
  }
}

@keyframes rotate {
  from {
    --rotationY: 0deg;
    --blur: 0.2vmin;
    --brightness: 1.2;
  }
  15%, 35%, 65%, 85% {
    --blur: 0.2vmin;
    --brightness: 1.2;
  }
  25%, 75% {
    --blur: 5vmin;
    --brightness: 3.35;
  }
  to {
    --rotationY: 360deg;
    --blur: 0.2vmin;
    --brightness: 1.2;
  }
}
:root {
  --color-primary: #f4e8f1;
  --color-secondary: #75d8ee;
  --color-tertiary: #deee75;
  --color-quaternary: #9375ee;
  --color-surface: #131212;
}

* {
  box-sizing: border-box;
}