/* css/scenes/projector.css · scene 3 `projector`: the photos (SPEC 2.3, 5.3) · prefix proj-
   The wall sits between the string lights and the dock. projector.js measures the dock, seats every frame
   on one baseline above a beam of constant length, and fades frames, beam and lens (opacity only).
   Keystone, vignette, sepia and glows are static. */
.scene--projector{
  --proj-top:calc(var(--chrome-h) + var(--sp-7));                 /* clears the string lights on phones */
  --proj-keystone:perspective(900px) rotateX(3deg);               /* the 3° keystone, hinged on the baseline */
  --proj-glow:0 0 var(--sp-7) rgba(var(--rgb-tungsten), .16), 0 0 0 1px rgba(var(--rgb-wick), .06);
  /* the lamp's warm falloff, multiplied onto the slide like the style tile's: tungsten over midnight composites to a
     warm brown, so the edges lose blue before red (about 74 % / 64 % / 53 % of R / G / B at the corners) */
  --proj-vignette:radial-gradient(ellipse at center, transparent 55%, rgba(var(--rgb-tungsten), .35) 100%),
    radial-gradient(ellipse at center, transparent 55%, rgba(var(--rgb-midnight), .42) 100%);
  --proj-falloff:radial-gradient(ellipse at center, transparent 55%, rgba(var(--rgb-midnight), .35) 100%); /* plain blend, for light on the wall */
  --proj-black:linear-gradient(rgba(var(--rgb-wick), .045), rgba(var(--rgb-wick), .045)), var(--c-midnight); /* the projector's black level */
  --proj-sepia:sepia(.03);
}
@media (min-width:760px){ .scene--projector{--proj-top:calc(var(--chrome-h) + var(--sp-8) + var(--sp-3))} }
@media (orientation:landscape) and (max-height:500px){ .scene--projector{--proj-top:calc(var(--chrome-h) + var(--sp-8))} }

.proj-wall{position:absolute;top:calc(env(safe-area-inset-top) + var(--proj-top));bottom:var(--proj-dock, var(--dock-h));
  left:calc(var(--gutter) + env(safe-area-inset-left));right:var(--proj-side, calc(var(--gutter) + env(safe-area-inset-right)))}

/* ---- the projected frames (the light on the wall) ---- */
/* a photo frame is opaque (the projector's black level, seen where a photo beyond 21:9 or 9:16 letterboxes),
   so the vignette can multiply onto it; the title frame is translucent light and falls off in a plain blend */
.proj-frame{position:absolute;left:0;top:0;width:100%;height:50%;opacity:0;overflow:hidden;border-radius:var(--r-paper);
  background:var(--proj-black);box-shadow:var(--proj-glow);transform:var(--proj-keystone);transform-origin:50% 100%}
.proj-frame::after{content:"";position:absolute;inset:0;background:var(--proj-vignette);mix-blend-mode:multiply;pointer-events:none}
.proj-frame--title::after{background:var(--proj-falloff);mix-blend-mode:normal}
.proj-photo{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:contain;filter:var(--proj-sepia)}

/* slide 0: STARRING, her portrait (≤ 56 % of the frame), her name, like an opening credit. It is light on the wall,
   no mat and no ring: the lamp's warm hot spot behind the portrait, falling off to tungsten at the edges, and its
   edge is only the glow it throws on the wall. Its words are part of the projection, so STARRING is light too
   (Smoke would drop under 4.5:1 on the lit field) */
.proj-frame--title{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--sp-3);
  padding:var(--sp-5) var(--sp-5);text-align:center;
  background:radial-gradient(ellipse 72% 66% at 50% 46%, rgba(var(--rgb-wick), .32), rgba(var(--rgb-wick), .2) 45%, rgba(var(--rgb-tungsten), .15) 80%, rgba(var(--rgb-tungsten), .13) 100%);
  box-shadow:0 0 var(--sp-7) rgba(var(--rgb-tungsten), .24)}
.proj-frame--title .proj-star{color:var(--c-wick)}
.proj-portrait{flex:0 1 auto;min-height:0;width:auto;height:auto;max-width:78%;max-height:56%;object-fit:contain;filter:var(--proj-sepia)}
.proj-name{max-width:100%;font:700 var(--step-2)/1.12 var(--font-script);letter-spacing:var(--track-caps);text-transform:uppercase;
  color:var(--c-wick);text-align:center;text-wrap:balance;overflow-wrap:anywhere}
.proj-frame--bare .proj-name{font-size:var(--step-3)}   /* no portrait: the name is the picture */

/* the projection is a gesture surface (tap, swipe), never a control of its own */
.proj-hit{position:absolute;left:0;top:0;width:100%;height:50%;pointer-events:auto;cursor:pointer;touch-action:pan-y pinch-zoom;
  -webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}

/* ---- the beam: from the frame's lower edge down to the lens; shape set per slide, only opacity changes ---- */
.proj-beam{position:absolute;left:0;right:0;top:60%;height:var(--sp-8);opacity:0;pointer-events:none;
  clip-path:polygon(0 0, 100% 0, 52% 100%, 48% 100%);
  background:linear-gradient(to top, rgba(var(--rgb-wick), .17), rgba(var(--rgb-tungsten), .075) 45%, rgba(var(--rgb-tungsten), .035))}

/* ---- the projector, seen from behind (literal colours in the SVG are its metal and plastic) ---- */
.proj-machine{position:absolute;left:50%;top:80%;width:var(--sp-8);height:auto;overflow:visible;transform:translateX(-50%);pointer-events:none}
.proj-lens{opacity:0}
.proj-s-core{stop-color:var(--c-wick);stop-opacity:.95}
.proj-s-hot{stop-color:var(--c-tungsten);stop-opacity:.6}
.proj-s-warm{stop-color:var(--c-tungsten);stop-opacity:.15}
.proj-s-off{stop-color:var(--c-tungsten);stop-opacity:0}
.proj-glass{fill:var(--c-wick)}
.proj-rim{fill:none;stroke:rgba(var(--rgb-tungsten), .5)}
.proj-pilot{fill:var(--c-tungsten)}

/* ---- the dock: a caption steps down one size before it wraps past three lines (never cut) ---- */
.scene-ui--projector .proj-caption{width:100%}
.scene-ui--projector .proj-caption.proj-caption--step{font-size:var(--step-0)}

/* the controls: a grid whose tracks projector.js fixes for the whole visit (--proj-cols / --proj-rows), so the tape
   keeps its exact place on every slide and Back and Skip keep their room while they are hidden */
.scene-ui--projector .proj-row{display:grid;width:100%;max-width:none;grid-template-columns:var(--proj-cols, 1fr auto 1fr);
  grid-template-rows:var(--proj-rows, auto);gap:var(--sp-2) var(--sp-4);align-items:center;justify-items:center}
.scene-ui--projector .proj-row > .tape{grid-area:1 / 2}
.scene-ui--projector .proj-aside{grid-area:1 / 3;justify-self:start;display:flex;align-items:center;gap:var(--sp-2) var(--sp-4)}
.scene-ui--projector .proj-row--under > .tape{grid-area:1 / 1 / 2 / 4}
.scene-ui--projector .proj-row--under .proj-aside{grid-area:2 / 1 / 3 / 4;justify-self:center;flex-wrap:wrap;justify-content:center}
.scene-ui--projector .proj-row--measure{display:flex;flex-wrap:wrap;justify-content:center}
