*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #09090f;
  --accent: #6366f1;
  --accent-bright: #818cf8;
  --text: #eef0f5;
  --text-muted: #8b8fa8;
  --text-faint: #4a4d6a;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --radius: 8px;
  --gap: 10px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  background: rgba(9, 9, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  width: 100%;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}
.logo:hover { color: var(--accent-bright); }

.nav-menu {
  list-style: none;
  display: flex;
  gap: 1.75rem;
}

.nav-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  position: relative;
}
.nav-menu a:hover { color: var(--text); }

.nav-menu a span {
  position: relative;
  display: inline-block;
}
.nav-menu a span::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-bright);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-menu a:hover span::after { width: 100%; }

.nav-coding-link {
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
  border: 1px solid #22c55e !important;
  color: #4ade80 !important;
  border-radius: 999px;
  padding: 0.2rem 0.85rem !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  transition: background 0.2s, color 0.2s !important;
}
.nav-coding-link:hover {
  background: #22c55e !important;
  color: #fff !important;
}
.nav-coding-link span::after { display: none !important; }

/* ── Header ─────────────────────────────────────────── */
.gallery-header {
  padding: 0 2rem 0;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.15;
}

.gallery-desc {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 0.5rem;
  line-height: 1.6;
}


/* -- Photographer intro -------------------------------- */
.photographer-intro {
  position: relative;
  width: 100%;
  height: 650px;
  overflow: hidden;
}

.photographer-intro-title {
  position: absolute;
  top: 2rem;
  left: 2rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.15;
  text-shadow: none;
  z-index: 2;
}

.photographer-intro-photo {
  position: absolute;
  inset: 0;
}

.photographer-intro-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(9,9,15,1) 0%, rgba(9,9,15,0.5) 20%, transparent 45%);
  pointer-events: none;
}

.photographer-intro-photo img {
  position: absolute;
  width: 100%;
  height: 140%;
  top: -20%;
  object-fit: cover;
  object-position: 55% 28%;
  display: block;
  transform: scale(1.4) translateY(0px);
  transform-origin: 55% 28%;
  will-change: transform;
}


@media (max-width: 768px) {
  .photographer-intro {
    height: 400px;
  }
}

@media (max-width: 480px) {
  .photographer-intro {
    height: 320px;
  }
}

/* ── Photographer blurb ──────────────────────────────── */
.photographer-blurb {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 2rem 0;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  border-top: 1px solid var(--border);
}

.photographer-blurb p {
  max-width: 700px;
}


/* ── Filter bar ─────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 2rem 2rem 1.75rem;
  max-width: 1400px;
  margin: 0 auto;
}

.filter-btn {
  padding: 0.375rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8125rem;
  font-family: inherit;
  letter-spacing: 0.02em;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* count badge */
.filter-btn .count {
  font-size: 0.7rem;
  opacity: 0.6;
  margin-left: 0.25rem;
}

/* ── Gallery grid ───────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  padding: 0 2rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Gallery item ───────────────────────────────────── */
.gallery-item {
  aspect-ratio: 4 / 3;
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius);
  position: relative;
  animation: fadeUp 0.45s ease both;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: blur(12px);
  opacity: 0.6;
  transform: scale(1.04);
  transition: transform 0.4s ease, filter 0.55s ease, opacity 0.55s ease;
}

.gallery-item img.img-loaded {
  filter: blur(0);
  opacity: 1;
  transform: scale(1);
}

.gallery-item:hover img.img-loaded {
  transform: scale(1.04);
}

/* Hover caption overlay */
.gallery-item::after {
  content: attr(data-caption);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 0.875rem 0.875rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.gallery-item:hover::after {
  opacity: 1;
}

/* Hidden (filtered out) */
.gallery-item.hidden {
  display: none;
}

/* Stagger animation delay by position */
.gallery-item:nth-child(1)  { animation-delay: 0.00s; }
.gallery-item:nth-child(2)  { animation-delay: 0.03s; }
.gallery-item:nth-child(3)  { animation-delay: 0.06s; }
.gallery-item:nth-child(4)  { animation-delay: 0.09s; }
.gallery-item:nth-child(5)  { animation-delay: 0.12s; }
.gallery-item:nth-child(6)  { animation-delay: 0.15s; }
.gallery-item:nth-child(7)  { animation-delay: 0.18s; }
.gallery-item:nth-child(8)  { animation-delay: 0.20s; }
.gallery-item:nth-child(9)  { animation-delay: 0.22s; }
.gallery-item:nth-child(10) { animation-delay: 0.24s; }
.gallery-item:nth-child(11) { animation-delay: 0.26s; }
.gallery-item:nth-child(12) { animation-delay: 0.28s; }
.gallery-item:nth-child(n+13) { animation-delay: 0.30s; }

/* ── Lightbox ───────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}
.lightbox.open {
  display: flex;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(88vw, 960px);
  max-height: 92vh;
}

#lightbox-img {
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8125rem;
  margin-top: 0.875rem;
  letter-spacing: 0.04em;
  text-align: center;
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255, 255, 255, 0.7);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 1001;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.lightbox-nav {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255, 255, 255, 0.6);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.lightbox-nav:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: rgba(99, 102, 241, 0.1);
}

/* ── Carousel ───────────────────────────────────────── */
.carousel-view {
  padding: 0 2rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.carousel-stage {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.carousel-frame {
  flex: 1;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#car-img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: var(--radius);
  transition: opacity 0.2s ease;
}

.car-caption-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 2.5rem 1rem 0.875rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  pointer-events: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

#car-caption {
  color: rgba(255,255,255,0.85);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

#car-counter {
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-left: 1rem;
}

.car-nav {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.car-nav:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: rgba(99,102,241,0.12);
}

/* Thumbnail strip */
.car-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.car-thumbs::-webkit-scrollbar { height: 4px; }
.car-thumbs::-webkit-scrollbar-track { background: transparent; }
.car-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.car-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 52px;
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: #000;
  transition: border-color 0.2s, opacity 0.2s;
  opacity: 0.45;
}
.car-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.car-thumb:hover {
  opacity: 0.75;
}
.car-thumb.active {
  border-color: var(--accent);
  opacity: 1;
}

/* ── Animations ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Empty state ────────────────────────────────────── */
.gallery-empty {
  display: none;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.9375rem;
  max-width: 1400px;
  margin: 0 auto;
}
.gallery-empty.visible {
  display: block;
}

/* ── Hamburger / Mobile Drawer ───────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--text);
  flex-direction: column;
  gap: 5px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(9, 9, 15, 0.97);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.mobile-nav-drawer.open { display: flex; }

.mobile-nav-drawer a {
  color: var(--text);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color 0.2s;
}

.mobile-nav-drawer a:hover { color: #818cf8; }

.mobile-nav-divider {
  width: 40px;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0.5rem 0;
}

.mobile-nav-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #7d8799;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .gallery-header { padding: 2.5rem 1.25rem 0; }
  .filter-bar { padding: 1.5rem 1.25rem 1.25rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); padding: 0 1.25rem 3rem; }
  .navbar { padding: 0 1.25rem; }
  .lightbox-nav { display: none; }
}

@media (max-width: 640px) {
  .nav-menu { display: none; }
  .nav-hamburger { display: flex; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-title { display: none; }
}
