/* ===================================================
   SCROLL3D.CSS — אנימציות תלת מימד בגלילה
   =================================================== */

/* ---- Perspective container ---- */
html {
  /* scroll-behavior: smooth removed to prevent conflict with Lenis */
}

/* Custom Global Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0a0614; /* Match site dark theme */
}
::-webkit-scrollbar-thumb {
  background: rgba(217, 194, 255, 0.2);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 194, 255, 0.4);
}



/* ---- 3D canvas overlay ---- */
#canvas3d {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   REVEAL ANIMATIONS — 3D entry effects
   ============================================ */

/* Base state — elements hidden before animation */
[data-3d] {
  opacity: 0;
  will-change: transform, opacity;
}

/* Tilt card on hover */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}
.tilt-card-inner {
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}



/* ============================================
   3D SCROLL SECTIONS
   ============================================ */

/* Parallax depth layers */
.depth-layer-0 { transform: translateZ(0px);   }
.depth-layer-1 { transform: translateZ(-50px);  }
.depth-layer-2 { transform: translateZ(-100px); }
.depth-layer-3 { transform: translateZ(-200px); }

/* ---- HERO parallax ---- */
.hero {
  perspective: 1200px;
  perspective-origin: 50% 50%;
}
.hero img {
  transition: transform 0.05s linear;
  will-change: transform;
}

/* ---- Scroll-triggered 3D reveals ---- */

/* Fly in from left with rotate */
[data-3d="fly-left"] {
  transform: perspective(800px) rotateY(45deg) translateX(-120px) translateZ(-80px);
}
[data-3d="fly-left"].animate-in {
  animation: flyLeft 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes flyLeft {
  to {
    opacity: 1;
    transform: perspective(800px) rotateY(0deg) translateX(0) translateZ(0);
  }
}

/* Fly in from right with rotate */
[data-3d="fly-right"] {
  transform: perspective(800px) rotateY(-45deg) translateX(120px) translateZ(-80px);
}
[data-3d="fly-right"].animate-in {
  animation: flyRight 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes flyRight {
  to {
    opacity: 1;
    transform: perspective(800px) rotateY(0deg) translateX(0) translateZ(0);
  }
}

/* Rise from below with 3D flip */
[data-3d="rise-flip"] {
  transform: perspective(600px) rotateX(70deg) translateY(80px) translateZ(-60px);
  transform-origin: bottom center;
}
[data-3d="rise-flip"].animate-in {
  animation: riseFlip 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes riseFlip {
  to {
    opacity: 1;
    transform: perspective(600px) rotateX(0deg) translateY(0) translateZ(0);
  }
}

/* Zoom from depth */
[data-3d="zoom-depth"] {
  transform: perspective(1000px) translateZ(-300px) scale(0.5);
}
[data-3d="zoom-depth"].animate-in {
  animation: zoomDepth 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes zoomDepth {
  to {
    opacity: 1;
    transform: perspective(1000px) translateZ(0) scale(1);
  }
}

/* Spin and land */
[data-3d="spin-land"] {
  transform: perspective(800px) rotateY(180deg) translateZ(-100px);
}
[data-3d="spin-land"].animate-in {
  animation: spinLand 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes spinLand {
  to {
    opacity: 1;
    transform: perspective(800px) rotateY(0deg) translateZ(0);
  }
}

/* Unfold from top */
[data-3d="unfold"] {
  transform: perspective(800px) rotateX(-90deg);
  transform-origin: top center;
}
[data-3d="unfold"].animate-in {
  animation: unfold 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes unfold {
  to {
    opacity: 1;
    transform: perspective(800px) rotateX(0deg);
  }
}

/* ============================================
   STAGGER DELAY CLASSES
   ============================================ */
[data-delay="1"] { animation-delay: 0.1s !important; }
[data-delay="2"] { animation-delay: 0.2s !important; }
[data-delay="3"] { animation-delay: 0.3s !important; }
[data-delay="4"] { animation-delay: 0.4s !important; }
[data-delay="5"] { animation-delay: 0.5s !important; }
[data-delay="6"] { animation-delay: 0.6s !important; }

/* ============================================
   PARALLAX SCROLL ELEMENTS
   ============================================ */
.parallax-slow  { will-change: transform; }
.parallax-med   { will-change: transform; }
.parallax-fast  { will-change: transform; }

/* ============================================
   MAGNETIC BUTTON EFFECT
   ============================================ */
.btn-light, .btn-ghost, .nav-cta {
  transition: transform 0.15s ease-out, background 0.2s, color 0.2s !important;
  will-change: transform;
}

/* ============================================
   3D CARD HOVER (Event cards)
   ============================================ */
.ecard {
  transform-style: preserve-3d;
  perspective: 800px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s !important;
  will-change: transform;
}
.ecard:hover {
  transform: perspective(800px) rotateX(-5deg) rotateY(5deg) translateY(-12px) scale(1.02) !important;
  box-shadow: 20px 30px 60px rgba(123, 47, 247, 0.35), 0 5px 15px rgba(0,0,0,0.3) !important;
}

/* Gallery figures 3D hover */
.gal-grid figure {
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s !important;
  will-change: transform;
}
.gal-grid figure:hover {
  transform: perspective(600px) rotateX(-4deg) rotateY(4deg) translateZ(20px) scale(1.03) !important;
  box-shadow: 10px 20px 40px rgba(123, 47, 247, 0.3) !important;
}

/* Video card 3D hover */
.vid {
  transform-style: preserve-3d;
  perspective: 800px;
  will-change: transform;
}
.vid:hover {
  transform: perspective(800px) rotateX(-4deg) translateY(-8px) !important;
  box-shadow: 0 30px 60px rgba(123, 47, 247, 0.2) !important;
}

/* ============================================
   SECTION TRANSITION: WAVE WARP
   ============================================ */
.sec {
  position: relative;
  overflow: visible;
}

/* ============================================
   TEXT REVEAL: CHAR-BY-CHAR 3D
   ============================================ */
.text-3d-reveal .char {
  display: inline-block;
  opacity: 0;
  transform: perspective(400px) rotateY(90deg) translateZ(-20px);
  animation: charReveal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes charReveal {
  to {
    opacity: 1;
    transform: perspective(400px) rotateY(0deg) translateZ(0);
  }
}

/* ============================================
   GLOWING ORBIT RING (decorative)
   ============================================ */
#orbit-ring {
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  border: 1px solid rgba(123, 47, 247, 0.15);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotateX(70deg);
  pointer-events: none;
  z-index: 0;
  animation: orbitPulse 8s ease-in-out infinite;
}
#orbit-ring::before {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #d9c2ff;
  box-shadow: 0 0 20px 5px rgba(217, 194, 255, 0.6);
  top: -6px; left: 50%;
  transform: translateX(-50%);
  animation: orbitDot 8s linear infinite;
}
@keyframes orbitPulse {
  0%, 100% { border-color: rgba(123, 47, 247, 0.15); transform: translate(-50%, -50%) rotateX(70deg) scale(1); }
  50% { border-color: rgba(201, 169, 255, 0.3); transform: translate(-50%, -50%) rotateX(70deg) scale(1.05); }
}
@keyframes orbitDot {
  0% { transform: translateX(-50%) rotate(0deg) translateX(300px) rotate(0deg); }
  100% { transform: translateX(-50%) rotate(360deg) translateX(300px) rotate(-360deg); }
}

/* ============================================
   SCROLL-LINKED MORPH SHAPES
   ============================================ */
.morph-blob {
  position: fixed;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  filter: blur(60px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
  animation: blobMorph 12s ease-in-out infinite;
  will-change: transform, border-radius;
}
.morph-blob-1 {
  width: 500px; height: 500px;
  background: #d9c2ff;
  top: -100px; right: -100px;
  animation-delay: 0s;
}
.morph-blob-2 {
  width: 400px; height: 400px;
  background: #c9a9ff;
  bottom: -50px; left: -80px;
  animation-delay: -6s;
}
@keyframes blobMorph {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; transform: scale(1) rotate(0deg); }
  25%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; transform: scale(1.05) rotate(5deg); }
  50%       { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; transform: scale(0.95) rotate(-5deg); }
  75%       { border-radius: 60% 40% 60% 30% / 60% 30% 40% 60%; transform: scale(1.02) rotate(3deg); }
}

/* ============================================
   NAV GLASSMORPHISM (enhanced)
   ============================================ */
header {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(15, 5, 25, 0.7) !important; /* Very dark purple */
  border-bottom: 1px solid rgba(201, 169, 255, 0.1) !important;
  transition: all 0.4s ease;
}
header.scrolled {
  background: rgba(15, 5, 25, 0.98) !important; /* Very dark purple on scroll */
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
header .brand img.nav-logo {
  height: 48px;
  width: auto;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.25));
}

/* ============================================
   CURSOR GLOW
   ============================================ */
#cursor-glow {
  position: fixed;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 47, 247, 0.12) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: transform 0.1s linear, width 0.3s, height 0.3s, opacity 0.3s;
  will-change: transform;
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */
.count-up {
  font-variant-numeric: tabular-nums;
}

/* ============================================
   SECTION BADGE FLOAT
   ============================================ */
.about-media .badge {
  animation: badgeFloat 4s ease-in-out infinite !important;
  background: linear-gradient(135deg, #d9c2ff, #b28fff) !important;
}
@keyframes badgeFloat {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50%       { transform: translateY(-10px) rotate(2deg); }
}

/* ============================================
   CINEMATIC HERO PARALLAX
   ============================================ */
.hero-inner {
  will-change: transform;
}

/* ============================================
   3D CYLINDER CAROUSEL
   ============================================ */

#page-gallery {
  background-color: #0a0614;
  background-image: 
    radial-gradient(rgba(217, 194, 255, 0.04) 1.5px, transparent 1.5px), /* Subtle dot texture */
    radial-gradient(circle at center, #1b1626 0%, #0a0614 70%); /* Dark cinematic background */
  background-size: 24px 24px, auto;
  padding-bottom: 60px;
}

#page-gallery .page-head {
  padding-bottom: 0;
}

/* The section itself — tall enough to allow scrolling through the full rotation */
.carousel-section {
  position: relative;
  height: 130vh; /* Shorter scroll space so it finishes faster */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transform-style: preserve-3d; /* Prevent horizontal scroll from 3D overflow */
  padding-top: 100px; /* Increased gap to raise the title above the wheel */
  margin-top: 0px; /* Reset */
}

/* The 3D viewport — fixed in center while scrolling through the section */
.carousel-viewport {
  position: sticky;
  top: 10vh; /* Raised slightly higher on the screen */
  transform: none; /* Removed translateY to fix overlap/gap confusion */
  width: 100%;
  max-width: 1200px;
  height: 500px;
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 150px auto; /* 150px bottom margin added AFTER '0 auto' to ensure it's not overwritten */
}

/* The rotating cylinder container */
.carousel-cylinder {
  position: relative;
  width: 280px;
  height: 380px;
  transform-style: preserve-3d;
  will-change: transform;
  /* Initial rotation set via JS */
}

/* Each card in the cylinder */
.carousel-item {
  position: absolute;
  width: 240px; /* 9:16 ratio for shorts */
  height: 426px;
  margin: 0;
  backface-visibility: hidden;
  border-radius: 18px;
  transform-style: preserve-3d;
  background: #1a1525;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(201, 169, 255, 0.08);
  transition: box-shadow 0.4s ease, filter 0.4s ease, width 0.3s ease, height 0.3s ease;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  border: 1px solid rgba(255,255,255,0.1);
}

.carousel-item::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  background: #0f0a17;
  transform: translateZ(-16px);
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 15px 40px rgba(0,0,0,0.9);
}

.carousel-item::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 12px;
  background: #000;
  transform: translateZ(-8px);
  opacity: 0.7;
}

.carousel-item img {
  border-radius: 18px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
  opacity: 0.8;
  
  /* Prevent image dragging */
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.play-overlay {
  border-radius: 18px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Darken top + bottom of each short, keep the middle clear */
  background:
    linear-gradient(to bottom,
      rgba(15, 5, 25, 0.75) 0%,
      rgba(15, 5, 25, 0) 22%,
      rgba(15, 5, 25, 0) 68%,
      rgba(15, 5, 25, 0.85) 100%);
  transition: background 0.3s;
}

.play-overlay svg {
  width: 64px;
  height: 64px;
  fill: #d9c2ff;
  stroke: #d9c2ff;
  stroke-width: 2.5px;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
  transition: transform 0.3s ease, fill 0.3s ease, stroke 0.3s ease;
}

/* Glassmorphism Shine Overlay */
.carousel-item::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%, rgba(255,255,255,0.05) 100%);
  border: 1px solid rgba(255,255,255,0.15);
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.4s ease, border-color 0.4s ease;
}

.carousel-item:hover::after {
  opacity: 1;
  border-color: rgba(255,255,255,0.4);
}

/* Caption overlay */
.carousel-item figcaption {
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 24px 18px 18px;
  background: linear-gradient(transparent, rgba(15, 5, 25, 0.9) 60%);
  color: #fff;
  font-family: 'Heebo', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 1px;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Hover effects */
.carousel-item:hover {
  
  z-index: 10;
  /* Removed transform: scale3d(1.05, 1.05, 1.05) !important; to stop shaking */
}

.carousel-item:hover img { opacity: 1; }

.carousel-item:hover .play-overlay svg {
  transform: scale(1.15);
  fill: #fff;
  stroke: #fff;
}

.carousel-item:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

/* Reflection / floor effect */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 255, 0.35);
  background: rgba(28, 21, 38, 0.75);
  backdrop-filter: blur(8px);
  color: #d9c2ff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s, color 0.25s;
}
.carousel-arrow svg { width: 24px; height: 24px; }
.carousel-arrow.next { right: 24px; }
.carousel-arrow.prev { left: 24px; }
.carousel-arrow:hover, .carousel-arrow:focus-visible {
  background: #944DFF;
  color: #fff;
  transform: translateY(-50%) scale(1.08);
}
@media (max-width: 768px) {
  .carousel-arrow { width: 42px; height: 42px; }
  .carousel-arrow.next { right: 8px; }
  .carousel-arrow.prev { left: 8px; }
}

.carousel-viewport::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: 10%;
  right: 10%;
  height: 120px;
  background: radial-gradient(ellipse at center, rgba(201, 169, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ============================================
   VIDEO MODAL POPUP
   ============================================ */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(15, 5, 25, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.video-modal.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 400px; /* Shorts ratio max width */
  max-height: 90vh;
  aspect-ratio: 9/16;
  background: #000;
  border-radius: 24px;
  overflow: hidden;
  transform-style: preserve-3d;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.video-modal.open .modal-content {
  transform: translateY(0) scale(1);
}

.modal-content iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  border-radius: 24px;
}

.close-modal {
  position: absolute;
  top: 30px;
  right: 30px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 50px; height: 50px;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.3s, transform 0.3s;
  z-index: 2;
}

.close-modal:hover {
  background: rgba(255,255,255,0.2);
  transform: rotate(90deg);
}

/* Responsive */
@media (max-width: 900px) {
  .carousel-cylinder,
  .carousel-item {
    width: 200px;
    height: 355px;
  }
}

@media (max-width: 768px) {
  .carousel-section {
    /* Section hugs the wheel: no sticky-scroll travel, so the page doesn't stretch past the wheel */
    height: auto;
    padding-top: 60px;
    padding-bottom: 40px;
    overflow: hidden; /* keep the 3D wheel's side items from poking outside the page */
  }
  .carousel-viewport {
    position: relative;
    top: 0;
    height: 400px;
    perspective: 900px;
    margin-bottom: 20px;
  }
  .carousel-cylinder,
  .carousel-item {
    width: 160px;
    height: 284px;
  }
}

@media (max-width: 480px) {
  .carousel-cylinder,
  .carousel-item {
    width: 130px;
    height: 231px;
  }



  .carousel-viewport {
    height: 320px;
    perspective: 700px;
  }
}

.carousel-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #0f0b15;
  border-radius: 18px;
  transform: translateZ(-12px);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 15px 35px rgba(0,0,0,0.8);
  pointer-events: none;
}

/* ============================================
   GALLERY OVERLAY
   ============================================ */
.gallery-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #0a0614;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  clip-path: circle(0% at 50% 50%); /* Tunnel portal closed by default */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gallery-overlay.active {
  visibility: visible;
  pointer-events: auto;
}

.gallery-header {
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 6, 20, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.gallery-header h2 {
  font-size: 2rem;
  color: #fff;
  font-weight: 700;
}

.close-gallery {
  background: rgba(255,255,255,0.1);
  border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

.close-gallery:hover {
  background: rgba(255,255,255,0.2);
}

.gallery-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 40px 80px;
  perspective: 1500px; /* Needed for 3D tunnel effect */
  transform-style: preserve-3d;
}

/* Custom Scrollbar for Gallery */
.gallery-content::-webkit-scrollbar {
  width: 8px;
}
.gallery-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}
.gallery-content::-webkit-scrollbar-thumb {
  background: rgba(217, 194, 255, 0.2);
  border-radius: 10px;
}
.gallery-content::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 194, 255, 0.4);
}

.masonry-grid {
  column-count: 3;
  column-gap: 20px;
}

.m-item {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: 12px;
  transform-origin: center center;
  backface-visibility: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.m-item img {
  width: 100%;
  display: block;
  border-radius: 12px;
  transition: transform 0.4s ease;
  cursor: pointer;
}

.m-item:hover img {
  transform: scale(1.03);
}

.m-item-video {
  position: relative;
  overflow: hidden;
  aspect-ratio: 9/16;
}
.m-item-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   LIGHTBOX OVERLAY
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(10px);
}
.lightbox.active {
  opacity: 1;
  visibility: visible;
}
.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lightbox.active img {
  transform: scale(1);
}
.close-lightbox {
  position: absolute;
  top: 30px; left: 30px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 50px; height: 50px;
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.close-lightbox:hover {
  background: rgba(255,255,255,0.2);
  transform: rotate(90deg);
}

@media (max-width: 900px) {
  .masonry-grid { column-count: 2; }
}
@media (max-width: 600px) {
  .masonry-grid { column-count: 1; }
  .gallery-header, .gallery-content { padding-left: 20px; padding-right: 20px; }
}
