body { margin: 0; background: #1c1b22; color: #fff; }
* { overscroll-behavior: none; font-family: Menlo, monospace;}
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 2rem;
  align-items: start;
}

figure { margin: 0; }

figure img, dialog img {
  display: block;
  box-sizing: border-box;
  border: 10px solid #fff;
}

figure img { width: 100%; aspect-ratio: 1; object-fit: cover; cursor: zoom-in; }

figcaption { margin-top: .4rem; font: 12px/1.4 monospace; text-align: center; }

dialog { padding: 0; border: 0; outline: 0; background: none; }
dialog::backdrop { background: none; }
dialog img { max-width: 90vw; max-height: 80vh; }
dialog p { max-width: 90vw; margin: .6rem 0 0; font: 14px/1.5 sans-serif; }

.back {
  a { color: #fface6; }
  padding: 0.5em 0 0.5em 1em;
  position: sticky;
  top: 0;
  background: #1c1b22;
}

@media (max-width: 600px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 1rem; padding: 1rem; }
}

