/* /portfolio — client case studies. Built on the site tokens and the shared
   button, tag, filter, band and lightbox components; only the layout is new. */

.pf-intro {
  padding: 64px 56px 52px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: end;
  border-bottom: 2.5px solid var(--ink);
}
.pf-intro__copy { display: flex; flex-direction: column; gap: 22px; }
.pf-intro__title {
  font-size: clamp(33px, 3.4vw + 14px, 62px);
  line-height: 1.03;
  letter-spacing: -.025em;
  font-weight: 600;
  max-width: 16ch;
  text-wrap: balance;
}
.pf-intro__lede { font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 52ch; }

.pf-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 2.5px solid var(--ink);
  border-left: 1px solid var(--rule);
}
.pf-stats > div { padding: 18px 20px 20px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.pf-stats dt {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.pf-stats dd { font-size: 44px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; }
.pf-stats > div:first-child dd { color: var(--ink); box-shadow: inset 0 -10px 0 var(--lime); display: inline-block; }

.pf-bar {
  padding: 20px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
}
.pf-bar__label {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The brands by country: white tiles on a hairline grid, each a link down
   to that client's work. */
.pf-brands { padding: 48px 56px 8px; display: flex; flex-direction: column; gap: 40px; border-bottom: 2.5px solid var(--ink); padding-bottom: 56px; }
.pf-brands__country {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
}
.pf-brands__country span { color: var(--muted); }
/* Hairlines belong to the tiles, not the grid, so the cells a short row
   leaves empty stay plain paper rather than a filled slab. */
.pf-brands__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-top: 1.5px solid var(--rule);
  border-left: 1.5px solid var(--rule);
}
.pf-brand {
  background: #fff;
  border-right: 1.5px solid var(--rule);
  border-bottom: 1.5px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 20px 16px;
  aspect-ratio: 5 / 3;
  text-decoration: none;
  color: var(--muted);
  transition: box-shadow .15s ease;
}
.pf-brand:hover, .pf-brand:focus-visible { box-shadow: inset 0 0 0 3px var(--lime); outline: none; }
/* A wall-only brand has no case study to jump to: no hover ring, plain cursor. */
.pf-brand--plain:hover { box-shadow: none; }
.pf-brand img { max-width: 100%; max-height: 58%; width: auto; height: auto; object-fit: contain; }
.pf-brand span {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
}

/* Shared: every image is a button that opens the lightbox. The ground is
   white in both themes: nearly every piece was exported on white, so a
   white ground makes the artwork's own edge the only edge you see. */
.pf-tile, .pf-card__cover {
  display: block;
  padding: 0;
  border: 1.5px solid var(--rule);
  background: #fff;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  overflow: hidden;
}
.pf-tile img, .pf-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .4s ease;
}
.pf-tile:hover img, .pf-card__cover:hover img { transform: scale(1.03); }
.pf-tile:focus-visible, .pf-card__cover:focus-visible, .pf-case__all:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}

/* Featured case study: text left, media right, alternating. */
.pf-case {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 56px;
  padding: 64px 56px;
  border-bottom: 2.5px solid var(--ink);
  align-items: start;
}
.pf-case:nth-of-type(even) .pf-case__text { order: 2; }
.pf-case__text { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 90px; }
.pf-case__num {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .22em;
  color: var(--muted);
}
.pf-case__name { font-size: clamp(30px, 2vw + 16px, 46px); line-height: 1.04; letter-spacing: -.025em; font-weight: 600; }
.pf-case__meta {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  padding-left: 12px;
  border-left: 4px solid var(--lime);
}
.pf-case__summary { font-size: 16.5px; line-height: 1.6; color: var(--muted); max-width: 48ch; }

/* Justified rows: portfolio.php sets each tile's width (its share of the
   row by aspect ratio) and aspect-ratio inline, so every piece shows whole
   and the row still lines up. The first row carries the cover, larger. */
.pf-case__media { display: flex; flex-direction: column; gap: 10px; }
.pf-row { display: flex; gap: 10px; align-items: flex-start; }
.pf-row:first-child .pf-tile { border: 2.5px solid var(--ink); }
.pf-tile { flex: none; }
.pf-case__all {
  align-self: flex-start;
  margin-top: 8px;
  padding: 12px 16px;
  border: 1.5px solid var(--ink);
  background: none;
  color: var(--ink);
  cursor: pointer;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.pf-case__all:hover { color: var(--lime); border-color: var(--lime); }

/* The rest: a three-across grid of cards. */
.pf-more { padding: 64px 56px 72px; }
.pf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px 32px;
  margin-top: 8px;
}
.pf-card { display: flex; flex-direction: column; gap: 10px; }
.pf-card__frame { position: relative; }
.pf-card__cover { width: 100%; border: 2.5px solid var(--ink); }
/* A portrait flyer in the square frame keeps a little white either side,
   which is the same white it was printed on. Never cropped. */
.pf-card__cover img { padding: 6%; box-sizing: border-box; }
.pf-card__name { font-size: 22px; font-weight: 600; letter-spacing: -.015em; margin-top: 6px; }
.pf-card__meta {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.pf-card__summary { font-size: 15px; line-height: 1.55; color: var(--muted); }

/* Named-only clients. */
.pf-named { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.pf-named__head { display: flex; flex-direction: column; gap: 16px; }
.pf-named__head h2 { font-size: 30px; line-height: 1.1; letter-spacing: -.015em; font-weight: 600; }
.pf-named__head p { color: var(--band-muted); font-size: 16px; line-height: 1.55; max-width: 44ch; }
.pf-named__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--band-rule); }
.pf-named__list li {
  padding: 18px 0;
  border-bottom: 1px solid var(--band-rule);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 14px;
}
.pf-named__list li::before { content: ''; width: 10px; height: 10px; background: var(--lime); flex: none; }

[data-category][hidden] { display: none !important; }
/* A logo link jumps to the client; keep its heading clear of the sticky filter bar. */
.pf-case, .pf-card { scroll-margin-top: 80px; }

@media (max-width: 1180px) {
  .pf-grid { grid-template-columns: repeat(2, 1fr); }
  .pf-brands__grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 960px) {
  .pf-intro, .pf-case, .pf-named { grid-template-columns: 1fr; gap: 36px; }
  .pf-case:nth-of-type(even) .pf-case__text { order: 0; }
  .pf-case__text { position: static; }
}

@media (max-width: 760px) {
  .pf-intro, .pf-case, .pf-more { padding-left: 16px; padding-right: 16px; }
  .pf-intro { padding-top: 40px; }
  .pf-case { padding-top: 44px; padding-bottom: 44px; }
  .pf-bar { padding: 14px 16px; }
  .pf-bar__label { display: none; }
  .pf-grid { grid-template-columns: 1fr; }
  .pf-case__media, .pf-row { gap: 6px; }
  .pf-brands { padding-left: 16px; padding-right: 16px; gap: 28px; }
  .pf-brands__grid { grid-template-columns: repeat(2, 1fr); }
  .pf-brand { padding: 16px 12px 12px; }
  .pf-stats dd { font-size: 34px; }
  .pf-named__list li { font-size: 17px; }
}
