.portfolio { 
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.06) 0%, transparent 28%),
    linear-gradient(138deg, rgba(253, 251, 247, 0.92) 0%, rgba(242, 234, 222, 0.94) 100%);
  padding: 120px 0; 
}

.portfolio::before,
.portfolio::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.portfolio::before {
  width: clamp(190px, 20vw, 280px);
  height: clamp(300px, 34vw, 420px);
  left: max(-44px, -4vw);
  top: 14%;
  background: url('../../public/images/ornaments/khachkar-slab.svg') center/contain no-repeat;
  opacity: 0.08;
  mix-blend-mode: multiply;
  --float-tilt: -6deg;
  --float-scale-x: 1;
  animation: khachkarFloat 28s ease-in-out infinite;
}

.portfolio::after {
  right: -8%;
  bottom: 8%;
  width: clamp(240px, 32vw, 480px);
  height: clamp(240px, 32vw, 480px);
  background:
    radial-gradient(circle at 48% 48%, rgba(var(--accent-rgb), 0.12), transparent 64%),
    radial-gradient(circle at 34% 34%, rgba(255, 248, 236, 0.5), transparent 38%);
  filter: blur(6px);
  animation: sectionAura 19s ease-in-out infinite;
}

.portfolio-header {
  text-align: center;
  margin-bottom: 64px;
}

.portfolio-kicker {
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 12px;
}

.portfolio-title {
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 5vw, 4rem);
  color: var(--text);
}

.portfolio-divider {
  margin: 16px auto 0;
}

.port-filters {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-bottom: 56px;
}
.filter-btn {
  padding: 10px 28px; border-radius: var(--radius-pill); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--text2); background: var(--bg);
  /* Outward stone buttons */
  box-shadow: var(--shadow-carved-out);
  border: none;
  transition: .4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--bg2); color: var(--accent);
  /* Depressed stone button active state */
  box-shadow: var(--shadow-carved-in);
  transform: translateY(1px);
}

.port-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 34px;
  align-items: start;
}
.port-item {
  position: relative; cursor: pointer;
  padding: 16px;
  background: var(--bg);
  box-shadow: var(--shadow-carved-out);
  border-radius: var(--radius-lg);
  transition:
    transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.22s ease,
    box-shadow 0.35s ease;
  will-change: transform, opacity;
}
.port-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}

.port-item[hidden] {
  display: none !important;
}

.port-item.is-filtered-out {
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  pointer-events: none;
}

@media(min-width: 940px) { .port-item.wide { grid-column: span 2; } }

.port-info {
  background: transparent !important;
  padding: 24px 16px 8px;
  text-align: center;
}
.port-info h3 {
  color: var(--text);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
}

.port-media {
  aspect-ratio: 3 / 4;
}

.port-media-reel {
  aspect-ratio: 9 / 16;
  position: relative;
}

.port-media-wide {
  aspect-ratio: 16 / 10;
}

.port-cover {
  width: 100%;
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: transform 0.8s ease;
}

.port-item:hover .port-cover {
  transform: scale(1.035);
}

.port-item .img-zoom-wrap {
  box-shadow: var(--shadow-carved-in);
  border-radius: var(--radius);
}

.port-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.port-play-icon {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.82);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  color: var(--accent);
  transition: transform 0.35s ease, background 0.35s ease;
}

.port-item:hover .port-play-icon {
  transform: scale(1.06);
  background: rgba(255,255,255,0.92);
}

.port-empty {
  max-width: 420px;
  margin: 30px auto 0;
  text-align: center;
  color: var(--text2);
  font-style: italic;
  font-family: var(--font-display);
}

@media (max-width: 720px) {
  .portfolio {
    padding: 96px 0;
  }

  .port-grid {
    gap: 22px;
  }

  .filter-btn {
    width: 100%;
    max-width: 240px;
  }

  .portfolio::before {
    opacity: 0.05;
    left: -56px;
  }
}
