/* "Slot and Pass" motion demo (#1241, #1242). Behaviours from the subject:
   - Pass: content in main slides in sideways, eastbound (every other card westbound), the first time it enters the screen.
     Triggered, not tied to the scroll position (Paul, 2026-11-25): js/motion.js adds .pass, then .passed, and a transition
     runs on its own clock. The curve is Material 3's "emphasized decelerate", cubic-bezier(.05,.7,.1,1): most of the
     distance in the first moments, then a long, soft settle, like a car braking to a stop. Cards and panels arrive with a
     speed blur that clears before they stop; headings slide without blur, since blurred big type reads as smeared text.
   - Board cards flip to a second photo of the same screen on hover or keyboard focus (replaces the Slot wipe, which was
     repetitive on 33 cards). The photo is the board's first gallery photo; boards without one flip to the same photo (#1262).
   - Night shift: a section about the screens goes Night while it holds the middle of the screen (js/motion.js toggles
     .night), and board photos on Night get a green LED glow.
   Reduced motion: no Pass, the flip is an instant swap, and Night sections are Night from the start. Only transform,
   filter, opacity and colours change, so nothing moves the layout. Without JS nothing is hidden. Heroes are left alone. */

:root{--pass-x:-14vw;--pass-blur:6px;--pass-ms:750ms;--ease-decel:cubic-bezier(.05,.7,.1,1);
  --glow:0 0 0 1px rgb(0 165 90/.45),0 0 28px rgb(0 165 90/.35),0 0 64px rgb(0 165 90/.18)}

/* Night shift. js/motion.js adds .night (the site's own Night colours) and .is-night (this rule wins over .white/.paper). */
main>section.night-shift{transition:background-color .7s var(--ease),color .7s var(--ease)}
main>section.night-shift :is(h2,h3,h4,a,.lead,.shape){transition:color .7s var(--ease),background-color .7s var(--ease),opacity .7s var(--ease)}
main>section.is-night{background-color:var(--night)}
.is-night .shape{opacity:.06}
.is-night .board-card{background:#16261d}
.is-night :is(.board-card h4 a,.areas b,h2 a){color:var(--white)}
.is-night :is(p,h3) a:not(.btn),.is-night .board-size{color:var(--accent)}
.is-night .btn.ghost{color:var(--white);border-color:var(--white)}
:is(.is-night,.night) :is(.shot,.board-card :is(img,video),.c-orbit img){box-shadow:var(--glow)}
.is-night .board-card{overflow:visible}
.is-night .board-card :is(img,video){border-radius:var(--r-m) var(--r-m) 0 0}
@media(prefers-contrast:more){:is(.is-night,.night) :is(.shot,.board-card :is(img,video),.c-orbit img){box-shadow:none}}

/* Flip. The second photo sits on the back of the first; both turn together. */
.board-card .flip-back{position:absolute;top:0;left:0;transform:perspective(1400px) rotateY(180deg)}
.board-card :is(img,video){backface-visibility:hidden;transition:transform .7s var(--ease-decel)}
@media(hover:hover){
  .board-card:is(:hover,:focus-within) :is(img,video):not(.flip-back){transform:perspective(1400px) rotateY(-180deg)}
  .board-card:is(:hover,:focus-within) .flip-back{transform:perspective(1400px) rotateY(0deg)}
}

@media screen and (prefers-reduced-motion:no-preference){
  main{overflow-x:clip}
  .pass{transform:translateX(var(--pass-x));filter:blur(var(--pass-blur));opacity:0}
  :is(h2,h3).pass{filter:none}
  /* Every other card in a row comes from the right (westbound traffic), so a grid reads as two lanes. */
  :is(.grid>:not(img):nth-child(even),.board-cards>li:nth-child(even)).pass{--pass-x:14vw}
  .pass.passed{transform:none;filter:none;opacity:1;
    transition:transform var(--pass-ms) var(--ease-decel),filter calc(var(--pass-ms)*.55) var(--ease-decel),opacity calc(var(--pass-ms)*.3) linear}
}

@media(prefers-reduced-motion:reduce){
  /* Night is the final state, so reduced motion gets it with no fade (js/motion.js sets it on every Night section at once). */
  main>section.night-shift,main>section.night-shift *{transition:none}
  .board-card img{transition:none}
}
