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

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

.vg {
  box-sizing: border-box;
  width: 100%;
  max-width: 432px;
}

.vg__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  transition: grid-template-columns 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.vg__grid.is-open-0 {
  grid-template-columns: 2.2fr 0.6fr 0.6fr 0.6fr;
}

.vg__grid.is-open-1 {
  grid-template-columns: 0.6fr 2.2fr 0.6fr 0.6fr;
}

.vg__grid.is-open-2 {
  grid-template-columns: 0.6fr 0.6fr 2.2fr 0.6fr;
}

.vg__grid.is-open-3 {
  grid-template-columns: 0.6fr 0.6fr 0.6fr 2.2fr;
}

.vg__item {
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 4px;
  margin: 0;
  border: 2px solid #1c1b22;
  border-radius: 16px;
  background: #fbf7ef;
  color: #1c1b22;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.vg__item:focus-visible {
  outline: 3px solid #479089;
  outline-offset: 2px;
}

.vg__item[aria-expanded=true] {
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.vg__thumb {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(56px, 20vw, 96px);
  border-radius: 8px;
  overflow: hidden;
}

.vg__thumb--a {
  background: radial-gradient(circle at 78% 22%, rgba(179, 218, 213, 0.55), transparent 58%), linear-gradient(135deg, #a49cce, #479089);
}

.vg__thumb--b {
  background: radial-gradient(circle at 22% 78%, rgba(164, 156, 206, 0.65), transparent 60%), linear-gradient(135deg, #1c1b22, #3b2f7a);
}

.vg__thumb--c {
  background: radial-gradient(circle at 50% 18%, rgba(251, 247, 239, 0.45), transparent 62%), linear-gradient(135deg, #479089, #b3dad5);
}

.vg__thumb--d {
  background: radial-gradient(circle at 80% 80%, rgba(71, 144, 137, 0.8), transparent 60%), linear-gradient(135deg, #1c1b22, #a49cce);
}

.vg__play {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fbf7ef;
  color: #1c1b22;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.vg__time {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(28, 27, 34, 0.82);
  color: #fbf7ef;
  font-weight: 700;
  font-size: 10px;
  line-height: 16px;
}

.vg__name {
  color: #1c1b22;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 13px);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vg__reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 300ms ease-out;
}

.vg__item[aria-expanded=true] .vg__reveal {
  clip-path: inset(0 0 0 0);
}

.vg__quote {
  display: block;
  color: #565062;
  font-weight: 500;
  font-size: clamp(9px, 2.4vw, 12px);
  line-height: 1.3;
  white-space: nowrap;
}

.vg.is-demo .vg__grid {
  animation-name: vgCols;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  transition: none;
}

.vg.is-demo .vg__item--1 .vg__reveal {
  animation-name: vgWipe;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  transition: none;
}

@keyframes vgCols {
  0%, 6% {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    animation-timing-function: cubic-bezier(0.7, 0, 0.9, 0.3);
  }
  33%, 66% {
    grid-template-columns: 2.2fr 0.6fr 0.6fr 0.6fr;
    animation-timing-function: linear;
  }
  90%, 100% {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}
@keyframes vgWipe {
  0%, 33% {
    clip-path: inset(0 100% 0 0);
  }
  33.01%, 66% {
    clip-path: inset(0 0 0 0);
  }
  66.01%, 100% {
    clip-path: inset(0 100% 0 0);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .vg__grid {
    gap: 4px;
  }
  .vg__item {
    border-width: 2px;
  }
  .vg__play {
    width: 24px;
    height: 24px;
  }
  .vg__play svg {
    width: 13px;
    height: 13px;
  }
  .vg__time {
    font-size: 9px;
    line-height: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .vg__grid, .vg__reveal {
    animation: none !important;
    transition: none !important;
  }
}
