/* The bone film that opens the start page (lab/wow, approved by Himan 2026-11-22): a scroll-driven WebGL shot of a
   scanned femur, the simulator's nail and lag screw, and a live fluoroscopy from the simulator's CT. film/boot.js sets
   html.film when the browser has WebGL2 and the visitor has not asked for reduced motion. Without it (or if the film
   fails to start) the same captions are a plain, static opening. Tokens and fonts come from assets/a.css. */

/* static opening (no film) */
.story{padding:56px 0 64px}
.story .pin{max-width:1240px;margin:0 auto;padding-left:max(24px,env(safe-area-inset-left,0px));padding-right:max(24px,env(safe-area-inset-right,0px));display:grid;grid-template-columns:1fr 1fr;gap:28px 48px}
.story canvas,.story .xr-flash,.story .hud,.story .prog{display:none}
.fc{margin:0;min-width:0}
.fc.c0{grid-column:1/-1;margin-bottom:16px}
.fc h1{font-size:clamp(34px,4.2vw,54px);line-height:1.06;letter-spacing:-.025em;max-width:none;margin-bottom:22px}
.fc h1 span,.fc h1 i{display:block;font-style:normal}
.fc h2{font-size:22px;margin-bottom:6px}
.fc p{color:var(--ink-2);max-width:40ch}
.fc .lead{font-size:18px;margin-bottom:30px}
html:not(.film) .fc,html:not(.film) .fc h1 i{opacity:1!important;transform:none!important}
/* static opening on wide screens: the film's own last-but-one frame (the nail and lag screw in the glass femur,
   rendered from this page at ?seek=0.66) beside the captions; img/film-still.jpg only loads when the film is off */
@media (min-width:1000px){
  html:not(.film) .story{position:relative;background:#07080a;overflow:hidden}
  html:not(.film) .story::before{content:"";position:absolute;right:max(0px,calc(50% - 640px));bottom:0;height:min(100%,780px);aspect-ratio:1000/1508;background:url(../img/film-still.jpg) center bottom/cover no-repeat;-webkit-mask-image:radial-gradient(closest-side,#000 72%,transparent);mask-image:radial-gradient(closest-side,#000 72%,transparent)}
  html:not(.film) .story::after{content:"";position:absolute;left:0;right:0;bottom:0;height:200px;background:linear-gradient(rgba(7,8,10,0),#07080a 45%,var(--bg));pointer-events:none}
  html:not(.film) .story .pin{position:relative;z-index:1;grid-template-columns:repeat(2,minmax(0,290px)) 1fr;padding-bottom:40px}
  html:not(.film) .fc.c0{grid-column:1/3}
  html:not(.film) .fc.c1,html:not(.film) .fc.c3{grid-column:1}
  html:not(.film) .fc.c2,html:not(.film) .fc.c4{grid-column:2}
}
/* narrower screens: the same frame above the headline, as the film itself is framed on phones */
@media (max-width:999px){
  html:not(.film) .story{background:linear-gradient(#07080a calc(100% - 120px),var(--bg));padding-top:8px}
  html:not(.film) .story::before{content:"";display:block;width:min(62vw,300px);aspect-ratio:1000/1508;margin:0 auto 8px;background:url(../img/film-still.jpg) center/cover no-repeat;-webkit-mask-image:radial-gradient(closest-side,#000 72%,transparent);mask-image:radial-gradient(closest-side,#000 72%,transparent)}
}

/* the film */
.film .story{height:1700vh;margin-top:-65px;padding:0 0 120px;background:linear-gradient(#000 calc(100% - 120px),var(--bg));position:relative} /* starts under the sticky header; the pin stops 120px early and the film's last frame (the fluoroscopy, on black) fades into the page */
.film .story .pin{position:sticky;top:0;height:100vh;height:100svh;overflow:hidden;display:block;max-width:none;padding:0;background:#060708}
.film .story canvas{display:block;position:absolute;inset:0;width:100%;height:100%;z-index:0}
.film .story .xr-flash{display:block;position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none;z-index:1}
.film .fc{position:absolute;left:clamp(24px,6vw,96px);top:50%;width:min(520px,40vw);transform:translateY(-50%);opacity:0;will-change:opacity,transform;z-index:2}
.film .fc h1{font:500 clamp(40px,5.2vw,84px)/1.0 var(--head);letter-spacing:-.035em;margin:0 0 28px}
.film .fc h1 span{overflow:hidden;padding-bottom:.06em;margin-bottom:-.06em}
.film .fc h1 span i{will-change:transform}
/* the opening headline rises in on first paint, before the 3D code has arrived (hero.js only fades it out on scroll) */
.film .fc.c0{opacity:1}
.film .c0 h1 span i{animation:fc-rise 1s cubic-bezier(.2,.7,.2,1) .3s both}
.film .c0 h1 span:nth-child(2) i{animation-delay:.44s}
.film .c0 h1 span:nth-child(3) i{animation-delay:.58s}
.film .c0 .lead{animation:fc-in .8s ease 1.1s both}
.film .c0 .acts{animation:fc-in .8s ease 1.24s both}
@keyframes fc-rise{from{transform:translateY(105%)}to{transform:none}}
@keyframes fc-in{from{opacity:0}to{opacity:1}}
/* the canvas fades in on its first frame (hero.js adds .on to the pin) */
.film .story canvas{opacity:0;transition:opacity 1.2s ease}
.film .story .pin.on canvas{opacity:1}
.film .fc h2{font:500 clamp(30px,3.4vw,54px)/1.04 var(--head);letter-spacing:-.03em;margin:0 0 16px}
.film .fc p{font-size:18px;max-width:34ch}
.film .fc .lead{margin:0 0 30px;max-width:36ch}
.film .story .hud{display:flex;position:absolute;right:clamp(24px,4vw,64px);bottom:40px;gap:18px;font:500 13px/1 var(--mono);letter-spacing:.08em;color:var(--ink-2);opacity:0;z-index:2}
.film .story .prog{display:block;position:absolute;left:clamp(24px,6vw,96px);bottom:40px;width:120px;height:1px;background:var(--line);z-index:2}
.film .prog i{position:absolute;left:0;top:0;bottom:0;background:var(--ink);width:0}
/* the header lies over the film as a dark fade, and turns solid again as the film scrolls away (hero.js) */
.film .top{background:linear-gradient(rgba(6,7,8,.82),rgba(6,7,8,0));border-bottom-color:transparent}
.film.past .top{background:var(--bg);border-bottom-color:var(--line)}

@media (max-width:900px){
  .story .pin{grid-template-columns:1fr;padding-left:max(18px,env(safe-area-inset-left,0px));padding-right:max(18px,env(safe-area-inset-right,0px))}
}
@media (max-width:820px){
  .film .story .pin::before{content:"";position:absolute;left:0;right:0;bottom:0;height:52%;background:linear-gradient(to bottom,rgba(6,7,8,0),rgba(6,7,8,.82) 45%,rgba(6,7,8,.9));pointer-events:none;z-index:1}
  .film .fc{left:18px;right:18px;width:auto;top:auto;bottom:72px;transform:none}
  .film .fc h1{font-size:36px}.film .fc .lead{display:none}.film .fc h2{font-size:30px}.film .fc p{font-size:16px}
}
