/* ── Variables ── */
:root {
  --bg:         #111111;
  --surface:    #1a1a1a;
  --border:     #2a2a2a;
  --text:       #f5f0e8;
  --muted:      #8a8680;
  --accent:     #e8a832;
  --accent-h:   #f0c040;
  --font:       'DM Sans', system-ui, sans-serif;
  --mono:       'JetBrains Mono', monospace;
  --radius:     4px;
  --transition: 150ms ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
img, video { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Header ── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-decoration: none;
  color: var(--text);
  transition: color var(--transition);
}
.logo:hover { color: var(--accent); }
.contact-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}
.contact-link:hover { color: var(--accent); }

/* ── Filter Tabs ── */
.filter-tabs {
  display: flex;
  gap: 8px;
  padding: 24px 40px 0;
  flex-wrap: wrap;
}
.tab-link {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  position: relative;
  text-decoration: none;
}
.tab-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--transition);
  border-radius: 1px;
}
.tab-link:hover { color: var(--text); }
.tab {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
  text-decoration: none;
  position: relative;
}
.tab::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--transition);
  border-radius: 1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); }
.tab.active::after { transform: scaleX(1); }

/* ── Main / Gallery ── */
main { flex: 1; padding: 24px 40px 48px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding-top: 16px;
}

/* ── Gallery Card ── */
.gallery-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.gallery-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.gallery-card[data-category="past"] {
  background: transparent;
  border: 1px dashed var(--border);
}
.gallery-card-img {
  width: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  display: block;
  background: var(--border);
  min-height: 180px;
}
.gallery-card[data-category="past"] .gallery-card-img { min-height: 120px; }
.gallery-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 12px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  opacity: 0;
  transition: opacity 200ms ease;
}
.gallery-card:hover .gallery-card-info,
.gallery-card[data-category="past"] .gallery-card-info { opacity: 1; }
.gallery-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-card-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.gallery-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  padding: 3px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Past project card — show arrow */
.gallery-card[data-category="past"] {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  transition: color var(--transition), border-color var(--transition), transform 200ms ease;
}
.gallery-card[data-category="past"]:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.02);
  box-shadow: none;
}

/* ── Footer ── */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px 40px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.footer-logo {
  height: 20px;
  width: auto;
  max-width: 150px;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.footer-logo:hover {
  opacity: 1;
}

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.94);
}
.lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1100px;
  max-height: 100dvh;
  padding: 40px 40px 24px;
  animation: lb-in 200ms ease-out;
}
@keyframes lb-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  z-index: 2;
}
.lightbox-close:hover { color: var(--text); background: var(--surface); }

/* Viewport */
.lightbox-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  max-height: 70dvh;
  width: 100%;
}
#lightbox-img {
  max-width: 100%;
  max-height: 70dvh;
  object-fit: contain;
  border-radius: var(--radius);
  display: none;
}
#lightbox-img.active { display: block; }
#lightbox-video {
  max-width: 100%;
  max-height: 70dvh;
  object-fit: contain;
  border-radius: var(--radius);
  display: none;
}
#lightbox-video.active { display: block; }

/* Meta row */
.lightbox-meta {
  width: 100%;
  padding-top: 16px;
}
.lightbox-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.lightbox-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.lightbox-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.nav-btn:hover { color: var(--accent); background: var(--surface); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.lightbox-counter {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  min-width: 48px;
  text-align: center;
}
.lightbox-caption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.lightbox-stage-info {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  margin-top: 4px;
  display: none;
}
.lightbox-stage-info.active { display: block; }

/* ── Filmstrip ── */
.lightbox-filmstrip {
  width: 100%;
  padding-top: 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  display: none;
  padding-bottom: 8px;
}
.lightbox-filmstrip.active { display: flex; }

.filmstrip-thumb {
  position: relative;
  height: 64px;
  flex-shrink: 0;
  border-radius: 2px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color var(--transition), opacity var(--transition);
  cursor: pointer;
  opacity: 0.6;
}
.filmstrip-thumb:hover { opacity: 0.85; }
.filmstrip-thumb.active {
  border-color: var(--accent);
  opacity: 1;
}
.filmstrip-thumb img,
.filmstrip-thumb video {
  height: 100%;
  width: auto;
  object-fit: cover;
  display: block;
}
.filmstrip-label {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.75);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text);
  text-align: center;
  padding: 1px 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filmstrip-video-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 8px;
  padding: 2px 4px;
  border-radius: 2px;
  font-weight: 500;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .site-header { padding: 16px 20px; }
  .filter-tabs { padding: 16px 20px 0; }
  main { padding: 16px 20px 40px; }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }
  .lightbox-content { padding: 20px 16px 16px; }
  .site-footer { padding: 16px 20px; }
}
