/* Option 13, the finale (finale.js): after the film the costume, standing round the empty stage, breaks
   into smoke where it stands; the smoke settles and what remains on the black is the studio's credit.

   The credit is the one The King Crab and The Monarch end on (lab/kingcrab/crab.css #end): "A" and
   "Production" in Cormorant Garamond italic, the studio's lettering between them in cream, the same
   sizes, gaps and timing. Nothing else stands under it: the legal links come with the studio's header
   at publication. */
@font-face { font-family: "Cormorant Garamond"; font-weight: 400 600; font-style: italic; src: url("./fonts/cormorant-garamond-italic.woff2") format("woff2"); font-display: swap; }

/* 100svh of stage plus FINALE.travel (0.4) window heights of scroll: keep in step with finale.js */
.finale{position:relative;z-index:3;width:100%}
.js .finale{height:140svh}
/* The footer comes up over the film block while the film still stands (the block stays pinned until the vanish,
   fan-stage.css), so the footer takes no pointer events of its own: nothing of ours stands in front of the player
   (pass 2, 8 October 2026; before, it took the player's clicks and taps for a third of a window before the vanish).
   The credit takes them once it stands (finale.js sets .on). tools/review-player-front.mjs checks it. */
.js .finale{pointer-events:none}
.js #end.on{pointer-events:auto}
.end-credit{position:sticky;top:0;height:100svh;display:grid;place-items:center;overflow:hidden;color:#efe6d3;font-size:16px}
#end p{margin:0;display:flex;flex-direction:column;align-items:center;gap:.15em;text-align:center}
#end .before,#end .after{font-family:"Cormorant Garamond",Georgia,serif;font-style:italic;font-weight:400;font-size:clamp(1.9rem,min(3.6vw,5.76vh),5.4rem);line-height:1;letter-spacing:.01em;color:rgba(239,230,211,.88)}
/* The link is the lettering's box; the lettering is drawn by the span inside it (a mask clips its own
   element's outline, so the focus ring stands on the link, outside the mask). */
#end .name{position:relative;display:block;width:min(60vw,max(720px,66.7vh));aspect-ratio:2090/522;margin:.1em 0 .05em}
#end .name .mark{position:absolute;inset:0;background:#efe6d3;transition:background .4s;-webkit-mask:url("assets/salt-to-taste.svg") center/contain no-repeat;mask:url("assets/salt-to-taste.svg") center/contain no-repeat}
#end .name:hover .mark,#end .name:focus-visible .mark{background:#fff8ea}
#end .name:focus{outline:none}
#end .name:focus-visible{outline:1px solid #d5bd91;outline-offset:4px}
/* it comes up as the smoke thins (finale.js sets .on), in the end cards' order and pace; it goes quickly
   (0.2 s: scrolling back, its stage is no longer pinned and moves down with the page, and a dimmed credit
   should not slide through the gathering smoke) */
#end .credit>*{opacity:0;transform:translateY(8px);transition:opacity .2s ease,transform .2s ease}
#end.on .credit>*{opacity:1;transform:none;transition:opacity 1.6s ease,transform 2s cubic-bezier(.2,.7,.2,1)}
#end.on .before{transition-delay:.4s}
#end.on .name{transition-delay:.9s}
#end.on .after{transition-delay:1.5s}
#end.instant .credit>*{transition:none}
/* (scoped to .js: without JavaScript nothing turns the credit on, and its link must still work) */
.js #end:not(.on){pointer-events:none}

/* Once vanished (its picture is the smoke engine's now), the cloth and the dim robe behind it are gone
   (wardrobe.js shows and hides its layers inline, hence !important). Without WebGL2 it fades out. */
.performer-world[data-finale="gone"] .wardrobe-front,.performer-world[data-finale="gone"] .wardrobe-backdrop{visibility:hidden!important}
.performer-world[data-finale="faded"] .wardrobe-front,.performer-world[data-finale="faded"] .wardrobe-backdrop{opacity:0;transition:opacity .8s ease}

/* Still versions (no JavaScript, reduced motion): the credit screen simply follows the film, black and
   opaque over the costume. */
html:not(.js) .end-credit{position:relative;background:#030303}
html:not(.js) #end .credit>*{opacity:1;transform:none;transition:none}
@media(prefers-reduced-motion:reduce){
 .js .finale{height:auto}
 .end-credit{position:relative;background:#030303}
 #end .credit>*{transition:none!important}
}
/* Without JavaScript the page's note ("Enable JavaScript to change masks. You can still explore the
   story below.") belongs to the opening: it stands at the foot of the first screen and scrolls away,
   instead of lying fixed over every screen and under the credit. */
.noscript-note{position:absolute;top:100svh;bottom:auto;transform:translateY(-100%)}

/* The film goes in smoke (finale.js, FILM): a loaded player first fades onto the block's own cover (its
   pixels cannot be read, and nothing is drawn over it while it plays), then the block is the smoke engine's
   picture and is only transparent here (never hidden: the keyboard still reaches Load film and the consent
   link, and a focus there brings the film back). */
.performance-film[data-film] #video-shell iframe{opacity:0;transition:opacity .3s ease}
.reveal-window>.performance-film[data-film="smoke"],.reveal-window>.performance-film[data-film="gone"]{opacity:0!important}
