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

.stage {
  position: relative;
}

.page {
  display: grid;
  place-items: center;
}

.trigger {
  border: 0;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: clamp(13px, 4vmin, 16px);
  line-height: 1;
  font-family: inherit;
  color: #ffffff;
  background: #17141a;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 20, 26, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-out;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  top: auto;
  transform: translate(-50%, 100%);
  width: min(94vw, 300px);
  box-sizing: border-box;
  padding: 8px 16px 24px;
  border-radius: 16px 16px 0 0;
  background: #fff7e6;
  color: #17141a;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  pointer-events: none;
  transition: transform 300ms ease-out;
}
.sheet h2 {
  margin: 8px 0 4px;
  font-size: clamp(13px, 4.2vmin, 17px);
}
.sheet p {
  margin: 0;
  font-size: clamp(10px, 3.2vmin, 13px);
  color: rgba(23, 20, 26, 0.7);
}

.sheet__handle {
  display: block;
  width: 36px;
  height: 4px;
  margin: 0 auto;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.28);
  cursor: pointer;
}

.stage.is-open .overlay {
  opacity: 1;
  pointer-events: auto;
}

.stage.is-open .sheet {
  pointer-events: auto;
}

.stage.is-open .sheet[data-snap=peek] {
  transform: translate(-50%, 78%);
}

.stage.is-open .sheet[data-snap=half] {
  transform: translate(-50%, 40%);
}

.stage.is-open .sheet[data-snap=full] {
  transform: translate(-50%, 0);
}

.stage.is-demo .overlay {
  animation: overlay-loop 2s ease-in-out infinite;
}

.stage.is-demo .sheet {
  animation: sheet-loop 2s ease-out infinite;
}

@keyframes overlay-loop {
  0%, 100% {
    opacity: 0;
  }
  10%, 90% {
    opacity: 1;
  }
  95% {
    opacity: 0;
  }
}
@keyframes sheet-loop {
  0% {
    transform: translate(-50%, 100%);
  }
  10% {
    transform: translate(-50%, 78%);
  }
  40% {
    transform: translate(-50%, 40%);
  }
  70% {
    transform: translate(-50%, 0);
  }
  90% {
    transform: translate(-50%, 78%);
  }
  100% {
    transform: translate(-50%, 100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage.is-demo .overlay, .stage.is-demo .sheet {
    animation: none;
  }
  .overlay, .sheet {
    transition-duration: 1ms;
  }
}
