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

.stage {
  padding: clamp(8px, 2.4vw, 16px);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 208px;
  max-width: 100%;
}

.cell {
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  outline: none;
  cursor: pointer;
  background: #17141a;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  transform: translateY(0);
  transition: transform 300ms ease-out, box-shadow 300ms ease-out;
}

.photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 300ms ease-out;
}

.cell:hover, .cell:focus-visible, .cell:active {
  transform: translateY(-3px);
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.cell:hover .photo, .cell:focus-visible .photo, .cell:active .photo {
  transform: scale(1.12);
}

.gallery.is-demo .cell {
  animation: lift-loop 2s ease-out infinite;
}

.gallery.is-demo .photo {
  animation: crop-zoom 2s ease-out infinite;
}

.gallery.is-demo .cell:nth-child(2) {
  animation-delay: -0.33s;
}

.gallery.is-demo .cell:nth-child(3) {
  animation-delay: -0.66s;
}

.gallery.is-demo .cell:nth-child(4) {
  animation-delay: -1s;
}

.gallery.is-demo .cell:nth-child(5) {
  animation-delay: -1.33s;
}

.gallery.is-demo .cell:nth-child(6) {
  animation-delay: -1.66s;
}

.gallery.is-demo .cell:nth-child(2) .photo {
  animation-delay: -0.33s;
}

.gallery.is-demo .cell:nth-child(3) .photo {
  animation-delay: -0.66s;
}

.gallery.is-demo .cell:nth-child(4) .photo {
  animation-delay: -1s;
}

.gallery.is-demo .cell:nth-child(5) .photo {
  animation-delay: -1.33s;
}

.gallery.is-demo .cell:nth-child(6) .photo {
  animation-delay: -1.66s;
}

@keyframes lift-loop {
  0%, 8% {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
  25%, 40% {
    transform: translateY(-3px);
    box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  }
  58%, 100% {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
}
@keyframes crop-zoom {
  0%, 8% {
    transform: scale(1);
  }
  25%, 40% {
    transform: scale(1.12);
  }
  58%, 100% {
    transform: scale(1);
  }
}
@media (hover: none) {
  .cell:active .photo {
    transform: scale(1.12);
  }
}
@media (prefers-reduced-motion: reduce) {
  .photo {
    transition: none;
  }
  .gallery.is-demo .photo {
    animation: none;
  }
}
