/* The ending of scene.html, the flying sheet (hill-fly.js; replaced hill.js on 2026-11-24). Loaded after
   hill.css, whose band, footer and still state it keeps. What changes: one still
   picture (.fly-pic) instead of the series of photographs, and the page's paper
   (.hill-leaf) is the flying sheet for the whole move, so it no longer fades out
   as the camera pulls back. hill-fly.js sets every transform and opacity. */

.fly-pic,.fly-patch,.fly-land,.fly-gl,.fly-cool,.fly-warm {display:none}

/* The picture, drawn at its resting size and only scaled a little by the breath: one image (the AI stand-in), or
   our render's layers stacked (sky, far clouds, near clouds, hill). The cloud bands are three frames wide and
   drift (hill-fly.js); the stage clips them. */
.hill-on .fly-pic {display:block;position:absolute;left:0;top:0;z-index:0;transform-origin:0 0;will-change:transform}
.fly-pic img {position:absolute;left:0;top:0;width:100%;height:100%;max-width:none;display:block}
.fly-band {position:absolute;inset:0}
.fly-dither {position:absolute;inset:0;background:url(assets/ending/dither.png);pointer-events:none}
.fly-pic .fly-copy {width:300%;transform:translate3d(-33.3333%,0,0);will-change:transform,opacity}
/* Ending A: the painted sheet, laid back over the empty desk from the desk up (--rise), so that its curled
   corner rises last. The patch is the original picture's own pixels; outside its box the two pictures match. */
.hill-on .fly-patch {display:block;position:absolute;left:0;top:0;z-index:0;max-width:none;transform-origin:0 0;opacity:0;will-change:transform,opacity;
  -webkit-mask-image:linear-gradient(0deg,#000 calc(var(--rise,0) * 140% - 40%),#0000 calc(var(--rise,0) * 140%));mask-image:linear-gradient(0deg,#000 calc(var(--rise,0) * 140% - 40%),#0000 calc(var(--rise,0) * 140%))}
/* The end of the flight, drawn in screen pixels (hill-fly.js, land()): the sheet, its contact shadow and its
   reflection in the desk. */
.hill-on .fly-land {display:block;position:absolute;left:0;top:0;z-index:2;pointer-events:none}
/* The drawn sheet (WebGL, hill-fly.js): from early in the flight the sheet bends, and is drawn here with its
   print and its shadow on the desk. Under the page's paper (z-index 1), which fades off it at the hand-over.
   Hidden at rest, so the band at rest is the page itself. */
.hill-on .fly-gl {display:block;position:absolute;left:0;top:0;z-index:1;pointer-events:none;visibility:hidden}
/* The sheet. A transparent ring of 3 px round the paper lets the browser draw
   its edge smooth when it is turned in space (the texture's own pixels are filtered). */
.hill-on .hill-leaf {box-sizing:content-box;padding:3px;background-clip:content-box;background-origin:content-box;opacity:var(--sheet-a,1)}
/* Its light: cool and a little dimmer while it turns its face from the low sun,
   then the warm light of the painted sheet as it lies down on the desk. */
.hill-on .fly-cool,.hill-on .fly-warm {display:block;position:absolute;inset:3px;opacity:0;will-change:opacity}
.hill-on .fly-cool {background:#b9c4dc}
.hill-on .fly-warm {background:linear-gradient(90deg,var(--warm-a,#efdada),var(--warm-b,#efdada) 55%,var(--warm-c,#efdada))}
/* The print leaves before the sheet lands (--print), and fades with it when it dissolves into the picture. */
.hill-on .hill-press {opacity:calc(var(--print,1) * var(--sheet-a,1) * (var(--toner) + (1 - var(--toner)) * var(--lift,1)))}
.hill-on .hill-grain {display:none}

/* The sky deepened behind the footer's text (Wave J, E 5): the sky's own deep blue over the upper half of the frame,
   32 % at the top, 24 % at a third, nothing at 52 %, like a graduated filter on the lens; wide and soft, so it is not seen as
   a shape. It makes every footer text at least 4.5 : 1 on round 16's paler sky.
   One sensor for all layers (photo-agreed.md, item 8): a vignette of -0.10 EV at the corners (black at 6.7 %, a
   multiply by 0.933), centred at (0.5, 0.56), fixed to the screen as a lens's falloff is. Above the picture and its
   painted sheet, under the flying sheet (z-index 1 and up), the footer and its text. Static: no cost per frame.
   Not while the band is the page (.flat), so the join is untouched. The still (no scripts, reduced motion) has the same. */
.fly-sensor {display:none}
.hill-on .fly-sensor {display:block;position:absolute;inset:0;z-index:0;pointer-events:none;
  background:linear-gradient(#061f5452,#061f543d 33%,#061f5400 52%),radial-gradient(ellipse farthest-corner at 50% 56%,#0000 0,#0000 32%,#00000002 50%,#00000005 68%,#0000000b 84%,#00000011 100%)}
.hill-on .hill.flat .fly-sensor {visibility:hidden}
/* Grain, for comparison only (?grain=1): static monochrome noise, about 1 code value RMS at device pixels. */
.hill-on .fly-sensor.fly-grain {background:url(assets/ending/grain.png) 0 0/calc(256px / var(--dpr,1)) auto,linear-gradient(#061f5452,#061f543d 33%,#061f5400 52%),radial-gradient(ellipse farthest-corner at 50% 56%,#0000 0,#0000 32%,#00000002 50%,#00000005 68%,#0000000b 84%,#00000011 100%)}
.sky-still::after {content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(#061f5452,#061f543d 33%,#061f5400 52%),radial-gradient(ellipse farthest-corner at 50% 56%,#0000 0,#0000 32%,#00000002 50%,#00000005 68%,#0000000b 84%,#00000011 100%)}

/* The film is held for the picture (hill-fly.js, hold()): the band's foot line breathes, slowly, so a visitor on a
   phone sees that something is coming (a desktop also gets the progress cursor). */
@keyframes fly-held {0%,100% {opacity:1} 50% {opacity:.3}}
.hill-on .hill.fly-held .hill-rig:last-child .hill-foot {animation:fly-held 1.6s ease-in-out infinite}
