.gallery-hero {
  padding-bottom: clamp(3.5rem, 7vw, 5.8rem);
}

.gallery-hero h1 {
  max-width: 11ch;
}

.gallery-hero .fact-card .big {
  font-size: clamp(3.5rem, 7vw, 5.8rem);
}

.gallery-surface {
  padding: clamp(3.8rem, 8vw, 7rem) 0;
  background: var(--paper);
  color: var(--ink);
}

.gallery-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.42fr);
  align-items: end;
  gap: 2rem;
  margin-bottom: 2rem;
}

.gallery-intro h2 {
  max-width: 12ch;
  margin-bottom: 0;
  font-size: clamp(2.7rem, 6vw, 5rem);
  font-weight: 1000;
  letter-spacing: -0.065em;
}

.gallery-intro > p {
  margin-bottom: 0;
  color: #565852;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 92px;
  gap: 0.9rem;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  margin: 0;
  border: 1px solid #8d8e87;
  background: #20231f;
}

.gallery-card:nth-child(1) { grid-column: span 5; grid-row: span 6; }
.gallery-card:nth-child(2) { grid-column: span 7; grid-row: span 6; }
.gallery-card:nth-child(3) { grid-column: span 4; grid-row: span 5; }
.gallery-card:nth-child(4) { grid-column: span 8; grid-row: span 5; }
.gallery-card:nth-child(5),
.gallery-card:nth-child(6),
.gallery-card:nth-child(7) { grid-column: span 4; grid-row: span 6; }
.gallery-card:nth-child(8),
.gallery-card:nth-child(9),
.gallery-card:nth-child(10) { grid-column: span 4; grid-row: span 5; }

.gallery-open {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: zoom-in;
  text-align: left;
}

.gallery-open::after {
  position: absolute;
  inset: 38% 0 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.92));
}

.gallery-open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.gallery-open:hover img,
.gallery-open:focus-visible img {
  transform: scale(1.025);
}

.gallery-open:focus-visible {
  outline: 5px solid var(--yellow);
  outline-offset: -5px;
}

.gallery-caption {
  position: absolute;
  right: 1.15rem;
  bottom: 1.1rem;
  left: 1.15rem;
  z-index: 2;
  display: grid;
  gap: 0.3rem;
  font-size: clamp(1.15rem, 2.5vw, 1.8rem);
  font-weight: 950;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.gallery-caption small {
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-proof {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem;
  margin-top: 1rem;
  padding: clamp(1.6rem, 4vw, 2.5rem);
  background: var(--ink);
  color: var(--paper);
}

.gallery-proof h2 {
  margin-bottom: 0.55rem;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 1000;
  letter-spacing: -0.05em;
}

.gallery-proof p {
  max-width: 48rem;
  margin-bottom: 0;
  color: var(--paper-muted);
}

.gallery-proof .button {
  white-space: nowrap;
}

.gallery-dialog {
  width: min(1080px, calc(100% - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--yellow);
  border-radius: 0;
  background: #0c0e0c;
  color: #fff;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.72);
}

.gallery-dialog::backdrop {
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(7px);
}

.gallery-dialog figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: calc(100dvh - 2.25rem);
  margin: 0;
}

.gallery-dialog img {
  display: block;
  width: 100%;
  height: min(76dvh, 760px);
  background: #080908;
  object-fit: contain;
}

.gallery-dialog figcaption {
  padding: 1rem 4.5rem 1.1rem 1.15rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
}

.gallery-close {
  position: absolute;
  right: 0.75rem;
  bottom: 0.7rem;
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid var(--yellow);
  background: var(--yellow);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.35rem;
  font-weight: 950;
}

body.dialog-open { overflow: hidden; }

@media (max-width: 900px) {
  .gallery-intro,
  .gallery-proof { grid-template-columns: 1fr; }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 270px;
  }

  .gallery-card,
  .gallery-card:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  .gallery-card:nth-child(2),
  .gallery-card:nth-child(4),
  .gallery-card:nth-child(9),
  .gallery-card:nth-child(10) { grid-column: span 2; }

  .gallery-proof .button { justify-self: start; }
}

@media (max-width: 620px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 330px;
    gap: 0.7rem;
  }

  .gallery-card,
  .gallery-card:nth-child(n) { grid-column: auto; }
  .gallery-caption { font-size: 1.25rem; }
  .gallery-proof .button { width: 100%; }

  .gallery-dialog {
    width: calc(100% - 0.75rem);
    max-height: calc(100dvh - 6rem);
  }

  .gallery-dialog figure { max-height: calc(100dvh - 6.25rem); }
  .gallery-dialog img { height: calc(100dvh - 11.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-open img { transition: none; }
}
