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);
}

.thumb {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(160deg, #fff7e6, #ffffff);
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  transform: translate(-30%, 20%) scale(0.3);
  transform-origin: 20% 75%;
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.thumb__caption {
  position: absolute;
  left: clamp(10px, 3vmin, 16px);
  bottom: clamp(10px, 3vmin, 16px);
  font-weight: 600;
  font-size: clamp(11px, 3.4vmin, 14px);
  line-height: 1;
  font-family: inherit;
  color: #17141a;
  opacity: 0;
  transition: opacity 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.thumb__close {
  position: absolute;
  right: clamp(10px, 3vmin, 16px);
  top: clamp(10px, 3vmin, 16px);
  width: clamp(20px, 6vmin, 26px);
  height: clamp(20px, 6vmin, 26px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(23, 20, 26, 0.55);
  color: #fff7e6;
  font-size: clamp(13px, 3.8vmin, 16px);
  opacity: 0;
  transition: opacity 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.stage.is-open .thumb {
  transform: translate(0, 0) scale(1);
  border-radius: 0;
}

.stage.is-open .thumb__caption,
.stage.is-open .thumb__close {
  opacity: 1;
}

.stage.is-demo .thumb {
  animation: thumb-loop 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.stage.is-demo .thumb__caption,
.stage.is-demo .thumb__close {
  animation: fade-loop 2s ease-in-out infinite;
}

@keyframes thumb-loop {
  0% {
    transform: translate(-30%, 20%) scale(0.3);
    border-radius: 16px;
  }
  20% {
    transform: translate(0, 0) scale(1);
    border-radius: 0;
  }
  65% {
    transform: translate(0, 0) scale(1);
    border-radius: 0;
  }
  85% {
    transform: translate(-30%, 20%) scale(0.3);
    border-radius: 16px;
  }
  100% {
    transform: translate(-30%, 20%) scale(0.3);
    border-radius: 16px;
  }
}
@keyframes fade-loop {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  65% {
    opacity: 1;
  }
  85% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage.is-demo .thumb,
  .stage.is-demo .thumb__caption,
  .stage.is-demo .thumb__close {
    animation: none;
  }
  .thumb, .thumb__caption, .thumb__close {
    transition-duration: 1ms;
  }
}
