/* Portfolio structure added on top of the residence presentation: project record, process, project index. */
.project-record, .project-index { padding: clamp(70px, 11vh, 130px) var(--pad); max-width: calc(1500px + 2 * var(--pad)); margin: 0 auto; }
.project-record { border-top: 1px solid var(--line); }
.project-record-head { margin-bottom: clamp(30px, 5vh, 56px); }
.project-facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.project-facts > div { padding: 22px 26px 26px 0; border-bottom: 1px solid var(--line); }
.project-facts dt { font: 400 11px/1.4 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.project-facts dd { font: 300 clamp(19px, 1.7vw, 25px)/1.3 var(--serif); max-width: 26em; }
.project-process { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: clamp(40px, 7vh, 80px); counter-reset: none; }
.project-process a { display: grid; gap: 8px; height: 100%; padding: 22px 22px 26px 0; border-top: 2px solid var(--ink); transition: border-color .4s var(--ease), padding .5s var(--ease); }
.project-process li + li a { padding-left: 22px; border-left: 1px solid var(--line); }
.project-process span { font: 400 11px/1 var(--sans); letter-spacing: .24em; color: var(--ink-2); }
.project-process strong { font: 300 clamp(24px, 2.4vw, 36px)/1.05 var(--serif); }
.project-process small { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.project-process a:hover, .project-process a:focus-visible { border-top-color: var(--gold); }
.project-list { list-style: none; border-top: 1px solid var(--line); max-width: 1500px; margin: 0 auto; }
.project-list a { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: clamp(20px, 3.4vh, 34px) 0; border-bottom: 1px solid var(--line); }
.project-list span { font: 400 12px var(--sans); letter-spacing: .2em; color: var(--ink-2); }
.project-list strong { font: 300 clamp(26px, 3.6vw, 52px)/1 var(--serif); }
.project-list small { font-size: 14px; color: var(--ink-2); letter-spacing: .04em; }
.project-list i { font-style: normal; color: var(--gold); }
.contact-more { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 26px; font-size: 14px; letter-spacing: .06em; }
.contact-more a { border-bottom: 1px solid currentColor; padding-bottom: 2px; opacity: .85; }
.contact-more a:hover { opacity: 1; }
@media (max-width: 860px) {
  .project-facts { grid-template-columns: 1fr; }
  .project-process { grid-template-columns: 1fr 1fr; }
  .project-process li + li a { padding-left: 0; border-left: 0; }
  .project-process li:nth-child(even) a { padding-left: 18px; border-left: 1px solid var(--line); }
  .project-list a { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .project-list small { grid-column: 2; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .project-process a, .project-process a::before, .project-list a, .contact-more a, .pf-motion .pf-stagger > * { transition: none; }
  .pf-motion .pf-stagger > * { opacity: 1; transform: none; }
}

/* Motion for the portfolio blocks: children rise in one after another; the process rule draws across. */
.pf-motion .pf-stagger > * { opacity: 0; transform: translateY(18px); transition: opacity .6s ease-out, transform .6s ease-out; }
.pf-motion .pf-stagger.pf-in > * { opacity: 1; transform: none; }
.pf-motion .pf-stagger > :nth-child(2) { transition-delay: .04s; } .pf-motion .pf-stagger > :nth-child(3) { transition-delay: .08s; }
.pf-motion .pf-stagger > :nth-child(4) { transition-delay: .12s; } .pf-motion .pf-stagger > :nth-child(5) { transition-delay: .16s; }
.pf-motion .pf-stagger > :nth-child(6) { transition-delay: .2s; }
.project-process a { position: relative; border-top-color: var(--line); }
.project-process a::before { content: ''; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .6s ease-out, background .3s ease-out; }
.pf-in.project-process a::before, html:not(.pf-motion) .project-process a::before { transform: scaleX(1); }
.project-process li:nth-child(2) a::before { transition-delay: .06s; } .project-process li:nth-child(3) a::before { transition-delay: .12s; } .project-process li:nth-child(4) a::before { transition-delay: .18s; }
.project-process a:hover::before, .project-process a:focus-visible::before { background: var(--gold); }
.project-process strong { transition: transform .5s var(--ease); }
.project-process a:hover strong { transform: translateX(8px); }
.project-list a { transition: padding .5s var(--ease), color .4s; }
.project-list a:hover { padding-left: 18px; color: var(--taupe); }
.contact-more a { transition: opacity .3s ease-out; }
.contact-more a:hover { opacity: 1; }

/* Selected-work cards and the case-study anatomy (scope, process, outcome, empty slots). */
.work-index { padding: clamp(56px, 8vh, 96px) var(--pad) clamp(20px, 4vh, 40px); max-width: calc(1500px + 2 * var(--pad)); margin: 0 auto; }
.work-index-head { max-width: 1500px; margin: 0 auto clamp(28px, 4vh, 48px); }
.work-grid { list-style: none; display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; gap: 22px 28px; max-width: 1500px; margin: 0 auto; }
.work-grid > :first-child { grid-row: 1 / span 2; }
.work-card[hidden] { display: none; }
.work-card a { display: block; height: 100%; color: inherit; }
.work-card figure { margin: 0; display: grid; gap: 12px; height: 100%; align-content: start; }
.work-card img, .work-card .slot-frame { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--paper-2); }
.work-grid > :first-child img { aspect-ratio: 4 / 5; min-height: 100%; }
/* One visible card (empty slots hidden): drop the vacant second column so no gap remains.
   Keep the same max-width as the heading, and use the default 3 / 2 crop rather than the tall featured 4 / 5. */
.work-grid:not(:has(.work-card:not([hidden]) ~ .work-card:not([hidden]))) { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
.work-grid:not(:has(.work-card:not([hidden]) ~ .work-card:not([hidden]))) > :first-child { grid-row: auto; }
.work-grid:not(:has(.work-card:not([hidden]) ~ .work-card:not([hidden]))) > :first-child img { aspect-ratio: 3 / 2; min-height: 0; height: auto; }
.work-card figcaption { display: grid; gap: 4px; }
.work-card figcaption span { font: 400 11px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.work-card strong { font: 300 clamp(28px, 3vw, 48px)/1 var(--serif); }
.work-card small { color: var(--ink-2); font-size: 14px; letter-spacing: .02em; }
.slot-frame { display: grid; place-items: center; border: 1px dashed rgba(42, 36, 32, .4); color: var(--ink-2); text-align: center; padding: 18px; font: 400 13px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.scope { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: clamp(36px, 6vh, 64px); }
.scope div { border-top: 2px solid var(--ink); padding-top: 14px; }
.scope span { display: block; margin-bottom: 8px; font: 400 11px/1.4 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.scope p { font: 300 clamp(18px, 1.6vw, 24px)/1.35 var(--serif); }
.process-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: clamp(36px, 6vh, 64px); }
.process-row figure { margin: 0; }
.process-row img { width: 100%; height: auto; background: var(--paper-2); }
.process-row figure:last-child img { aspect-ratio: 4 / 3; object-fit: cover; }
.process-row figcaption, .asset-slot figcaption { margin-top: 8px; font-size: 13px; letter-spacing: .04em; color: var(--ink-2); }
.asset-slot { margin: clamp(28px, 5vh, 48px) 0 0; }
.asset-slot .slot-frame { aspect-ratio: 16 / 6; }
.outcome { max-width: 38em; margin-top: clamp(28px, 5vh, 48px); }
.outcome p:last-child { font: 300 clamp(22px, 2vw, 32px)/1.35 var(--serif); }
@media (max-width: 860px) {
  .work-grid, .work-grid > :first-child { grid-template-columns: 1fr; grid-row: auto; }
  .work-grid > :first-child img { aspect-ratio: 3 / 2; }
  .scope, .process-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .work-card img { transform: none; }
}
