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: #2f6df6;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 20, 26, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.drawer {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  right: auto;
  transform: translateX(-100%);
  width: min(76vw, 240px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 16px;
  background: #17141a;
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  pointer-events: none;
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer h2 {
  margin: 0 0 8px;
  font-size: clamp(13px, 4.2vmin, 17px);
}

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

.group__toggle {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}

.chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 300ms ease-out;
}

.group.is-open .chevron {
  transform: rotate(225deg);
}

.submenu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms ease-out;
}

.submenu__inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 16px;
}
.submenu__inner a {
  color: #ffffff;
  opacity: 0.8;
  text-decoration: none;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.8;
  font-family: inherit;
}
.submenu__inner a:hover, .submenu__inner a:focus-visible {
  opacity: 1;
  color: #2f6df6;
}

.group.is-open .submenu {
  grid-template-rows: 1fr;
}

.drawer__close {
  margin-top: auto;
  border: 0;
  border-radius: 12px;
  background: #2f6df6;
  color: #ffffff;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
}

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

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

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

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

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

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

@keyframes overlay-loop {
  0%, 100% {
    opacity: 0;
  }
  12%, 90% {
    opacity: 1;
  }
  96% {
    opacity: 0;
  }
}
@keyframes drawer-loop {
  0%, 100% {
    transform: translateX(-100%);
  }
  12%, 90% {
    transform: translateX(0);
  }
  96% {
    transform: translateX(-100%);
  }
}
@keyframes submenu-loop {
  0%, 25%, 100% {
    grid-template-rows: 0fr;
  }
  45%, 75% {
    grid-template-rows: 1fr;
  }
}
@keyframes chevron-loop {
  0%, 25%, 100% {
    transform: rotate(45deg);
  }
  45%, 75% {
    transform: rotate(225deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage.is-demo .overlay, .stage.is-demo .drawer, .stage.is-demo .submenu, .stage.is-demo .chevron {
    animation: none;
  }
  .overlay, .drawer, .submenu, .chevron {
    transition-duration: 1ms;
  }
}
