/* Existing study palette and typography; approved centred gallery revision. */
.project{padding-top:26px;padding-bottom:70px;max-width:1600px}
.project-breadcrumb{display:flex;gap:24px;align-items:center;font-size:12px;color:var(--muted)}
.project-breadcrumb a{padding-block:10px}.project-breadcrumb a:hover{text-decoration:underline}
.project-breadcrumb span{border-left:1px solid var(--line);padding-left:24px}
.project-heading{padding-top:32px;padding-bottom:30px}.project-heading>.eyebrow{color:var(--muted)}
.project-heading h1{font-size:clamp(60px,8vw,118px);line-height:1;letter-spacing:-.035em;margin:14px 0 22px;text-wrap:balance}
.project-meta{font-size:14px}
.gallery-stage{position:relative;isolation:isolate;overflow:hidden;height: min(570px,72svh);min-height:350px;background:#09100e;display:flex;align-items:center}
.gallery-backdrop{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.28;z-index:-2}
.gallery-stage:after{content:'';position:absolute;inset:0;background:linear-gradient(0deg,rgba(4,14,11,0.722),transparent 30%,rgba(4,14,11,0.094) 70%,rgba(4,14,11,0.333));z-index:-1;pointer-events:none}
.gallery-track{--slide:55%;--gap:24px;position:relative;display:flex;gap:var(--gap);width:100%;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;padding-block:14px;align-items:center;overscroll-behavior-x:contain}
.gallery-track::-webkit-scrollbar{display:none}
.gallery-track:before,.gallery-track:after{content:'';flex:0 0 calc((100% - var(--slide))/2 - var(--gap))}
.gallery-track:focus-visible{outline:2px solid var(--accent);outline-offset:-3px}
.gallery-slide{flex:0 0 var(--slide);min-width:0;margin:0;scroll-snap-align:center;position:relative;background:transparent}
.gallery-slide img{width:100%;height:min(350px,42svh);min-height:180px;object-fit:contain;user-select:none;-webkit-user-drag:none}
.gallery-slide figcaption{font-size:12px;line-height:1.5;padding:12px 16px;min-height:60px;color:var(--fg);background:transparent;text-align:center;text-shadow:0 1px 5px #000000}
.gallery-slide img.is-error{visibility:hidden}.slide-error{position:absolute;top:35%;left:10%;right:10%;text-align:center;font-size:14px}
.gallery-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:2;width:52px;height:64px;background:rgba(7,17,14,0.933);border:1px solid #6d815a;color:var(--fg);font-size:27px}
.gallery-prev{left:16px}.gallery-next{right:16px}.gallery-arrow:hover:not(:disabled){background:var(--fg);color:var(--bg)}.gallery-arrow:disabled{opacity:.35;cursor:default}
.gallery-position{position:absolute;bottom:20px;left:24px;right:24px;display:flex;justify-content:space-between;font-size:12px;color:var(--fg);pointer-events:none;text-shadow:0 1px 5px #000000}
#gallery-counter{font-variant-numeric:tabular-nums}
.project-story{display:grid;grid-template-columns:1fr 1fr;gap:9vw;margin-top:44px;padding-top:32px;border-top:1px solid var(--line)}
.project-story .eyebrow{color:var(--muted);margin-bottom:22px}.project-story h2{font-size:clamp(46px,5vw,76px);text-wrap:balance}
.project-prose{max-width:56ch;font-size:15px;line-height:1.9}.project-prose p+p{margin-top:23px;color:var(--muted)}.project-prose .project-lead{font-size:19px;line-height:1.75}
.project-details,.project-team{margin-top:44px;padding-top:28px;border-top:1px solid var(--line)}
.project-details h2,.project-team h2{font-size:40px}.project-details dl{display:grid;grid-template-columns:1fr 1fr;gap:32px 9vw;margin:32px 0}
.project-details dt,.project-team dt{font-size:11px;text-transform:uppercase;letter-spacing:.1em;color:var(--muted);margin-bottom:10px}
.project-details dd,.project-team dd{margin:0;font-size:14px;line-height:1.9}
.project-team dl{margin:28px 0 0}.project-team dl>div{display:grid;grid-template-columns:1fr 1.4fr;gap:6vw;padding:18px 0;border-bottom:1px solid var(--line)}.project-team dt{margin:3px 0 0;max-width:34ch}
.project-ending{display:flex;justify-content:space-between;align-items:center;gap:32px;border-top:1px solid var(--line);margin-top:40px;padding-top:24px}
.project-ending p{font-size:11px;color:var(--muted);max-width:50ch}.project-ending a{flex-shrink:0}
@media(max-width:700px){
 .project{padding-top:18px;padding-bottom:42px}.project-breadcrumb{font-size:11px;gap:15px}.project-breadcrumb span{padding-left:15px}
 .project-heading{padding-top:24px;padding-bottom:24px}.project-heading h1{font-size:clamp(53px,13vw,84px);margin:14px 0 20px}.project-meta{font-size:12px}
 .gallery-stage{height: min(440px,68svh);min-height:330px;margin-inline:-24px}
 .gallery-track{--slide:76%;--gap:12px}.gallery-slide img{height:min(300px,42svh);min-height:180px}.gallery-slide figcaption{font-size:11px;min-height:70px;padding:10px 12px}
 .gallery-arrow{width:42px;height:52px;font-size:23px}.gallery-prev{left:4px}.gallery-next{right:4px}.gallery-position{left:18px;right:18px;bottom:16px;font-size:11px}
 .project-story{display:block;margin-top:32px;padding-top:26px}.project-story h2{font-size:48px}.project-prose{margin-top:28px;font-size:14px}.project-prose .project-lead{font-size:17px}
 .project-details,.project-team{margin-top:40px;padding-top:28px}.project-details h2,.project-team h2{font-size:36px}.project-details dl{grid-template-columns:1fr;gap:24px;margin-block:26px}
 .project-team dl>div{grid-template-columns:1fr;gap:5px;padding:16px 0}.project-team dt{max-width:none}.project-team dd{font-size:13px}
 .project-ending{display:block;margin-top:40px;padding-top:24px}.project-ending p{margin-top:24px}
}
@media(max-height:550px) and (min-width:701px){.gallery-stage{min-height:300px}.gallery-slide img{min-height:140px;height:40svh}.gallery-slide figcaption{min-height:44px;padding-block:8px}}

/* Each slide follows its photograph, without empty side fields. */
.gallery-track{--photo-height:min(350px,42svh);--gap:20px;align-items:flex-start}
.gallery-track:before{flex-basis:var(--start-space,0px)}.gallery-track:after{flex-basis:var(--end-space,0px)}
.gallery-slide{flex:0 0 var(--photo-width,55%)}
.gallery-slide img{height:auto;min-height:0;width:100%;aspect-ratio:var(--photo-ratio);object-fit:contain}
.gallery-slide figcaption{padding:12px 4px;min-height:0;max-width:100%;text-wrap:balance;overflow-wrap:anywhere}
@media(max-width:700px){.gallery-track{--photo-height:min(260px,34svh);--gap:14px}.gallery-slide figcaption{padding:10px 3px}}

/* Compact introduction; fit the gallery to the remaining opening height. */
.project{padding-top:14px}.project-heading{padding-top:16px;padding-bottom:20px}
.project-heading h1{font-size:clamp(48px,6vw,88px);margin:10px 0 14px}
.gallery-stage{height:var(--opening-gallery-height, min(570px,65svh));min-height:280px}
.gallery-track{--photo-height:min(350px,calc(var(--opening-gallery-height, 450px) - 105px))}
@media(max-width:700px){.project-heading h1{font-size:clamp(43px,11vw,65px)}.project-heading{padding-top:12px;padding-bottom:16px}.gallery-stage{min-height:280px}.gallery-track{--photo-height:min(260px,calc(var(--opening-gallery-height, 400px) - 110px))}}

/* Photographs retain useful size, even in a short window; no letterbox panels. */
.gallery-track{--photo-height:min(390px,calc(var(--opening-gallery-height, 500px) - 100px))}
@media(max-width:700px){.gallery-track{--photo-height:min(290px,calc(var(--opening-gallery-height, 400px) - 100px))}}

/* More room for the background image; foreground slide sizing is unchanged. */
.project{padding-top:10px}
.project-heading{padding-top:8px;padding-bottom:12px}
.project-heading h1{margin-top:8px;margin-bottom:10px}
.gallery-stage{height:calc(var(--opening-gallery-height, 500px) + 100px)}
.gallery-backdrop{opacity:.43}
.gallery-stage:after{background:linear-gradient(0deg,rgba(4,14,11,0.502),transparent 28%,transparent 80%,rgba(4,14,11,0.125))}
@media(max-width:700px){.project-heading{padding-top:6px;padding-bottom:12px}.gallery-stage{height:calc(var(--opening-gallery-height, 400px) + 70px)}}

/* Subtle hover feedback on gallery photos, matching the work cards. */
.gallery-slide img{transition:transform .45s ease;transform-origin:center}
@media(hover:hover) and (pointer:fine){.gallery-slide img:hover{transform:scale(1.025)}}
@media(prefers-reduced-motion:reduce){.gallery-slide img{transition:none;transform:none!important}}

.gallery-slide img{cursor:zoom-in}.gallery-slide img:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
body.photo-open{position:fixed;width:100%;overflow:hidden}
dialog.photo-viewer{position:fixed;inset:0;width:100%;height:100dvh;max-width:none;max-height:none;margin:0;padding:64px 20px 20px;border:0;background:#09100e;color:var(--fg);overflow:auto}
.photo-viewer[open]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px}
.photo-viewer img{max-width:100%;max-height:calc(100dvh - 150px);width:auto;height:auto;object-fit:contain;flex-shrink:1;min-height:0}
.photo-viewer p{font-size:13px;text-align:center;max-width:65ch;flex-shrink:0}
.photo-close{position:absolute;top:10px;right:14px;width:44px;height:44px;font-size:34px;line-height:1;border:1px solid var(--muted);border-radius:50%}
