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

:root {
  --bg:        #0a0a0a;
  --surface:   #111111;
  --border:    #1e1e1e;
  --accent:    #c9a84c;
  --accent2:   #e8c97a;
  --text:      #e8e0d0;
  --muted:     #999999;
  --white:     #ffffff;
  --radius:    4px;
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── HEADER ── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 3rem;
  background: rgba(10,10,10,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.header-logo {
  height: 40px;
  width: auto;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: 0 0 15px rgba(201, 168, 76, 0.2);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.logo span { font-style: italic; color: var(--text); }

.header-count {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── HERO STRIP ── */
.hero {
  padding: 4rem 3rem 2.5rem;
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.95;
  color: var(--white);
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}
.hero-sub {
  max-width: 280px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.7;
  padding-bottom: 0.5rem;
}
.hero-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
  transition: all 0.3s var(--ease);
  padding: 0 1px;
}
.hero-link:hover {
  color: var(--accent2);
  border-bottom-color: var(--accent);
  background: rgba(201, 168, 76, 0.08);
}
.hero-title .hero-link, .logo-container.hero-link {
  color: inherit;
  border-bottom: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
}
.hero-title .hero-link:hover, .logo-container.hero-link:hover {
  background: none;
  transform: translateY(-2px);
}
.hero-title .hero-link { display: inline-block; }

/* ── FILTERS / CATEGORIES ── */
.filter-bar {
  padding: 0 3rem 2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(232, 224, 208, 0.7);
  margin-right: 0.8rem;
}

.filter-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0.38rem 1.1rem;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0a;
  font-weight: 500;
}

/* ── GALLERY GRID ── */
.gallery-wrap {
  padding: 0 3rem 5rem;
  position: relative;
  z-index: 1;
}

.gallery-grid {
  columns: 3;
  column-gap: 1rem;
}

@media (max-width: 960px) { .gallery-grid { columns: 2; } }
@media (max-width: 580px) {
  .gallery-grid { columns: 1; }
  header, .hero, .filter-bar, .gallery-wrap { padding-left: 1.2rem; padding-right: 1.2rem; }
}

/* ── GALLERY ITEM ── */
.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  transform: translateY(0);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), opacity 0.4s var(--ease);
}

.gallery-item.hidden {
  display: none;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px var(--accent);
}

/* SKELETON LOADING */
.gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  z-index: 1;
  pointer-events: none;
}

.gallery-item img {
  position: relative;
  z-index: 2;
  width: 100%;
  display: block;
  transition: transform 0.55s var(--ease), filter 0.35s var(--ease), opacity 0.5s ease;
  filter: saturate(0.85) brightness(0.92);
  opacity: 0;
}

.gallery-item img.loaded {
  opacity: 1;
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.gallery-item:hover img {
  transform: scale(1.05);
  filter: saturate(1.1) brightness(1);
}

/* ── ITEM OVERLAY ── */
.item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.2rem;
}

.gallery-item:hover .item-overlay { opacity: 1; }

.item-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 0.25rem;
  transform: translateY(8px);
  transition: transform 0.35s var(--ease) 0.05s;
}
.gallery-item:hover .item-title { transform: translateY(0); }

.item-cat {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  transform: translateY(8px);
  transition: transform 0.35s var(--ease);
}
.gallery-item:hover .item-cat { transform: translateY(0); }

.item-expand {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s var(--ease), background 0.3s;
}
.gallery-item:hover .item-expand { opacity: 1; }
.item-expand:hover { background: var(--accent); }
.item-expand svg { width: 14px; height: 14px; stroke: #fff; fill: none; }

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: all; }

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.93);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.lb-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
  transform: scale(0.96);
  transition: transform 0.35s var(--ease);
}
.lightbox.open .lb-container { transform: scale(1); }

.lb-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 40px 120px rgba(0,0,0,0.8);
  border: 1px solid var(--border);
}

#lb-img {
  display: block;
  max-width: 80vw;
  max-height: 72vh;
  object-fit: contain;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
#lb-img.switching { opacity: 0; transform: scale(0.98); }

/* css filters panel inside lightbox */
.lb-filters {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.lbf-btn {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  background: transparent;
  color: rgba(232, 224, 208, 0.8);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}
.lbf-btn:hover, .lbf-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0a;
}

.lb-info {
  margin-top: 1rem;
  text-align: center;
}
.lb-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--white);
}
.lb-meta {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.3rem;
}
.lb-counter {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* NAV ARROWS */
.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(40,40,40,0.9);
  border: 1px solid rgba(255,255,255,0.25);
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}
.lb-nav:hover { background: var(--accent); border-color: var(--accent); }
.lb-nav:hover svg { stroke: #0a0a0a; }
.lb-nav svg { width: 20px; height: 20px; stroke: var(--text); fill: none; stroke-width: 2; transition: stroke 0.25s; }
#lb-prev { left: 1.5rem; }
#lb-next { right: 1.5rem; }
.lb-nav:active { transform: translateY(-50%) scale(0.93); }

/* CLOSE */
.lb-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(40,40,40,0.9);
  border: 1px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  transition: background 0.25s, transform 0.25s;
}
.lb-close:hover { background: #c0392b; border-color: #c0392b; transform: rotate(90deg); }
.lb-close svg { width: 18px; height: 18px; stroke: var(--text); fill: none; stroke-width: 2.5; }

/* THUMBNAILS STRIP */
.lb-thumbs {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.9rem;
  max-width: 80vw;
  overflow-x: auto;
  padding: 0.2rem;
  scrollbar-width: none;
}
.lb-thumbs::-webkit-scrollbar { display: none; }
.lb-thumb {
  width: 48px;
  height: 40px;
  border-radius: 3px;
  object-fit: cover;
  opacity: 0.7;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.lb-thumb.active { opacity: 1; border-color: var(--accent); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ── ENTRANCE ANIMATION ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gallery-item {
  animation: fadeUp 0.5s var(--ease) both;
}

#gallery-sentinel {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}

#gallery-sentinel::after {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
