/* css/scenes/record.css · scene 2 `record`, the record (SPEC 2.2 · WP1 gate-and-record) · prefix record-
   The record player is SVG art in the stage root. Its deck is drawn in top view and squashed into a
   three-quarter view (--record-k); the record and the tonearm are layers inside the deck, so the
   33 1/3 rpm spin and the arm swing are compositor-only transforms. */
.scene--record{
  --record-k:.46;     /* the look-down squash of the deck */
  --record-cy:42%;    /* where the player's centre sits, down the screen (the stool hangs below it) */
  --record-max:466px; /* the plinth is 90 % of the rig: 420 px */
  --record-vw:95.5vw; /* plinth ≈ 86 vw */
}
/* the rig is 400 x 330; the player's centre is 34 % down it, so the stool's feet end 54.45 % of the
   rig's width below --record-cy and the deck's back edge 28.05 % above: both bounds keep it clear of
   the festoon and the dock */
.scene--record .record-rig{position:absolute;left:0;right:0;top:var(--record-cy);margin:0 auto;transform:translateY(-34%);
  width:min(var(--record-vw), var(--record-max), calc((58vh - var(--dock-h) - var(--sp-3)) / .5445), calc((42vh - var(--chrome-h) - var(--sp-7)) / .2805));
  width:min(var(--record-vw), var(--record-max), calc((58dvh - var(--dock-h) - var(--sp-3)) / .5445), calc((42dvh - var(--chrome-h) - var(--sp-7)) / .2805))}
.scene--record .record-rig::before{content:"";display:block;padding-top:82.5%}   /* 400 : 330 */
.scene--record .record-base,.scene--record .record-plane,.scene--record .record-plane > *{position:absolute}
.scene--record .record-base,.scene--record .record-deck,.scene--record .record-arm{top:0;right:0;bottom:0;left:0}
.scene--record .record-plane{transform:scaleY(var(--record-k));transform-origin:50% 0}
.scene--record .record-rig svg{display:block;width:100%;height:100%;overflow:visible}

/* the needle drop: the arm swings in 600 ms; the platter spins up over 800 ms (an ease-in whose end
   speed is exactly 33 1/3 rpm: 40° at 4x the mean), then turns once every 1.8 s. The spin-up runs on
   `rotate` and the steady turn on `transform`: two animations of one property on one element drop
   off the compositor in Chrome, and the turn would then cost a style recalc on every frame */
.scene--record .record-arm{transition:transform calc(600ms * var(--t-scale)) var(--ease-inout)}
.scene--record .record-rig.is-down .record-arm{transform:rotate(var(--record-swing))}
.scene--record .record-rig.is-spinning .record-disc{
  animation:record-spinup calc(800ms * var(--t-scale)) var(--ease-in) both,
    record-spin calc(1800ms * var(--t-scale)) linear calc(800ms * var(--t-scale)) infinite}
@keyframes record-spinup{from{rotate:0deg}to{rotate:40deg}}
@keyframes record-spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
.scene--record .record-pilot{opacity:0;transition:opacity var(--t-slow) var(--ease-out)}
.scene--record .record-rig.is-spinning .record-pilot{opacity:1}

@media (min-width:760px){
  .scene--record{--record-cy:45%;--record-max:622px;--record-vw:72vw}   /* plinth ≤ 560 px */
  .scene--record .record-rig{
    width:min(var(--record-vw), var(--record-max), calc((55vh - var(--dock-h) - var(--sp-3)) / .5445), calc((45vh - var(--chrome-h) - var(--sp-7)) / .2805));
    width:min(var(--record-vw), var(--record-max), calc((55dvh - var(--dock-h) - var(--sp-3)) / .5445), calc((45dvh - var(--chrome-h) - var(--sp-7)) / .2805))}
}
/* short desktop windows (a laptop browser): the dock's reserve is fixed, so the player rises a little
   into the free air under the festoon instead of shrinking */
@media (min-width:760px) and (max-height:700px){
  .scene--record{--record-cy:40%}
  .scene--record .record-rig{
    width:min(var(--record-vw), var(--record-max), calc((60vh - var(--dock-h) - var(--sp-3)) / .5445), calc((40vh - var(--chrome-h) - var(--sp-7)) / .2805));
    width:min(var(--record-vw), var(--record-max), calc((60dvh - var(--dock-h) - var(--sp-3)) / .5445), calc((40dvh - var(--chrome-h) - var(--sp-7)) / .2805))}
}
/* landscape phones: the shot takes the left 60 %, the dock is the right-hand column */
@media (orientation:landscape) and (max-height:500px){
  .scene--record .record-rig{right:40%;top:calc(50% + var(--chrome-h) / 2 + var(--sp-4));transform:translateY(-50%);
    width:min(54vw, calc((100vh - var(--chrome-h) - var(--sp-7) - var(--sp-5)) / .825));
    width:min(54vw, calc((100dvh - var(--chrome-h) - var(--sp-7) - var(--sp-5)) / .825))}
}

@media (prefers-reduced-motion:reduce){
  .scene--record .record-rig.is-spinning .record-disc{animation:none}
  .scene--record .record-arm{transition:none}
}
