/* Headline, photographic stack, byline; shared scan rendering and film handoff. */
body.landing[data-hero-study="stack"] .hero { --hero-gap: clamp(8px,2svh,28px); min-height: calc(100svh - 72px); display: flex; flex-direction: column; justify-content: center; padding: clamp(8px,3svh,40px) 0 clamp(16px,4svh,56px); overflow: visible; }
body[data-hero-study="stack"] .hero-copy { padding-top: 0; opacity: var(--stack-copy-opacity,1); }
body[data-hero-study="stack"] .hero h1 { font-size: clamp(44px,5.1vw,70px); line-height: 1.01; letter-spacing: -.06em; font-weight: 550; }
body[data-hero-study="stack"] .hero-byline { display: flow-root; text-align: center; opacity: var(--stack-byline-opacity,0); }
body[data-hero-study="stack"] .hero .intro { margin-top: var(--hero-gap); max-width: 430px; font-size: 17px; line-height: 1.5; }
body[data-hero-study="stack"] .hero-actions { margin-top: var(--hero-gap); }
.photo-stack { --photo-width: min(420px,70vw,24svh); position: relative; margin: var(--hero-gap) auto 0; flex: 0 0 auto; width: min(760px,100%); }
.photo-stack-stage { position: relative; height: var(--stack-stage-height,calc(var(--photo-width)*1.12 + 48px)); isolation: isolate; touch-action: pan-y; cursor: default; outline-offset: -3px; }
.stack-photo { position: fixed; left: 50%; width: var(--photo-width); aspect-ratio: 1.5; border-radius: 12px; overflow: hidden; background: #e5e5e5; box-shadow: 0 2px 5px #00000019,0 8px 20px #00000020; transform: translate(-50%,-50%); user-select: none; contain: layout style; will-change: transform; }
.stack-photo svg,.stack-photo img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* HTML photographs remain a useful fallback if enhancement cannot initialize. */
.stack-photo:has(> img) { position: absolute; top: 50%; }
.stack-photo:has(> img):nth-child(1) { z-index: 7; transform: translate(-50%,-50%) rotate(-4deg); }
.stack-photo:has(> img):nth-child(2) { z-index: 6; transform: translate(-46%,-53%) rotate(4deg); }
.stack-photo:has(> img):nth-child(3) { z-index: 5; transform: translate(-54%,-48%) rotate(-8deg); }
.stack-photo:has(> img):nth-child(4) { z-index: 4; transform: translate(-48%,-46%) rotate(3deg); }
/* Match the enhanced equal-area geometry in the no-JavaScript fallback. */
.stack-photo[data-photo="3"] { width: calc(var(--photo-width)*.81649658); aspect-ratio: 1; }
.stack-photo[data-photo="0"] { width: calc(var(--photo-width)*.70710678); aspect-ratio: 3/4; }
.stack-photo[data-photo="4"] { width: calc(var(--photo-width)*.91287093); aspect-ratio: 5/4; }
@media(max-height:800px) {
 body[data-hero-study="stack"] .hero h1 { font-size: clamp(38px,4.6vw,58px); }
 body[data-hero-study="stack"] .hero-actions { margin-top: var(--hero-gap); }
 .photo-stack { margin-top: var(--hero-gap); }
}
@media(max-width:600px) {
 body[data-hero-study="stack"] .hero h1 { font-size: clamp(38px,10vw,52px); }
 .photo-stack { --photo-width: min(420px,70vw,24svh); margin-top: var(--hero-gap); }
 body[data-hero-study="stack"] .hero .intro { max-width: 330px; font-size: 16px; margin-top: var(--hero-gap); }
}
@media(prefers-reduced-motion:reduce) {
 .stack-photo { position: absolute; top: 50% !important; will-change: auto; }
 body[data-hero-study="stack"] .hero-copy, body[data-hero-study="stack"] .hero-byline { opacity: 1; }
}
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }

.photo-stack[data-processing="complete"] .photo-stack-stage { cursor: auto; }

/* The headline finishes before the decoded stack arrives, then the call to action. */
.stack-loading .photo-stack:not([data-ready]),
.stack-enhanced .photo-stack:not([data-ready]) { visibility: hidden; }
.stack-loading body[data-hero-study="stack"] .hero-byline { opacity: 0; }
body[data-hero-study="stack"] .hero .intro,
body[data-hero-study="stack"] .hero-actions { animation: none; }
body:not(.stack-enhanced)[data-hero-study="stack"] .hero-byline { opacity: 1; }
body[data-hero-study="stack"] .button[data-download] {
 background: linear-gradient(#fafafa,#f0f0f0); border: 1px solid #d3d3d3;
 box-shadow: 0 1px 2px #00000012;
}
body[data-hero-study="stack"] .button[data-download]:hover {
 background: #f5f5f5; box-shadow: 0 2px 4px #00000016;
}
.stack-photo:focus-visible { outline: 2px solid #6c965b; outline-offset: 3px; }

/* Extra photographs use the same static fallback stack and equal-area square. */
.stack-photo:has(> img):nth-child(5) { z-index: 3; transform: translate(-56%,-52%) rotate(-5deg); }
