/* Work Gallery page styles */
:root{ --brand:#081B25; --ink:#0E2330; --muted:#5B6D77; --stroke: rgba(8,27,37,.10); }

#gallery-main section{ padding: clamp(48px, 6vw, 96px) 0; }

.gallery-hero{ display:grid; place-items:center; text-align:center; min-height:40vh; }
.gallery-hero__inner{ max-width:900px; display:grid; gap:18px; }
.gallery-grid-section{ position:relative; }
.gallery-grid__head{ display:grid; gap:8px; text-align:center; max-width:720px; margin:0 auto; }
.gallery-grid{ margin-top:32px; display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); gap:0; padding-inline:0; }
.gallery-item{ position:relative; margin:0; overflow:hidden; border-radius:0; border:0; background:#dfe7ef; display:grid; aspect-ratio:1 / 1; perspective:1200px; transform-style:preserve-3d; }
.gallery-item img{ width:100%; height:100%; object-fit:cover; display:block; filter:saturate(1.05); transition:transform .5s ease, filter .5s ease; backface-visibility:hidden; }
.gallery-item figcaption{ position:absolute; left:0; right:0; bottom:0; padding:12px 14px; background:linear-gradient(180deg, rgba(8,27,37,0) 0%, rgba(8,27,37,.72) 100%); color:#f4fbff; font-size:.85rem; line-height:1.4; opacity:0; transform:translateY(12px); transition:opacity .35s ease, transform .35s ease; }
.gallery-item:hover img{ transform:scale(1.04); filter:saturate(1.12); }
.gallery-item:hover figcaption{ opacity:1; transform:translateY(0); }
.gallery-item--tall,
.gallery-item--wide,
.gallery-item--wide.gallery-item--tall{ grid-column:auto; grid-row:auto; }

.gallery-item.is-flipping-horizontal img{ animation:galleryFlipHorizontal 1.6s ease-in-out forwards; }
.gallery-item.is-flipping-vertical img{ animation:galleryFlipVertical 1.6s ease-in-out forwards; }

@keyframes galleryFlipHorizontal{
  0%{ transform:rotateY(0deg); }
  50%{ transform:rotateY(180deg); }
  100%{ transform:rotateY(360deg); }
}

@keyframes galleryFlipVertical{
  0%{ transform:rotateX(0deg); }
  50%{ transform:rotateX(180deg); }
  100%{ transform:rotateX(360deg); }
}

.gallery-cta{ display:flex; justify-content:center; }
.gallery-cta__card{ max-width:720px; text-align:center; padding:42px 32px; border-radius:24px; border:1px solid rgba(8,27,37,.08); background:linear-gradient(160deg, rgba(232,244,255,.92), #ffffff); box-shadow:0 24px 48px rgba(8,27,37,.14); display:grid; gap:16px; }

@media (max-width:900px){
  .gallery-grid{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce){
  .gallery-item,
  .gallery-item img,
  .gallery-item figcaption{ transition:none !important; }
  .gallery-item.is-flipping-horizontal img,
  .gallery-item.is-flipping-vertical img{ animation:none !important; }
}
