/* /projects (v3) — "The spaces we build". Page layout + its one motion signature (DESIGN-V3 §8.7, §6.5):
   3D-perspective masonry that flattens as it arrives · filter re-flow (own FLIP) · shared-element zoom into the viewer
   (View Transitions API, FLIP fallback). Everything else (header, crumbs, hero entrance, form, reveals) is base.css.
   The masonry is laid out by projects.php (and re-laid by projects.js): each tile gets its column (--x) and its offset as a
   sum of height factors (--ya, × column width) plus a count of caption rows (--yn); two plans, 3 columns ≥ 1024 px and
   2 columns below. Column width comes from the wall's own width (container units), so nothing is measured by script and
   nothing shifts at load. Static (html.a-noanim / no-js / a-late): the same wall, flat, no lag. */

/* ------------------------------------------------------------------ hero (paper, the grid is the image) */
.page-projects .a-head::before { bottom: 0; }   /* the header's fade stays inside its ink band (no grey wash over the paper hero) */
.a-phero.pj-hero { height: auto; min-height: 0; max-height: none; }   /* a paper hero is as tall as its content (base.css gives every hero 84svh on phones) */
.pj-hero .a-phero__in { padding-top: clamp(28px, 4.2vw, 60px); padding-bottom: clamp(20px, 2.4vw, 32px); }
.pj-hero__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px 48px; }
.pj-hero .a-label { margin-bottom: 18px; }
.pj-hero .a-h1 { max-width: none; margin-bottom: 16px; }
.pj-hero .a-lead { margin: 0; }
.pj-hero__ctas { padding-bottom: 2px; }
.pj-filter { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 32px; margin-top: clamp(28px, 3.4vw, 44px); padding-top: 20px; border-top: 1px solid var(--line); }
.pj-filter fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pj-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-chip { position: relative; display: flex; }
.pj-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pj-chip span { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border: 1px solid rgba(18, 20, 23, .18); border-radius: var(--r);
  font-size: 15px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color .25s, color .25s, border-color .25s; }
.pj-chip b { font: 500 11px/1 var(--mono); letter-spacing: .06em; color: var(--muted); font-variant-numeric: tabular-nums; transition: color .25s; }
.pj-chip:hover span { border-color: rgba(18, 20, 23, .45); }
.pj-chip input:checked + span { background: var(--text); border-color: var(--text); color: #fff; }
.pj-chip input:checked + span b { color: var(--gold-2); }
.pj-chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.pj-status { font: 500 12px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pj-status [data-st="2"] { display: none; }
.pj-apply { height: 44px; }
.a-motion .pj-filter { animation: aUp .8s .34s var(--ease) both; }
.a-motion .pj-hero .a-label { animation: aUp .8s .06s var(--ease) both; }

/* ------------------------------------------------------------------ the wall (perspective masonry) */
.pj-gal { padding: clamp(24px, 2.6vw, 40px) 0 var(--sec); overflow-x: clip; }
.pj-wall { container-type: inline-size; perspective: 1800px; perspective-origin: 50% 0; }
.pj-grid {
  --cols: 3; --caph: 64px;
  --cw: calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols));
  --rg: calc(var(--caph) + var(--gap));
  --c0a: var(--c0a3, 0); --c0n: var(--c0n3, 0); --c1a: var(--c1a3, 0); --c1n: var(--c1n3, 0); --c2a: var(--c2a3, 0); --c2n: var(--c2n3, 0);
  position: relative; transform-origin: 50% 0;
  height: calc(max(var(--c0a) * var(--cw) + var(--c0n) * var(--rg), var(--c1a) * var(--cw) + var(--c1n) * var(--rg), var(--c2a) * var(--cw) + var(--c2n) * var(--rg)) - var(--gap));
}
.pj-tile { --x: var(--x3, 0); --ya: var(--ya3, 0); --yn: var(--yn3, 0); --lag: var(--lag3, 0);
  position: absolute; left: calc(var(--x) * (var(--cw) + var(--gap))); top: calc(var(--ya) * var(--cw) + var(--yn) * var(--rg)); width: var(--cw); }
.pj-tile[hidden] { display: none !important; }
.pj-tile[data-leaving] { pointer-events: none; }
.pj-tile__open { position: relative; display: block; border-radius: var(--r); }
.pj-tile__frame { position: relative; display: block; height: calc(var(--a) * var(--cw)); overflow: hidden; border-radius: var(--r); background: var(--photo-bg); }
.pj-tile__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); transition: transform 1.2s var(--ease); }
.pj-tile__zoom { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff;
  background: rgba(10, 12, 14, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transform: scale(.8); transition: opacity .35s, transform .5s var(--ease); }
.pj-tile__zoom .icon { width: 18px; height: 18px; }
@media (hover: hover) {
  .pj-tile__open:hover img { transform: scale(1.04); }
  .pj-tile__open:hover .pj-tile__zoom { opacity: 1; transform: none; }
}
.pj-tile__open:focus-visible .pj-tile__zoom { opacity: 1; transform: none; }
.pj-tile__tag { position: absolute; left: 12px; top: 12px; }
.pj-tile__cap { display: grid; align-content: start; justify-items: start; height: var(--caph); padding-top: 14px; }
.pj-tile__t { display: block; max-width: 100%; font: 500 12px/16px var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-tile__svc { display: inline-flex; align-items: center; min-height: 32px; font-size: 15px; font-weight: 600; line-height: 1.15; transition: color .25s; }
.pj-tile__svc .icon { display: inline-block; width: 15px; height: 15px; margin-left: 7px; vertical-align: -2px; transition: transform .45s var(--ease); }   /* the arrow follows the last word, even when the name wraps */
.pj-tile__svc:hover { color: var(--gold-ink); }
.pj-tile__svc:hover .icon { transform: translateX(4px); }
/* the call to action a filtered view ends with (it fills the shortest column) */
.pj-cta { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; height: calc(var(--a) * var(--cw) + var(--caph) - 14px); padding: clamp(18px, 2vw, 28px);
  background: var(--ink); color: var(--on-dark); border-radius: var(--r); transition: background-color .3s; }
.pj-cta:hover { background: var(--ink-3); }
.pj-cta > .icon { width: 28px; height: 28px; color: var(--gold); }
.pj-cta__t { font-size: var(--fs-h3); font-weight: 600; line-height: 1.12; letter-spacing: -.015em; max-width: 14ch; text-wrap: balance; }
.pj-cta__go { display: block; font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--gold-2); }
.pj-cta__go .icon { display: inline-block; width: 16px; height: 16px; margin-left: 8px; vertical-align: -3px; transition: transform .45s var(--ease); }
.pj-nw { white-space: nowrap; }
.pj-cta:hover .pj-cta__go .icon { transform: translateX(4px); }
.pj-tile--cta { --a: var(--a3, 1); }
.pj-more { display: flex; justify-content: center; margin-top: clamp(40px, 4.4vw, 64px); }
.pj-more[hidden] { display: none; }

/* signature start state (motion on): the wall leans back in perspective, the outer columns sit a little lower; projects.js
   scrubs --tilt and --lagk to 0 as the wall arrives. The wall itself rises into place at load. */
.a-motion .pj-grid { --tilt: 16; --lagk: 1; transform: rotateX(calc(var(--tilt) * 1deg)); }
.a-motion .pj-grid.is-flat { transform: none; }
.a-motion .pj-tile__in { transform: translate3d(0, calc(var(--lag) * var(--lagk) * 1px), 0); }
.a-motion .pj-grid.is-flat .pj-tile__in { transform: none; }
.a-motion .pj-wall { animation: pjRise 1.5s .18s var(--ease) both; }
@keyframes pjRise { from { transform: translate3d(0, 72px, 0); } to { transform: none; } }

/* ------------------------------------------------------------------ site visit (closing section) */
.pj-visit { border-bottom: 1px solid var(--line-dark); }
.pj-visit .a-form { color: var(--text); }   /* the white form card on the ink surface keeps dark text (base.css lets it inherit) */
.pj-visit .a-chipbox > span > span[aria-hidden] { display: inline; flex: none; min-height: 0; padding: 0; border: 0; }   /* day chips: one box, not two */
.pj-visit__text { position: sticky; top: calc(var(--head-h) + 40px); }
.pj-visit .a-lead { margin-top: 20px; }
.pj-talk { display: grid; justify-items: start; gap: 8px; margin-top: clamp(32px, 4vw, 52px); padding-top: 26px; border-top: 1px solid var(--line-dark); }
.pj-talk__or { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-2); }
.pj-talk__tel { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-size: clamp(34px, 3.6vw, 54px); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; transition: color .3s; }
.pj-talk__tel .icon { width: .62em; height: .62em; color: var(--gold); transition: transform .5s var(--ease); }
.pj-talk__tel:hover { color: var(--gold-2); }
.pj-talk__tel:hover .icon { transform: translate(3px, -3px); }
.pj-talk__mail { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; color: var(--on-dark-2); text-decoration: underline; text-decoration-color: rgba(242, 238, 231, .3); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.pj-talk__mail:hover { color: #fff; text-decoration-color: #fff; }

/* ------------------------------------------------------------------ the viewer (native <dialog>, top layer) */
.pj-view { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden;
  background: transparent; color: var(--on-dark); }
.pj-view::backdrop { background: transparent; }
.pj-view__bg { position: absolute; inset: 0; background: rgba(8, 10, 12, .96); view-transition-name: pj-view-bg; }
.pj-view__stage { position: absolute; inset: 76px clamp(16px, 5vw, 96px) 104px; display: grid; place-items: center; touch-action: pan-y; }
.pj-view__img { display: block; max-width: none; border-radius: var(--r); }
.pj-view__bar, .pj-view__foot { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 var(--gut); }
.pj-view__bar { top: 0; height: 76px; view-transition-name: pj-view-bar; }
.pj-view__foot { bottom: 0; height: 104px; view-transition-name: pj-view-foot; }
.pj-view__count { font: 500 12px/1 var(--mono); letter-spacing: .14em; color: var(--on-dark-2); font-variant-numeric: tabular-nums; }
.pj-view__meta { display: grid; gap: 6px; min-width: 0; }
.pj-view__label { font: 500 12px/1.3 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--on-dark-2); }
.pj-view__svc { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 17px; font-weight: 600; color: #fff; transition: color .25s; }
.pj-view__svc .icon { width: 16px; height: 16px; transition: transform .45s var(--ease); }
.pj-view__svc:hover { color: var(--gold-2); }
.pj-view__svc:hover .icon { transform: translateX(4px); }
.pj-view__nav { display: flex; gap: 10px; }
.pj-view__btn { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid rgba(242, 238, 231, .28); border-radius: 50%; color: #fff; transition: background-color .25s, border-color .25s, color .25s; }
.pj-view__btn:hover { background: rgba(242, 238, 231, .1); border-color: rgba(242, 238, 231, .6); }
.pj-view__btn .icon { width: 20px; height: 20px; }
.pj-view__prev .icon { transform: rotate(180deg); }
.pj-view__close { width: 44px; height: 44px; }
/* shared-element zoom (View Transitions): the tile's frame becomes the viewer's photo */
::view-transition-group(pj-zoom) { animation-duration: .8s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
::view-transition-image-pair(pj-zoom) { overflow: hidden; border-radius: 3px; }
::view-transition-old(pj-zoom), ::view-transition-new(pj-zoom) { width: 100%; height: 100%; object-fit: cover; animation-duration: .38s; }
::view-transition-old(root), ::view-transition-new(root), ::view-transition-group(pj-view-bg), ::view-transition-group(pj-view-bar), ::view-transition-group(pj-view-foot) { animation-duration: .5s; }

/* ------------------------------------------------------------------ tablets and phones: two columns */
@media (max-width: 1023px) {
  .pj-grid { --cols: 2; --c0a: var(--c0a2, 0); --c0n: var(--c0n2, 0); --c1a: var(--c1a2, 0); --c1n: var(--c1n2, 0); --c2a: 0; --c2n: 0; }
  .pj-tile { --x: var(--x2, 0); --ya: var(--ya2, 0); --yn: var(--yn2, 0); --lag: var(--lag2, 0); }
  .pj-tile--cta { --a: var(--a2, 1); }
  .pj-tile[data-wide-only] { display: none; }
  .pj-status [data-st="3"] { display: none; }
  .pj-status [data-st="2"] { display: inline; }
  .pj-visit__text { position: static; }
}
@media (max-width: 767px) {
  .pj-hero__head { grid-template-columns: 1fr; gap: 24px; }
  .pj-hero .a-h1 { margin-bottom: 14px; }
  .pj-filter { margin-top: 28px; padding-top: 16px; }
  .pj-chip span { padding: 0 13px; gap: 8px; }
  .pj-wall { perspective: 900px; }
  .a-motion .pj-grid { --tilt: 10; }
  .pj-grid { --caph: 68px; }
  .pj-tile__cap { padding-top: 8px; }
  .pj-tile__t { letter-spacing: .08em; }
  .pj-tile__svc { min-height: 44px; font-size: 14px; }
  .pj-cta { gap: 10px; padding: 16px; height: calc(var(--a) * var(--cw) + var(--caph) - 8px); }
  .pj-cta > .icon { width: 24px; height: 24px; }
  .pj-cta__t { font-size: 18px; }
  .pj-cta__go { font-size: 14px; }
  .pj-view__stage { inset: 64px 0 132px; }
  .pj-view__img { border-radius: 0; }
  .pj-view__bar { height: 64px; }
  .pj-view__foot { height: 132px; align-items: flex-start; padding-top: 18px; flex-wrap: wrap; }
  .pj-view__btn { width: 48px; height: 48px; }
  .pj-talk__tel { font-size: 34px; }
}
