/* TERESA ARC · PIER NINE, the sight on the foreman (2026-10-22, the author's three plates in
   assets/images/scenes/teresa/pier/, sources in src/): the CSS stand-in (two blue walls, a
   rectangle for a man) wears the pictures. Night, one dirty-yellow sodium lamp, the arc's steel.
     pier_1  the foreman in the aisle, the clipboard still in his hand  (scene 'foreman')
     pier_2  the foreman walking down the lane, the wounded man behind him getting a hand back
             onto a weapon nobody counted                               (scene 'cost')
     pier_3  the ground: the concrete close, the aisle sideways, her boots coming
   HOLD in the cost (.tzp-wounded): a small flash at the far end, the hit — white, the frame
   jerks left (the round comes in under the left arm), greys, blurs and goes over, and the cut
   to pier_3; the sound (a heavy blow, then a ring where the port was) is
   js/dialogue-scenes/scene-teresa-pier-art.js. Every layer in the picture's own pixels (the
   cover scale --s), as in teresa-guns-art.css. Loads after teresa-fight.css. */
#tzSight { container-type: size; background: #07090c; }
#tzSight > * { --s: max(calc(100cqw / 1920), calc(100cqh / 1080)); }
#tzSight .tzp-light, #tzSight .tzp-stack, #tzSight .tzp-ground, #tzSight .tzp-fore, #tzSight .tzp-man { display: none; }
#tzSight .tzp-sky {                      /* the plate */
  inset: 0; background: #07090c url('../assets/images/scenes/teresa/pier/pier_1.jpg') center / cover no-repeat;
  transform-origin: 50% 70%;
}
#tzSight.tzs-cost .tzp-sky { background-image: url('../assets/images/scenes/teresa/pier/pier_2.jpg'); }
#tzSight::before {                       /* the ground after the hit: the concrete close, flaring sodium */
  content: ''; position: absolute; inset: -4%; z-index: 1; pointer-events: none; opacity: 0;
  background: #07090c url('../assets/images/scenes/teresa/pier/pier_flare_ground.jpg') center / cover no-repeat;
}
#tzSight .tzk-sight { z-index: 2; left: calc(50% + (1184 - 960) * var(--s)); top: calc(50% + (522 - 540) * var(--s)); }   /* his chest */
#tzSight.tzs-cost .tzk-sight { left: calc(50% + (1290 - 960) * var(--s)); top: calc(50% + (674 - 540) * var(--s)); }    /* the man on the ground — the foreman in the line */
#tzSight .tzk-sight::before { left: calc(-5 * var(--s)); top: calc(-5 * var(--s)); width: calc(10 * var(--s)); height: calc(10 * var(--s)); box-shadow: none; }
#tzSight .tzk-sight::after {             /* our .38 from the first person, as in every scene of the arc */
  left: calc(-625 * var(--s)); top: calc(-59 * var(--s)); width: calc(1254 * var(--s)); height: calc(706 * var(--s));
  border-radius: 0; filter: none;
  background: url('../assets/images/scenes/teresa/guns/revolver_fp.webp') center top / 100% 100% no-repeat;
}
#tzSight .tzk-say, #tzSight .tzp-note, #tzSight .tzk-choices { z-index: 3; }
#tzSight .tzp-flash, #tzSight .tzp-hit { z-index: 2; }

/* ── the cost: HOLD, and the round comes in ── */
#tzSight .tzp-flash {                    /* his muzzle, far down the lane */
  position: absolute; pointer-events: none; opacity: 0; border-radius: 50%;
  left: calc(50% + (1300 - 960 - 40) * var(--s)); top: calc(50% + (664 - 540 - 40) * var(--s));
  width: calc(80 * var(--s)); height: calc(80 * var(--s));
  background: radial-gradient(circle, #fffbe8 0%, rgba(255, 236, 190, .8) 25%, transparent 70%);
}
#tzSight .tzp-hit {                      /* the hit is a flare: the aisle blown out in the port's sodium (the author's idea) */
  background: #07090c url('../assets/images/scenes/teresa/pier/pier_flare_aisle.jpg') center / cover no-repeat;
  transform-origin: 50% 70%;
}
#tzSight.tzp-wounded { animation: none; }
#tzSight.tzp-wounded .tzp-flash { animation: tzpMuzzle .16s ease-out forwards; }
#tzSight.tzp-wounded .tzp-hit { animation: tzpFlare 1.7s cubic-bezier(.5, 0, .8, .4) .12s forwards; }
#tzSight.tzp-wounded .tzk-sight { animation: tzpGunDrop .9s ease-in .12s forwards; }
#tzSight.tzp-wounded::before { animation: tzpGround 1.6s ease-out 1.4s forwards; }
#tzSight.tzp-wounded .tzk-say, #tzSight.tzp-wounded .tzp-note { opacity: 0; transition: opacity .3s ease .1s; }
@keyframes tzpMuzzle { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tzpFlare {
  0%   { opacity: 1; transform: none; filter: brightness(2.6) contrast(.8); }
  10%  { opacity: 1; transform: translateX(calc(-46 * var(--s))) rotate(-2deg) scale(1.04); filter: brightness(1.7); }
  45%  { opacity: 1; transform: translateX(calc(-20 * var(--s))) rotate(4deg) scale(1.1); filter: brightness(1.2) blur(2px); }
  85%  { opacity: .8; }
  100% { opacity: 0; transform: translateY(calc(260 * var(--s))) rotate(24deg) scale(1.3); filter: brightness(.35) blur(9px); }
}
@keyframes tzpGunDrop { 0% { transform: none; opacity: 1; } 100% { transform: translate(calc(-120 * var(--s)), calc(700 * var(--s))) rotate(-30deg); opacity: 0; } }
@keyframes tzpGround {
  0%   { opacity: 0; filter: brightness(2.2) blur(8px); }
  100% { opacity: 1; filter: brightness(1) blur(0); }
}


/* her and the foreman, under the strip (scene 'pierHer') */
#tzPierHer {
  position: fixed; inset: 0; z-index: 1000030; pointer-events: none; opacity: 0; transition: opacity .9s ease;
  background: #07090c url('../assets/images/scenes/teresa/pier/pier_her.jpg') center / cover no-repeat;
  animation: tphPush 30s linear forwards;
}
#tzPierHer.tph-in { opacity: 1; }
@keyframes tphPush { from { transform: scale(1); } to { transform: scale(1.06); } }

/* the run's stage: the plate under the strip, crossfading (break tz-pier) */
#tzPierStage { position: fixed; inset: 0; z-index: 1000030; pointer-events: none; background: #07090c; opacity: 0; transition: opacity .8s ease; }
#tzPierStage.tps-in { opacity: 1; }
#tzPierStage .tps-plate { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; transition: opacity .9s ease; }
#tzPierStage .tps-plate.tps-on { opacity: 1; }
