.lighthouse-scene {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  background: #243b4b;
  --beacon-period: 11s;
}

.lighthouse-layer,
.lighthouse-beam {
  position: absolute;
  display: block;
  pointer-events: none;
  user-select: none;
}

.lighthouse-layer {
  inset: 0;
  width: 100%;
  height: 100%;
}

.lighthouse-beam {
  /* Map the sprite pivot (1072, 180) to the lantern (1472, 200). */
  left: 23.923445%;
  top: 2.125399%;
  width: 66.985646%;
  height: 38.257173%;
  transform-origin: 95.714286% 50%;
  animation: lighthouse-sweep var(--beacon-period) linear infinite;
}

.lighthouse-wave {
  transform-origin: center bottom;
  scale: 1.017;
  animation: lighthouse-swell var(--wave-period) ease-in-out infinite;
}

.lighthouse-wave--rear {
  --wave-period: 13s;
  --swell-x: .22cqw;
  --swell-y: .085cqw;
  animation-delay: -3.5s;
}

.lighthouse-wave--middle {
  --wave-period: 10s;
  --swell-x: -.35cqw;
  --swell-y: .14cqw;
  animation-delay: -1.5s;
}

.lighthouse-wave--foreground {
  --wave-period: 8s;
  --swell-x: .51cqw;
  --swell-y: .21cqw;
  animation-delay: -5s;
}

@keyframes lighthouse-swell {
  0%, 100% { translate: calc(-1 * var(--swell-x)) 0; }
  50% { translate: var(--swell-x) calc(-1 * var(--swell-y)); }
}

@keyframes lighthouse-sweep {
  0%, 100% { opacity: 1; transform: rotate(-1deg) scaleX(1); }
  14% { opacity: .77; transform: rotate(-8deg) scaleX(.62); }
  24% { opacity: 0; transform: rotate(-10deg) scaleX(.10); }
  27% { opacity: 0; transform: rotate(9deg) scaleX(-.10); }
  40% { opacity: .67; transform: rotate(5deg) scaleX(-.62); }
  50% { opacity: .88; transform: rotate(1deg) scaleX(-.90); }
  62% { opacity: .62; transform: rotate(-6deg) scaleX(-.56); }
  72% { opacity: 0; transform: rotate(-9deg) scaleX(-.10); }
  75% { opacity: 0; transform: rotate(10deg) scaleX(.10); }
  87% { opacity: .70; transform: rotate(7deg) scaleX(.60); }
}

.lighthouse-scene.is-paused > * { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .lighthouse-beam,
  .lighthouse-wave { animation: none; }
  .lighthouse-beam { transform: rotate(-1deg); }
  .lighthouse-wave { scale: 1; }
}
