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

.tg {
  width: 320px;
}

.tg__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 13px;
  line-height: 18px;
  color: #fff7e6;
}

.tg__head svg {
  flex: none;
  color: rgba(255, 255, 255, 0.55);
}

.tg__row {
  display: flex;
  gap: 8px;
}

.tg__tile {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 136px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  flex-grow: 1;
  transition: flex-grow 300ms cubic-bezier(0.2, 0.8, 0.2, 1), background 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tg__tile.is-open {
  flex-grow: 2.6;
  background: rgba(255, 255, 255, 0.15);
}

.tg__main {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px 40px;
  border: 0;
  background: transparent;
  color: #fff7e6;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.tg__main:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: -2px;
  border-radius: 16px;
}

.tg__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #17141a;
  font-weight: 800;
  font-size: 13px;
  line-height: 16px;
}

.tg__avatar--a {
  background: linear-gradient(135deg, #2f6df6, #b9a0ff);
}

.tg__avatar--b {
  background: linear-gradient(135deg, #ff9ebb, #b9a0ff);
}

.tg__avatar--c {
  background: linear-gradient(135deg, #4cd4a6, #6ec8ff);
}

.tg__name {
  max-width: 100%;
  font-weight: 800;
  font-size: 13px;
  line-height: 17px;
  color: #fff7e6;
  white-space: nowrap;
}

.tg__role {
  max-width: 100%;
  font-weight: 600;
  font-size: 11px;
  line-height: 14px;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tg__tile.is-open .tg__role {
  opacity: 1;
  transform: translateY(0);
}

.tg__follow {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  border: 0;
  border-radius: 12px;
  background: #2f6df6;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  line-height: 14px;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1), background 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tg__tile.is-open .tg__follow {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

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

.tg__follow.is-on {
  background: rgba(255, 255, 255, 0.18);
  color: #fff7e6;
}

.tg__f-off,
.tg__f-on {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tg__f-on {
  display: none;
}

.tg__follow.is-on .tg__f-off {
  display: none;
}

.tg__follow.is-on .tg__f-on {
  display: inline-flex;
}

.tg.is-demo .tg__tile {
  animation-name: tg-grow;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.tg.is-demo .tg__role,
.tg.is-demo .tg__follow {
  animation-name: tg-detail;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.tg.is-demo .tg__tile:nth-child(2),
.tg.is-demo .tg__tile:nth-child(2) .tg__role,
.tg.is-demo .tg__tile:nth-child(2) .tg__follow {
  animation-delay: 583ms;
}

.tg.is-demo .tg__tile:nth-child(3),
.tg.is-demo .tg__tile:nth-child(3) .tg__role,
.tg.is-demo .tg__tile:nth-child(3) .tg__follow {
  animation-delay: 1166ms;
}

@keyframes tg-grow {
  0% {
    flex-grow: 1;
    animation-timing-function: cubic-bezier(0.55, 0, 0.85, 0.25);
  }
  12.2% {
    flex-grow: 2.6;
  }
  16.4% {
    flex-grow: 2.6;
  }
  28.9% {
    flex-grow: 1;
  }
  100% {
    flex-grow: 1;
  }
}
@keyframes tg-detail {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  12.2% {
    opacity: 1;
    transform: translateY(0);
  }
  20% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (max-width: 340px) {
  .tg {
    width: 272px;
  }
  .tg__head {
    gap: 4px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 15px;
  }
  .tg__row {
    gap: 4px;
  }
  .tg__tile {
    height: 104px;
  }
  .tg__main {
    gap: 0;
    padding: 8px 4px 32px;
  }
  .tg__avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
    line-height: 14px;
  }
  .tg__name {
    font-size: 12px;
    line-height: 15px;
  }
  .tg__role {
    font-size: 10px;
    line-height: 12px;
  }
  .tg__follow {
    left: 4px;
    right: 4px;
    bottom: 8px;
    height: 28px;
    font-size: 11px;
    line-height: 13px;
  }
  .tg__follow svg {
    width: 12px;
    height: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tg.is-demo .tg__tile,
  .tg.is-demo .tg__role,
  .tg.is-demo .tg__follow {
    animation: none !important;
  }
  .tg__tile, .tg__role, .tg__follow {
    transition: none;
  }
}
