/* Portfolio page: all projects on one page, filterable, with an in-page enlarged view */

/* Hero: three overlapping screenshots */
.pf-hero__facts { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 30px 0 0; }
.pf-hero__facts div { border-left: 2px solid var(--brand); padding-left: 14px; }
.pf-hero__facts dt { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pf-hero__facts dd { margin: 4px 0 0; font: 600 1.35rem/1.2 var(--font-display); letter-spacing: -.02em; }
.pf-hero__stack { position: relative; aspect-ratio: 1 / .82; }
.pf-hero__shot { position: absolute; margin: 0; border-radius: 14px; overflow: hidden; background: #e9e7e0; box-shadow: var(--shadow-2); border: 1px solid rgba(11, 31, 26, .08); }
.pf-hero__shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; }
.pf-hero__shot figcaption { position: absolute; left: 12px; bottom: 12px; padding: 6px 11px; border-radius: 999px; background: rgba(11, 31, 26, .78); color: #fff; font: 600 .74rem/1 var(--font-body); }
.pf-hero__shot--1 { width: 78%; left: 0; top: 0; z-index: 2; transform: rotate(-1.5deg); }
.pf-hero__shot--2 { width: 62%; right: 0; top: 30%; z-index: 3; transform: rotate(2deg); }
.pf-hero__shot--3 { width: 56%; left: 8%; bottom: 0; z-index: 1; transform: rotate(-.5deg); }
@media (max-width: 1023px) { .pf-hero__stack { max-width: 620px; margin-top: 8px; } }

/* Toolbar */
.pf-toolbar { margin-bottom: clamp(28px, 4vw, 48px); }
.pf-toolbar__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.pf-toolbar__title { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); }
.pf-status { color: var(--muted); font-size: .95rem; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.pf-status__hint::before { content: '\00B7'; margin-right: 10px; } /* middle dot between the count and the hint */
@media (max-width: 599px) { .pf-status__hint { display: none; } } /* on phones the enlarge icon is always shown on each screenshot */
.pf-filter { margin-bottom: 0; }
.filter__count { display: inline-block; min-width: 1.6em; margin-left: 4px; padding: 2px 6px; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: .78rem; font-weight: 600; text-align: center; }
.filter__btn[aria-pressed="true"] .filter__count { background: rgba(255, 255, 255, .16); color: #fff; }
.no-js [data-filter-toolbar] { display: none; }
@media (max-width: 767px) {
  /* one swipeable row on phones instead of a tall wall of buttons */
  .pf-filter { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 10px; scrollbar-width: none; }
  .pf-filter::-webkit-scrollbar { display: none; }
  .pf-filter .filter__btn { flex: 0 0 auto; }
}

/* Grid */
.pf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; gap: clamp(32px, 4vw, 52px) clamp(18px, 2.4vw, 32px); }
.wk-card { display: flex; flex-direction: column; min-width: 0; }
.wk-card.is-hidden { display: none; }
.wk-card--featured { grid-column: span 2; }
@media (min-width: 1100px) {
  /* featured work takes two columns and two rows, alternating sides, with two smaller projects beside it */
  .wk-card--featured { grid-row: span 2; }
  .wk-card--featured:nth-child(even) { grid-column: 2 / span 2; }
}
.wk-card__media {
  position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line-soft); border-radius: 14px; overflow: hidden;
  background: #e9e7e0; cursor: zoom-in; aspect-ratio: 16 / 9;
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.wk-card__media:hover, .wk-card__media:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.wk-card__title { transition: color .25s; }
.wk-card:has(.wk-card__media:hover, .wk-card__media:focus-visible) .wk-card__title { color: var(--brand); }
.wk-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .8s var(--ease-out); }
.wk-card__media:hover img, .wk-card__media:focus-visible img { transform: scale(1.035); }
.wk-card__media:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.wk-card__zoom {
  position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--ink); box-shadow: var(--shadow-1); font-size: .85rem; opacity: 0; transform: translateY(6px);
  transition: opacity .3s, transform .4s var(--ease-out);
}
.wk-card__media:hover .wk-card__zoom, .wk-card__media:focus-visible .wk-card__zoom { opacity: 1; transform: none; }
@media (hover: none) { .wk-card__zoom { opacity: 1; transform: none; } }
.wk-card__badge { position: absolute; left: 12px; top: 12px; padding: 6px 11px; border-radius: 999px; background: var(--ink); color: #fff; font: 600 .72rem/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase; }
.wk-card__body { padding-top: 16px; }
.wk-card__sector { font: 600 var(--fs-xs)/1.2 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.wk-card__title { margin-top: 8px; font-size: 1.18rem; line-height: 1.2; letter-spacing: -.015em; }
.wk-card--featured .wk-card__title { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.9rem); }
.wk-card__desc { margin-top: 8px; color: var(--muted); font-size: .95rem; line-height: 1.55; max-width: 42em; }
.wk-card--featured .wk-card__desc { font-size: 1.02rem; }
.wk-card__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
@media (min-width: 1100px) {
  /* the featured screenshot grows to fill its two rows, so the card ends level with the pair beside it */
  .pf-grid:not(.is-filtered) .wk-card--featured .wk-card__media { flex: 1 1 auto; aspect-ratio: auto; min-height: 320px; }
  .pf-grid:not(.is-filtered) .wk-card--featured .wk-card__media img { position: absolute; inset: 0; }
}
/* A filtered selection is shown as an even grid of same-size cards */
.pf-grid.is-filtered .wk-card--featured { grid-column: auto; grid-row: auto; }
.pf-grid.is-filtered .wk-card--featured .wk-card__title { font-size: 1.18rem; }
.pf-grid.is-filtered .wk-card--featured .wk-card__desc { font-size: .95rem; }
@media (max-width: 1099px) { .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .pf-grid { grid-template-columns: minmax(0, 1fr); } .wk-card--featured { grid-column: auto; } }

/* Closing card: fills the last place in the grid and invites an enquiry */
.pf-cta {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 24px;
  padding: clamp(24px, 2.6vw, 34px); border-radius: 14px; min-width: 0;
  background-image: radial-gradient(90% 70% at 100% 0, rgba(25, 150, 105, .5), transparent 62%);
}
.pf-cta__title { font-size: clamp(1.4rem, 1.2rem + .7vw, 1.8rem); line-height: 1.12; letter-spacing: -.025em; }
.pf-cta__title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.06em; color: var(--citron); }
.pf-cta p { margin-top: 12px; color: var(--on-dark-muted); font-size: .95rem; line-height: 1.55; }

/* Enlarged view (native <dialog>) */
.lightbox { width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 18px; background: var(--ink); color: var(--on-dark); box-shadow: 0 40px 100px rgba(0, 0, 0, .5); overflow: auto; }
.lightbox::backdrop { background: rgba(6, 18, 15, .82); backdrop-filter: blur(4px); }
/* Opening eases the panel up out of a fading backdrop; each project's image fades in as you step through */
.lightbox[open] { animation: lb-in .45s var(--ease-out); }
.lightbox[open]::backdrop { animation: lb-fade .35s var(--ease); }
.lightbox__figure img { animation: lb-fade .5s var(--ease); }
@keyframes lb-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes lb-fade { from { opacity: 0; } }
.lightbox__inner { position: relative; }
.lightbox__figure { margin: 0; background: #10241E; aspect-ratio: 16 / 9; }
.lightbox__figure img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.lightbox__close {
  position: absolute; z-index: 2; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(11, 31, 26, .78); color: #fff; font-size: 1.1rem; display: grid; place-items: center;
}
.lightbox__close:hover { background: var(--brand); }
.lightbox__meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 20px 24px 24px; flex-wrap: wrap; }
.lightbox__sector { font: 600 var(--fs-xs)/1.2 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--citron); }
.lightbox__title { margin-top: 6px; font: 600 1.5rem/1.2 var(--font-display); letter-spacing: -.02em; color: #fff; }
.lightbox__desc { margin-top: 6px; color: var(--on-dark-muted); max-width: 46em; }
.lightbox__nav { display: flex; align-items: center; gap: 10px; }
.lightbox__btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #fff; display: grid; place-items: center; }
.lightbox__btn:hover { background: #fff; color: var(--ink); }
.lightbox__pos { min-width: 5.5em; text-align: center; font-size: .88rem; color: var(--on-dark-muted); }
.lightbox :focus-visible { outline-color: var(--citron); }
