/* ── Fade-in ─────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.fade-in.visible { opacity: 1; transform: none; }

/* ── Portfolio header ───────────────────────────────── */
.portfolio-header { margin-bottom: 2.5rem; }
.portfolio-header h1 { font-size: clamp(2.5rem, 5vw, 4rem); margin-top: 0.5rem; }
.portfolio-intro {
  color: var(--warm-muted);
  max-width: 520px;
  margin-top: 0.75rem;
}

/* ── Filters ────────────────────────────────────────── */
.filters {
  display: flex;
  gap: 0;
  margin-bottom: 3rem;
  border-bottom: 0.5px solid var(--warm-mid);
  flex-wrap: wrap;
  justify-content: center;
}
.filter-btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 24px;
  border: none;
  background: transparent;
  color: var(--warm-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}
.filter-btn::after {
  content: '';
  position: absolute;
  bottom: -0.5px;
  left: 0; right: 0;
  height: 1px;
  background: var(--black);
  transform: scaleX(0);
  transition: transform 0.2s;
}
.filter-btn:hover { color: var(--black); }
.filter-btn.active {
  color: var(--black);
  font-weight: 500;
}
.filter-btn.active::after { transform: scaleX(1); }

/* ── Portfolio grid ─────────────────────────────────── */
.portfolio-grid {
  columns: 3;
  column-gap: 0.75rem;
}
.grid-item {
  break-inside: avoid;
  margin-bottom: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.grid-item img {
  width: 100%;
  display: block;
  transition: transform 0.5s ease, opacity 0.3s;
}
.grid-item:hover img { transform: scale(1.03); }
.grid-item.hidden {
  display: none;
}

/* ── Lightbox ───────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14,14,13,0.96);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lb-img-wrap {
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img-wrap img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
}
.lb-close {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  font-size: 2rem;
  line-height: 1;
  background: none;
  border: none;
  color: rgba(247,245,242,0.7);
  cursor: pointer;
  transition: color 0.2s;
  z-index: 201;
}
.lb-close:hover { color: var(--off-white); }
.lb-prev, .lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(247,245,242,0.5);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 1rem 1.5rem;
  transition: color 0.2s;
  z-index: 201;
}
.lb-prev { left: 0; }
.lb-next { right: 0; }
.lb-prev:hover, .lb-next:hover { color: var(--off-white); }
.lb-counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(247,245,242,0.4);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .portfolio-grid { columns: 2; }
}
@media (max-width: 500px) {
  .portfolio-grid { columns: 1; }
  .filter-btn { padding: 8px 14px; font-size: 11px; }
}
