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

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

.gallery {
  display: grid;
  grid-auto-flow: row dense;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 4px;
  column-gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 176px;
  max-width: 100%;
}

.tile {
  margin-bottom: 8px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  transform: scale(1);
  transition: transform 220ms ease-out, box-shadow 220ms ease-out;
}

.tile--1 {
  grid-row-end: span 10;
  background: linear-gradient(150deg, #fff7e6 0%, #17141a 100%);
}

.tile--2 {
  grid-row-end: span 13;
  background: linear-gradient(210deg, #2f6df6 0%, #fff7e6 100%);
}

.tile--3 {
  grid-row-end: span 9;
  background: linear-gradient(60deg, #17141a 0%, #fff7e6 100%);
}

.tile--4 {
  grid-row-end: span 12;
  background: linear-gradient(300deg, #fff7e6 0%, #2f6df6 100%);
}

.tile--5 {
  grid-row-end: span 10;
  background: linear-gradient(20deg, #2f6df6 0%, #17141a 100%);
}

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

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

.gallery.is-demo .tile--2 {
  animation-delay: -0.4s;
}

.gallery.is-demo .tile--3 {
  animation-delay: -0.8s;
}

.gallery.is-demo .tile--4 {
  animation-delay: -1.2s;
}

.gallery.is-demo .tile--5 {
  animation-delay: -1.6s;
}

@keyframes pop-loop {
  0%, 8% {
    transform: scale(1);
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
  24%, 40% {
    transform: scale(1.05);
    box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  }
  56%, 100% {
    transform: scale(1);
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
}
@media (hover: none) {
  .tile:active {
    transform: scale(1.05);
    box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none;
  }
  .gallery.is-demo .tile {
    animation: none;
  }
}
