/* PERFORMANCE rules. Loaded last. Written because iPhone Safari lagged and showed blank (black) patches while scrolling.
   What costs a phone the most: big layers that BLEND with what is behind them (mix-blend-mode), huge animated layers, and
   dozens of endless animations. On phones and tablets (narrow screens or touch) we keep the same look but make it cheaper.
   Desktop keeps everything exactly as designed. */

/* off-screen sections: all their animations are paused (perf.js adds .is-off) */
.is-off, .is-off *, .is-off *::before, .is-off *::after { animation-play-state: paused !important; }

@media (max-width: 900px), (pointer: coarse) {
  /* film grain: a still, normal-blend sheet instead of a huge jittering overlay-blend layer */
  .grain, .desk::after { mix-blend-mode: normal !important; animation: none !important; inset: 0 !important; opacity: .16 !important; }
  .desk::after { opacity: .2 !important; }
  /* light effects and the big dark grime sheets: ordinary transparency instead of "screen" / "multiply" against everything behind.
     (The small paper-texture layers keep "multiply": as plain transparency they would turn the photos hazy.) */
  .blinds-light, .neon-wash, .light-cone, .bulb .cone, .pool, .lightning,
  .board-wrap::before, .board-wrap .board::after, .desk-surface::after { mix-blend-mode: normal !important; }
  .board-wrap::after { display: none; }          /* the glass shine was a "screen" layer; as plain transparency it only looks like fog */
  /* fewer floating dust specks */
  .dust i:nth-child(n+9) { display: none; }
  /* the wall light slides more slowly than the eye can follow anyway */
  .neon-wash::before, .neon-wash::after { animation-duration: 18s; }

  /* SVG blur / roughen filters: Safari redraws them on the processor, and again on EVERY frame of anything animating inside them.
     So on phones: the beam, its cloud and the wisps stay still (drawn once), the animated smoke and the detective are not blurred. */
  [filter]:not(.breathe), .sig, .mote { animation: none !important; }
  .breathe, g[filter="url(#sm)"] { filter: none; }
  /* the skyline zooms as you scroll: draw each layer once and let the phone scale that picture (instead of redrawing it at every size) */
  .layer, .roof { will-change: transform; }
  .hero-dim, .hero-fog { will-change: opacity; }
  /* the locker objects' little glint is a filter animation on 30 pictures: skip it */
  button.it svg { animation: none; }
}
