* { box-sizing: border-box; }
html { background: #fff; scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: #111; font-family: Arial, Helvetica, sans-serif; }
button { font: inherit; }

/* Minimal editorial navigation: brand left, categories centered. */
.site-nav {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 30px 50px;
  pointer-events: none;
  color: #111;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
}
.brand, .category {
  pointer-events: auto;
  color: inherit;
  text-decoration: none;
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.brand { justify-self: start; letter-spacing: .28em; }
.categories { display: flex; gap: 34px; justify-self: center; }
.category {
  position: relative;
  padding: 0 0 7px;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: .42;
}
.category.active, .category:hover, .category:focus-visible { opacity: 1; }
.category.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  height: 1px;
  background: currentColor;
  transform: translateX(-50%);
}
.category:focus-visible { outline: 1px solid currentColor; outline-offset: 5px; }

.gallery {
  width: min(1400px, calc(100% - 100px));
  margin: 0 auto;
  padding: 124px 0 70px;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.gallery.empty { min-height: 100vh; }

.photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
}
.photo img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: opacity 220ms ease;
}
.photo:hover img { opacity: .88; }

/* Desktop rhythm: 3 images / 4 images / 3 images. */
.photo-1, .photo-2, .photo-3 { grid-column: span 4; }
.photo-4, .photo-5, .photo-6, .photo-7 { grid-column: span 3; }
.photo-8, .photo-9, .photo-10 { grid-column: span 4; }

.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr minmax(0, 92vw) 1fr;
  align-items: center;
  background: #000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}
.viewer.open { opacity: 1; visibility: visible; pointer-events: auto; }
.viewer-figure { margin: 0; width: 100%; height: 100%; display: grid; place-items: center; }
.viewer-figure img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.close { position: absolute; top: 18px; right: 25px; z-index: 3; border: 0; background: transparent; color: rgba(255,255,255,.7); font-size: 28px; line-height: 1; cursor: pointer; }
.nav { height: 100%; border: 0; background: transparent; cursor: pointer; z-index: 2; }
.prev { grid-column: 1; }
.next { grid-column: 3; }
body.viewer-open { overflow: hidden; }

@media (max-width: 800px) {
  .site-nav {
    grid-template-columns: 1fr auto;
    padding: 18px 16px;
  }
  .brand { font-size: 10px; letter-spacing: .22em; }
  .categories { gap: 18px; }
  .category { font-size: 10px; }
  .gallery {
    width: calc(100% - 32px);
    padding: 86px 0 36px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .photo-1, .photo-2, .photo-3,
  .photo-4, .photo-5, .photo-6, .photo-7,
  .photo-8, .photo-9, .photo-10 { grid-column: span 1; }
  .photo-1, .photo-4, .photo-7, .photo-10 { grid-column: 1 / -1; }
  .viewer { grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .viewer-figure img { max-width: calc(100vw - 88px); max-height: 100vh; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .photo img, .viewer { transition: none; }
}
