.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0, 0, 0, 0);
  white-space:nowrap;
  border:0;
}

.gallery-section{
  background:transparent;
  color:#fff;
  padding:clamp(36px, 6vh, 72px) clamp(16px, 6vw, 80px) clamp(52px, 8vh, 96px);
}

.gallery-shell{
  width:min(1280px, 100%);
  margin:0 auto;
  position:relative;
}

.gallery-shell::before{
  content:"";
  position:absolute;
  top:clamp(12px, 2vw, 28px);
  left:clamp(-10px, -2vw, -20px);
  width:min(52vw, 640px);
  height:min(36vw, 440px);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.06), transparent 36%),
    linear-gradient(135deg, rgba(143,5,5,0.22), transparent 62%);
  filter:blur(46px);
  opacity:0.82;
  pointer-events:none;
  z-index:0;
}

.gallery-header,
.gallery-controls,
.gallery-grid,
.gallery-expand,
.gallery-empty{
  position:relative;
  z-index:1;
}

.gallery-header{
  display:grid;
  grid-template-columns:minmax(0, 460px) minmax(0, 1fr);
  gap:clamp(18px, 3vw, 54px);
  align-items:end;
  margin-bottom:clamp(22px, 4vh, 34px);
}

.gallery-kicker{
  margin:0 0 10px;
  text-transform:uppercase;
  letter-spacing:0.14em;
  font-weight:700;
  font-size:clamp(11px, 0.85vw, 13px);
  color:rgba(255,255,255,0.72);
}

.gallery-title{
  margin:0;
  font-weight:700;
  letter-spacing:0.02em;
  text-transform:uppercase;
  font-size:clamp(24px, 4.4vw, 56px);
  line-height:0.98;
  max-width:none;
}

.gallery-title-line{
  display:block;
}

.gallery-copy{
  margin:0;
  max-width:54ch;
  color:rgba(255,255,255,0.84);
  font-weight:600;
  font-size:clamp(15px, 1.2vw, 19px);
  line-height:1.6;
}

.gallery-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
  margin-bottom:clamp(18px, 3vh, 28px);
}

.gallery-filters{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.gallery-filter{
  appearance:none;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:8px;
  background:rgba(6,6,8,0.72);
  color:#fff;
  padding:11px 16px;
  font:inherit;
  font-weight:700;
  letter-spacing:0.08em;
  text-transform:uppercase;
  font-size:12px;
  cursor:pointer;
  transition:transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.gallery-filter:hover,
.gallery-filter:focus-visible{
  transform:translateY(-1px);
  border-color:rgba(255,84,108,0.38);
  box-shadow:0 14px 30px rgba(0,0,0,0.3), 0 0 20px rgba(255,34,54,0.18);
}

.gallery-filter[aria-pressed="true"]{
  background:var(--button-fill);
  border-color:rgba(255,255,255,0.18);
  box-shadow:var(--button-shadow);
}

.gallery-filter:disabled{
  opacity:0.5;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

.gallery-caption-rail{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:20px;
  color:rgba(255,255,255,0.58);
  font-size:12px;
  font-weight:700;
  letter-spacing:0.12em;
  text-transform:uppercase;
}

.gallery-caption-rail::before{
  content:"";
  width:44px;
  height:1px;
  background:linear-gradient(90deg, rgba(255,34,54,0), rgba(255,34,54,0.92));
}

.gallery-grid{
  display:grid;
  grid-template-columns:repeat(12, minmax(0, 1fr));
  grid-auto-rows:8px;
  grid-auto-flow:row;
  gap:clamp(12px, 1.5vw, 18px);
  align-items:start;
}

.gallery-grid--expanding{
  transition:height 0.55s cubic-bezier(.22,.8,.24,1);
  will-change:height;
}

.gallery-expand{
  display:flex;
  justify-content:center;
  margin-top:clamp(18px, 3vh, 28px);
}

.gallery-expand[hidden],
.gallery-expand-button[hidden]{
  display:none !important;
}

.gallery-expand-button{
  appearance:none;
  border:0;
  background:transparent;
  color:rgba(246,241,226,0.72);
  padding:10px 18px;
  font:inherit;
  font-size:clamp(13px, 1.05vw, 16px);
  font-weight:700;
  letter-spacing:0.13em;
  text-transform:uppercase;
  cursor:pointer;
  text-shadow:0 0 18px rgba(246,241,226,0.18);
  transition:color 0.22s ease, opacity 0.22s ease, transform 0.22s ease, text-shadow 0.22s ease;
}

.gallery-expand-button::after{
  content:"";
  display:block;
  width:100%;
  height:1px;
  margin-top:8px;
  background:linear-gradient(90deg, transparent, rgba(246,241,226,0.64), transparent);
  opacity:0.72;
}

.gallery-expand-button:hover,
.gallery-expand-button:focus-visible{
  color:rgba(255,250,235,0.94);
  transform:translateY(-1px);
  text-shadow:0 0 22px rgba(255,250,235,0.3);
  outline:none;
}

.gallery-preview-active .gallery-grid{
  margin-bottom:0;
}

.gallery-card{
  appearance:none;
  border:0;
  background:transparent;
  color:inherit;
  padding:0;
  margin:0;
  width:100%;
  display:block;
  cursor:pointer;
  grid-column:span 4;
  opacity:1;
  transform:none;
}

.gallery-card.is-visible{
  opacity:1;
  transform:translateY(0);
}

.gallery-card.gallery-card--revealed{
  opacity:0;
  transform:translateY(-18px) scale(.985);
  animation:gallery-card-reveal 0.46s cubic-bezier(.22,.8,.24,1) forwards;
  animation-delay:calc(var(--gallery-reveal-index, 0) * 42ms);
}

@keyframes gallery-card-reveal{
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}

.gallery-card--hero{
  grid-column:span 7;
}

.gallery-card--wide{
  grid-column:span 6;
}

.gallery-card--feature{
  grid-column:span 5;
}

.gallery-card__frame{
  position:relative;
  display:block;
  width:100%;
  aspect-ratio:var(--gallery-ratio, 1);
  border-radius:8px;
  overflow:hidden;
  background:rgba(10,10,12,0.92);
  border:1px solid rgba(255,255,255,0.08);
  box-shadow:0 26px 58px rgba(0,0,0,0.28);
  transition:transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.gallery-card__frame::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(180deg, rgba(2,2,4,0.08) 0%, rgba(2,2,4,0.08) 30%, rgba(2,2,4,0.88) 100%),
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 42%);
  pointer-events:none;
}

.gallery-card__image{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transform:scale(1.001);
  opacity:0;
  filter:blur(10px);
  transition:transform 0.45s ease, opacity 0.28s ease, filter 0.28s ease;
}

.gallery-card__image.is-loaded{
  opacity:1;
  filter:none;
}

.gallery-card__scan{
  position:absolute;
  top:-30%;
  left:-42%;
  width:36%;
  height:180%;
  background:linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.18), rgba(255,255,255,0));
  transform:rotate(14deg) translateX(0);
  opacity:0;
  transition:transform 0.55s ease, opacity 0.28s ease;
  pointer-events:none;
  mix-blend-mode:screen;
}

.gallery-card__meta{
  position:absolute;
  inset:auto 0 0 0;
  padding:clamp(16px, 2vw, 20px);
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:flex-start;
  z-index:1;
}

.gallery-card__eyebrow{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-size:clamp(13px, 1.1vw, 16px);
  font-weight:700;
  letter-spacing:0.16em;
  text-transform:uppercase;
  color:rgba(255,255,255,0.9);
}

.gallery-card__eyebrow::before{
  content:"";
  width:24px;
  height:2px;
  background:rgba(255,34,54,0.92);
}

.gallery-card__text{
  max-width:32ch;
  color:rgba(255,255,255,0.84);
  font-size:clamp(13px, 1vw, 15px);
  line-height:1.48;
  font-weight:600;
}

.gallery-card:hover .gallery-card__frame,
.gallery-card:focus-visible .gallery-card__frame{
  transform:translateY(-4px);
  border-color:rgba(255,84,108,0.34);
  box-shadow:0 30px 62px rgba(0,0,0,0.4), 0 0 32px rgba(255,34,54,0.16);
}

.gallery-card:hover .gallery-card__image,
.gallery-card:focus-visible .gallery-card__image{
  transform:scale(1.05);
}

.gallery-card:hover .gallery-card__scan,
.gallery-card:focus-visible .gallery-card__scan{
  opacity:0.82;
  transform:rotate(14deg) translateX(320%);
}

.gallery-card:focus-visible{
  outline:none;
}

.gallery-empty{
  margin:16px 0 0;
  padding:18px 0 0;
  color:rgba(255,255,255,0.7);
  font-weight:600;
}

html.gallery-lightbox-open,
body.gallery-lightbox-open{
  overflow:hidden !important;
}

.gallery-lightbox[hidden]{
  display:none !important;
}

.gallery-lightbox{
  position:fixed;
  inset:0;
  z-index:10040;
  display:grid;
  place-items:center;
  padding:16px;
}

.gallery-lightbox__backdrop{
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at center, rgba(143,5,5,0.18), transparent 44%),
    rgba(2,2,5,0.84);
  backdrop-filter:blur(18px);
}

.gallery-lightbox__dialog{
  position:relative;
  z-index:1;
  width:min(1220px, 100%);
  max-height:min(92vh, 900px);
  display:grid;
  grid-template-columns:minmax(0, 1fr) 300px;
  gap:clamp(16px, 2vw, 24px);
  padding:clamp(16px, 2vw, 24px);
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.12);
  background:linear-gradient(145deg, rgba(12,12,16,0.96), rgba(3,3,5,0.96));
  box-shadow:0 36px 96px rgba(0,0,0,0.5);
}

.gallery-lightbox__stage{
  position:relative;
  min-height:0;
  border-radius:8px;
  overflow:hidden;
  background:rgba(6,6,8,0.94);
  border:1px solid rgba(255,255,255,0.06);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:clamp(20px, 3vw, 30px);
}

.gallery-lightbox__stage::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:34px;
  height:34px;
  margin:-17px 0 0 -17px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,0.2);
  border-top-color:rgba(255,34,54,0.9);
  opacity:0;
  transform:rotate(0deg);
  transition:opacity 0.18s ease;
  pointer-events:none;
}

.gallery-lightbox__stage.is-loading::after{
  opacity:1;
  animation:gallery-lightbox-spin 0.8s linear infinite;
}

@keyframes gallery-lightbox-spin{
  to{transform:rotate(360deg);}
}

.gallery-lightbox__image{
  max-width:100%;
  max-height:min(78vh, 760px);
  width:auto;
  height:auto;
  object-fit:contain;
  display:block;
  opacity:0;
  transition:opacity 0.22s ease;
}

.gallery-lightbox__image.is-loaded{
  opacity:1;
}

.gallery-lightbox__sidebar{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-height:0;
  color:#fff;
}

.gallery-lightbox__close{
  align-self:flex-end;
}

.gallery-lightbox__close,
.gallery-lightbox__nav{
  appearance:none;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:8px;
  background:rgba(8,8,10,0.76);
  color:#fff;
  cursor:pointer;
  font:inherit;
  transition:transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.gallery-lightbox__close{
  width:44px;
  height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  line-height:1;
}

.gallery-lightbox__nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:46px;
  height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  line-height:1;
  z-index:1;
}

.gallery-lightbox__nav--prev{
  left:14px;
}

.gallery-lightbox__nav--next{
  right:14px;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus-visible,
.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus-visible{
  transform:translateY(-1px);
  border-color:rgba(255,84,108,0.36);
  box-shadow:0 14px 30px rgba(0,0,0,0.3), 0 0 20px rgba(255,34,54,0.18);
}

.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus-visible{
  transform:translateY(-50%);
}

.gallery-lightbox__nav:disabled{
  opacity:0.35;
  cursor:not-allowed;
  box-shadow:none;
}

.gallery-lightbox__count{
  color:rgba(255,255,255,0.68);
  font-size:12px;
  font-weight:700;
  letter-spacing:0.14em;
  text-transform:uppercase;
}

.gallery-lightbox__category{
  color:rgba(255,255,255,0.72);
  font-size:11px;
  font-weight:700;
  letter-spacing:0.14em;
  text-transform:uppercase;
}

.gallery-lightbox__title{
  margin:0;
  font-weight:700;
  letter-spacing:0.02em;
  text-transform:uppercase;
  font-size:clamp(24px, 2.4vw, 36px);
  line-height:1.02;
}

.gallery-lightbox__text{
  margin:0;
  color:rgba(255,255,255,0.84);
  font-size:clamp(14px, 1.1vw, 17px);
  line-height:1.6;
  font-weight:600;
}

@media (max-width:1100px){
  .gallery-header{
    grid-template-columns:1fr;
  }

  .gallery-grid{
    grid-template-columns:repeat(8, minmax(0, 1fr));
  }

  .gallery-card{
    grid-column:span 4;
  }

  .gallery-card--hero,
  .gallery-card--wide{
    grid-column:span 8;
  }

  .gallery-card--feature{
    grid-column:span 4;
  }

  .gallery-lightbox__dialog{
    grid-template-columns:1fr;
  }
}

@media (max-width:720px){
  .gallery-section{
    padding-inline:16px;
  }

  .gallery-controls{
    align-items:flex-start;
  }

  .gallery-grid{
    grid-template-columns:1fr;
    grid-auto-rows:auto;
  }

  .gallery-card,
  .gallery-card--hero,
  .gallery-card--wide,
  .gallery-card--feature{
    grid-column:1 / -1;
  }

  .gallery-lightbox{
    padding:10px;
  }

  .gallery-lightbox__dialog{
    padding:12px;
    gap:12px;
  }

  .gallery-lightbox__stage{
    padding:44px 12px 52px;
  }

  .gallery-lightbox__nav{
    top:auto;
    bottom:10px;
    transform:none;
  }

  .gallery-lightbox__nav:hover,
  .gallery-lightbox__nav:focus-visible{
    transform:translateY(-1px);
  }

  .gallery-lightbox__nav--prev{
    left:12px;
  }

  .gallery-lightbox__nav--next{
    right:12px;
  }
}

@media (prefers-reduced-motion:reduce){
  .gallery-card,
  .gallery-card__frame,
  .gallery-card__image,
  .gallery-card__scan,
  .gallery-grid--expanding,
  .gallery-expand-button,
  .gallery-lightbox__stage::after,
  .gallery-filter,
  .gallery-lightbox__close,
  .gallery-lightbox__nav{
    transition:none !important;
    animation:none !important;
  }

  .gallery-shell::before{
    animation:none;
  }
}
