/* Portfolio - Atomic dark theme (extends body.landing) */

.portfolio-page main {
  overflow-x: hidden;
}

.portfolio-hero {
  position: relative;
  padding: 88px 24px 40px;
  text-align: center;
}

.portfolio-hero h1 {
  margin: 18px 0 0;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #f2f2f2;
}

.portfolio-hero .text-lead {
  max-width: 560px;
  margin: 20px auto 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.portfolio-filters {
  max-width: var(--landing-max);
  margin: 0 auto;
  padding: 0 32px 32px;
}

.portfolio-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  background: #141414;
  border: 1px solid #232323;
  border-radius: 999px;
}

.portfolio-filter-btn {
  padding: 9px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #b9b9b9;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-fast), background var(--duration-fast);
}

.portfolio-filter-btn:hover {
  color: #f2f2f2;
}

.portfolio-filter-btn.is-active {
  background: #1e1e1e;
  color: #f2f2f2;
}

.portfolio-grid-section {
  max-width: var(--landing-max);
  margin: 0 auto;
  padding: 8px 32px 96px;
}

.portfolio-masonry {
  columns: 3;
  column-gap: 16px;
}

.portfolio-masonry__item {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  cursor: zoom-in;
  break-inside: avoid;
  transition: transform var(--duration-fast) var(--ease-out-expo),
    box-shadow var(--duration-fast);
}

.portfolio-masonry__item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.portfolio-masonry__item:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.portfolio-masonry__item img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.portfolio-empty {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  padding: 48px 0;
}

.portfolio-empty.is-hidden {
  display: none;
}

.portfolio-cta {
  max-width: var(--landing-max);
  margin: 0 auto;
  padding: 0 32px 96px;
  text-align: center;
}

.portfolio-cta h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #f2f2f2;
}

.portfolio-cta__action {
  margin-top: 28px;
}

/* Lightbox */
.portfolio-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.portfolio-lightbox[hidden] {
  display: none;
}

.portfolio-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.portfolio-lightbox__figure {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
}

.portfolio-lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;
}

.portfolio-lightbox__close,
.portfolio-lightbox__nav {
  position: absolute;
  z-index: 2;
  border: none;
  background: rgba(20, 20, 20, 0.85);
  color: #f2f2f2;
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.portfolio-lightbox__close:hover,
.portfolio-lightbox__nav:hover {
  background: var(--color-accent);
  color: #0f1400;
}

.portfolio-lightbox__close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.portfolio-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.portfolio-lightbox__nav--prev {
  left: 20px;
}

.portfolio-lightbox__nav--next {
  right: 20px;
}

@media (max-width: 1024px) {
  .portfolio-masonry {
    columns: 2;
  }
}

@media (max-width: 768px) {
  .portfolio-hero {
    padding: 64px 20px 32px;
  }

  .portfolio-filters,
  .portfolio-grid-section,
  .portfolio-cta {
    padding-left: 20px;
    padding-right: 20px;
  }

  .portfolio-filter-bar {
    border-radius: 16px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .portfolio-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .portfolio-masonry {
    columns: 1;
  }

  .portfolio-grid-section {
    padding-bottom: 72px;
  }

  .portfolio-cta {
    padding-bottom: 72px;
  }

  .portfolio-lightbox__nav--prev {
    left: 8px;
  }

  .portfolio-lightbox__nav--next {
    right: 8px;
  }
}
