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

.stage {
  position: relative;
}

.layout {
  position: relative;
  overflow: hidden;
  width: min(88vw, 320px);
  height: min(50vw, 150px);
  border-radius: 16px;
  background: #ffffff;
}

.drawer {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 8px;
  background: #17141a;
  color: #ffffff;
  transform: translateX(-100%);
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1;
}

.drawer__link {
  padding: 4px;
  border-radius: 4px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
}
.drawer__link:hover, .drawer__link:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: #2f6df6;
}

.content {
  position: relative;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  padding: 16px;
  background: #ffffff;
  color: #17141a;
  transform: translateX(0);
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 2;
}

.content__line {
  margin: 0;
  font-size: clamp(10px, 3vmin, 12px);
  color: rgba(23, 20, 26, 0.65);
}

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

.stage.is-open .drawer {
  transform: translateX(0);
}

.stage.is-open .content {
  transform: translateX(40%);
}

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

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

@keyframes drawer-loop {
  0%, 100% {
    transform: translateX(-100%);
  }
  15%, 70% {
    transform: translateX(0);
  }
  85% {
    transform: translateX(-100%);
  }
}
@keyframes content-loop {
  0%, 100% {
    transform: translateX(0);
  }
  15%, 70% {
    transform: translateX(40%);
  }
  85% {
    transform: translateX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage.is-demo .drawer, .stage.is-demo .content {
    animation: none;
  }
  .drawer, .content {
    transition-duration: 1ms;
  }
}
