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

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

.cu {
  box-sizing: border-box;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(208px, 100%);
}

.cu__frame {
  position: relative;
  width: 112px;
  height: 112px;
  border: 2px solid rgba(255, 247, 230, 0.4);
  border-radius: 50%;
}

.cu__frame:focus-within {
  border-color: #b9a0ff;
  box-shadow: 0 0 0 2px #b9a0ff;
}

.cu__window {
  position: absolute;
  inset: 0;
  clip-path: circle(50%);
  touch-action: none;
  cursor: grab;
}

.cu__window:active {
  cursor: grabbing;
}

.cu__mini, .cu__photo {
  background: radial-gradient(circle at 32% 26%, #fff7e6 0 17%, rgba(255, 247, 230, 0) 38%), radial-gradient(circle at 72% 76%, #17141a 0 15%, rgba(23, 20, 26, 0) 36%), linear-gradient(160deg, #6ec8ff 0%, #b9a0ff 34%, #9791c9 62%, #ab5488 100%);
}

.cu__photo {
  position: absolute;
  inset: -25%;
  transform: translate(var(--x, 0px), var(--y, 0px)) scale(var(--z, 1));
  will-change: transform;
}

.cu__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cu__cam {
  flex: none;
  color: #b9a0ff;
}

.cu__zoom {
  width: 104px;
  margin: 0;
  accent-color: #b9a0ff;
}

.cu__preview {
  position: relative;
  flex: none;
  display: block;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 2px solid rgba(255, 247, 230, 0.4);
  border-radius: 50%;
}

.cu__mini {
  position: absolute;
  inset: -25%;
  transform: translate(calc(var(--x, 0px) * 0.25), calc(var(--y, 0px) * 0.25)) scale(var(--z, 1));
}

.cu.is-demo .cu__photo {
  animation-name: cuPhoto;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes cuPhoto {
  0% {
    transform: translate(0, 0) scale(1);
  }
  30% {
    transform: translate(-16px, 10px) scale(1.25);
  }
  55% {
    transform: translate(14px, -12px) scale(1.6);
  }
  78% {
    transform: translate(0, 6px) scale(1.9);
  }
  88%, 100% {
    transform: translate(0, 0) scale(1);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .cu {
    gap: 8px;
  }
  .cu__frame {
    width: 96px;
    height: 96px;
  }
  .cu__zoom {
    width: 84px;
  }
  .cu__preview {
    width: 32px;
    height: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cu__photo {
    animation: none !important;
  }
}
