/* Selected client work: card gallery, 2026-10-29 (designer spec).
   Desktop: 10-column grid. Madeel (.is-lead) spans four columns and two rows;
   four .is-small cards fill the right in a 2×2; the two light, wide images
   (.is-wide: a site screenshot and a product banner) close the grid as a
   pair. Caption content steps down with card size: small cards drop the
   description and the text link (the whole card is the link; the hover arrow
   is the affordance). Tags cap at 2 / 3 with a "+N" pill (work-gallery.js).
   Filter chips sit in the section heading; any filter switches to an even
   three-up grid (.is-filtered). */

/* Heading side: paragraph + filter chips */
.work-gallery .work-heading-side{display:flex;flex-direction:column;align-items:flex-end;gap:var(--sp-4)}
.work-gallery .work-heading-side>p{margin:0;text-align:right}
.work-gallery .work-filters{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--sp-2)}
.work-gallery .work-filters button{display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border:1px solid var(--line);border-radius:99px;background:transparent;color:var(--sand);font:500 13px/1 Manrope,sans-serif;cursor:pointer;transition:border-color .2s,color .2s,background .2s}
.work-gallery .work-filters button span{font-size:11px;opacity:.6;font-variant-numeric:tabular-nums}
.work-gallery .work-filters button:hover{border-color:rgba(255,139,66,.55);color:var(--cream)}
.work-gallery .work-filters button[aria-pressed=true]{background:var(--cream);border-color:var(--cream);color:var(--night)}
.work-gallery .work-filters button:focus-visible{outline:2px solid var(--amber);outline-offset:2px}

/* Grid */
.work-gallery .home-projects.work-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px}
.work-gallery .work-grid .work-card,
.work-gallery .work-grid .work-card:last-child{position:relative;display:flex;flex-direction:column;grid-template-columns:none;border-radius:12px;background:var(--surface);transform:none;transition:border-color .45s}
.work-gallery .work-grid .work-card:hover{transform:none;border-color:rgba(255,139,66,.45)}
.work-gallery .work-grid:not(.is-filtered) .work-card[href="/projects/madeel"]{grid-column:1/5;grid-row:1/3}
.work-gallery .work-grid:not(.is-filtered) .work-card[href="/projects/alter-health"]{grid-column:5/8;grid-row:1}
.work-gallery .work-grid:not(.is-filtered) .work-card[href="/projects/mypediaclinic"]{grid-column:8/11;grid-row:1}
.work-gallery .work-grid:not(.is-filtered) .work-card[href="/projects/best-sim-setup"]{grid-column:5/8;grid-row:2}
.work-gallery .work-grid:not(.is-filtered) .work-card[href="/projects/ulo-systems"]{grid-column:8/11;grid-row:2}
.work-gallery .work-grid:not(.is-filtered) .work-card[href="/projects/house-of-stox"]{grid-column:1/6;grid-row:3}
.work-gallery .work-grid:not(.is-filtered) .work-card[href="/projects/1clickreport"]{grid-column:6/11;grid-row:3}
.work-gallery .work-grid.is-filtered .work-card{grid-column:span 4}

/* Images */
.work-gallery .work-grid .project-image,
.work-gallery .work-grid .project-image.website-screenshot,
.work-gallery .work-grid .work-card:last-child .project-image{position:relative;aspect-ratio:auto;height:150px;min-height:0;flex:0 0 auto;background:#17130f;overflow:hidden}
.work-gallery .work-grid .is-wide .project-image,
.work-gallery .work-grid .work-card.is-wide:last-child .project-image{height:190px}
.work-gallery .work-grid:not(.is-filtered) .is-lead .project-image{height:auto;flex:1 1 auto;min-height:0}
.work-gallery .work-grid.is-filtered .work-card .project-image{height:180px}
.work-gallery .work-grid .project-image img,
.work-gallery .work-grid .project-image.website-screenshot img{position:absolute;inset:0;width:100%;height:100%;max-height:none;object-fit:cover;transform:none;transition:transform .6s cubic-bezier(.16,1,.3,1),filter .45s}
.work-gallery .work-grid .project-image.website-screenshot img{object-position:top}
.work-gallery .work-grid .hero-1clickreport img{display:block;object-position:left center}
.work-gallery .work-grid .work-card:hover .project-image img{transform:scale(1.03)}
.work-gallery .work-grid .project-hero-copy{display:none}
.work-gallery .work-grid .hero-preview:after{display:none}
/* Light images sit back into the dark palette */
.work-gallery .work-grid .is-wide .project-image img{filter:brightness(.9)}
.work-gallery .work-grid .is-wide:hover .project-image img{filter:none}
.work-gallery .work-grid .is-wide .project-image{box-shadow:inset 0 0 0 1px rgba(255,255,255,.06)}

/* Hover arrow */
.work-gallery .work-grid .work-card:before{content:"↗";position:absolute;z-index:3;top:12px;right:12px;width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:var(--cream);color:var(--night);font-size:15px;opacity:0;transform:scale(.85);transition:opacity .3s,transform .45s cubic-bezier(.16,1,.3,1)}
.work-gallery .work-grid .work-card:is(:hover,:focus-visible):before{opacity:1;transform:none}

/* Captions */
.work-gallery .work-grid .project-caption{display:flex;flex-direction:column;flex:0 0 auto;padding:14px 18px 16px}
.work-gallery .work-grid .project-caption small{font-size:var(--fs-eyebrow);letter-spacing:var(--tr-eyebrow);margin-bottom:6px;line-height:var(--lh-ui)}
.work-gallery .work-grid .project-caption h3{font-size:20px;line-height:1.15;letter-spacing:-.01em;margin:0}
.work-gallery .work-grid .service-tags{margin:10px 0 0;gap:6px}
.work-gallery .work-grid .service-tags li{font-size:12px;line-height:1;padding:5px 10px;height:24px;display:inline-flex;align-items:center}
.work-gallery .work-grid .service-tags li.is-extra{display:none}
.work-gallery .work-grid .service-tags li.tag-more{color:var(--whisper)}
.work-gallery .work-grid .project-caption p{flex:none;margin:8px 0 0;font-size:14px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
.work-gallery .work-grid .project-caption>span{margin-top:12px;font-size:var(--fs-sm)}
.work-gallery .work-grid .is-small .project-caption p,
.work-gallery .work-grid .is-small .project-caption>span,
.work-gallery .work-grid .is-wide .project-caption>span{display:none}
.work-gallery .work-grid .is-wide .project-caption{padding:16px 20px 18px}
.work-gallery .work-grid:not(.is-filtered) .is-lead .project-caption{padding:20px 24px 22px}
.work-gallery .work-grid:not(.is-filtered) .is-lead .project-caption h3{font-size:var(--fs-title);line-height:1.05;letter-spacing:-.02em}
.work-gallery .work-grid.is-filtered .work-card .project-caption p{display:-webkit-box}
.work-gallery .work-grid.is-filtered .project-caption>span{display:none}

/* Filter transition */
.work-gallery .work-grid .work-card.is-hidden,
.work-gallery .work-grid .work-card.is-hidden:last-child{display:none}
.work-gallery .work-grid .work-card.is-entering{animation:work-card-in .45s cubic-bezier(.16,1,.3,1) both}
@keyframes work-card-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* Tablet */
@media(max-width:1000px){
  .work-gallery .home-projects.work-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .work-gallery .work-grid .work-card,
  .work-gallery .work-grid:not(.is-filtered) .work-card[href]{grid-column:auto;grid-row:auto}
  .work-gallery .work-grid:not(.is-filtered) .work-card.is-lead{grid-column:1/-1}
  .work-gallery .work-grid .project-image,
  .work-gallery .work-grid .work-card:last-child .project-image,
  .work-gallery .work-grid.is-filtered .work-card .project-image{height:auto;aspect-ratio:4/3}
  .work-gallery .work-grid:not(.is-filtered) .is-lead .project-image{flex:none;aspect-ratio:16/9}
  .work-gallery .work-grid .is-wide .project-image,
  .work-gallery .work-grid .work-card.is-wide:last-child .project-image{height:auto;aspect-ratio:2/1}
  .work-gallery .work-grid.is-filtered .work-card{grid-column:auto}
}

/* Phone: keep the structure, 2-up small cards */
@media(max-width:700px){
  .work-gallery .work-heading-side{align-items:flex-start}
  .work-gallery .work-heading-side>p{text-align:left}
  .work-gallery .work-filters{justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;max-width:100%;scrollbar-width:none;padding-bottom:2px}
  .work-gallery .work-filters::-webkit-scrollbar{display:none}
  .work-gallery .work-filters button{flex:0 0 auto}
  .work-gallery .home-projects.work-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  /* lead-capture.css hides cards 4+ on phones; the gallery shows all seven */
  .selected-work.work-gallery .work-grid .work-card:nth-child(n){display:flex}
  .selected-work.work-gallery .work-grid .work-card.is-hidden:nth-child(n){display:none}
  .work-gallery .work-grid:not(.is-filtered) .is-lead .project-image{aspect-ratio:16/10}
  .work-gallery .work-grid .work-card.is-wide{grid-column:1/-1}
  .work-gallery .work-grid .is-small .project-caption{padding:10px 12px 12px}
  .work-gallery .work-grid .is-small .project-caption small{font-size:11px;letter-spacing:.12em;margin-bottom:4px}
  .work-gallery .work-grid .is-small .project-caption h3{font-size:16px}
  .work-gallery .work-grid .is-small .service-tags{display:none}
  .work-gallery .work-grid .is-wide .project-caption p{display:none}
  .work-gallery .work-grid .project-caption h3:after{content:" ↗";color:var(--highlight);font-size:.8em}
  .work-gallery .work-grid .work-card:before{display:none}
}
@media(prefers-reduced-motion:reduce){
  .work-gallery .work-grid .work-card,.work-gallery .work-grid .project-image img,.work-gallery .work-grid .work-card:before{transition:none}
  .work-gallery .work-grid .work-card.is-entering{animation:none}
}
.work-gallery .work-grid:not(.is-filtered) .is-lead .project-caption p{-webkit-line-clamp:2}

/* Hierarchy pass, 2026-10-29. The name leads; everything else is quiet meta.
   Before: amber widely-tracked sector label, outlined cream pills and the
   name all pulled at the same volume. Now: sector label small in ash,
   services as one muted text line (no pills), amber only on hover. */
.work-gallery .work-grid .project-caption small{font-size:11px;letter-spacing:.12em;color:var(--whisper);font-weight:600;margin-bottom:8px}
.work-gallery .work-grid .project-caption h3{color:var(--cream);font-weight:500}
.work-gallery .work-grid .service-tags{margin:8px 0 0;gap:0;flex-wrap:wrap}
.work-gallery .work-grid .service-tags li{border:0;padding:0;height:auto;background:none;color:var(--sand);font:400 13px/1.4 Manrope,sans-serif;letter-spacing:0}
.work-gallery .work-grid .service-tags li+li:before{content:"·";margin:0 7px;color:var(--whisper)}
.work-gallery .work-grid .service-tags li.tag-more{color:var(--whisper)}
.work-gallery .work-grid .project-caption p{color:var(--whisper);margin-top:12px}
.work-gallery .work-grid .project-caption>span{color:var(--sand)}
.work-gallery .work-grid .work-card:hover .project-caption>span,
.work-gallery .work-grid .work-card:hover .project-caption small{color:var(--highlight)}
.work-gallery .work-grid:not(.is-filtered) .is-lead .project-caption p{font-size:15px;max-width:52ch}
.work-gallery .work-grid:not(.is-filtered) .is-lead .service-tags li{font-size:14px}

/* Shaded rest state, after madeel.ae's service cards. At rest the photo is
   desaturated and dimmed and melts into a card darker than the page; on hover
   it warms to full colour, the name turns ember-glow and the border lights. */
.work-gallery .work-grid .work-card,.work-gallery .work-grid .work-card:last-child{background:#0e0c0a;border-color:color-mix(in srgb,var(--cream) 5.9%,transparent);transition:border-color .5s,box-shadow .5s}
.work-gallery .work-grid .project-image img,
.work-gallery .work-grid .is-wide .project-image img{filter:grayscale(.65) brightness(.58) contrast(1.06);transition:filter .7s cubic-bezier(.16,1,.3,1),transform .9s cubic-bezier(.16,1,.3,1)}
.work-gallery .work-grid .work-card:is(:hover,:focus-visible) .project-image img{filter:none;transform:scale(1.03)}
.work-gallery .work-grid .project-image{background:#0e0c0a}
.work-gallery .work-grid .project-image.hero-preview:after,
.work-gallery .work-grid .project-image:after{content:"";display:block;position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(180deg,rgba(14,12,10,0) 45%,rgba(14,12,10,.55) 78%,#0e0c0a 100%)}
.work-gallery .work-grid .is-wide .project-image{box-shadow:none}
.work-gallery .work-grid .project-caption h3{transition:color .5s}
.work-gallery .work-grid .work-card:is(:hover,:focus-visible){border-color:color-mix(in srgb,var(--highlight) 55%,transparent);box-shadow:0 0 0 1px color-mix(in srgb,var(--highlight) 12%,transparent),0 30px 60px -30px rgba(0,0,0,.7)}
.work-gallery .work-grid .work-card:is(:hover,:focus-visible) .project-caption h3{color:var(--highlight)}
@media(hover:none){.work-gallery .work-grid .project-image img{filter:grayscale(.25) brightness(.8)}}
/* Near-white images (site screenshot, product banner) need a deeper dim to
   sit at the same darkness as the photographs. */
.work-gallery .work-grid .is-wide .project-image img{filter:grayscale(.7) brightness(.36) contrast(1.1)}
.work-gallery .work-grid .is-wide:is(:hover,:focus-visible) .project-image img{filter:none}

/* Balance pass, 2026-10-30: at six of twelve columns Madeel took half the
   grid and dwarfed the rest. Ten columns: Madeel 40%, small cards 30% each,
   the wide pair 50/50. Its title steps down to sit one size above the cards. */
@media(min-width:1001px){
  .work-gallery .home-projects.work-grid:not(.is-filtered){grid-template-columns:repeat(10,minmax(0,1fr))}
  .work-gallery .work-grid:not(.is-filtered) .is-lead .project-caption h3{font-size:clamp(24px,1.8vw,28px);line-height:1.1}
  .work-gallery .work-grid:not(.is-filtered) .is-small .project-image{height:170px}
}
/* Below 1000px .agency-rest is a flex column, and the scrolling filter row's
   width stretched this section to ~580px on 390px screens. */
.agency-rest>#selected-work{max-width:100%}
/* Phones: the two wide cards were meant to span the row, but the 1000px
   reset (.work-card[href]) outranked .is-wide and squeezed them to half. */
@media(max-width:700px){.work-gallery .work-grid:not(.is-filtered) .work-card.is-wide[href]{grid-column:1/-1}}

/* Heading row, 2026-10-30. Title and filters only fit side by side from
   ~1500px (the italic line is 578px, the filters 630px); narrower, the title
   squeezed to three or four lines or "Our products" wrapped alone. So: side
   by side from 1501px, filters on one line; 1101–1500px the title takes the
   full width with filters left and the note right beneath it; up to 1100px
   note and filters stack under the title. */
@media(min-width:1501px){
  .work-gallery .section-heading>div:first-child{flex:1 1 auto;min-width:0}
  .work-gallery .work-heading-side{flex:0 0 auto}
  .work-gallery .work-filters{flex-wrap:nowrap}
}
@media(min-width:701px) and (max-width:1500px){
  .work-gallery .section-heading{flex-direction:column;align-items:stretch;gap:var(--sp-5)}
  .work-gallery .work-heading-side{flex-direction:row-reverse;justify-content:space-between;align-items:center;gap:var(--sp-5)}
  .work-gallery .work-heading-side>p{text-align:right}
  .work-gallery .work-filters{justify-content:flex-start;flex-wrap:nowrap}
}
@media(min-width:701px) and (max-width:1100px){
  .work-gallery .work-heading-side{flex-direction:column;align-items:flex-start}
  .work-gallery .work-heading-side>p{text-align:left}
  .work-gallery .work-filters{flex-wrap:wrap}
}

/* Proof at full strength, 2026-10-30. The photos rested at 65% grey and 58%
   brightness until hover (never, on touch), so the real work read dimmer
   than the illustrative mocks above it. The caption fade stays. */
.work-gallery .work-grid .project-image img,.work-gallery .work-grid .is-wide .project-image img{filter:saturate(.92) brightness(.94)}
.work-gallery .work-grid .work-card:is(:hover,:focus-visible) .project-image img,.work-gallery .work-grid .is-wide:is(:hover,:focus-visible) .project-image img{filter:none}
@media(hover:none){.work-gallery .work-grid .project-image img{filter:saturate(.92) brightness(.94)}}
