/* ─── Projects — same split as the product page: pinned index left, imagery right ─── */
.pj { display: flex; flex-direction: column; }
/* Laptops: text 40%, images 60%, and each side scrolls on its own. */
@media (min-width: 1024px) {
  .pj { display: grid; grid-template-columns: 40% 60%; height: calc(100svh - var(--header-h) - var(--ribbon-h)); }
  .pj__info, .stream { height: 100%; overflow-y: auto; /* at either end the page carries on to the brief */ overscroll-behavior-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
}

.pj__info { padding: var(--s4) var(--gutter) var(--s6); display: grid; gap: var(--s6); align-content: start; }
@media (min-width: 1024px) { .pj__info { padding: var(--s5) var(--s6) var(--s7) var(--gutter); } }
.pj__head { display: grid; gap: 6px; justify-items: start; }
.pj__logo { height: 64px; width: auto; filter: brightness(0); margin-bottom: var(--s3); }
@media (min-width: 750px) { .pj__logo { height: 84px; } }
.pj__title { font-family: var(--sans); font-weight: 400; font-size: clamp(32px, 3.2vw, 46px); line-height: 1.06; letter-spacing: -0.025em; margin: 0; }
.pj__intro { max-width: 56ch; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stats > div { padding: 14px 12px 0 0; }
.pump { display: flex; align-items: flex-end; font-family: var(--display); font-weight: 400; font-size: clamp(36px, 3.6vw, 52px); line-height: 1; height: 1em; }
.pump__col { display: block; width: 0.62em; height: 1em; overflow: hidden; text-align: center;
  -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.pump__strip { display: block; will-change: transform; }
.pump__strip span { display: block; height: 1em; line-height: 1; }
.pump__sfx { font-family: var(--sans); font-size: 0.5em; line-height: 1; align-self: flex-start; margin: 0.08em 0 0 2px; }
.stats > div > span { display: block; margin-top: 8px; font-size: var(--fs-xs); color: var(--ink-2); }

.clients { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.client { display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; gap: 8px; min-height: 104px; padding: 14px 10px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; transition: background-color var(--t-ui) var(--ease); }
.client img { max-height: 34px; max-width: 78%; width: auto; height: auto; object-fit: contain; opacity: 0.85; transition: opacity var(--t-ui) var(--ease); }
.client__all { font-family: var(--display); font-size: clamp(17px, 4.4vw, 24px); line-height: 1.05; text-align: center; overflow-wrap: anywhere; }
.client__name { font-size: var(--fs-xs); color: var(--ink-2); text-align: center; line-height: 1.25; }
.client:hover { background: var(--paper-2); }
.client:hover img { opacity: 1; }
.client[aria-pressed="true"] { background: var(--paper-2); }
.client[aria-pressed="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--ink); }
.client[aria-pressed="true"] .client__name { color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: 2px 16px; }
.filters button { min-height: 36px; color: var(--ink-2); transition: color var(--t-ui) var(--ease); }
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.filters sup { font-size: 10px; margin-left: 2px; }

.index { border-top: 1px solid var(--line); }
.index-toggle { justify-self: start; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 1023px) { .index:not(.is-open) { display: none; } }
@media (min-width: 1024px) { .index-toggle { display: none; } }
.index__row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s4); align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); transition: opacity var(--t-ui) var(--ease); }
.index__row[hidden] { display: none; }
.index__row .muted { font-size: var(--fs-xs); }
.index__row button { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-size: var(--fs-xs); min-height: 28px; }
.index__row button:disabled { text-decoration: none; color: var(--ink-3); cursor: default; }
.index__row.is-hot { background: var(--paper-2); }

.pj__cta { display: flex; flex-wrap: wrap; gap: 8px; }

/* Stream — SlideGlass "Installed" mechanics: each project drifts at its own speed (--spd) and the
   photo parallaxes inside its frame, both scroll-driven. Two staggered columns on laptops, one on phones. */
.stream { min-width: 0; padding: var(--s5) var(--gutter) var(--s8); }
@media (min-width: 1024px) { .stream { padding: var(--s6) var(--gutter) var(--s9) var(--s5); } }
.row { display: flex; gap: 24px; align-items: flex-start; margin-bottom: var(--s7); }
.row--one-full .proj { width: 100%; }
@media (min-width: 1024px) {
  .row { margin-bottom: var(--s9); }
  .row--one-l .proj, .row--one-r .proj, .row--one-c .proj { width: 70%; }
  .row--one-r { justify-content: flex-end; }
  .row--one-c { justify-content: center; }
  .row--two-a .proj:first-child { width: 58%; } .row--two-a .proj:last-child { width: 36%; margin-top: 16%; }
  .row--two-b .proj:first-child { width: 40%; margin-top: 12%; } .row--two-b .proj:last-child { width: 54%; }
  .row--two-c .proj:first-child { width: 46%; } .row--two-c .proj:last-child { width: 44%; margin-top: 22%; margin-left: auto; }
}
.proj { scroll-margin-top: 24px; min-width: 0; }
.proj[hidden] { display: none; }
.proj__main { position: relative; display: block; width: 100%; aspect-ratio: var(--ratio, 5 / 4); overflow: clip; /* clip, not hidden: hidden makes the frame a scroll container and view() then never moves the photo */ background: var(--paper-2); cursor: zoom-in; }
.proj__main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.proj__more { display: flex; gap: 6px; padding: 8px 0 0; }
.proj__more button { width: 64px; aspect-ratio: 1; overflow: hidden; background: var(--paper-2); }
.proj__more img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--t-ui) var(--ease); }
.proj__more button:hover img { opacity: 0.8; }
.proj__cap { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0 0; }
.proj__cap .proj__scope { grid-column: 1 / -1; }

@supports (animation-timeline: view()) {
  .proj { animation-name: pj-drift; animation-timing-function: linear; animation-fill-mode: both; }
  .proj__main img { animation-name: pj-par; animation-timing-function: linear; animation-fill-mode: both; scale: 1.16; }
  /* the timeline in a rule of its own (SlideGlass: a minifier folds it into a shorthand browsers reject) */
  html .proj, html .proj__main img { animation-timeline: view(); animation-range: cover 0% cover 100%; }
}
@keyframes pj-drift { 0% { translate: 0 calc(var(--spd, 0) * 1px); } 100% { translate: 0 calc(var(--spd, 0) * -1px); } }
@keyframes pj-par { 0% { translate: 0 -7%; } 100% { translate: 0 7%; } }
@media (prefers-reduced-motion: reduce) {
  .proj, .proj__main img { animation: none; scale: none; }
}

/* Residences */
.res { display: grid; gap: var(--s4); grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .res { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.res figure { margin: 0; }
.res .tile__img { aspect-ratio: 3 / 4; }
.res figcaption { margin-top: 10px; }

/* Enquiry builder — send a brief in one tap (after SlideGlass's configurator) */
.brief { display: grid; gap: var(--s6); }
@media (min-width: 1024px) { .brief { grid-template-columns: 1fr 1fr; gap: 0; } .brief > * { padding-right: var(--s7); } }
.brief__title { font-family: var(--sans); font-size: var(--fs-xl); line-height: 1.08; letter-spacing: -0.025em; font-weight: 400; margin: 6px 0 var(--s4); }
.brief form { display: grid; gap: var(--s5); }
.brief fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.brief legend { padding: 0; margin-bottom: 10px; color: var(--ink-2); }
.brief .chips { gap: 6px; }
.brief .chip input[type="checkbox"] + span { padding: 0 14px; }
.brief__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.brief input[type="text"], .brief input[type="number"], .brief select { width: 100%; height: 48px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: 16px; padding: 0 12px; border-radius: 0; color: var(--ink); appearance: none; -webkit-appearance: none; }
.brief input:focus, .brief select:focus { outline: none; border-color: var(--ink); }
.brief label.field { display: grid; gap: 6px; color: var(--ink-2); }
.brief__preview { background: var(--paper-2); padding: var(--s5); white-space: pre-wrap; font-size: var(--fs-s); line-height: 1.55; min-height: 220px; }
.brief__send { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s4); }

/* Lightbox */
.lb { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lb::-webkit-scrollbar { display: none; }
.lb__slide { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: center; display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: 64px 16px 24px; }
@media (min-width: 750px) { .lb__slide { padding: 64px 96px 28px; } }
.lb__slide img { width: 100%; height: 100%; object-fit: contain; }
.lb__slide figcaption { padding-top: 12px; color: var(--ink-2); text-align: center; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); height: 44px; padding: 0 16px; display: none; align-items: center; z-index: 4; }
.lb__nav:hover { text-decoration: underline; text-underline-offset: 4px; }
.lb__nav--prev { left: 8px; } .lb__nav--next { right: 8px; }
@media (min-width: 750px) { .lb__nav { display: flex; } }
.lb__count { position: absolute; left: var(--gutter); top: 20px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.lb:focus { outline: none; }
