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

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

.th {
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  width: min(300px, 92vw);
  padding: 12px;
  border-radius: 16px;
  background: #fff7e6;
  color: #17141a;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.th * {
  box-sizing: border-box;
}

.th__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.09);
}

.th__tab {
  margin: 0;
  padding: 8px 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(23, 20, 26, 0.68);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 300ms cubic-bezier(0.2, 0.8, 0.2, 1), color 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.th__tab:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.th__tab[aria-selected=true] {
  background: #17141a;
  color: #fff7e6;
}

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

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

.th__clip {
  min-height: 0;
  overflow: hidden;
}

.th__body {
  padding: 8px 0 0;
  opacity: 0;
  transition: opacity 300ms steps(1, end);
}

.th__panel.is-open .th__body {
  opacity: 1;
  transition-duration: 0s;
}

.th__price {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.th__desc {
  margin: 4px 0 0;
  color: rgba(23, 20, 26, 0.68);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

@keyframes th-row-1 {
  0%, 20% {
    grid-template-rows: 1fr;
  }
  28%, 82% {
    grid-template-rows: 0fr;
  }
  90%, 100% {
    grid-template-rows: 1fr;
  }
}
@keyframes th-row-2 {
  0%, 20% {
    grid-template-rows: 0fr;
  }
  28%, 48% {
    grid-template-rows: 1fr;
  }
  56%, 100% {
    grid-template-rows: 0fr;
  }
}
@keyframes th-row-3 {
  0%, 48% {
    grid-template-rows: 0fr;
  }
  56%, 74% {
    grid-template-rows: 1fr;
  }
  82%, 100% {
    grid-template-rows: 0fr;
  }
}
@keyframes th-body-1 {
  0% {
    opacity: 1;
  }
  28% {
    opacity: 0;
  }
  82%, 100% {
    opacity: 1;
  }
}
@keyframes th-body-2 {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  56%, 100% {
    opacity: 0;
  }
}
@keyframes th-body-3 {
  0% {
    opacity: 0;
  }
  48% {
    opacity: 1;
  }
  82%, 100% {
    opacity: 0;
  }
}
@keyframes th-tab-1 {
  0% {
    background-color: #17141a;
    color: #fff7e6;
  }
  20% {
    background-color: transparent;
    color: rgba(23, 20, 26, 0.68);
  }
  82%, 100% {
    background-color: #17141a;
    color: #fff7e6;
  }
}
@keyframes th-tab-2 {
  0% {
    background-color: transparent;
    color: rgba(23, 20, 26, 0.68);
  }
  20% {
    background-color: #17141a;
    color: #fff7e6;
  }
  48%, 100% {
    background-color: transparent;
    color: rgba(23, 20, 26, 0.68);
  }
}
@keyframes th-tab-3 {
  0% {
    background-color: transparent;
    color: rgba(23, 20, 26, 0.68);
  }
  48% {
    background-color: #17141a;
    color: #fff7e6;
  }
  82%, 100% {
    background-color: transparent;
    color: rgba(23, 20, 26, 0.68);
  }
}
.th.is-demo .th__panel:nth-child(1) {
  animation-name: th-row-1;
}
.th.is-demo .th__panel:nth-child(2) {
  animation-name: th-row-2;
}
.th.is-demo .th__panel:nth-child(3) {
  animation-name: th-row-3;
}
.th.is-demo .th__panel {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.th.is-demo .th__panel:nth-child(1) .th__body {
  animation-name: th-body-1;
}
.th.is-demo .th__panel:nth-child(2) .th__body {
  animation-name: th-body-2;
}
.th.is-demo .th__panel:nth-child(3) .th__body {
  animation-name: th-body-3;
}
.th.is-demo .th__tab:nth-child(1) {
  animation-name: th-tab-1;
}
.th.is-demo .th__tab:nth-child(2) {
  animation-name: th-tab-2;
}
.th.is-demo .th__tab:nth-child(3) {
  animation-name: th-tab-3;
}
.th.is-demo .th__body,
.th.is-demo .th__tab {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@media (max-width: 340px) {
  .th {
    gap: 4px;
    width: min(292px, 96vw);
    padding: 8px;
  }
  .th__tabs {
    gap: 0;
  }
  .th__tab {
    padding: 4px 0;
    font-size: 11px;
  }
  .th__body {
    padding: 4px 0 0;
  }
  .th__price {
    font-size: 17px;
  }
  .th__desc {
    margin: 0;
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .th.is-demo .th__panel,
  .th.is-demo .th__body,
  .th.is-demo .th__tab {
    animation: none !important;
    transition: none !important;
  }
  .th.is-demo .th__panel:nth-child(1) {
    grid-template-rows: 1fr !important;
  }
  .th.is-demo .th__panel:nth-child(1) .th__body {
    opacity: 1 !important;
  }
  .th.is-demo .th__tab:nth-child(1) {
    background-color: #17141a !important;
    color: #fff7e6 !important;
  }
}
