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

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

.frame {
  position: relative;
  width: clamp(160px, 70vw, 280px);
  aspect-ratio: 4/3;
  border-radius: 12px;
  overflow: hidden;
  isolation: isolate;
}
.frame__image {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #ffd23f, #ff4d1f 60%, #17141a);
}
.frame__curtain {
  position: absolute;
  inset: 0;
  background: #17141a;
  transform: scaleX(1);
  transform-origin: right;
}
@supports (animation-timeline: view()) {
  .frame__curtain {
    animation: curtain-open cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-timeline: view();
    animation-range: entry 10% cover 50%;
  }
}
@supports not (animation-timeline: view()) {
  .frame__curtain {
    transform: scaleX(0);
  }
}

@keyframes curtain-open {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}
.frame.is-demo .frame__curtain {
  animation: curtain-loop 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes curtain-loop {
  0% {
    transform: scaleX(1);
  }
  35% {
    transform: scaleX(0);
  }
  75% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .frame__curtain, .frame.is-demo .frame__curtain {
    animation: none !important;
    transform: scaleX(0);
  }
}
