/* Portfolio category page (/portfolio/{slug}): band, category pills, project tabs, masonry grid and the image slideshow. */
.pf-page { padding-block: clamp(1rem, 3vw, 2rem) clamp(3rem, 6vw, 5rem); }

.pf-crumbs { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.pf-crumbs a { color: inherit; text-decoration: none; }
.pf-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.pf-crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* Band: colour with playful shapes, or a photo with a soft dark layer */
.pf-band { position: relative; isolation: isolate; overflow: hidden; border-radius: 28px; min-height: clamp(220px, 30vw, 360px);
  display: grid; place-items: center; text-align: center; padding: clamp(2rem, 5vw, 3.5rem) 1.5rem;
  background: var(--band-c, var(--yellow)); color: var(--fixed-ink); }
.pf-band.has-img { background: #171114 var(--band-img) center / cover no-repeat; color: #fff; }
.pf-band.has-img::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(23, 17, 20, .25), rgba(23, 17, 20, .6)); }
.pf-band.has-img .pf-shape { display: none; }
.pf-shape { position: absolute; z-index: -1; opacity: .9; animation: pf-float 9s ease-in-out infinite; }
.pf-shape.s1 { width: 30%; aspect-ratio: 1; left: -6%; top: -30%; background: var(--pink); border-radius: 50%; }
.pf-shape.s2 { width: 18%; aspect-ratio: 1; right: 6%; bottom: -16%; background: var(--blue); border-radius: 22%; transform: rotate(18deg); animation-delay: -3s; }
.pf-shape.s3 { width: 9%; aspect-ratio: 1; right: 22%; top: 12%; background: #fff; opacity: .55; border-radius: 50%; animation-delay: -6s; }
@keyframes pf-float { 50% { translate: 0 -12px; } }
.pf-band-in { max-width: 46rem; position: relative; z-index: 1; }
/* 3D layer (portfolio3d.js): sits above the colour/image (and its dark layer), under the heading */
.pf-3d { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
.pf-3d canvas { width: 100%; height: 100%; display: block; }
.pf-band.is-3d .pf-3d { opacity: 1; }
.pf-band.is-3d .pf-shape { display: none; }
.pf-band.is-3d-img .pf-3d { opacity: .9; }
.pf-kicker { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: .3rem .8rem; border-radius: 999px;
  border: 1.5px solid currentColor; margin-bottom: .9rem; }
.pf-band h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.pf-band.has-img h1, .pf-band.has-img p { text-shadow: 0 2px 16px rgba(0, 0, 0, .35); }
.pf-band p { margin: .9rem auto 0; max-width: 40rem; font-size: clamp(1rem, 1.6vw, 1.12rem); }
.pf-count { display: inline-block; margin-top: 1.1rem; font-size: .85rem; font-weight: 600; opacity: .85; }
.pf-band-in > * { animation: pf-rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.pf-band-in > :nth-child(2) { animation-delay: .08s; }
.pf-band-in > :nth-child(3) { animation-delay: .16s; }
.pf-band-in > :nth-child(4) { animation-delay: .24s; }
@keyframes pf-rise { from { opacity: 0; transform: translateY(14px); } }

/* Other categories */
.pf-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 1.4rem 0 .4rem; }
.pf-cats a { padding: .45rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 500;
  transition: border-color .2s, background .2s, transform .25s; }
.pf-cats a:hover { border-color: var(--ink); transform: translateY(-2px); }
.pf-cats a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Project tabs */
.pf-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.4rem; margin: 2rem 0 1.6rem; }
.pf-tabs button { font: 700 clamp(.95rem, 1.6vw, 1.1rem) var(--display); letter-spacing: -.01em; text-transform: uppercase; color: var(--ink); background: none;
  border: 0; padding: .35rem 0; cursor: pointer; position: relative; }
.pf-tabs button span { font: 600 .72rem var(--body); vertical-align: super; color: var(--muted); margin-left: .15rem; }
.pf-tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: #FF5A2D; transform: scaleX(0); transition: transform .3s; }
.pf-tabs button:hover::after { transform: scaleX(.4); }
.pf-tabs button[aria-pressed="true"] { color: #FF5A2D; }
.pf-tabs button[aria-pressed="true"]::after { transform: none; }

/* Grid: every image in the same 4:3 frame, so rows line up (the slideshow shows the whole picture) */
.pf-masonry { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem 1.2rem; margin-top: 1.6rem; }
.pf-item { margin: 0; min-width: 0; animation: pf-in .55s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
.pf-item[hidden] { display: none; }
@keyframes pf-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.pf-open { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: var(--card); border-radius: 16px; overflow: hidden; cursor: zoom-in; position: relative; }
.pf-open img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .6s cubic-bezier(.2, .8, .2, 1), filter .4s; }
.pf-item figcaption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .pf-masonry { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pf-open:hover img, .pf-open:focus-visible img { transform: scale(1.05); }
.pf-open:focus-visible { outline: 3px solid #FF5A2D; outline-offset: 3px; }
.pf-zoom { position: absolute; right: .7rem; bottom: .7rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #2B2220;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18); opacity: 0; transform: scale(.7); transition: opacity .3s, transform .3s; }
.pf-zoom svg { width: 1.2rem; height: 1.2rem; }
.pf-open:hover .pf-zoom, .pf-open:focus-visible .pf-zoom { opacity: 1; transform: none; }
.pf-item figcaption { font-size: .85rem; color: var(--muted); margin-top: .45rem; padding-inline: .2rem; }

/* Pages of 6 */
.pf-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .45rem; margin-top: 1.8rem; }
.pf-pager[hidden] { display: none; }
.pf-pager button { min-width: 2.6rem; height: 2.6rem; padding: 0 .7rem; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink);
  font: 600 .95rem var(--body); cursor: pointer; transition: border-color .2s, background .2s, color .2s, transform .25s; }
.pf-pager button:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-2px); }
.pf-pager button[aria-current="page"] { background: #FF5A2D; border-color: #FF5A2D; color: #fff; }
.pf-pager button:disabled { opacity: .35; cursor: default; }
.pf-pager button:focus-visible { outline: 3px solid #FF5A2D; outline-offset: 2px; }
.pf-pager .gap { color: var(--muted); padding: 0 .1rem; }
.pf-pager button.view-all { margin-left: .6rem; padding: 0 1.2rem; border-color: var(--ink); background: var(--ink); color: var(--bg); }
.pf-pager button.view-all:hover { background: transparent; color: var(--ink); }
.pf-pager button.view-all[aria-pressed="true"] { margin-left: 0; background: transparent; color: var(--ink); }
@media (max-width: 480px) { .pf-pager button.view-all { flex-basis: 100%; margin: .4rem 0 0; } }
.pf-pager .info { flex-basis: 100%; text-align: center; font-size: .85rem; color: var(--muted); margin-top: .2rem; }

.pf-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); font-size: 1.05rem; }
.pf-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2.2rem; }
.pf-back, .pf-cta { font-weight: 600; color: var(--ink); text-decoration: none; }
.pf-back:hover, .pf-cta:hover { text-decoration: underline; }
.pf-cta { color: #FF5A2D; }

/* Slideshow */
.pf-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 11, 13, .94); color: #fff; display: grid;
  grid-template: auto 1fr / auto 1fr auto; align-items: center; animation: pf-fade .25s ease both; }
.pf-lightbox[hidden] { display: none; }
@keyframes pf-fade { from { opacity: 0; } }
.pf-lb-bar { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding: .8rem 1rem; }
.pf-lb-count { font-size: .9rem; font-variant-numeric: tabular-nums; opacity: .85; }
.pf-lb-actions { display: flex; gap: .3rem; }
.pf-lightbox button { background: transparent; border: 0; color: #fff; cursor: pointer; border-radius: 50%; display: grid; place-items: center; transition: background .2s; }
.pf-lightbox button:hover, .pf-lightbox button:focus-visible { background: rgba(255, 255, 255, .14); }
.pf-lightbox button:focus-visible { outline: 2px solid #fff; }
.pf-lb-actions button { width: 2.6rem; height: 2.6rem; }
.pf-lb-actions svg { width: 1.3rem; height: 1.3rem; }
.pf-lb-nav { width: 3.2rem; height: 3.2rem; margin: 0 .6rem; }
.pf-lb-nav svg { width: 1.6rem; height: 1.6rem; }
.pf-lb-stage { margin: 0; height: 100%; min-height: 0; display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; padding-bottom: 1rem; overflow: hidden; }
.pf-lb-stage img { max-width: 100%; max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem); object-fit: contain; border-radius: 6px; user-select: none;
  transition: opacity .2s, transform .25s; }
.pf-lb-stage img.swap { opacity: 0; transform: scale(.98); }
.pf-lb-stage figcaption { margin-top: .8rem; font-size: .95rem; text-align: center; max-width: 60ch; padding-inline: 1rem; opacity: .9; }
@media (max-width: 640px) {
  .pf-lightbox { grid-template: auto 1fr auto / 1fr 1fr; }
  .pf-lb-stage { grid-column: 1 / -1; grid-row: 2; }
  .pf-lb-nav { grid-row: 3; margin: .4rem auto 1rem; }
  .pf-lb-nav.prev { grid-column: 1; } .pf-lb-nav.next { grid-column: 2; }
  .pf-masonry { gap: 1rem .8rem; }
  .pf-open { border-radius: 12px; }
}
body.pf-lb-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .pf-shape, .pf-band-in > *, .pf-item, .pf-lightbox { animation: none; }
  .pf-open img, .pf-lb-stage img { transition: none; }
}
