/* The homepage film (film-hero.js). While html.film is set the top of the page is only the film:
   the header is hidden (and inert), the hero's contents are transparent and the chapter rail (or menu) waits
   until the film is scrolled away. The released edition reserves a dock for the homepage links
   and the film controls at the bottom of the first screen. */
.film .site-header{visibility:hidden}
.film .hero :is(.h1-lead,.flesh,.lede,.hero-claim,.actions:not(.hero-actions)>*,.film-replay,.hero-meta,.hero-description,.host-card,.specimen){opacity:0}
.film:not(.film-away) :is(.rail,.mobile-guide,.motion-toggle){opacity:0;visibility:hidden}
/* The first paint, before the script has put the film in place. */
.film:not(.film-staged) .hero::before{content:"";position:absolute;inset:0 0 auto;height:min(100%,100svh);z-index:-1;background:var(--ground)}

/* The film's parts are the hero's own children, so they interleave with its layers: the ground under
   everything, the video and its grain over the specimen, the lifted words over the video. */
.film-part{position:absolute;left:0;top:0;pointer-events:none}
.film-ground,.film-grain{width:100%;height:min(100%,100svh)}
.film-ground{z-index:-1;background:var(--ground);-webkit-mask:linear-gradient(#000 calc(100% - 72px),#0000);mask:linear-gradient(#000 calc(100% - 72px),#0000)}
.film-video{z-index:4;display:block;object-fit:fill;transform-origin:0 0;
  /* The picture already fades to the ground at its edge; the mask makes that edge vanish on any ground. */
  -webkit-mask:linear-gradient(90deg,#0000,#000 5%,#000 95%,#0000),linear-gradient(#0000,#000 5%,#000 95%,#0000);-webkit-mask-composite:source-in;
  mask:linear-gradient(90deg,#0000,#000 5%,#000 95%,#0000) intersect,linear-gradient(#0000,#000 5%,#000 95%,#0000)}
.film-grain{z-index:4;background:url('/art/grain.png');opacity:.05;animation:film-grain .6s steps(5) infinite}
@keyframes film-grain{to{background-position:173px 291px}}
.film-word{z-index:5;margin:0;font-family:OphioBook,serif;font-style:italic;font-weight:400;line-height:1.15;color:var(--signal);white-space:nowrap;transform-origin:0 0;opacity:0}
.film-rule{position:absolute;left:0;right:0;bottom:-1px;height:1px;background:#eee6dc29;transform-origin:0 0;transform:scaleX(0);visibility:visible}

/* Bottom right of the film: Skip, then the sound notice. */
.film-controls{z-index:6;left:auto;right:max(14px,2.2%);top:min(100%,100svh);translate:0 calc(-100% - max(14px,1.6vh));display:flex;align-items:center;justify-content:flex-end;gap:8px;max-width:calc(100% - 28px);pointer-events:auto}
.film-away .film-controls{visibility:hidden;opacity:0}
.film-controls button{display:inline-flex;align-items:center;gap:9px;min-height:40px;margin:0;padding:9px 13px;border:1px solid var(--edge);background:#0a0605d9;color:#d9c6e3;font:12px/1.25 OphioMono,monospace;letter-spacing:.06em;text-transform:uppercase;text-align:left}
.film-controls button:hover{border-color:#a47cbe;color:var(--ivory)}
.film-sound i{flex:none;width:6px;height:6px;border-radius:50%;background:var(--signal);box-shadow:0 0 12px #c3ff24aa}
.film-sound svg{flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.film-sound[aria-pressed="true"] .off,.film-sound:not([aria-pressed="true"]) .on{display:none}
/* "Watch the film" sits under the hero text without taking any room, so the hero keeps today's layout. */
.film-replay{position:absolute;left:0;top:100%;margin:calc(6*var(--u,1px)) 0 0;padding-block:calc(6*var(--u,1px));border-width:0 0 1px;background:none;color:inherit;font-family:inherit;text-align:left;white-space:nowrap}
@media(max-width:760px){.film-controls{right:12px;max-width:calc(100% - 24px);gap:6px}.film-controls button{padding:8px 10px;letter-spacing:.04em}}
@media(prefers-reduced-motion:reduce){.film-grain{animation:none}}
/* The headline sits over the picture, so "host." comes in cleanly as "in." goes. */
.film .hero-copy{z-index:5}

/* Dock both sets of controls below the picture. On narrower screens the film controls
   sit above the links. The consent prompt's actual measured height clears the whole dock. */
.film .hero--released{
  --film-gap:clamp(10px,1.65svh,16px);
  --film-action-height:max(52px,54 * var(--u));
  --film-control-height:40px;
  --film-visit-space:0px;
  --film-usable:calc(100svh - var(--film-visit-space));
  --film-dock-bottom:calc(var(--film-usable) - var(--film-gap));
  --film-dock-height:max(var(--film-action-height),var(--film-control-height));
  --film-picture:calc(var(--film-dock-bottom) - var(--film-dock-height) - var(--film-gap));
  min-height:100svh;
}
.film.visit-asking .hero--released{--film-visit-space:var(--visit-space,0px)}
.film .hero--released :is(.film-ground,.film-grain){height:max(1px,var(--film-picture))}
.film .hero--released .hero-copy{position:static}
.film .hero--released .hero-copy::after{content:"";display:block;height:calc(var(--hero-action-gap) + var(--film-action-height))}
.film .hero--released h1{position:relative;z-index:5}
.film .hero--released .hero-actions{
  position:absolute;z-index:6;left:var(--hero-gutter);top:calc(var(--film-dock-bottom) - var(--hero-action-gap));
  max-width:calc(100% - 2 * var(--hero-gutter));translate:0 -100%;
}
.film .hero--released .film-controls{top:var(--film-dock-bottom);translate:0 -100%;transform:none}
@media(max-width:920px){
  .film .hero--released{--film-dock-height:calc(var(--film-action-height) + var(--film-gap) + var(--film-control-height))}
  .film .hero--released .film-controls{top:calc(var(--film-dock-bottom) - var(--film-action-height) - var(--film-gap))}
}
/* A short landscape window can spend its width on a shared dock instead of two rows. */
@media(min-width:650px) and (max-width:920px) and (max-height:500px){
  .film .hero--released{--film-dock-height:max(var(--film-action-height),var(--film-control-height))}
  .film .hero--released .film-controls{top:var(--film-dock-bottom);max-width:calc(100% - 465px)}
}
