/* ============================================================
   THE GALLERY — premium media portal
   Dark, cinematic, editorial. Built to feel expensive.
   ============================================================ */

:root {
  --bg:        #0a0a0b;
  --bg-soft:   #141416;
  --card:      #1a1a1d;
  --line:      rgba(255,255,255,0.08);
  --text:      #f4f1ea;
  --muted:     #9a958c;
  --gold:      #c9a86a;
  --gold-soft: rgba(201,168,106,0.15);
  --radius:    14px;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* subtle film grain over everything */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(201,168,106,0.10), transparent 70%),
    var(--bg);
}
.hero-inner { max-width: 760px; animation: rise 1.4s var(--ease) both; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.42em;
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 1.6rem;
  padding-left: 0.42em;
}
.title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin-bottom: 1.4rem;
}
.subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  font-weight: 300;
  max-width: 30em;
  margin: 0 auto;
}

.scroll-cue {
  position: absolute; bottom: 2.4rem; left: 50%; transform: translateX(-50%);
}
.scroll-cue span {
  display: block; width: 1px; height: 48px;
  background: linear-gradient(var(--gold), transparent);
  animation: pulse 2.4s var(--ease) infinite;
}

/* ---------- STATES ---------- */
.state {
  text-align: center;
  padding: 6rem 1.5rem;
  color: var(--muted);
}
.state h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400; font-size: 2rem; color: var(--text); margin-bottom: 0.6rem;
}
.spinner {
  width: 34px; height: 34px; margin: 0 auto 1.6rem;
  border: 1px solid var(--line); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}

/* ---------- GALLERY GRID ---------- */
.gallery {
  position: relative; z-index: 2;
  max-width: 1500px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  columns: 3 320px;
  column-gap: 18px;
}
@media (max-width: 640px) { .gallery { columns: 2 160px; column-gap: 10px; padding-inline: 0.75rem; } }

.card {
  position: relative;
  break-inside: avoid;
  margin-bottom: 18px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  cursor: zoom-in;
  border: 1px solid var(--line);
  opacity: 0;
  transform: translateY(24px);
  transition: transform 0.6s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
}
@media (max-width: 640px) { .card { margin-bottom: 10px; } }
.card.in { opacity: 1; transform: translateY(0); }
.card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-soft);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.8), 0 0 0 1px var(--gold-soft);
}
.card img {
  display: block; width: 100%; height: auto;
  background: var(--bg-soft);
  transition: transform 1.2s var(--ease), filter 0.6s var(--ease);
}
.card:hover img { transform: scale(1.04); }

/* video badge */
.card .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.card .play::after {
  content: '';
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(10,10,11,0.55); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.25);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='%23f4f1ea'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 54% 50%;
  transition: transform 0.4s var(--ease), background-color 0.4s var(--ease);
}
.card:hover .play::after { transform: scale(1.08); background-color: rgba(201,168,106,0.35); }

.card .meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.4rem 1rem 0.9rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  font-size: 0.78rem; color: rgba(255,255,255,0.85);
  letter-spacing: 0.02em;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.card:hover .meta { opacity: 1; transform: translateY(0); }

/* ---------- ACTIONS ---------- */
.actions { text-align: center; padding-bottom: 5rem; }
.btn-ghost {
  font-family: inherit; font-size: 0.82rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text); background: transparent;
  border: 1px solid var(--line); border-radius: 100px;
  padding: 1rem 2.4rem; cursor: pointer;
  transition: all 0.4s var(--ease);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); letter-spacing: 0.22em; }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,5,6,0.96); backdrop-filter: blur(20px);
  display: flex; flex-direction: column;
  animation: fade 0.4s var(--ease);
}
.lb-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 4.5rem 1.5rem 1rem; min-height: 0;
}
.lb-stage img, .lb-stage video, .lb-stage iframe {
  max-width: min(1200px, 94vw); max-height: 100%;
  width: auto; height: auto; border-radius: 8px;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,0.9);
  animation: pop 0.5s var(--ease);
}
.lb-stage iframe { width: min(1100px, 92vw); aspect-ratio: 16/9; height: auto; border: 0; }

.lb-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.2rem clamp(1.5rem, 5vw, 4rem) 2rem;
  flex-wrap: wrap;
}
.lb-caption { color: var(--muted); font-size: 0.9rem; letter-spacing: 0.02em; }
.btn-download {
  font-family: inherit; font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; color: var(--bg); background: var(--gold);
  padding: 0.85rem 1.8rem; border-radius: 100px;
  transition: all 0.35s var(--ease); white-space: nowrap;
}
.btn-download:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -8px var(--gold-soft); filter: brightness(1.08); }

.lb-close, .lb-nav {
  position: absolute; z-index: 2;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  color: var(--text); cursor: pointer;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: all 0.35s var(--ease); backdrop-filter: blur(8px);
}
.lb-close { top: 1.4rem; right: 1.4rem; width: 46px; height: 46px; font-size: 1.6rem; line-height: 1; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 54px; height: 54px; font-size: 2rem; line-height: 1; }
.lb-prev { left: 1.4rem; } .lb-next { right: 1.4rem; }
.lb-close:hover, .lb-nav:hover { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.lb-nav:hover { transform: translateY(-50%) scale(1.06); }
@media (max-width: 640px) {
  .lb-nav { width: 44px; height: 44px; font-size: 1.6rem; }
  .lb-prev { left: 0.6rem; } .lb-next { right: 0.6rem; }
}

/* ---------- FOOTER ---------- */
.footer {
  text-align: center; padding: 3rem 1.5rem 4rem;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.8rem; letter-spacing: 0.08em;
}

/* ---------- UTIL ---------- */
.hidden { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop  { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%,100% { opacity: 0.3; transform: scaleY(0.6); } 50% { opacity: 1; transform: scaleY(1); } }
