/* =====================================================================================
   phone-flight.css · own file (2 Nov 2026). The light flight for phones (html.gl.lite).
   Phones now fly through the worlds like the desktop does, with moving photos instead of 3D.
   Also: the still page (?static or a failure) gets a gentle fade and zoom as each world scrolls in.
   ===================================================================================== */

/* the stage: fixed behind the words, the same place the 3D canvas uses on desktop */
html.lite #gl{display:none}
.pf{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none;background:var(--space);contain:strict}
.pf__sky{position:absolute;inset:0;background:var(--space) url(../assets/img/space-1280.webp) center/cover no-repeat;filter:saturate(.9) brightness(.85);
  will-change:transform,opacity;transform-origin:50% 42%;backface-visibility:hidden}
/* each world: one photo, sized and placed by phone-flight.js so it always covers the whole screen */
.pf__w{position:absolute;z-index:3;visibility:hidden;opacity:0;backface-visibility:hidden;contain:layout paint}
.pf__w img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;opacity:0;visibility:hidden;user-select:none;-webkit-user-select:none}
.pf__w i{position:absolute;inset:-1px;opacity:0;visibility:hidden;pointer-events:none}
/* arriving: the soft copy has cloudy edges that melt into the stars; the plain copy takes over once the photo fills the screen */
.pf__soft{-webkit-mask-image:radial-gradient(farthest-side at 50% 46%,#000 52%,rgba(0,0,0,.6) 72%,rgba(0,0,0,0) 100%);
  mask-image:radial-gradient(farthest-side at 50% 46%,#000 52%,rgba(0,0,0,.6) 72%,rgba(0,0,0,0) 100%)}
/* the last world sinks: a third copy whose top edge melts into the stars (a see-through fade, never a dark band or a hard line) */
.pf__sink{-webkit-mask-image:linear-gradient(rgba(0,0,0,0) 0%,rgba(0,0,0,.35) 12%,rgba(0,0,0,.8) 26%,#000 40%);
  mask-image:linear-gradient(rgba(0,0,0,0) 0%,rgba(0,0,0,.35) 12%,rgba(0,0,0,.8) 26%,#000 40%)}
/* leaving: the edges burn away first with a warm gold rim, centred on Bryan's face ... */
.pf__burn,.pf__ember{position:absolute;inset:0;z-index:4;opacity:0;visibility:hidden;pointer-events:none}
.pf__burn{background:radial-gradient(circle at var(--bx,50%) var(--by,35%),rgba(7,7,15,0) 0,rgba(7,7,15,0) 30vmax,rgba(255,206,140,.32) 36vmax,rgba(150,86,46,.55) 42vmax,rgba(7,7,15,.97) 56vmax)}
/* ... then the middle goes, leaving a soft warm glow that melts into the stars */
.pf__ember{background:radial-gradient(circle at var(--bx,50%) var(--by,35%),rgba(150,96,60,.96) 0,rgba(60,36,30,.98) 26vmax,#07070f 60vmax)}

/* the hero words show before any script has run */
html.lite .stop--hero .ov{opacity:var(--o,1)}
/* the stage paints its own space; the page background behind it is not needed */
html.pf-on body::before{display:none}

/* ---------- still page: a gentle fade and zoom as each picture and block scrolls in ---------- */
@media (prefers-reduced-motion:no-preference){
 @supports (animation-timeline:view()){
  /* the frame clips its picture (overflow hidden), so the timeline is taken from the frame, not the picture */
  html.static .stop--world .still{view-timeline:--pfst block}
  html.static .stop--world .still img{animation:pfStill linear both;animation-timeline:--pfst;animation-range:entry 0% cover 55%;will-change:transform}
  html.static .stop:not(.stop--hero) .block{animation:pfRise linear both;animation-timeline:view();animation-range:entry 0% entry 70%}
 }
 /* phones without scroll-driven animation: main.js sets --pv (0..1) on each picture instead */
 html.static.pv .stop--world .still img{transform:scale(calc(1.12 - .12 * var(--pv,1)));opacity:calc(.3 + .7 * var(--pv,1))}
}
@keyframes pfStill{from{transform:scale(1.12);opacity:.3}to{transform:scale(1);opacity:1}}
@keyframes pfRise{from{opacity:0;transform:translate3d(0,24px,0)}to{opacity:1;transform:none}}

/* Hero v19 (Bryan): deeper sky and warmer, darker burn between worlds on phones. The sky uses the re-graded picture
   (space-1280-deep.webp; the original is untouched). The burn ring is burnished gold and clay, never pale cream. */
.pf__sky{background-image:url(../assets/img/space-1280-deep.webp);filter:saturate(1.08) contrast(1.06)}
.pf__burn{background:radial-gradient(circle at var(--bx,50%) var(--by,35%),rgba(7,7,15,0) 0,rgba(7,7,15,0) 30vmax,rgba(var(--gold-lit-rgb),.2) 36vmax,rgba(154,102,80,.5) 42vmax,rgba(7,7,15,.97) 56vmax)}
.pf__ember{background:radial-gradient(circle at var(--bx,50%) var(--by,35%),rgba(125,101,56,.9) 0,rgba(23,52,49,.96) 26vmax,#07070f 60vmax)}

/* Round v20: the Creation Density world on phones. Its own star field with four deep clouds in palette tints (indigo, teal,
   gold) screened onto it, with a darker middle so the words stay easy to read. JS sets its opacity and a slow scale and turn. */
.pf__dens{position:absolute;inset:-12%;z-index:2;opacity:0;visibility:hidden;pointer-events:none;isolation:isolate;background:var(--space) url(../assets/img/space-1280-deep.webp) center/cover no-repeat}
.pf__dens i{position:absolute;background:center/contain no-repeat;opacity:1;mix-blend-mode:screen}
.pf__dens i:nth-child(1){left:-30%;top:-8%;width:95%;height:70%;background-image:url(../assets/img/neb-pine-density.webp)}
.pf__dens i:nth-child(2){right:-30%;top:4%;width:95%;height:66%;background-image:url(../assets/img/neb-jade-density.webp)}
.pf__dens i:nth-child(3){left:-12%;bottom:-6%;width:100%;height:62%;background-image:url(../assets/img/neb-gold-vivid.webp);opacity:.6}
.pf__dens i:nth-child(4){right:-24%;bottom:6%;width:90%;height:58%;background-image:url(../assets/img/neb-jade-density.webp);transform:rotate(160deg)}
/* Round v21 density-green: deeper teal-green clouds (neb-pine/jade-density.webp), gold kept as a quieter accent */
.pf__dens::after{content:"";position:absolute;inset:0;background:radial-gradient(ellipse 46% 40% at 50% 50%,rgba(7,7,15,.45),rgba(7,7,15,0))}
/* shooting stars and lake shimmer, over the photo and under the burn */
.pf__fx{position:absolute;inset:0;width:100%;height:100%;z-index:4;pointer-events:none}


/* mobile-scroll-v24: cheaper phone paint while scrolling (transform/opacity only where we can) */
.pf__sky{filter:saturate(.95) brightness(.88);contain:strict}
.pf__dens{contain:strict}
.pf__fx{contain:strict}
html.lite .ov{will-change:opacity}


/* mobile-scroll-v24b: drop two density blend layers on small phones (mix-blend was the density jank) */
@media (max-width:760px){
  .pf__dens i:nth-child(3),.pf__dens i:nth-child(4){display:none}
  .pf__sky{filter:none;background-color:var(--space)}
}
