.project-card .project-overlay {
  background: linear-gradient(180deg, rgba(0, 0, 0, .22), transparent 27%, rgba(0, 0, 0, .86) 100%);
}

.project-card .project-copy p { color: rgba(255, 255, 255, .86); line-height: 1.45; }

.portfolio-open {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: white;
  cursor: pointer;
}

.portfolio-open:focus-visible { outline: 2px solid white; outline-offset: -5px; }
.portfolio-open svg {
  position: absolute;
  top: 18px;
  right: 18px;
}
.portfolio-open svg, .portfolio-arrow svg { filter: drop-shadow(0 1px 2px #000) drop-shadow(0 0 3px #000); }
.portfolio-open:hover svg, .portfolio-arrow:hover svg, .portfolio-close:hover { color: #ffb5b6; }

.portfolio-dialog {
  width: min(1120px, calc(100% - 36px));
  max-width: none;
  max-height: calc(100dvh - 36px);
  margin: auto;
  padding: 0;
  border: 1px solid #484343;
  background: var(--ink);
  color: var(--white);
  overscroll-behavior: contain;
}
.portfolio-case {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .56fr);
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  padding: 64px clamp(16px, 3vw, 40px) clamp(16px, 3vw, 36px);
}
.portfolio-details { grid-area: 1 / 2; }
.portfolio-details .eyebrow { margin-bottom: 14px; }
.portfolio-details h2 {
  margin: 0 0 14px;
  font-size: clamp(30px, 3.6vw, 47px);
  line-height: 1.02;
  overflow-wrap: anywhere;
}
.portfolio-date { margin: 0 0 16px; color: #d3ccc5; font-size: 13px; line-height: 1.45; }
.portfolio-description { margin: 0 0 16px; font-size: 14px; line-height: 1.6; }
.portfolio-source { color: #ff8588; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

.portfolio-close, .portfolio-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: white;
  cursor: pointer;
}
.portfolio-close { position: absolute; top: 10px; right: 12px; font-size: 26px; }
.portfolio-case :focus-visible { outline: 2px solid white; outline-offset: 2px; }

.portfolio-gallery { grid-area: 1 / 1; min-width: 0; }
.portfolio-photo {
  position: relative;
  height: clamp(240px, 54dvh, 565px);
  background: #161414;
}
.portfolio-photo > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.portfolio-full { opacity: 0; }
.portfolio-full.is-loaded { opacity: 1; }
.portfolio-arrow { position: absolute; top: 50%; transform: translateY(-50%); }
.portfolio-previous { left: 8px; }
.portfolio-previous svg { transform: scaleX(-1); }
.portfolio-next { right: 8px; }
.portfolio-photo-number {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  margin: 0;
  padding: 5px 10px;
  background: rgba(23, 22, 22, .88);
  color: white;
  font-size: 11px;
}
.portfolio-thumbnails { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.portfolio-thumbnails button {
  width: min(20%, 76px);
  height: 46px;
  padding: 0;
  border: 2px solid transparent;
  background: #161414;
  cursor: pointer;
  opacity: .7;
}
.portfolio-thumbnails button[aria-pressed='true'] { border-color: #ff8588; opacity: 1; }
.portfolio-thumbnails button img { display: block; width: 100%; height: 100%; object-fit: cover; }

@media (prefers-reduced-motion: no-preference) {
  .project-grid[data-filtered] { animation: portfolio-arrive .24s var(--motion-ease); }
  .portfolio-full.is-loaded { animation: portfolio-photo-arrive .2s ease-out; }
  .portfolio-open svg { transition: scale .18s ease-out, color .18s ease-out; }
  .portfolio-open:active svg { scale: .9; }
}

@keyframes portfolio-arrive { from { opacity: .35; transform: translateY(5px); } }
@keyframes portfolio-photo-arrive { from { opacity: 0; } }

@media (max-width: 720px) {
  .portfolio-dialog { width: calc(100% - 18px); max-height: calc(100dvh - 18px); }
  .portfolio-case { display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding-top: 54px; }
  .portfolio-details h2 { font-size: clamp(28px, 7.5vw, 36px); }
  .portfolio-details .eyebrow { margin-bottom: 10px; }
  .portfolio-photo { height: clamp(195px, 54vw, 380px); }
}
