/* Krebber Lab – yeast microscope background */
#kl-microscope {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

/* Illumination field: soft, slowly wandering light – animated on the
   compositor (transform only), so it costs practically nothing. */
#kl-microscope .kl-field {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(ellipse 42% 38% at 30% 34%, rgba(150, 172, 255, 0.38), transparent 70%),
    radial-gradient(ellipse 40% 36% at 72% 64%, rgba(246, 168, 232, 0.32), transparent 70%),
    radial-gradient(ellipse 50% 46% at 50% 46%, rgba(255, 255, 255, 0.26), transparent 72%);
  animation: kl-field-drift 70s ease-in-out infinite alternate;
  will-change: transform;
}

/* Microscope vignette */
#kl-microscope::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 80% at 50% 48%, transparent 58%, rgba(58, 28, 108, 0.16) 100%);
}

#kl-microscope canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s ease;
}
#kl-microscope.is-ready canvas { opacity: 1; }

@keyframes kl-field-drift {
  0%   { transform: translate3d(-3%, -2%, 0) rotate(0deg); }
  50%  { transform: translate3d(2%, 3%, 0) rotate(6deg); }
  100% { transform: translate3d(4%, -3%, 0) rotate(-4deg); }
}

@media (prefers-reduced-motion: reduce) {
  #kl-microscope .kl-field { animation: none; }
  #kl-microscope canvas { transition: none; }
}
