.grid.gallery{
  grid-template-columns:repeat(2, 1fr);gap:16px;
  opacity:0;
  animation:galleryFadeIn 0.8s cubic-bezier(.25,.46,.45,.94) 0.3s forwards;
}
@keyframes galleryFadeIn{
  0%{opacity:0;transform:translateY(20px)}
  100%{opacity:1;transform:translateY(0)}
}

@media (max-width:480px){.grid.gallery{grid-template-columns:1fr}}

.thumb{
  position:relative;overflow:hidden;border-radius:12px;
  background:rgba(255,255,255,.05);cursor:pointer;
  transition:transform 0.3s cubic-bezier(.25,.46,.45,.94), 
             box-shadow 0.3s cubic-bezier(.25,.46,.45,.94),
             filter 0.3s cubic-bezier(.25,.46,.45,.94);
  opacity:0;
  transform:translateY(30px) scale(.95);
  animation:thumbEnter 0.6s cubic-bezier(.25,.46,.45,.94) forwards;
}

.thumb:nth-child(odd){animation-delay:0.1s}
.thumb:nth-child(even){animation-delay:0.2s}
.thumb:nth-child(3n){animation-delay:0.3s}
.thumb:nth-child(4n){animation-delay:0.4s}

@keyframes thumbEnter{
  0%{opacity:0;transform:translateY(30px) scale(.95) rotateX(5deg)}
  60%{opacity:1;transform:translateY(-5px) scale(1.02) rotateX(-1deg)}
  100%{opacity:1;transform:translateY(0) scale(1) rotateX(0deg)}
}

.thumb:hover{
  transform:translateY(-3px) scale(1.05);
  box-shadow:0 12px 35px rgba(244,114,182,.25), 0 0 20px rgba(244,114,182,.1);
  filter:saturate(1.1) brightness(1.05);
}

.thumb:active{
  transform:translateY(-1px) scale(1.02);
  transition-duration:.1s;
}

.thumb img{
  width:100%;height:180px;object-fit:cover;display:block;
  transition:transform 0.4s cubic-bezier(.25,.46,.45,.94),
             filter 0.3s cubic-bezier(.25,.46,.45,.94);
}

.thumb:hover img{
  transform:scale(1.1) rotate(1deg);
  filter:contrast(1.1) brightness(1.05);
}

.thumb .actions{position:absolute;top:8px;right:8px;display:flex;gap:6px}

/* Enhanced lightbox styles with better animations */
.lightbox{
  position:fixed;top:0;left:0;right:0;bottom:0;
  background:rgba(0,0,0,.96);z-index:1000;
  display:flex;align-items:center;justify-content:center;
  opacity:0;backdrop-filter:blur(10px);
  transition:opacity 0.4s cubic-bezier(.25,.46,.45,.94),
             backdrop-filter 0.4s cubic-bezier(.25,.46,.45,.94);
}
.lightbox.open{opacity:1}

.lightbox-backdrop{
  position:absolute;top:0;left:0;right:0;bottom:0;cursor:pointer;
}

.lightbox-content{
  position:relative;max-width:90vw;max-height:90vh;
  display:flex;align-items:center;justify-content:center;
  transform:scale(.9) rotateY(5deg);
  transition:transform 0.4s cubic-bezier(.25,.46,.45,.94);
}

.lightbox.open .lightbox-content{
  transform:scale(1) rotateY(0deg);
}

.lightbox-image{
  max-width:100%;max-height:90vh;object-fit:contain;
  border-radius:8px;box-shadow:0 20px 60px rgba(0,0,0,.7);
  transition:transform 0.3s cubic-bezier(.25,.46,.45,.94);
}

.lightbox-image:hover{
  transform:scale(1.02);
}

.lightbox-close,.lightbox-prev,.lightbox-next{
  background:rgba(255,255,255,.15);border:none;color:#fff;
  border-radius:50%;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  transition:all 0.3s cubic-bezier(.25,.46,.45,.94);
  backdrop-filter:blur(15px);
  border:1px solid rgba(255,255,255,.1);
}

.lightbox-close{
  position:absolute;top:-50px;right:-10px;
  font-size:2rem;width:40px;height:40px;
}

.lightbox-prev,.lightbox-next{
  position:absolute;top:50%;transform:translateY(-50%);
  font-size:1.5rem;width:50px;height:50px;
}

.lightbox-prev{left:-70px}
.lightbox-next{right:-70px}

.lightbox-close:hover,.lightbox-prev:hover,.lightbox-next:hover{
  background:rgba(244,114,182,.4);
  transform:scale(1.1);
  box-shadow:0 8px 25px rgba(244,114,182,.3);
}

.lightbox-close:active,.lightbox-prev:active,.lightbox-next:active{
  transform:scale(.95);
}

@media (max-width:768px){
  .lightbox-close{top:-40px;right:10px;font-size:1.5rem;width:35px;height:35px}
  .lightbox-prev{left:10px;bottom:20px;top:auto;transform:none}
  .lightbox-next{right:10px;bottom:20px;top:auto;transform:none}
  .lightbox-prev,.lightbox-next{width:45px;height:45px;font-size:1.2rem}
}
