/* Final framing layer. Aspect ratio, not device identity, chooses the composition.
   Keep these rules after the historic chapter styles and brand artwork. */
:root{--safe-bottom:max(20px,env(safe-area-inset-bottom));--eclipse-focus:50%}
html{scroll-padding-top:0}
.site-header{gap:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:16px}
.site-header nav{gap:clamp(12px,2vw,28px);flex-shrink:0}
.site-header [data-bag-count]{margin-left:.25em}
.site-header nav a,.site-header nav button{display:inline-flex;align-items:center;min-height:44px;white-space:nowrap}
.site-header .motion-toggle{max-width:none;line-height:1.2}
.theme-picker{bottom:var(--safe-bottom);gap:10px}
.theme-picker fieldset{gap:2px}
.theme-picker .swatch{width:44px;height:44px}
.theme-picker>span{min-width:4ch}
.hero,.craft,.ritual{height:100svh;min-height:520px}
.hero-media{inset:0}
.hero-media[data-framing] :is(img,video){object-fit:cover}
.hero h1{font-size:clamp(56px,min(8.4vw,13svh),144px)}
.hero-copy{top:26%;max-width:58%}
.hero-endnote{bottom:calc(var(--safe-bottom) + 12px)}
.video-play{min-height:44px;max-width:calc(100% - 2 * var(--pad));bottom:calc(var(--safe-bottom) + 68px)}
.craft-film .video-play{left:var(--pad);bottom:calc(var(--safe-bottom) + 68px);transform:none}
.eclipse-poster{object-position:var(--eclipse-focus) center}
.eclipse-copy{top:16%;width:30%;max-width:520px}
.eclipse-copy h2{font-size:clamp(36px,min(4.4vw,9svh),74px)}
.eclipse-caption{top:auto;bottom:0;display:flex;padding:12px var(--pad) calc(var(--safe-bottom) + 80px)}
.eclipse-caption .text-link{margin:0;gap:8px;flex-wrap:wrap}
.craft-copy{left:auto;right:var(--pad);top:50%;bottom:auto;width:29%;max-width:430px;transform:translateY(-50%)}
.craft-copy h2{font-size:clamp(36px,min(5.5vw,10svh),82px)}
.craft-copy p{position:static;max-width:25ch;font-size:clamp(16px,1.3vw,20px)}
.ritual-copy{top:auto;bottom:18%;width:30%;max-width:480px}
.ritual-copy h2{font-size:clamp(42px,min(6.5vw,12svh),112px)}
.ritual-copy p{position:static;max-width:22ch;margin-top:24px}
.ritual-copy .text-link{position:static;margin-top:20px;white-space:normal}
.ritual-film :is(img,video){object-position:55% 35%}
.closing-copy{width:38%;max-width:590px}
.closing-copy h2{font-size:clamp(40px,min(6.15vw,12svh),94px)}
.closing-camera img{object-fit:cover;object-position:60% center}
.viewer-actions{flex-wrap:wrap;gap:12px}
.viewer-actions button{min-width:44px;min-height:44px}
.film-dialog .viewer-media{height:min(68svh,900px)}

/* Portrait screens retain the full-bleed chapter. Copy overlays the source;
   media never becomes an inset panel or a separate row. */
@media(max-aspect-ratio:1/1){
 :root{--eclipse-focus:61%}
 .hero-copy{top:16%;max-width:calc(100% - 2 * var(--pad))}
 .hero h1{font-size:clamp(48px,10vw,90px);max-width:12ch}
 .hero-copy .text-link{margin-top:22px}
 .hero-copy h1{transition:opacity 1s ease}
 .hero:has(.hero-media.is-detail) .hero-copy h1{opacity:0}
 .hero-endnote{bottom:calc(var(--safe-bottom) + 144px)}
 .hero-media[data-framing=material] :is(img,video){object-position:50% 65%}
 .eclipse-copy{left:var(--pad);top:13%;width:calc(100% - 2 * var(--pad));max-width:480px}
 .eclipse-copy h2{font-size:clamp(36px,6.8vw,60px);max-width:13ch}
 .eclipse-copy p{margin-top:14px;font-size:16px;max-width:24ch}
 .eclipse-caption{top:auto;bottom:0;padding-bottom:calc(var(--safe-bottom) + 80px)}
 .eclipse-caption>span{display:none}
 .eclipse-copy p br{display:initial}
 .eclipse-caption .text-link{padding:8px 12px;background:color-mix(in srgb,var(--ground) 90%,transparent)}
 .craft-copy{left:auto;right:var(--pad);top:13%;bottom:auto;width:calc(100% - 2 * var(--pad));max-width:480px;transform:none;text-align:right}
 .craft-copy h2{font-size:clamp(38px,6.8vw,62px)}
 .craft-copy p{margin:16px 0 0 auto;max-width:28ch}
 .craft-copy .text-link{margin-top:12px}
 .craft-film :is(img,video){inset:0;width:100%;height:100%;object-fit:cover;object-position:left center;transform:none}
 .ritual-copy{inset:10% var(--pad) auto;width:auto;max-width:480px}
 .ritual-copy h2{font-size:clamp(40px,7.8vw,68px)}
 .ritual-copy p{margin-top:16px}
 .ritual-copy .text-link{margin-top:12px}
 .ritual-film{background:var(--ground)}
 .ritual-film :is(img,video){inset:0;width:100%;height:100%;object-fit:cover;object-position:57% 15%;transform:none}
 .closing-track{height:100svh;min-height:0}
 .closing-track .closing-scene{position:relative;top:0;height:100svh;min-height:0;padding:0}
 .closing-camera{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto}
 .closing-camera img{width:100%;height:100%;object-fit:cover;object-position:67% center}
 .closing-copy{position:absolute;inset:0;width:100%;height:100%;max-width:none;margin:0;padding:14svh var(--pad) 0;pointer-events:none}
 .closing-copy h2{max-width:11ch}
 .closing-copy .text-link{position:absolute;left:var(--pad);bottom:calc(var(--safe-bottom) + 66px);width:max-content;max-width:calc(100% - 2 * var(--pad));pointer-events:auto;white-space:nowrap}
 .closing-copy h2{font-size:clamp(30px,5.8vw,54px)}
 .closing-support{margin-top:16px;max-width:18ch;font-size:15px}
 .closing-copy .text-link{margin-top:12px;gap:8px;flex-wrap:wrap}
}
@media(max-width:600px){
 :root{--pad:20px}
 .site-header{gap:10px;padding-top:max(10px,env(safe-area-inset-top))}
 .site-header .brand{width:92px;flex-basis:92px}
 .site-header nav{gap:12px;font-size:13px}
 .site-header nav button{font-size:13px}
 .site-header .motion-toggle{max-width:48px;white-space:normal;text-align:left}
 .theme-picker{right:var(--pad);font-size:14px;padding:0}
 .hero h1{font-size:clamp(46px,11.5vw,68px);line-height:1}
 .eclipse-copy h2{font-size:clamp(34px,8.6vw,48px)}
 .craft-copy h2{font-size:clamp(36px,9vw,50px)}
 .craft-copy p{font-size:15px;max-width:25ch}
 .craft-copy p br{display:initial}
 .ritual-copy h2{font-size:clamp(38px,9.6vw,54px)}
 .ritual-copy p{font-size:16px}
 .ritual-film :is(img,video){object-position:57% 15%}
 .film-dialog .viewer-media{height:48svh}
 .viewer-caption{padding-bottom:30px}
 .viewer-actions{justify-content:flex-start;gap:12px}
 .viewer-actions a{margin-left:auto}
 .bag-item{grid-template-columns:56px minmax(0,1fr) auto;gap:12px}
 .quantity-controls{gap:12px}
 .quantity-controls button{min-width:44px;min-height:44px}
}
/* Keep the complete subject in shallow windows; source pixels aren't stretched. */
@media(min-aspect-ratio:2/1){
 .craft-film :is(img,video){object-position:left 70%}
 .ritual-film :is(img,video){object-position:55% 20%}
 .closing-camera img{object-fit:cover;object-position:60% 43%}
 .hero-copy{top:22%}
 .hero-copy .text-link{margin-top:20px}
}
@media(max-height:600px) and (min-aspect-ratio:1/1){
 .hero,.craft,.ritual{height:100svh;min-height:360px}
 .site-header{padding-top:6px;padding-bottom:6px}
 .site-header .brand{width:100px;flex-basis:100px}
 .theme-picker{bottom:10px;font-size:14px}
 .theme-picker .swatch{width:40px;height:40px}
 .hero h1{font-size:clamp(38px,9svh,54px)}
 .hero-copy{top:24%;max-width:55%}
 .hero-copy .text-link{margin-top:16px}
 .hero-endnote{bottom:26px}
 .eclipse-copy{top:22%;width:32%}
 .eclipse-copy h2,.craft-copy h2{font-size:clamp(28px,7.5svh,42px)}
 .eclipse-copy p,.craft-copy p,.ritual-copy p{font-size:14px;margin-top:12px}
 .eclipse-caption{padding-bottom:62px;font-size:14px}
 .craft-copy{width:30%}
 .craft-copy .text-link,.ritual-copy .text-link{margin-top:10px;font-size:14px}
 .ritual-copy{top:24%;bottom:auto;width:30%}
 .ritual-copy h2{font-size:clamp(32px,9svh,48px)}
 .closing-copy{top:24%;width:38%}
 .closing-copy h2{font-size:clamp(32px,9svh,48px)}
 .closing-support{font-size:14px;margin-top:12px}
 .closing-copy .text-link{margin-top:10px;font-size:14px}
 .video-play,.craft-film .video-play{bottom:70px;padding:10px 16px}
 .film-dialog .viewer-media{height:55svh}
}

/* The narrow closing uses the same photograph behind its copy, with no gutter. */
@media(max-width:700px){
 .closing-track{height:100svh;min-height:0}
 .closing-track .closing-scene{position:relative;top:0;height:100svh;min-height:0;padding:0}
 .closing-camera{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto}
 .closing-camera img{width:100%;height:100%;object-fit:cover;object-position:67% center}
 .closing-copy{position:absolute;inset:0;width:100%;height:100%;max-width:none;margin:0;padding:14svh var(--pad) 0;pointer-events:none}
 .closing-copy h2{max-width:11ch}
 .closing-copy .text-link{position:absolute;left:var(--pad);bottom:calc(var(--safe-bottom) + 66px);width:max-content;max-width:calc(100% - 2 * var(--pad));pointer-events:auto;white-space:nowrap}
 .closing-copy h2{font-size:clamp(30px,5.8vw,42px)}
 .closing-support{margin-top:16px;max-width:18ch;font-size:15px}
 .closing-copy .text-link{margin-top:14px;gap:6px;flex-wrap:wrap;font-size:15px;border-bottom:0}
 .closing-shade{display:block;background:linear-gradient(90deg,#10111185,transparent 80%)}
 .closing-track[data-tone=light] .closing-shade{background:linear-gradient(90deg,#f3eade88,transparent 80%)}
 .closing-status{position:absolute;left:var(--pad);bottom:90px;margin:0}
}
.closing-track.is-closing-settled{height:100svh;min-height:0}
.closing-track.is-closing-settled .closing-scene{height:100svh;min-height:0;padding:0}

.dialog-header button{white-space:nowrap}

.text-link :is([data-colour-name],[data-closing-name]){font-size:inherit}
