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

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

.fsm {
  box-sizing: border-box;
  width: clamp(320px, 92vw, 432px);
  padding: 16px;
  border-radius: 16px;
  background: #1b1a20;
  color: #ffffff;
}

.fsm__brand {
  margin: 0 0 12px;
  color: #ffd23f;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.fsm__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 92px;
}

.fsm__head {
  margin: 0;
}

.fsm__btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: #ffffff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.fsm__btn:focus-visible {
  outline: 2px solid #b3dad5;
  outline-offset: 2px;
}

.fsm__caret {
  flex: 0 0 auto;
  color: #b3dad5;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fsm__btn[aria-expanded=false] .fsm__caret {
  transform: rotate(-90deg);
}

.fsm__panel {
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  transition: grid-template-rows 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fsm__panel > * {
  min-height: 0;
}

.fsm__col:has(.fsm__btn[aria-expanded=false]) .fsm__panel {
  grid-template-rows: 0fr;
}

.fsm__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
}

.fsm__list a {
  color: #b9b3c4;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}

.fsm__list a:hover {
  color: #b3dad5;
}

.fsm__list a:focus-visible {
  outline: 2px solid #b3dad5;
  outline-offset: 2px;
  border-radius: 4px;
}

.fsm__legal {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid #2c2a33;
  color: #b9b3c4;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.fsm.is-demo .fsm__panel,
.fsm.is-demo .fsm__caret {
  animation-duration: 2s;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.fsm.is-demo .fsm__panel {
  animation-name: fsmSweep;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: none;
}

.fsm.is-demo .fsm__caret {
  animation-name: fsmCaret;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: none;
}

.fsm.is-demo .fsm__col:nth-child(2) .fsm__panel,
.fsm.is-demo .fsm__col:nth-child(2) .fsm__caret {
  animation-delay: -0.6667s;
}

.fsm.is-demo .fsm__col:nth-child(3) .fsm__panel,
.fsm.is-demo .fsm__col:nth-child(3) .fsm__caret {
  animation-delay: -1.3333s;
}

@keyframes fsmSweep {
  0% {
    grid-template-rows: 0fr;
  }
  8%, 74% {
    grid-template-rows: 1fr;
  }
  86%, 100% {
    grid-template-rows: 0fr;
  }
}
@keyframes fsmCaret {
  0% {
    transform: rotate(-90deg);
  }
  8%, 74% {
    transform: rotate(0deg);
  }
  86%, 100% {
    transform: rotate(-90deg);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .fsm {
    width: 100%;
    padding: 8px;
  }
  .fsm__brand {
    margin-bottom: 4px;
    font-size: 10px;
  }
  .fsm__cols {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 0;
  }
  .fsm__btn {
    justify-content: space-between;
    font-size: 11px;
  }
  .fsm__list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 8px;
    padding-top: 4px;
  }
  .fsm__list a {
    font-size: 10px;
    line-height: 1.3;
  }
  .fsm__list a:nth-child(3) {
    display: none;
  }
  .fsm__legal {
    margin-top: 4px;
    padding-top: 4px;
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fsm__panel, .fsm__caret {
    animation: none !important;
    transition: none !important;
  }
}
