.gallery-body{
  background:var(--bg);
}

/* header override: gallery has no video behind it, so drop the
   difference-blend trick used on the main page and make links clickable */
.gallery-body .site-header{
  position:fixed;
  pointer-events:auto;
  mix-blend-mode:normal;
  background:linear-gradient(to bottom, rgba(11,11,12,.92), rgba(11,11,12,0));
}
.gallery-body .logo{
  color:var(--ink);
  text-decoration:none;
}
.back-link{
  font-size:.75rem;
  letter-spacing:.15em;
  text-transform:uppercase;
  color:var(--ink-dim);
  text-decoration:none;
  transition:color .3s ease;
}
.back-link:hover{ color:var(--accent); }

.gallery-main{
  padding-top:0;
}

.gallery-hero{
  min-height:60vh;
  min-height:60dvh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:16vh 8vw 8vh;
}
.gallery-hero h1{
  font-family:var(--serif);
  font-weight:300;
  font-size:clamp(2.6rem, 6vw, 5rem);
  letter-spacing:.02em;
  margin-bottom:20px;
}
.gallery-hero__sub{
  font-size:.95rem;
  font-weight:300;
  color:var(--ink-dim);
  max-width:46ch;
  line-height:1.7;
}

.gallery-group{
  padding:6vh 6vw 8vh;
  max-width:1600px;
  margin:0 auto;
}
.gallery-group__head{
  display:flex;
  align-items:baseline;
  gap:20px;
  margin-bottom:5vh;
  border-bottom:1px solid rgba(244,241,234,.12);
  padding-bottom:22px;
}
.gallery-group__head .version-index{
  margin-bottom:0;
}
.gallery-group__head h2{
  font-family:var(--serif);
  font-weight:500;
  font-size:clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing:.02em;
  color:#fff;
}

.gallery-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(300px, 1fr));
  gap:28px;
  perspective:1400px;
}

.gallery-card{
  position:relative;
  aspect-ratio:4 / 3;
  border-radius:6px;
  overflow:hidden;
  cursor:pointer;
  background:#111;
  box-shadow:0 20px 40px rgba(0,0,0,.35);
  transform:rotateX(0) rotateY(0) scale(1);
  transition:transform .5s cubic-bezier(.16,.8,.24,1), box-shadow .5s ease;
  will-change:transform;
}
.gallery-card::after{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background:radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,.22), transparent 55%);
  opacity:0;
  transition:opacity .4s ease;
}
.gallery-card:hover::after{ opacity:1; }
.gallery-card:hover{
  box-shadow:0 30px 60px rgba(0,0,0,.5);
}
.gallery-card img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transform:scale(1.02);
  transition:transform .6s ease;
}
.gallery-card:hover img{
  transform:scale(1.08);
}

.gallery-footer{
  display:flex;
  justify-content:center;
  padding:6vh 8vw 14vh;
}

/* ---------- lightbox ---------- */
.lightbox{
  position:fixed;
  inset:0;
  z-index:200;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(6,6,7,.94);
  opacity:0;
  visibility:hidden;
  transition:opacity .35s ease, visibility .35s ease;
}
.lightbox.is-open{
  opacity:1;
  visibility:visible;
}
.lightbox__img{
  max-width:88vw;
  max-height:86vh;
  border-radius:4px;
  box-shadow:0 30px 80px rgba(0,0,0,.6);
  transform:scale(.96);
  transition:transform .35s cubic-bezier(.16,.8,.24,1);
}
.lightbox.is-open .lightbox__img{
  transform:scale(1);
}
.lightbox__close{
  position:absolute;
  top:28px;
  right:32px;
  width:44px;
  height:44px;
  border-radius:50%;
  border:1px solid rgba(244,241,234,.3);
  background:transparent;
  color:var(--ink);
  font-size:1.6rem;
  line-height:1;
  cursor:pointer;
  transition:background .3s ease, border-color .3s ease;
}
.lightbox__close:hover{
  background:rgba(244,241,234,.1);
  border-color:var(--accent);
}

@media (max-width:780px){
  .gallery-grid{ grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:18px; }
  .gallery-group{ padding:5vh 6vw 6vh; }
}
