@charset "UTF-8";
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);
}

@property --s {
  syntax: "<number>";
  inherits: false;
  initial-value: 1;
}
@property --x {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
.mg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 24px;
}

.mg__dock {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
}

.mg__btn {
  --s: 1;
  --x: 0px;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: end center;
  padding: 0;
  border: 0;
  background: none;
  color: #fff7e6;
  cursor: pointer;
  transform: translateX(var(--x));
  transition: transform 140ms linear;
}

.mg__btn:focus-visible {
  outline: 2px solid #6ec8ff;
  outline-offset: 2px;
  border-radius: 4px;
}

.mg__btn svg {
  width: 32px;
  height: 32px;
  display: block;
  transform-origin: bottom center;
  scale: var(--s);
  transition: scale 140ms linear;
}

.mg__cap {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
}

/* 자동 재생 — 물결이 왼쪽에서 오른쪽으로 지나간다. 지연은 개별 속성으로 */
.is-demo .mg__btn {
  animation-name: mg-push;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.is-demo .mg__btn svg {
  animation-name: mg-swell;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.is-demo .mg__btn:nth-child(2),
.is-demo .mg__btn:nth-child(2) svg {
  animation-delay: 0.2s;
}

.is-demo .mg__btn:nth-child(3),
.is-demo .mg__btn:nth-child(3) svg {
  animation-delay: 0.4s;
}

.is-demo .mg__btn:nth-child(4),
.is-demo .mg__btn:nth-child(4) svg {
  animation-delay: 0.6s;
}

.is-demo .mg__btn:nth-child(5),
.is-demo .mg__btn:nth-child(5) svg {
  animation-delay: 0.8s;
}

.is-demo .mg__btn:nth-child(6),
.is-demo .mg__btn:nth-child(6) svg {
  animation-delay: 1s;
}

.is-demo .mg__btn:nth-child(7),
.is-demo .mg__btn:nth-child(7) svg {
  animation-delay: 1.2s;
}

@keyframes mg-push {
  0% {
    transform: translateX(0);
  }
  4% {
    transform: translateX(9px);
  }
  10% {
    transform: translateX(0);
  }
  16% {
    transform: translateX(-9px);
  }
  24% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(0);
  }
}
@keyframes mg-swell {
  0% {
    scale: 1;
  }
  4% {
    scale: 1.3;
  }
  10% {
    scale: 1.8;
  }
  16% {
    scale: 1.3;
  }
  24% {
    scale: 1;
  }
  100% {
    scale: 1;
  }
}
@media (max-width: 340px) {
  .mg__btn {
    width: 36px;
    height: 36px;
  }
  .mg__btn svg {
    width: 26px;
    height: 26px;
  }
  .mg__dock {
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-demo .mg__btn,
  .is-demo .mg__btn svg {
    animation-name: none;
  }
  .mg__btn,
  .mg__btn svg {
    transition: none;
  }
}
