/* ============================================================
   Work section (work/**, 404.html). Loaded after styles.css and
   builds on its .wd page, .wk-card grid and .cs-* case study styles.
   Pages are generated by tools/build_work.py.
   ============================================================ */
.wx-body{--muted:rgba(11,11,12,.68);--line:rgba(11,11,12,.18)}
.wx{outline:none}
.wx h1{max-width:16ch}
.wx .wx-title{max-width:22ch;font-size:clamp(40px,6vw,120px)}

/* skip link */
.wx-skip{position:fixed;top:8px;left:8px;z-index:70;padding:10px 16px;border-radius:99px;background:#0B0B0C;color:#F2EFE9;font-family:var(--ui);font-size:15px;transform:translateY(-200%);transition:transform .2s ease}
.wx-skip:focus{transform:none;outline:2px solid var(--red);outline-offset:2px}
#topbar .work-link[aria-current]::after{transform:scaleX(1)}

/* breadcrumbs */
.wx-crumbs ol{display:flex;flex-wrap:wrap;gap:6px 0;margin:0;padding:0;list-style:none;font-size:clamp(14px,1vw,17px);font-weight:500}
.wx-crumbs li{display:flex;align-items:center;color:var(--muted)}
.wx-crumbs li+li::before{content:"/";margin:0 10px;color:rgba(11,11,12,.35)}
.wx-crumbs a{color:var(--muted);transition:color .2s ease}
.wx-crumbs a:hover{color:var(--red)}
.wx-crumbs [aria-current]{color:#0B0B0C;max-width:32ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* headings and intro */
.wx-lede{max-width:24ch;margin:clamp(18px,2vw,30px) 0 0;font-size:clamp(24px,2.6vw,48px);font-weight:500;line-height:1.1;letter-spacing:-.045em}
.wx-section{margin:clamp(64px,10vh,120px) 0 0}
.wx-head{display:flex;justify-content:space-between;align-items:flex-end;flex-wrap:wrap;gap:12px 24px;margin:0 0 24px}
.wx-head .wx-h2{margin:0}
.wx-h2{margin:0 0 24px;font-size:clamp(22px,2vw,34px);font-weight:500;letter-spacing:-.04em}
.wx-count{margin:0;font-size:15px;color:var(--muted)}

/* category tabs and subcategory chips: wrap on desktop, scroll sideways on phones */
.wx-tabs,.wx-chips{display:flex;flex-wrap:wrap;gap:8px;margin:clamp(32px,5vh,56px) 0 0}
.wx-section .wx-tabs{margin:0 0 clamp(24px,3vh,36px)}
.wx-tabs a,.wx-tabs button,.wx-chips a{font:inherit;font-family:var(--ui);background:none;color:#0B0B0C;cursor:pointer;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:10px 18px;border:1px solid rgba(11,11,12,.3);border-radius:99px;
  font-size:15px;font-weight:500;white-space:nowrap;transition:background .2s ease,color .2s ease,border-color .2s ease}
.wx-tabs a span,.wx-tabs button span{font-family:var(--mono);font-size:12px;color:var(--muted)}
.wx-tabs a:hover,.wx-tabs button:hover,.wx-chips a:hover{border-color:#0B0B0C}
.wx-tabs a[aria-current],.wx-tabs button[aria-pressed="true"],.wx-chips a[aria-current]{background:#0B0B0C;border-color:#0B0B0C;color:#F2EFE9}
.wx-tabs a[aria-current] span,.wx-tabs button[aria-pressed="true"] span{color:rgba(242,239,233,.7)}
.wx-tabs a:focus-visible,.wx-tabs button:focus-visible,.wx-chips a:focus-visible{outline:2px solid var(--red);outline-offset:3px}

/* project grids reuse the homepage .wk-card look */
.wx-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(36px,5vw,64px) clamp(16px,2vw,32px)}
.wx-grid--3{grid-template-columns:repeat(3,minmax(0,1fr))}
.wx-grid .wk-wide{grid-column:1/-1}
.wx-grid .wk-wide .wk-thumb{aspect-ratio:21/9}
.wx-card{min-width:0}
.wx-card .wk-thumb{position:relative}
.wx-card .wk-cap h3{margin:0;font-size:clamp(20px,1.7vw,30px);font-weight:400;letter-spacing:-.03em;color:#0B0B0C}
.wx-grid--3 .wx-card .wk-cap h3{font-size:clamp(19px,1.4vw,26px)}
.wx-card .wk-cap p{flex-basis:100%;max-width:none;color:var(--muted);line-height:1.45}
.wx-card .wk-num{color:var(--muted)}
.wx-card .wk-cap .wx-card-meta{margin-top:10px;font-size:13px;font-weight:500;color:var(--muted)}
.wx-badge{display:inline-block;margin-left:6px;padding:2px 8px;border-radius:99px;background:rgba(11,11,12,.08);font-size:12px;color:#0B0B0C}
.wx-card[hidden]{display:none}
.wx-card:focus-visible{outline:2px solid var(--red);outline-offset:6px}
.wx-empty{margin:0;padding:clamp(40px,8vh,80px) 24px;border:1px dashed rgba(11,11,12,.3);border-radius:6px;text-align:center;color:var(--muted)}
.wx-empty[hidden]{display:none}

/* sort control */
.wx-sort{display:inline-flex;align-items:center;gap:10px;font-size:15px;color:var(--muted)}
.wx-sort select{min-height:44px;padding:8px 36px 8px 16px;border:1px solid rgba(11,11,12,.3);border-radius:99px;background:#E0E0E0;color:#0B0B0C;font:inherit;font-weight:500;
  appearance:none;-webkit-appearance:none;cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B0B0C' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center;background-size:16px}
.wx-sort select:focus-visible{outline:2px solid var(--red);outline-offset:3px}

/* images: grey placeholder until the file loads, then a soft fade in */
.wx-img{opacity:0;transition:opacity .5s ease}
.wx-img.is-loaded{opacity:1}
.wx-hero{aspect-ratio:16/9}

/* project page */
.wx-facts{grid-template-columns:repeat(auto-fit,minmax(170px,1fr));row-gap:28px}
.wx-facts dt{color:var(--muted)}
.cs-block p,.wx-steps p,.wx-list li{color:rgba(11,11,12,.78)}
.wx-list{margin:0;padding:0 0 0 1.1em;max-width:62ch;font-size:clamp(15px,1.15vw,20px);line-height:1.6}
.wx-list li+li{margin-top:.5em}
.wx-steps{display:grid;gap:clamp(22px,3vh,34px);margin:0;padding:0;list-style:none;counter-reset:step}
.wx-steps li{counter-increment:step;display:grid;grid-template-columns:44px 1fr;column-gap:12px}
.wx-steps li::before{content:counter(step,decimal-leading-zero);grid-row:1/3;padding-top:4px;font-family:var(--mono);font-size:13px;color:var(--red)}
.wx-steps h3{margin:0 0 6px;font-size:clamp(17px,1.3vw,22px);font-weight:600;letter-spacing:-.025em}
.wx-steps p{margin:0;max-width:62ch;font-size:clamp(15px,1.15vw,20px);line-height:1.6}
.wx-results li{font-weight:500;color:#0B0B0C}

/* gallery: rows of one, two or three, set per row in the data */
.wx-gallery-wrap{margin:clamp(64px,9vh,120px) 0 0;padding-top:22px;border-top:1px solid var(--line)}
.wx-gallery{display:grid;gap:clamp(16px,2vw,32px)}
.wx-row{display:grid;gap:clamp(16px,2vw,32px)}
.wx-row--pair{grid-template-columns:repeat(2,minmax(0,1fr))}
.wx-row--trio{grid-template-columns:repeat(3,minmax(0,1fr))}
.wx-frame{position:relative;overflow:hidden;border-radius:12px;background:linear-gradient(160deg,#D2D2D2,#BEBEBE);aspect-ratio:16/9}
.wx-row--pair .wx-frame{aspect-ratio:4/3}
.wx-row--trio .wx-frame{aspect-ratio:4/5}
.wx-frame img,.wx-frame video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.wx-ph{position:absolute;inset:0;display:grid;place-items:center;padding:16px;text-align:center;font-size:13px;color:rgba(11,11,12,.55);word-break:break-all}
.wx-shot figcaption{margin-top:10px;font-size:14px;color:var(--muted)}

/* previous / next */
.wx-pager{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin:clamp(64px,10vh,120px) 0 0;padding-top:24px;border-top:1px solid var(--line)}
.wx-pager a{display:flex;flex-direction:column;gap:8px}
.wx-pager-next{grid-column:2;text-align:right;align-items:flex-end}
.wx-pager small{font-size:14px;font-weight:600;color:var(--muted)}
.wx-pager strong{font-size:clamp(22px,2.6vw,48px);font-weight:600;letter-spacing:-.045em;line-height:1.05;transition:color .2s ease}
.wx-pager a:hover strong{color:var(--red)}
.wx-pager a:focus-visible{outline:2px solid var(--red);outline-offset:6px}

/* buttons (404) */
.wx-actions{display:flex;flex-wrap:wrap;gap:12px;margin:clamp(32px,5vh,56px) 0 0}
.wx-button{display:inline-flex;align-items:center;min-height:48px;padding:12px 24px;border-radius:99px;background:#0B0B0C;color:#F2EFE9;font-size:16px;font-weight:600;transition:background .2s ease}
.wx-button:hover{background:var(--red)}
.wx-button--ghost{background:transparent;color:#0B0B0C;border:1px solid rgba(11,11,12,.35)}
.wx-button--ghost:hover{background:#0B0B0C;color:#F2EFE9}
.wx-button:focus-visible,.wd-contact a:focus-visible,.wx .cs-ext a:focus-visible{outline:2px solid var(--red);outline-offset:3px}

@media (max-width:1000px){
  .wx-grid--3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:760px){
  .wd.wx{padding-left:16px;padding-right:16px}
  .wd.wx h1{font-size:clamp(36px,11vw,56px);overflow-wrap:break-word}
  .wx-grid,.wx-grid--3{grid-template-columns:minmax(0,1fr);gap:36px}
  .wx-grid .wk-wide .wk-thumb{aspect-ratio:1.42/1}
  .wx-tabs,.wx-chips{flex-wrap:nowrap;overflow-x:auto;margin-left:-16px;margin-right:-16px;padding:2px 16px 6px;scrollbar-width:none}
  .wx-tabs::-webkit-scrollbar,.wx-chips::-webkit-scrollbar{display:none}
  .wx-row--pair,.wx-row--trio{grid-template-columns:minmax(0,1fr)}
  .wx-pager{grid-template-columns:1fr}
  .wx-pager-next{grid-column:auto}
  .wd-contact{flex-direction:column;align-items:flex-start}
  .wx-crumbs [aria-current]{max-width:22ch}
}
@media (prefers-reduced-motion:reduce){
  .wx-img{transition:none}
  .wx-card .wk-thumb img{transition:none}
}

/* project card placeholders take a soft tint of their category colour until the image is added */
.wx-card .wk-ph{background:linear-gradient(150deg,color-mix(in srgb,var(--tint,#9A9A9A) 18%,#E8E8E8),color-mix(in srgb,var(--tint,#9A9A9A) 42%,#C9C9C9))}

/* subcategory page: big heading with a layout toggle, then large image cards
   (one per row, or two in grid view) with the title and tags over the image */
.wx-sub-head{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin-top:clamp(28px,4vh,48px)}
.wx .wx-sub-head h1{margin:0;max-width:none;font-size:clamp(44px,6.4vw,112px);line-height:.95;letter-spacing:-.06em}
.wx-sub-intro{max-width:60ch;margin:clamp(14px,1.6vw,22px) 0 0;font-size:clamp(16px,1.2vw,20px);line-height:1.5;color:var(--muted)}
.wx-sub-intro span{white-space:nowrap;font-family:var(--mono);font-size:13px;margin-left:8px;color:#0B0B0C}
.wx-view{display:flex;gap:6px;flex:none;padding-bottom:6px}
.wx-view button{display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:rgba(11,11,12,.45);cursor:pointer;
  transition:background .2s ease,color .2s ease}
.wx-view button:hover{color:#0B0B0C}
.wx-view button[aria-pressed="true"]{background:#0B0B0C;color:#F2EFE9}
.wx-view button:focus-visible{outline:2px solid var(--red);outline-offset:3px}
.wx-view svg{width:18px;height:18px;fill:currentColor}
.wx-showcase{display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(14px,1.4vw,22px);margin-top:clamp(28px,4vh,48px)}
.wx-showcase[data-view="grid"]{grid-template-columns:repeat(2,minmax(0,1fr))}
.wx-show{position:relative;display:block;aspect-ratio:1.9/1;border-radius:clamp(14px,1.6vw,24px);overflow:hidden;isolation:isolate;
  background:linear-gradient(150deg,color-mix(in srgb,var(--tint,#8A8A8F) 70%,#fff),color-mix(in srgb,var(--tint,#8A8A8F) 70%,#0B0B0C));color:#fff}
.wx-showcase[data-view="grid"] .wx-show{aspect-ratio:4/3}
.wx-show img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:transform 1.1s cubic-bezier(.2,.75,.15,1),opacity .5s ease}
.wx-show:hover img{transform:scale(1.03)}
.wx-show::after{content:"";position:absolute;left:0;right:0;bottom:0;height:50%;z-index:1;pointer-events:none;
  background:linear-gradient(180deg,rgba(11,11,12,0),rgba(11,11,12,.55))}
.wx-show-cap{position:absolute;left:clamp(16px,2vw,28px);right:clamp(16px,2vw,28px);bottom:clamp(16px,2vw,28px);z-index:2}
.wx-show-cap h2,.wx-show-cap h3{margin:0;font-family:var(--ui);font-size:clamp(18px,1.6vw,24px);font-weight:500;letter-spacing:-.02em;color:#fff;transition:transform .4s cubic-bezier(.2,.75,.15,1)}
.wx-show:hover .wx-show-cap h2,.wx-show:hover .wx-show-cap h3{transform:translateX(4px)}
.wx-tags{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 0}
.wx-tags span{padding:3px 8px;border:1px solid rgba(255,255,255,.75);border-radius:5px;font-size:12px;line-height:1.3;color:#fff}
.wx-show:focus-visible{outline:3px solid var(--red);outline-offset:4px}
@media (max-width:760px){
  .wx-showcase[data-view="grid"]{grid-template-columns:minmax(0,1fr)}
  .wx-show,.wx-showcase[data-view="grid"] .wx-show{aspect-ratio:4/3}
  .wx-view{display:none}
}
@media (prefers-reduced-motion:reduce){.wx-show img,.wx-show-cap h2,.wx-show-cap h3{transition:none}}
.wx-section .wx-showcase{margin-top:0}
.wx-showcase[data-view="grid"]>.wx-show:last-child:nth-child(odd){grid-column:1/-1;aspect-ratio:2.6/1}
@media (max-width:760px){.wx-showcase[data-view="grid"]>.wx-show:last-child:nth-child(odd){aspect-ratio:4/3}}
.wx-section:has(> h2.visually-hidden:first-child){margin-top:clamp(32px,5vh,56px)}
