html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ff4d1f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.tx {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: 100%;
}

.tx__scene {
  display: grid;
  place-items: center;
  width: clamp(200px, 54vw, 268px);
  height: clamp(72px, 19vw, 92px);
  perspective: 520px;
}

.tx__scene:focus-visible {
  outline: 3px solid #17141a;
  outline-offset: 8px;
  border-radius: 8px;
}

.tx__stack {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(0deg);
}

.tx__layer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateZ(var(--z));
  color: rgba(23, 20, 26, 0.55);
  font-weight: 800;
  font-size: clamp(26px, 8vw, 40px);
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tx__layer:nth-child(1) {
  --z: -32px;
}

.tx__layer:nth-child(2) {
  --z: -24px;
}

.tx__layer:nth-child(3) {
  --z: -16px;
}

.tx__layer:nth-child(4) {
  --z: -8px;
}

.tx__layer--top {
  --z: 0px;
  position: relative;
  left: auto;
  top: auto;
  transform: translateZ(0);
  color: #fff7e6;
}

.tx__hint {
  margin: 0;
  color: #17141a;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
}

.tx.is-demo .tx__stack {
  animation-name: txTilt;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes txTilt {
  0% {
    transform: rotateX(10deg) rotateY(-18deg);
  }
  8% {
    transform: rotateX(7deg) rotateY(-8deg);
  }
  26% {
    transform: rotateX(2deg) rotateY(-2deg);
  }
  44% {
    transform: rotateX(-2deg) rotateY(2deg);
  }
  52% {
    transform: rotateX(-7deg) rotateY(8deg);
  }
  58% {
    transform: rotateX(-10deg) rotateY(18deg);
  }
  66% {
    transform: rotateX(-7deg) rotateY(8deg);
  }
  84% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  94% {
    transform: rotateX(7deg) rotateY(-8deg);
  }
  100% {
    transform: rotateX(10deg) rotateY(-18deg);
  }
}
@media (max-width: 340px) {
  .tx {
    gap: 12px;
  }
  .tx__layer:nth-child(1) {
    --z: -24px;
  }
  .tx__layer:nth-child(2) {
    --z: -18px;
  }
  .tx__layer:nth-child(3) {
    --z: -12px;
  }
  .tx__layer:nth-child(4) {
    --z: -6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tx.is-demo .tx__stack {
    animation: none !important;
    transform: rotateX(6deg) rotateY(-14deg) !important;
  }
}
