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

.fm, .fm * {
  box-sizing: border-box;
}

.fm {
  position: relative;
  width: min(440px, 94vw);
  height: clamp(168px, 84vh, 264px);
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255, 247, 230, 0.04);
}

.fm__bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.fm__brand {
  color: #fff7e6;
  font-size: 16px;
  line-height: 22px;
  font-weight: 800;
  transition: opacity 200ms linear;
}

.fm.is-open .fm__brand {
  opacity: 0;
}

.fm__btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 247, 230, 0.1);
  cursor: pointer;
}

.fm__btn:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: 2px;
}

.fm__burger {
  display: grid;
  gap: 4px;
}

.fm__burger span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #fff7e6;
  transition: transform 300ms cubic-bezier(0.2, 1.4, 0.4, 1), opacity 160ms linear;
}

.fm.is-open .fm__burger span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.fm.is-open .fm__burger span:nth-child(2) {
  transform: scaleX(0);
  opacity: 0;
}

.fm.is-open .fm__burger span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.fm__page {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 12px;
}

.fm__block {
  border-radius: 8px;
  background: rgba(255, 247, 230, 0.1);
}

.fm__block--a {
  height: clamp(40px, 20vh, 84px);
}

.fm__block--b {
  height: clamp(20px, 10vh, 44px);
  background: rgba(255, 247, 230, 0.06);
}

.fm__rule {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 247, 230, 0.14);
}

.fm__rule--s {
  width: 64%;
}

.fm__rule--m {
  width: 44%;
}

.fm__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 0 32px;
  background: #241f2d;
  visibility: hidden;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 260ms ease-out, transform 320ms cubic-bezier(0.2, 1.4, 0.4, 1), visibility 0s linear 320ms;
}

.fm.is-open .fm__overlay {
  visibility: visible;
  opacity: 1;
  transform: scale(1);
  transition: opacity 260ms ease-out, transform 320ms cubic-bezier(0.2, 1.4, 0.4, 1), visibility 0s;
}

.fm__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff7e6;
  font-size: 24px;
  line-height: 32px;
  font-weight: 800;
  text-decoration: none;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 260ms ease-out, transform 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.fm__link svg {
  opacity: 0.6;
}

.fm__link:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: 4px;
  border-radius: 4px;
}

.fm.is-open .fm__link {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--i) * 80ms);
}

.fm.is-demo .fm__overlay {
  visibility: visible;
  animation-name: fm-ov;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.fm.is-demo .fm__burger span,
.fm.is-demo .fm__link {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.fm.is-demo .fm__burger span:nth-child(1) {
  animation-name: fm-b1;
}

.fm.is-demo .fm__burger span:nth-child(2) {
  animation-name: fm-b2;
}

.fm.is-demo .fm__burger span:nth-child(3) {
  animation-name: fm-b3;
}

.fm.is-demo .fm__link:nth-child(1) {
  animation-name: fm-l1;
}

.fm.is-demo .fm__link:nth-child(2) {
  animation-name: fm-l2;
}

.fm.is-demo .fm__link:nth-child(3) {
  animation-name: fm-l3;
}

.fm.is-demo .fm__link:nth-child(4) {
  animation-name: fm-l4;
}

@keyframes fm-ov {
  0%, 8.3% {
    opacity: 0;
    transform: scale(1.06);
  }
  8.4%, 74% {
    opacity: 1;
    transform: scale(1);
  }
  80%, 100% {
    opacity: 0;
    transform: scale(1);
  }
}
@keyframes fm-b1 {
  0%, 8.3% {
    transform: translateY(0) rotate(0deg);
  }
  18%, 78% {
    transform: translateY(6px) rotate(45deg);
  }
  88%, 100% {
    transform: translateY(0) rotate(0deg);
  }
}
@keyframes fm-b2 {
  0%, 8.3% {
    opacity: 1;
    transform: scaleX(1);
  }
  18%, 78% {
    opacity: 0;
    transform: scaleX(0);
  }
  88%, 100% {
    opacity: 1;
    transform: scaleX(1);
  }
}
@keyframes fm-b3 {
  0%, 8.3% {
    transform: translateY(0) rotate(0deg);
  }
  18%, 78% {
    transform: translateY(-6px) rotate(-45deg);
  }
  88%, 100% {
    transform: translateY(0) rotate(0deg);
  }
}
@keyframes fm-l1 {
  0%, 12% {
    opacity: 0;
    transform: translateY(18px);
  }
  24%, 100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fm-l2 {
  0%, 20% {
    opacity: 0;
    transform: translateY(18px);
  }
  32%, 100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fm-l3 {
  0%, 28% {
    opacity: 0;
    transform: translateY(18px);
  }
  40%, 100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fm-l4 {
  0%, 36% {
    opacity: 0;
    transform: translateY(18px);
  }
  48%, 100% {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 340px) {
  .fm__bar {
    padding: 8px 12px;
  }
  .fm__brand {
    font-size: 14px;
    line-height: 20px;
  }
  .fm__btn {
    width: 36px;
    height: 36px;
  }
  .fm__page {
    gap: 4px;
    padding: 0 12px 8px;
  }
  .fm__rule {
    height: 6px;
  }
  .fm__overlay {
    gap: 8px;
    padding: 0 20px;
  }
  .fm__link {
    font-size: 19px;
    line-height: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fm.is-demo .fm__overlay,
  .fm.is-demo .fm__burger span,
  .fm.is-demo .fm__link {
    animation: none !important;
  }
  .fm.is-demo .fm__overlay {
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .fm.is-demo .fm__link {
    opacity: 1 !important;
    transform: none !important;
  }
  .fm.is-demo .fm__burger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg) !important;
  }
  .fm.is-demo .fm__burger span:nth-child(2) {
    opacity: 0 !important;
    transform: scaleX(0) !important;
  }
  .fm.is-demo .fm__burger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg) !important;
  }
  .fm.is-demo .fm__brand {
    opacity: 0 !important;
  }
  .fm__burger span, .fm__overlay, .fm__link, .fm__brand {
    transition: none !important;
    transition-delay: 0ms !important;
  }
}
