.gallery-section {
  position: relative;
  padding: 8rem 2rem 12rem;
  background: linear-gradient(to bottom, #000, #000);
  color: white;
  overflow: hidden;
  isolation: isolate;
}

/* Decorative glow blobs */
.gallery-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(11rem);
  opacity: 0.18;
  z-index: 0;
}
.gallery-blob-purple {
  top: -6rem;
  left: -6rem;
  width: 23rem;
  height: 23rem;
  background: #9b5de5;
}
.gallery-blob-cyan {
  bottom: -10rem;
  right: -8rem;
  width: 27rem;
  height: 27rem;
  background: #00acee;
}

/* Container & Header */
.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.gallery-header {
  text-align: center;
  margin-bottom: 4rem;
}

.gallery-header h2 {
  font-size: 4rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
  letter-spacing: -1px;
}

.gallery-header p {
  color: #b3b3b3;
  font-size: 1.2rem;
  max-width: 650px;
  margin: 0.5rem auto 0;
}

/* Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2.5rem;
  justify-items: center;
}

/* Cards — global fade-up classes still used from style.css */
.gallery-card {
  width: 100%;
  max-width: 340px;
  position: relative;
}

/* Perspective wrapper for tilt */
.gallery-tilt {
  perspective: 900px;
}

/* Image wrapper — glass frame + shadow */
.gallery-img-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  aspect-ratio: 1 / 1;
  box-shadow:
    0 8px 35px rgba(0,0,0,0.65),
    0 0 28px rgba(155, 93, 229, 0.18);
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.4s ease;
}

.gallery-card:hover .gallery-img-wrapper {
  box-shadow:
    0 14px 45px rgba(0,0,0,0.75),
    0 0 36px rgba(155, 93, 229, 0.35),
    0 0 24px rgba(0, 172, 238, 0.28);
}

/* Image — blur-in + zoom */
.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(10px);
  opacity: 0;
  transform: scale(1.05);
  transition: opacity .6s ease, filter .6s ease, transform .6s ease;
}

.gallery-img.loaded {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.gallery-card:hover .gallery-img {
  transform: scale(1.06);
}

/* Overlay wash */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(155, 93, 229, 0.35),
    rgba(0, 172, 238, 0.15),
    transparent
  );
  opacity: 0;
  transition: opacity .35s ease;
}
.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

/* Floating label */
.gallery-label {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;

  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);

  opacity: 0;
  transform: translateY(10px);
  transition: opacity .35s ease, transform .35s ease;
}
.gallery-card:hover .gallery-label {
  opacity: 1;
  transform: translateY(0);
}

/* Lightbox */

#lightboxOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
}

.lightbox-inner {
  position: relative;
  max-width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#lightboxOverlay img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 1rem;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.9),
    0 0 40px rgba(155, 93, 229, 0.4);
  animation: lightboxPop .35s ease;
}

/* Caption */
.lightbox-caption {
  font-size: 0.95rem;
  color: #e5e7eb;
  text-align: center;
  max-width: 600px;
}

/* Close + nav buttons */
.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(0,0,0,0.6);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform .2s ease, background .25s ease, box-shadow .25s ease;
}

.lightbox-close {
  top: -1.5rem;
  right: -1.5rem;
  font-size: 1.4rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
}

.lightbox-prev {
  left: -2.5rem;
}

.lightbox-next {
  right: -2.5rem;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(180,106,255,0.8);
  box-shadow: 0 0 20px rgba(180,106,255,0.7);
  transform: translateY(-50%) scale(1.06);
}

.lightbox-close:hover {
  transform: scale(1.06);
}

/* Lightbox pop animation */
@keyframes lightboxPop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-header h2 {
    font-size: 3rem;
  }

  .gallery-section {
    padding: 6rem 1.5rem 10rem;
  }

  .gallery-grid {
    gap: 2rem;
  }

  .lightbox-prev {
    left: -1.5rem;
  }
  .lightbox-next {
    right: -1.5rem;
  }
}
