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

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

.menu {
  position: relative;
  align-self: flex-start;
  justify-self: start;
  font-weight: 500;
  font-size: clamp(13px, 3.6vw, 16px);
  line-height: 1.4;
  font-family: inherit;
}
.menu__trigger {
  border: 0;
  border-radius: 12px;
  padding: clamp(9px, 3vw, 13px) clamp(16px, 4vw, 22px);
  font-weight: 700;
  font-family: inherit;
  color: #fff7e6;
  background: #17141a;
  cursor: pointer;
}
.menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(260px, 90vw);
  padding: 4px;
  pointer-events: none;
}
.menu__fill {
  position: absolute;
  inset: 0;
  background: #fff7e6;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  transform: scaleX(0);
  transform-origin: left;
}
.menu__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 8px;
  opacity: 0;
}
.menu__grid a {
  padding: 8px 10px;
  border-radius: 8px;
  color: #17141a;
  text-decoration: none;
  text-align: center;
}
.menu__grid a:hover {
  background: rgba(23, 20, 26, 0.06);
}
.menu.is-open .menu__fill {
  transform: scaleX(1);
  pointer-events: auto;
  transition: transform 300ms ease-out;
}
.menu.is-open .menu__grid {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 300ms ease-out 120ms;
}
.menu.is-demo .menu__fill {
  animation: fill-loop 2s ease-out infinite;
}
.menu.is-demo .menu__grid {
  animation: grid-loop 2s ease-out infinite;
}

@keyframes fill-loop {
  0%, 25% {
    transform: scaleX(0);
  }
  45%, 80% {
    transform: scaleX(1);
  }
  95%, 100% {
    transform: scaleX(0);
  }
}
@keyframes grid-loop {
  0%, 33% {
    opacity: 0;
  }
  50%, 78% {
    opacity: 1;
  }
  92%, 100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .menu__fill, .menu__grid {
    transition: none !important;
  }
  .menu.is-demo .menu__fill, .menu.is-demo .menu__grid {
    animation: none;
  }
  .menu.is-demo .menu__fill {
    transform: scaleX(0);
  }
  .menu.is-demo .menu__grid {
    opacity: 0;
  }
}
