:root {
  color-scheme: light;
  font-family: sans-serif;
  --gutter: 8px;
  --edge-fade: clamp(44px, 10vh, 100px);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { position: fixed; inset: 0; margin: 0; background: #fff; }
[hidden] { display: none !important; }
.gallery {
  position: fixed;
  inset: 0;
  overflow: clip;
  padding: 8px;
  background: #fff;
  overscroll-behavior: none;
  touch-action: pinch-zoom;
  scroll-behavior: auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--edge-fade), #000 calc(100% - var(--edge-fade)), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 var(--edge-fade), #000 calc(100% - var(--edge-fade)), transparent);
}
.gallery:focus-visible { outline: 0; }
.wall { position: relative; width: 100%; margin: 0; padding: 0; list-style: none; }
.photo-item { position: absolute; top: 0; left: 0; }
.photo-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.photo-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .25s;
}
.photo-link.loaded img { opacity: 1; }
.photo-link.failed img { visibility: hidden; }
.photo-link:focus-visible { outline: 2px solid #555; outline-offset: -2px; }
.photo-page { display: flex; align-items: center; justify-content: center; padding: 8px; }
.photo-page img { display: block; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 600px) {
  :root { --gutter: 5px; }
  .gallery { padding: 5px; }
  .photo-page { padding: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-link img { transition: none; }
}
