/* gs-project — the v2 project case-study template, shared by every
   project-*.html page and /projects. Load it after /css/gs-v2.css and before
   the page's own <style>, so page rules win ties. Spec:
   docs/design/project-template.md. When this file changes, bump ?v= on every
   page that links it. */

/* ── Hero: the project's best real photo, a measured overlay, the record's headline ── */
.pj-hero { position: relative; margin-top: var(--nav-h); height: calc(88vh - var(--nav-h)); min-height: 620px; max-height: 960px; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; }
.pj-hero > .gs-ph { position: absolute; inset: 0; z-index: -1; margin: 0; --gs-out-origin: 50% 40%; }
.pj-hero > .gs-ph::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(12, 12, 12, 0.95) 0%, rgba(12, 12, 12, 0.85) 24%, rgba(12, 12, 12, 0.4) 44%, rgba(12, 12, 12, 0) 58%); pointer-events: none; }
.pj-cap { position: absolute; z-index: 3; top: 1.25rem; left: var(--gs-gutter); max-width: calc(100% - 2 * var(--gs-gutter)); padding: 0.45rem 0.65rem; background: rgba(12, 12, 12, 0.74); font-size: 0.8125rem; line-height: 1.45; color: rgba(245, 242, 235, 0.92); }
.pj-cap a { color: var(--gs-ink); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-color: rgba(245, 242, 235, 0.5); }
.pj-copy { position: relative; z-index: 2; width: min(var(--gs-max), 100% - 2 * var(--gs-gutter)); margin: 0 auto; padding-bottom: clamp(2rem, 5vh, 3.5rem); display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.25rem 4rem; align-items: end; }
.pj-hero h1 { font-size: clamp(2.3rem, 3.9vw, 3.5rem); line-height: 1.04; letter-spacing: -0.02em; max-width: 18ch; }
.pj-answer { margin-top: 1rem; font-size: clamp(1rem, 1.25vw, 1.125rem); line-height: 1.55; color: rgba(245, 242, 235, 0.9); max-width: 62ch; }
.pj-figure { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; padding-bottom: 0.8rem; border-bottom: 1px solid rgba(245, 242, 235, 0.22); }
.pj-figure b { font-family: var(--gs-font-display); font-weight: 300; font-size: clamp(2.2rem, 3.4vw, 3rem); line-height: 1; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.pj-figure span { font-size: 0.9375rem; line-height: 1.4; color: rgba(245, 242, 235, 0.82); }
.pj-tags { margin-top: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pj-tags li { padding: 0.3rem 0.65rem; border: 1px solid rgba(245, 242, 235, 0.26); border-radius: var(--gs-pill); font-size: 0.8125rem; line-height: 1.3; color: rgba(245, 242, 235, 0.88); }
.pj-actions { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
/* .pj-hero--plain: the project has no clean photo yet, so the hero is type on
   night with the record's figure, and no image. */
.pj-hero--plain { height: auto; min-height: 0; max-height: none; padding-top: clamp(3rem, 9vh, 6rem); border-bottom: 1px solid var(--gs-line); }
.pj-hero--plain .pj-copy { padding-bottom: clamp(2.5rem, 7vh, 4.5rem); }
/* .pj-hero--split: for a clean photo under 1200px wide. On desktop the photo
   sits beside the copy at its own proportions, near its own size, instead of
   being stretched behind it; below 1025px it stacks like every other hero. */
@media (min-width: 1025px) {
  .pj-hero--split { height: auto; min-height: clamp(560px, calc(100vh - var(--nav-h)), 820px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: clamp(2.5rem, 5vw, 4.5rem); padding: clamp(2.5rem, 7vh, 4.5rem) max(var(--gs-gutter), (100% - var(--gs-max)) / 2); }
  .pj-hero--split > .gs-ph { position: relative; inset: auto; z-index: 0; grid-area: 1 / 2; aspect-ratio: var(--gs-iw) / var(--gs-ih); }
  .pj-hero--split > .gs-ph::after { content: none; }
  .pj-hero--split .pj-copy { grid-area: 1 / 1; width: auto; margin: 0; padding: 0; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .pj-hero--split .pj-cap { top: auto; bottom: 0.75rem; left: 0.75rem; max-width: calc(100% - 1.5rem); }
}
/* .pj-hero--base: on desktop the photo's bottom edge holds the frame, so a
   measured line low in the photo clears the copy. The overlay box keeps the
   photo's own proportions, so lines and labels stay on the photo. */
@media (min-width: 1025px) {
  .pj-hero--base .gs-scrollout { inset: auto; left: 50%; bottom: 0; width: max(100cqw, 100cqh * var(--gs-iw) / var(--gs-ih)); height: max(100cqh, 100cqw * var(--gs-ih) / var(--gs-iw)); translate: -50% 0; container-type: size; }
}
/* .pj-hero--top: the subject sits in the top third of the photo. Wherever the
   hero crops the photo (any width; a split hero only crops below 1025px), its
   top edge holds the frame, and the overlay box keeps the photo's proportions. */
.pj-hero--top .gs-scrollout { inset: auto; left: 50%; top: 0; width: max(100cqw, 100cqh * var(--gs-iw) / var(--gs-ih)); height: max(100cqh, 100cqw * var(--gs-ih) / var(--gs-iw)); translate: -50% 0; container-type: size; }

/* ── Section heads: the heading left, its one line right ── */
.pj-head { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 1rem clamp(2.5rem, 6vw, 6rem); align-items: end; margin-bottom: clamp(2rem, 4vw, 3rem); }
.pj-head h2 { margin-bottom: 0; }
.pj-head p { color: var(--gs-fg-muted); max-width: 60ch; }

/* ── At a glance: the record as a drawing's title block ── */
@media (min-width: 769px) { .pj-tb { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 769px) and (max-width: 1024px) { .pj-tb { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pj-record { margin-top: clamp(1.5rem, 3vw, 2rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem clamp(2rem, 5vw, 4rem); align-items: start; }
.pj-record p { font-size: 0.9375rem; line-height: 1.6; color: var(--gs-fg-muted); max-width: 62ch; }
.pj-record p + p { margin-top: 0.6rem; }
.pj-record h3, .pj-sys h3 { font-family: var(--gs-font-body); font-size: var(--gs-small); font-weight: 600; line-height: 1.5; letter-spacing: 0; }
.pj-record h3 { margin-bottom: 0.6rem; }
.pj-feats { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pj-feats li { padding: 0.3rem 0.7rem; border: 1px solid var(--gs-tb-line); border-radius: var(--gs-pill); font-size: 0.8125rem; line-height: 1.35; color: var(--gs-fg); }
.pj-sys { margin-top: clamp(2rem, 4vw, 2.75rem); padding-top: 1.1rem; border-top: 1px solid var(--gs-rule); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1.5rem; }
.pj-sys .gs-linkrow { margin: 0; padding: 0; border: 0; }

/* ── The project: one sentence per stage, the full account inside ── */
.pj-story { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 2rem clamp(2.5rem, 6vw, 6rem); align-items: start; }
.pj-story h2 { margin-bottom: 1rem; }
.pj-story .gs-statement summary { font-size: clamp(1.3rem, 2.1vw, 1.8rem); }
.pj-story .gs-statement-body p + p { margin-top: 0.75rem; }

/* ── Photos: every clean photo of the project, the measured facts drawn on ── */
.pj-film-p { max-width: 46ch; }
.pj-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.75rem); }
.pj-shot { margin: 0; }
.pj-shot .gs-ph { aspect-ratio: 4 / 3; }
/* A lone photo (not in a pair) never renders taller than the screen: its 4:3
   frame narrows instead, so nothing is cropped away. */
.gs-wrap:not(.pj-pair) > .pj-shot { max-width: calc((100svh - var(--nav-h) - 7rem) * 4 / 3); }
.pj-shot figcaption, .pj-photos .gs-film-card figcaption { display: block; padding-top: 0.85rem; }
.pj-shot h3, .pj-photos .gs-film-card h3 { font-size: 1.3rem; }
.pj-shot p, .pj-photos .gs-film-card p { margin-top: 0.15rem; font-size: var(--gs-small); line-height: 1.5; color: var(--gs-fg-muted); max-width: 52ch; }
.pj-quote { margin: clamp(3rem, 6vw, 4.5rem) 0 0; padding-left: 25%; }
.pj-quote blockquote p { font-family: var(--gs-font-display); font-weight: 300; font-style: italic; font-size: clamp(1.3rem, 2.1vw, 1.8rem); line-height: 1.3; letter-spacing: -0.01em; max-width: 40ch; }
.pj-quote figcaption { margin-top: 1.1rem; font-size: 0.875rem; line-height: 1.5; color: var(--gs-fg-muted); }

/* ── Related projects and the project pager ── */
.pj-rel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.5rem); }
.pj-rel a { display: block; color: var(--gs-fg); transition: translate 0.5s var(--gs-ease); }
.pj-rel .gs-ph { aspect-ratio: 4 / 3; }
.pj-rel .gs-ph > img { transition: transform 0.9s var(--gs-ease); }
.pj-rel h3 { margin-top: 0.85rem; font-size: 1.25rem; transition: color 0.2s; }
.pj-rel p { margin-top: 0.2rem; font-size: var(--gs-small); line-height: 1.5; color: var(--gs-fg-muted); }
.pj-rel a:hover, .pj-rel a:focus-visible { translate: 0 -4px; }
.pj-rel a:hover .gs-ph > img, .pj-rel a:focus-visible .gs-ph > img { transform: scale(1.03); }
.pj-rel a:hover h3 { color: var(--gs-link); }
.pj-more { margin-top: clamp(2rem, 4vw, 2.75rem); }
.pj-pager { margin-top: clamp(2rem, 4vw, 3rem); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--gs-rule); border-bottom: 1px solid var(--gs-rule); }
.pj-pager a { display: grid; align-content: start; gap: 0.3rem; padding: 1.1rem 1.5rem 1.2rem 0; color: var(--gs-fg); }
.pj-pager a + a { padding: 1.1rem 0 1.2rem 1.5rem; border-left: 1px solid var(--gs-rule); text-align: right; }
.pj-pager span { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.8125rem; color: var(--gs-fg-muted); }
.pj-pager a + a span { justify-content: flex-end; }
.pj-pager .pj-back { rotate: 180deg; }
.pj-pager b { font-family: var(--gs-font-display); font-weight: 300; font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.3; transition: color 0.2s; }
.pj-pager a:hover b { color: var(--gs-link); }
.pj-pager a:hover .gs-ar { translate: 3px 0; }

/* ── Close: the quote request, then California installation ── */
.pj-close { border-top: 1px solid var(--gs-line); }
.pj-close-in { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.5rem 3rem; }
.pj-close h2 { margin-bottom: 0.6rem; max-width: 18ch; }
.pj-close .gs-lede { max-width: 56ch; }
.pj-contact { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; font-size: 0.9375rem; }
.pj-close .pj-actions { margin-top: 0; }
.pj-ca { margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: clamp(1.5rem, 3vw, 2rem); border-top: 1px solid var(--gs-line); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 1.25rem clamp(2rem, 5vw, 4rem); align-items: start; }
.pj-ca h3 { margin-bottom: 0.6rem; }
.pj-ca p { font-size: 0.9375rem; line-height: 1.65; color: var(--gs-muted); max-width: 60ch; }
.pj-ca p + p { margin-top: 0.6rem; font-size: 0.8125rem; }
.pj-ca ul { border-top: 1px solid var(--gs-line); }
.pj-ca li a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--gs-line); font-size: 0.9375rem; line-height: 1.4; transition: color 0.2s; }
.pj-ca li a .gs-ar { color: var(--gs-gold); }
.pj-ca li a:hover { color: var(--gs-gold); }
.pj-ca li a:hover .gs-ar, .pj-ca li a:focus-visible .gs-ar { translate: 3px 0; }

/* Shell quick-action bar: steps aside while the hero or closing buttons are on screen */
.m-cta-bar { transition: transform 0.35s var(--gs-ease), opacity 0.3s linear; }
.m-cta-bar.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }

@media (max-width: 1024px) {
  .pj-hero { height: auto; min-height: 0; max-height: none; justify-content: flex-start; }
  .pj-hero > .gs-ph { position: relative; inset: auto; z-index: 0; height: clamp(300px, 46svh, 480px); }
  .pj-hero > .gs-ph::after { background: linear-gradient(to top, rgba(12, 12, 12, 0.5) 0%, rgba(12, 12, 12, 0) 35%); }
  .pj-cap { top: auto; bottom: 0.75rem; }
  .pj-copy { grid-template-columns: minmax(0, 1fr); padding: 1.75rem 0 2.25rem; }
  .pj-head, .pj-story, .pj-record { grid-template-columns: minmax(0, 1fr); }
  .pj-rel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj-quote { padding-left: 0; }
}
@media (max-width: 768px) {
  .pj-hero > .gs-ph { height: clamp(250px, 40svh, 360px); }
  .pj-cap { bottom: 0.6rem; font-size: 0.75rem; padding: 0.35rem 0.55rem; }
  .pj-hero h1 { font-size: clamp(2.1rem, 9vw, 2.7rem); }
  .pj-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .pj-pair, .pj-rel, .pj-ca { grid-template-columns: minmax(0, 1fr); }
  .pj-pager { grid-template-columns: minmax(0, 1fr); }
  .pj-pager a + a { padding-left: 0; border-left: 0; border-top: 1px solid var(--gs-rule); text-align: left; }
  .pj-pager a + a span { justify-content: flex-start; }
  .pj-quote blockquote p { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .m-cta-bar, .pj-rel a, .pj-rel .gs-ph > img, .pj-rel h3 { transition: none; }
  .pj-rel a:hover, .pj-rel a:focus-visible { translate: none; }
  .pj-rel a:hover .gs-ph > img, .pj-rel a:focus-visible .gs-ph > img { transform: none; }
}
