/* R36S 'Up close' build animation, copied unchanged from variants/final/product-stage.css (lines 366-438 at fee3c25).
   Needs /final/home-lower.css (.pp-screen) and /final/home-closeup.css (.pp-film). Driven by PV.build(section). */
.ps-build { --sq: min(720px, 80vw, max(300px, calc(100svh - 220px))); }
.ps-build .ps-build__fig { width: min(1100px, 92vw); display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--sq) * .6) minmax(0, 1fr); column-gap: 16px; }
.ps-build .pp-film__fig > .pp-film__cap--m { grid-column: 1 / -1; }
.ps-build .ps-build__pic { grid-column: 2; grid-row: 2; width: var(--sq); aspect-ratio: 1; margin-inline: calc(var(--sq) * -.2); overflow: hidden;
  background: #101114;   /* the render's own studio colour, so the gap while the halves meet looks like the studio, not a band */
  -webkit-mask-image: linear-gradient(90deg, transparent 10%, #000 23%, #000 77%, transparent 90%), linear-gradient(transparent, #000 8%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(90deg, transparent 10%, #000 23%, #000 77%, transparent 90%), linear-gradient(transparent, #000 8%, #000 90%, transparent);
          mask-composite: intersect; }
.ps-build__cam { position: absolute; inset: 0; transform-origin: 50% 46%; }
.ps-build__part { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ps-build__part--top { clip-path: inset(0 0 49.7% 0); }
.ps-build__part--bottom { clip-path: inset(49.4% 0 0 0); z-index: 1; }   /* overlaps the top half a little, so no hairline shows at rest */
/* a line of light along the seam as the halves meet */
.ps-build__seam { position: absolute; z-index: 2; left: 24%; right: 24%; top: 50.1%; height: 2px; margin-top: -1px; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 214, .95) 30%, #fff 50%, rgba(255, 244, 214, .95) 70%, transparent);
  box-shadow: 0 0 14px 3px rgba(255, 228, 160, .55); transform: scaleX(.2); }
/* one soft sheen across the console after it lights up */
.ps-build__sheen { position: absolute; z-index: 4; inset: -10% -40%; opacity: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .55) 48%, rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, .55) 52%, transparent 62%);
  transform: translateX(-55%); }
.ps-build .pp-film__screen { z-index: 3; }
.ps-build .pp-film__cap { position: relative; z-index: 3; }
.ps-build .pp-film__cap > span { text-wrap: balance; }
.ps-build .pp-film__cap--l, .ps-build .pp-film__cap--r { grid-row: 2; align-self: end; margin-bottom: calc(var(--sq) * .2); }
.ps-build .pp-film__cap--l { grid-column: 1; justify-items: end; text-align: right; }
.ps-build .pp-film__caps { display: contents; }
.ps-build .pp-film__cap--r { grid-column: 3; justify-items: start; text-align: left; }

/* armed: the camera a little closer, the screen half sunk in the dark, the controls half below and out of sight */
.ps-build[data-build-armed] .ps-build__cam { transform: scale(1.09); }
.ps-build[data-build-armed] .ps-build__part--top { opacity: 0; transform: translateY(5%); }
.ps-build[data-build-armed] .ps-build__part--bottom { opacity: 0; transform: translateY(34%); }
.ps-build[data-build-armed] .pp-film__cap { opacity: 0; transform: translateY(10px); }
/* go: a short push-out while the screen half rises into place */
.ps-build[data-build-go] .ps-build__cam { transform: none; transition: transform 2000ms var(--ease-out); }
.ps-build[data-build-go] .ps-build__part--top { opacity: 1; transform: none;
  transition: opacity 350ms var(--ease-out), transform 700ms var(--ease-out); }
/* join: the controls half glides up and settles, no bounce */
.ps-build[data-build-join] .ps-build__part--bottom { opacity: 1; transform: none;
  transition: opacity 300ms var(--ease-out), transform 800ms var(--ease-out); }
/* landed: the seam flashes once; the side captions arrive one after the other */
.ps-build[data-build-landed] .ps-build__seam { animation: ps-seam 600ms var(--ease-out) both; }
@keyframes ps-seam { 0% { opacity: 0; transform: scaleX(.2); } 35% { opacity: 1; transform: scaleX(1); } 100% { opacity: 0; transform: scaleX(1.05); } }
.ps-build .pp-film__cap { transition: opacity 350ms var(--ease-out), transform 450ms var(--ease-out); }
.ps-build[data-build-landed] .pp-film__cap--l, .ps-build[data-build-landed] .pp-film__cap--r,
.ps-build[data-build-lit] .pp-film__cap--m { opacity: 1; transform: none; }
.ps-build[data-build-landed] .pp-film__cap--r { transition-delay: 80ms; }
.ps-build[data-build-lit] .pp-film__cap--m { transition-delay: 120ms; }
/* lit: the screen powers on as soon as the halves have settled */
.js .ps-build:not([data-build-lit]) .pp-film__screen { opacity: 0; }
.ps-build .pp-film__screen.is-booting .pp-screen__in { animation-duration: .6s; }
/* shine: one sheen crosses the console */
.ps-build[data-build-shine] .ps-build__sheen { animation: ps-sheen 900ms var(--ease-out) both; }
@keyframes ps-sheen { 0% { opacity: 0; transform: translateX(-55%); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(55%); } }

@media (max-width: 759px) {
  .ps-build { --sq: min(100vw, max(280px, calc(100svh - 300px))); }
  .ps-build .ps-build__fig { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; padding-inline: 20px; box-sizing: border-box; }
  .ps-build .ps-build__pic { grid-column: 1 / -1; justify-self: center; margin-inline: 0; margin-block: -4% -6%; }
  .ps-build .pp-film__cap--l, .ps-build .pp-film__cap--r { grid-row: 3; align-self: start; margin: 14px 0 0; }
  .ps-build .pp-film__cap--l { justify-items: start; text-align: left; }
  .ps-build .pp-film__cap--r { grid-column: 2; justify-items: end; text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  .ps-build .ps-build__cam, .ps-build .ps-build__part { transform: none !important; opacity: 1 !important; filter: none !important; transition: none !important; }
  .ps-build .pp-film__cap { opacity: 1 !important; transform: none !important; }
  .ps-build__seam, .ps-build__sheen { display: none; }
}
