:root {
  --ink: #f6f4ef;
  --muted: #aaa7a1;
  --black: #080808;
}

* { box-sizing: border-box; }

html { background: var(--black); }

body {
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

body.lightbox-open { overflow: hidden; }

button { font: inherit; }

.gallery-header {
  min-height: 92px;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #090909;
}

.gallery-header img {
  width: min(230px, 45vw);
  height: 54px;
  object-fit: contain;
  object-position: left center;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 24px;
}

.legal-links {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.legal-links a {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.legal-links a:hover,
.legal-links a:focus-visible {
  color: white;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.photo-wall {
  column-width: 180px;
  column-gap: 0;
  line-height: 0;
}

.photo-tile {
  position: relative;
  width: 100%;
  display: block;
  border: 0;
  padding: 0;
  background: #151515;
  cursor: zoom-in;
  break-inside: avoid;
  overflow: hidden;
}

.photo-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.16);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.photo-tile:hover::after,
.photo-tile:focus-visible::after { opacity: 1; }

.photo-tile:focus-visible { outline: 3px solid white; outline-offset: -3px; }

.photo-tile img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 300ms ease;
}

.photo-tile:hover img { transform: scale(1.025); }

.gallery-footer {
  min-height: 78px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #777;
  background: #090909;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.lightbox {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.94);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}

.lightbox[hidden] { display: none; }

.lightbox figure {
  margin: 0;
  max-width: calc(100vw - 110px);
  max-height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: zoom-out;
}

.lightbox figure img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 108px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
}

.lightbox figcaption {
  height: 38px;
  padding-top: 13px;
  color: #bbb;
  font-size: 12px;
  letter-spacing: .04em;
}

.lightbox-close,
.lightbox-arrow {
  position: fixed;
  z-index: 2;
  border: 0;
  color: white;
  background: rgba(20,20,20,.55);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.lightbox-close {
  top: 14px;
  right: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 34px;
  line-height: 42px;
}

.lightbox-arrow {
  top: 50%;
  width: 48px;
  height: 72px;
  margin-top: -36px;
  font-size: 54px;
  line-height: 60px;
}

.lightbox-previous { left: 8px; }
.lightbox-next { right: 8px; }
.lightbox-close:hover, .lightbox-arrow:hover { background: rgba(70,70,70,.8); transform: scale(1.05); }

@media (max-width: 560px) {
  .gallery-header { min-height: 76px; padding: 12px 16px; }
  .gallery-header img { height: 46px; }
  .header-meta { gap: 10px; }
  .legal-links { gap: 12px; }
  .legal-links a { font-size: 10px; }
  .photo-wall { column-width: 150px; }
  .gallery-footer { padding: 20px 16px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .lightbox figure { max-width: calc(100vw - 24px); }
  .lightbox-arrow { width: 42px; height: 58px; font-size: 44px; background: rgba(0,0,0,.45); }
}

@media (prefers-reduced-motion: reduce) {
  .photo-tile img, .photo-tile::after, .lightbox-close, .lightbox-arrow { transition: none; }
}
