/* Backdrop effects.
   REVERTED per user preference: pixel-accurate captures (a real frozen
   canvas screenshot for home/work.html; the real wallpaper image at its
   real opacity for others/writing.html) were tried and looked worse in
   practice than this approximation, even though the approximation is less
   accurate - animated mirror/blur/hue-shift reads better than a static
   real image at high opacity. The accurate versions are kept out of the
   deliverable but not lost: capture/backdrop-captures/ has the raw canvas
   screenshots, and gen-gallery.mjs's wallpaperBackdropHashes + the git
   history of this file have the exact real image/opacity values, in case
   a future pass wants to revisit this trade-off. */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #050505;
}

.backdrop img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  min-width: 900px;
  filter: blur(2px) saturate(1.4);
  animation: backdrop-hue 30s linear infinite;
}

/* Two copies mirrored left/right to fill the full viewport width. Both used
   to share one `backdrop-drift` animation that hardcoded a single
   transform - since an animated `transform` always wins over a plain CSS
   rule, that silently made both copies use image 1's mirrored transform,
   so they exactly overlapped and the right half of every backdrop page
   (home, work, others, writing) rendered as flat background color instead
   of the second mirrored copy. Each now gets its own drift keyframe that
   preserves its own base transform. */
.backdrop img:nth-child(1) { animation-name: backdrop-hue, backdrop-drift-1; animation-duration: 30s, 22s; animation-timing-function: linear, ease-in-out; animation-iteration-count: infinite, infinite; }
.backdrop img:nth-child(2) { animation-name: backdrop-hue, backdrop-drift-2; animation-duration: 30s, 22s; animation-timing-function: linear, ease-in-out; animation-iteration-count: infinite, infinite; }

@keyframes backdrop-hue {
  0%   { filter: blur(2px) saturate(1.4) hue-rotate(0deg); }
  50%  { filter: blur(2px) saturate(1.6) hue-rotate(25deg); }
  100% { filter: blur(2px) saturate(1.4) hue-rotate(0deg); }
}

@keyframes backdrop-drift-1 {
  0%, 100% { transform: translate(-100%, -50%) scaleX(-1) scale(1); }
  50%      { transform: translate(-100%, -52%) scaleX(-1) scale(1.03); }
}

@keyframes backdrop-drift-2 {
  0%, 100% { transform: translate(0%, -50%) scale(1); }
  50%      { transform: translate(0%, -52%) scale(1.03); }
}

.flying-object {
  position: absolute;
  top: 0;
  left: var(--lane, 50%);
  pointer-events: none;
  will-change: transform;
}

@keyframes drift-a {
  0%   { transform: translate(-50%, -20vh) rotate(var(--base-rotation, 0deg)); }
  100% { transform: translate(-50%, 120vh) rotate(calc(var(--base-rotation, 0deg) + 20deg)); }
}

@keyframes drift-b {
  0%   { transform: translate(-50%, 120vh) rotate(var(--base-rotation, 0deg)); }
  100% { transform: translate(-50%, -20vh) rotate(calc(var(--base-rotation, 0deg) - 20deg)); }
}
