/* ═══════════════════════════════════════════════════════════════
   gallery.css — the96studio gallery page
   Pinterest / bento grid · Sharp corners · Parallax
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────
   GALLERY PAGE OVERRIDES
─────────────────────────────────────────────── */
.gallery-page {
  background: var(--c-bg);
  overflow-x: hidden;
}

/* Active nav link */
.nav__link--active {
  color: var(--c-amber) !important;
}
.nav__link--active::after {
  width: 100% !important;
  background: var(--c-amber);
}

/* ───────────────────────────────────────────────
   PRELOADER — 96 infinity mark drawing itself
─────────────────────────────────────────────── */
.gal-preloader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #030303;
  display: flex;
  align-items: center;
  justify-content: center;
  /* JS will animate this out */
}

.gal-preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
  width: 100%;
  text-align: center;
}

/* The SVG mark */
.gal-preloader__mark {
  width: clamp(120px, 20vw, 200px);
  height: auto;
  overflow: visible;
  color: #fff;
}

.gal-pre__path {
  fill: currentColor;
}

/* Studio name below the mark */
.gal-preloader__label {
  display: block;
  width: 100%;
  font-size: var(--fs-label);
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  opacity: 0;
  text-align: center;
  /* JS fades this in after mark is complete */
}

/* ───────────────────────────────────────────────
   HERO — horizontal split layout
   Matches screenshot: dark band, left headline, right description
─────────────────────────────────────────────── */
.gal-hero {
  position: relative;
  /* Compact banner — not full-height */
  min-height: clamp(220px, 30vh, 360px);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: #040404;
  /* Push content below the fixed header */
  padding-top: var(--header-h);
}

.gal-hero__bg {
  position: absolute;
  inset: 0;
  /* Very dark, near-pure black with subtle warm gradient */
  background:
    radial-gradient(ellipse 60% 80% at 20% 60%, rgba(242,166,90,0.04) 0%, transparent 60%),
    #040404;
  will-change: transform;
}

/* Subtle horizontal grid line at bottom of hero */
.gal-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--c-hairline);
  z-index: 2;
}

/* Split container */
.gal-hero__split {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  padding: clamp(2.5rem, 6vh, 5rem) var(--sp-lg);
  gap: 0;
}

/* Left — eyebrow + big headline (~55% width) */
.gal-hero__left {
  flex: 0 0 55%;
  display: flex;
  flex-direction: column;
  gap: clamp(0.6rem, 1.5vh, 1.2rem);
}

.gal-hero__eyebrow {
  font-size: var(--fs-label);
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  opacity: 0;
}

.gal-hero__headline {
  font-size: clamp(2.8rem, 7vw, 7rem);
  font-weight: 200;
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--c-text);
  margin: 0;
}

.gal-hero__headline .line-wrap {
  display: block;
  overflow: hidden;
}

.gal-hero__headline .line {
  display: block;
}

/* Vertical divider */
.gal-hero__divider {
  flex: 0 0 1px;
  align-self: stretch;
  background: rgba(255,255,255,0.12);
  margin: 0 clamp(2rem, 5vw, 5rem);
  opacity: 0;
}

/* Right — description */
.gal-hero__right {
  flex: 1;
  display: flex;
  align-items: center;
}

.gal-hero__desc {
  font-size: clamp(0.85rem, 1.4vw, 1.1rem);
  font-weight: 300;
  line-height: 1.75;
  color: var(--c-text-muted);
  max-width: 320px;
  opacity: 0;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
  .gal-hero__split {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem var(--sp-md);
  }
  .gal-hero__left  { flex: none; width: 100%; }
  .gal-hero__divider { display: none; }
  .gal-hero__right { flex: none; width: 100%; }
  .gal-hero__desc  { max-width: 100%; }
}

/* ───────────────────────────────────────────────
   BAND WRAPPER (each grid section)
─────────────────────────────────────────────── */
.gal-band {
  padding: var(--sp-sm) var(--sp-sm);
}

/* ───────────────────────────────────────────────
   INTERLUDE LABELS
─────────────────────────────────────────────── */
.gal-interlude {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-xl) var(--sp-lg);
  opacity: 0;
}

.gal-interlude__line {
  flex: 1;
  height: 1px;
  background: var(--c-hairline);
}

.gal-interlude__text {
  font-size: var(--fs-label);
  font-weight: 300;
  letter-spacing: 0.22em;
  color: var(--c-text-dim);
  white-space: nowrap;
}

/* ───────────────────────────────────────────────
   BENTO GRIDS
   All use CSS Grid, hand-crafted for each section.
   NO border-radius anywhere.
─────────────────────────────────────────────── */

/* Grid A — 3 column, mixed heights */
.gal-grid--a {
  display: grid;
  grid-template-columns: 1fr 1.6fr 1.6fr;
  grid-template-rows: 340px 340px;
  gap: var(--sp-xs);
}

/* Grid B — 3 column asymmetric */
.gal-grid--b {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.3fr;
  grid-template-rows: 320px 320px;
  gap: var(--sp-xs);
}

/* Grid C — 3 column, editorial */
.gal-grid--c {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  grid-template-rows: 360px 360px;
  gap: var(--sp-xs);
}

/* Grid D — 3 column, cinematic */
.gal-grid--d {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.4fr;
  grid-template-rows: 340px 340px;
  gap: var(--sp-xs);
}

/* ── CELL ───────────────────────────────────── */
.gal-cell {
  position: relative;
  overflow: hidden;
  background: var(--c-surface);
  border-radius: 0; /* SHARP — no rounding */
  cursor: none;
  isolation: isolate;
}

/* Row-span 2 */
.gal-cell--span-r2 {
  grid-row: span 2;
}

/* Col-span 2 */
.gal-cell--span-c2 {
  grid-column: span 2;
}

/* ── PARALLAX IMAGE INNER ───────────────────── */
.gal-cell__inner {
  position: absolute;
  /* Extend beyond cell for parallax travel */
  inset: -18% 0;
  overflow: hidden;
}

.gal-cell__img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform-origin: center;
  /* Scale up slightly so parallax shift stays within bounds */
  transform: scale(1.15);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Hover: subtle brightening */
.gal-cell:hover .gal-cell__img {
  transform: scale(1.22);
  filter: brightness(1.08);
}

/* Dark gradient scrim at bottom */
.gal-cell::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(0deg,
    rgba(5,4,10,0.85) 0%,
    rgba(5,4,10,0.25) 60%,
    transparent 100%
  );
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* Top hairline — amber accent that grows on hover */
.gal-cell::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 0;
  height: 1px;
  background: var(--c-amber);
  z-index: 3;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gal-cell:hover::before {
  width: 100%;
}

/* ── CELL META (image number only) ─────────── */
.gal-cell__meta {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: var(--sp-sm) var(--sp-sm) calc(var(--sp-sm) + 2px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  z-index: 2;
  transform: translateY(4px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gal-cell:hover .gal-cell__meta {
  transform: translateY(0);
}

.gal-cell__num {
  font-size: clamp(1.4rem, 3vw, 2.5rem);
  font-weight: 200;
  color: rgba(255,255,255,0.15);
  letter-spacing: -0.02em;
  line-height: 1;
  transition: color 0.4s ease;
}

.gal-cell:hover .gal-cell__num {
  color: rgba(255,255,255,0.35);
}


/* ── ENTRY ANIMATION INITIAL STATE ─────────── */
.gal-cell {
  opacity: 0;
  transform: translateY(32px);
}

/* ── LOGO WATERMARK ─────────────────────────── */
.gal-cell__watermark {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 4;
  /* Size: subtle but legible */
  width: clamp(32px, 4vw, 52px);
  height: auto;
  /* The logo is black-on-white PNG:
     invert() makes it white, then reduce opacity for watermark effect */
  filter: invert(1) brightness(2);
  opacity: 0.18;
  pointer-events: none;
  /* Transition opacity on hover */
  transition: opacity 0.4s ease;
}

/* Slightly more visible on hover */
.gal-cell:hover .gal-cell__watermark {
  opacity: 0.32;
}

/* ───────────────────────────────────────────────
   GALLERY FOOTER CTA
─────────────────────────────────────────────── */
.gal-footer-cta {
  padding: var(--sp-xl) var(--sp-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--c-hairline);
  min-height: 50svh;
  position: relative;
  overflow: hidden;
}

/* Ambient amber glow */
.gal-footer-cta::before {
  content: '';
  position: absolute;
  bottom: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 200px;
  background: radial-gradient(ellipse, rgba(242,166,90,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.gal-footer-cta__inner {
  text-align: center;
  max-width: 600px;
}

.gal-footer-cta__headline {
  font-size: clamp(1.8rem, 4vw, 4rem);
  font-weight: 200;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--c-text);
  margin-bottom: var(--sp-lg);
  opacity: 0;
}

.gal-footer-cta__btn {
  display: inline-flex;
  opacity: 0;
}

/* ───────────────────────────────────────────────
   LIGHTBOX
─────────────────────────────────────────────── */
.gal-lightbox__backdrop {
  position: fixed;
  inset: 0;
  z-index: 490;
  background: rgba(3,3,8,0.97);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.gal-lightbox__backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.gal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.gal-lightbox:not([hidden]) {
  opacity: 1;
  pointer-events: all;
}

.gal-lightbox__stage {
  position: relative;
  max-width: 90vw;
  max-height: 88svh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gal-lightbox__img {
  max-width: 90vw;
  max-height: 88svh;
  object-fit: contain;
  display: block;
  /* Sharp — no rounded corners */
  border-radius: 0;
  box-shadow: 0 0 80px rgba(0,0,0,0.8);
}

.gal-lightbox__close {
  position: fixed;
  top: var(--sp-md);
  right: var(--sp-md);
  z-index: 10;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--c-hairline);
  background: rgba(5,4,10,0.85);
  color: var(--c-text-muted);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  cursor: none;
}

.gal-lightbox__close svg { width: 16px; height: 16px; }

.gal-lightbox__close:hover {
  border-color: var(--c-amber);
  color: var(--c-amber);
}

.gal-lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--c-hairline);
  background: rgba(5,4,10,0.75);
  color: var(--c-text-muted);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  cursor: none;
}

.gal-lightbox__nav svg { width: 20px; height: 20px; }
.gal-lightbox__nav--prev { left: var(--sp-md); }
.gal-lightbox__nav--next { right: var(--sp-md); }

.gal-lightbox__nav:hover {
  border-color: var(--c-amber);
  color: var(--c-amber);
  background: rgba(242,166,90,0.1);
}

.gal-lightbox__info {
  position: fixed;
  bottom: var(--sp-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  z-index: 10;
}

.gal-lightbox__counter {
  font-size: var(--fs-label);
  font-weight: 300;
  letter-spacing: 0.14em;
  color: var(--c-text-dim);
}

/* ───────────────────────────────────────────────
   RESPONSIVE
─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .gal-grid--a,
  .gal-grid--b,
  .gal-grid--c,
  .gal-grid--d {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .gal-cell--span-r2 {
    grid-row: span 1;
  }

  .gal-cell--portrait {
    min-height: 420px;
  }
  .gal-cell--landscape {
    min-height: 260px;
  }
}

@media (max-width: 600px) {
  .gal-grid--a,
  .gal-grid--b,
  .gal-grid--c,
  .gal-grid--d {
    grid-template-columns: 1fr;
  }

  .gal-cell--span-c2 {
    grid-column: span 1;
  }

  .gal-cell--portrait  { min-height: 70vw; }
  .gal-cell--landscape { min-height: 56vw; }

  .gal-hero__headline {
    font-size: clamp(2.8rem, 14vw, 5rem);
  }

  .gal-band {
    padding: var(--sp-xs);
  }

  .gal-interlude {
    padding: var(--sp-lg) var(--sp-md);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .gal-cell {
    opacity: 1;
    transform: none;
  }
  .gal-cell__img {
    transform: scale(1) !important;
    transition: none;
  }
}
