/* The light, shared by the login screen and the Contact page: a glow at the source, rays (warm gold to
   daylight blue, like the Kelvin strip) that die out toward the floor, and photons, soft specks rising
   from the floor and fading. Markup comes from lp_light() in functions.php; the panel that holds it
   must be position: relative (or fixed) with overflow: hidden. */
.lp-glow, .lp-rays, .lp-photon { position: absolute; pointer-events: none; }
.lp-glow { inset: 0; background: radial-gradient(ellipse 55% 45% at 50% -8%, rgba(239, 230, 200, .45), transparent 70%); }
.lp-rays {
	inset: 0 -25%; transform-origin: 50% -8%;
	background: conic-gradient(from 150deg at 50% -8%,
		transparent 0 6deg, rgba(212, 192, 121, .13) 7deg 9deg,
		transparent 10deg 16deg, rgba(212, 192, 121, .1) 16.5deg 18.5deg,
		transparent 19deg 26deg, rgba(239, 230, 200, .09) 27deg 30deg,
		transparent 31deg 38deg, rgba(143, 179, 255, .1) 38.5deg 40.5deg,
		transparent 41deg 49deg, rgba(143, 179, 255, .13) 50deg 53deg, transparent 54deg);
	-webkit-mask-image: linear-gradient(to bottom, #000 15%, transparent 88%);
	mask-image: linear-gradient(to bottom, #000 15%, transparent 88%);
}
/* A radial falloff reads as blur and is cheaper than filter: blur. Size, speed, colour and start come per
   speck from lp_light(); --rise (how far they travel) is set by the panel. */
.lp-photon {
	bottom: -32px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%;
	translate: var(--ox, 0) var(--oy, 0); transition: translate .7s cubic-bezier(.2, .7, .2, 1); /* eases away from the pointer (site.js); translate stacks on the rising transform */
	background: radial-gradient(circle, var(--c) 0, color-mix(in srgb, var(--c) 45%, transparent) 30%, transparent 70%);
	opacity: 0;
}

/* On arrival the lamp switches on (glow, then the rays fall into place); after that the light only
   breathes, the rays drift a couple of degrees and the photons keep rising. */
@keyframes lp-on { from { opacity: 0; } }
@keyframes lp-rays-on { from { opacity: 0; transform: scaleY(.55); } }
@keyframes lp-breathe { to { opacity: .65; } }
@keyframes lp-sway { 25% { transform: rotate(1.6deg); } 75% { transform: rotate(-1.6deg); } } /* starts and ends level, so it picks up from the switch-on without a jump */
@keyframes lp-photon {
	0% { transform: translate(0, 0) scale(.6); opacity: 0; }
	15% { opacity: var(--o); }
	65% { opacity: calc(var(--o) * .6); }
	100% { transform: translate(var(--dx), calc(-1 * var(--rise, 480px))) scale(1.15); opacity: 0; }
}
@keyframes lp-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes lp-strip { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: no-preference) {
	.lp-glow { animation: lp-on 1.2s ease-out both, lp-breathe 7s ease-in-out 1.2s infinite alternate; }
	.lp-rays { animation: lp-rays-on 1.6s cubic-bezier(.2, .7, .2, 1) .2s both, lp-sway 28s ease-in-out 1.8s infinite; }
	.lp-photon { animation: lp-photon var(--d) cubic-bezier(.3, .1, .4, 1) var(--delay) infinite; }
}
