/* ==========================================================================
   Portfolio pages (/portfolio and /portfolio/:user). Loaded last.
   Mobile-first: base rules target phones, min-width queries add the rest.
   ========================================================================== */

.pf { min-height: 100vh; display: flex; flex-direction: column; }
.pf-main { flex: 1; width: 100%; padding-top: calc(var(--hdr-h) + var(--xl2)); padding-bottom: var(--xl5); }

.pf-draft {
  position: fixed; top: var(--hdr-h); left: 0; right: 0; z-index: 50;
  padding: 10px var(--gut);
  background: var(--pink); color: #0a0a0a;
  font-size: .875rem; text-align: center;
}

/* ---------- Hero ---------- */
.pf-hero { max-width: 60rem; animation: pfUp .9s var(--ease-out) both; }
.pf-back {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); margin-bottom: var(--sm);
  color: var(--mute); text-decoration: none; font-size: .9375rem;
  transition: color var(--dur-fast);
}
.pf-back span { transition: transform .45s var(--ease-spring); }
.pf-back:hover { color: var(--pink); }
.pf-back:hover span { transform: translateX(-3px); }
.pf-avatar {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover; display: block;
  margin-bottom: var(--md);
  box-shadow: 0 0 0 1px var(--rule), 0 0 0 6px var(--bg), 0 0 0 7px var(--pink);
}
.pf-kicker {
  color: var(--pink); font-size: .8125rem; letter-spacing: .02em; text-transform: uppercase;
  margin-bottom: var(--sm);
}
.pf h1 {
  font-size: clamp(3rem, 9vw, 7.5rem);
  line-height: .95;
  letter-spacing: -.06em;
  max-width: none;
  overflow-wrap: break-word;
  hyphens: auto;
}
.pf-tag { font-size: clamp(1.25rem, 2.2vw, 1.75rem); letter-spacing: -.04em; margin-top: var(--md); max-width: 32ch; }
.pf-bio { color: var(--mute); max-width: 52ch; line-height: 1.5; margin-top: var(--md); font-weight: 400; letter-spacing: -.01em; }

.pf-links { list-style: none; padding: 0; margin: var(--xl) 0 0; display: flex; flex-wrap: wrap; gap: var(--xs); }
.pf-links a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px;
  border: 1px solid var(--rule); border-radius: 999px;
  text-decoration: none; font-size: .9375rem;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.pf-links a:hover { border-color: var(--pink); color: var(--pink); }

/* Index hero is an intro, not the subject: smaller, and the list follows right away. */
.pf-hero-index h1 { font-size: clamp(2.5rem, 6.4vw, 5.5rem); max-width: 14ch; line-height: 1; }

/* ---------- Work grid ----------
   Row-major so the order set in the admin reads left to right. Without JS it
   is a plain grid; js/portfolio.js adds .is-masonry and sets each item's row
   span from its height so columns pack without gaps. */
.pf-works { margin-top: var(--xl4); }
.pf-works-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--md);
  border-top: 1px solid var(--rule); padding-top: var(--md); margin-bottom: var(--xl);
}
.pf-works-head h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -.045em; max-width: none; }
.pf-works-head span { color: var(--mute); font-size: .9375rem; }

.pf-grid {
  --row: 4px;
  --gap-y: var(--xl);
  display: grid; grid-template-columns: 1fr; column-gap: var(--md); row-gap: var(--gap-y);
  align-items: start;
}
.pf-grid.is-masonry { grid-auto-rows: var(--row); row-gap: 0; }
.pf-item {
  margin: 0; min-width: 0;
  animation: pfUp .9s var(--ease-out) both;
  animation-delay: calc(min(var(--i), 8) * 70ms + 150ms);
}
.pf-open {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  background: var(--paper); border-radius: var(--radius); overflow: hidden;
  color: inherit; font: inherit;
}
.pf-open img, .pf-open video {
  display: block; width: 100%; height: auto;
  transition: transform .8s var(--ease-out), opacity .4s;
}
.pf-open:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
.pf-play {
  position: absolute; right: 12px; bottom: 12px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(10, 10, 10, .7); backdrop-filter: blur(6px);
}
.pf-play::after {
  content: ""; position: absolute; left: 12px; top: 9px;
  border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.pf-item figcaption { padding: var(--sm) 2px 0; }
.pf-item h3 { font-size: 1.0625rem; letter-spacing: -.03em; }
.pf-item p { color: var(--mute); font-size: .9375rem; line-height: 1.45; margin-top: 4px; font-weight: 400; letter-spacing: -.01em; }
.pf-empty { color: var(--mute); padding: var(--xl4) 0; }

/* ---------- Portfolio index: designer roster ----------
   One row per designer: who they are on one side, a strip of their latest
   work on the other. A pink rule sweeps in on hover, like the homepage list. */
.pr-list { list-style: none; margin: var(--xl3) 0 0; padding: 0; }
.pr-row {
  position: relative; border-top: 1px solid var(--rule);
  animation: pfUp .9s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 8) * 70ms + 150ms);
}
.pr-row:last-child { border-bottom: 1px solid var(--rule); }
.pr-row::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: var(--pink); transform: scaleX(0); transform-origin: right;
  transition: transform .6s var(--ease);
}
.pr-row > a {
  display: grid; gap: var(--md);
  padding: var(--md) 0 var(--xl);
  text-decoration: none; color: inherit;
}
.pr-row > a:focus-visible { outline: 2px solid var(--pink); outline-offset: 4px; }

.pr-id { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: var(--sm); min-width: 0; }
.pr-av {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 0 0 1px var(--rule);
}
.pr-av-fallback {
  display: grid; place-items: center; background: var(--paper); color: var(--pink);
  font-size: 1.125rem; font-weight: 600;
}
.pr-meta { min-width: 0; }
.pr-meta h2 {
  font-size: clamp(1.75rem, 4.4vw, 3.25rem); line-height: 1; letter-spacing: -.05em; max-width: none;
  overflow-wrap: break-word; hyphens: auto;
  transition: color var(--dur-base) var(--ease), transform .6s var(--ease);
}
.pr-tag { margin-top: 6px; font-size: 1rem; letter-spacing: -.03em; }
.pr-count { margin-top: 4px; color: var(--mute); font-size: .875rem; font-weight: 400; letter-spacing: -.01em; }
.pr-draft {
  display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: var(--radius-sm);
  background: var(--pink); color: #0a0a0a; font-size: .75rem; font-weight: 500;
}
.pr-go {
  align-self: start; color: var(--mute); font-size: 1.25rem;
  transition: color var(--dur-fast), transform .45s var(--ease-spring);
}

/* Strip: fixed slots (3 on phones, 4 from tablet) so thumbs stay one size
   however much a designer has posted; unused slots just stay empty. */
.pr-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--xs); }
.pr-strip .pr-thumb:nth-child(4) { display: none; }
.pr-thumb {
  display: block; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--paper);
}
.pr-thumb img, .pr-thumb video {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease-out);
}
.pr-thumb-empty {
  grid-column: 1 / -1;
  display: grid; place-items: center; aspect-ratio: auto; min-height: 96px;
  border: 1px dashed var(--rule); background: none;
  color: var(--mute); font-size: .875rem;
}

@media (hover: hover) and (pointer: fine) {
  .pf-open:hover img, .pf-open:hover video { transform: scale(1.03); }
  .pr-row:hover::before { transform: scaleX(1); transform-origin: left; }
  .pr-row:hover h2 { color: var(--pink); transform: translateX(6px); }
  .pr-row:hover .pr-go { color: var(--pink); transform: translateX(4px); }
  .pr-row:hover .pr-thumb img, .pr-row:hover .pr-thumb video { transform: scale(1.04); }
}

/* ---------- Lightbox ---------- */
.pf-lb {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: rgba(6, 6, 6, .96); color: #fff;
  display: none; flex-direction: column;
}
.pf-lb[open] { display: flex; animation: pfFade .25s var(--ease) both; }
.pf-lb::backdrop { background: transparent; }
.pf-lb-media {
  flex: 1; min-height: 0; display: grid; place-items: center;
  padding: calc(var(--tap) + var(--sm)) var(--gut) 0;
}
.pf-lb-media img, .pf-lb-media video {
  max-width: 100%; max-height: 100%; border-radius: var(--radius-sm); display: block;
  animation: pfZoom .35s var(--ease-out) both;
}
.pf-lb button {
  font: inherit; font-size: .9375rem; color: #fff; background: #ffffff14;
  border: 1px solid #ffffff26; border-radius: 999px; cursor: pointer;
  min-height: var(--tap); min-width: var(--tap); padding: 0 16px;
  transition: background var(--dur-fast), transform .2s var(--ease-spring);
}
.pf-lb button:hover { background: #ffffff26; }
.pf-lb button:active { transform: scale(.95); }
.pf-lb button:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.pf-lb-close {
  position: absolute; z-index: 1;
  top: max(var(--xs), env(safe-area-inset-top)); right: var(--gut);
}
.pf-lb-bar {
  display: flex; flex-direction: column; align-items: stretch; gap: var(--sm);
  padding: var(--sm) var(--gut) max(var(--sm), env(safe-area-inset-bottom));
}
.pf-lb-cap h3 { font-size: 1rem; }
.pf-lb-cap p { color: #ffffff99; font-size: .9375rem; margin-top: 2px; font-weight: 400; }
.pf-lb-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--xs); flex-shrink: 0; }
.pf-lb-nav span { color: #ffffff99; font-size: .875rem; min-width: 5ch; text-align: center; font-variant-numeric: tabular-nums; }
.pf-lb-nav button { min-width: 64px; font-size: 1.125rem; }

/* ---------- Footer ---------- */
.pf-foot {
  /* inset by the gutter so the rule lines up with the content above */
  width: calc(100% - 2 * var(--gut)); max-width: calc(1440px - 2 * var(--gut));
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--xs) var(--md);
  padding: var(--md) 0;
  border-top: 1px solid var(--rule); color: var(--mute); font-size: .875rem;
}
.pf-foot a { text-decoration: none; }
.pf-foot a:hover { color: var(--pink); }

.pf-404-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--md); margin-top: var(--xl); }

@keyframes pfUp { from { opacity: 0; transform: translateY(24px); } }
@keyframes pfFade { from { opacity: 0; } }
@keyframes pfZoom { from { opacity: 0; transform: scale(.97); } }

/* ---------- Wider screens ---------- */
@media (min-width: 600px) {
  .pf-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 721px) {
  .pf-main { padding-top: calc(var(--hdr-h) + var(--xl3)); }
  .pf-works { margin-top: var(--xl6); }
  .pr-list { margin-top: var(--xl4); }

  .pr-strip { grid-template-columns: repeat(4, 1fr); }
  .pr-strip .pr-thumb:nth-child(4) { display: block; }

  .pf-lb-bar { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--md); }
  .pf-lb-nav { justify-content: flex-end; }
}

@media (min-width: 1024px) {
  .pf-grid { grid-template-columns: repeat(3, 1fr); }
  /* Roster goes side by side: name on the left, work strip on the right. */
  .pr-row > a { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--xl3); align-items: start; padding: var(--xl) 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-hero, .pf-item, .pr-row, .pf-lb[open], .pf-lb-media img, .pf-lb-media video { animation: none; }
  .pf-open img, .pf-open video, .pr-thumb img, .pr-thumb video, .pr-meta h2, .pr-go, .pr-row::before, .pf-back span { transition: none; }
  .pf-open:hover img, .pf-open:hover video,
  .pr-row:hover h2, .pr-row:hover .pr-go, .pr-row:hover .pr-thumb img, .pr-row:hover .pr-thumb video { transform: none; }
}
