/* The halo stays in place while the real canvas waits for its first frame. */
.home-earth-visual[data-earth-presentation]::after {
  position: absolute;
  z-index: 4;
  top: 42%;
  left: 68%;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  content: "";
  pointer-events: none;
  border: 1.5px solid rgb(235 244 255 / 16%);
  border-top-color: rgb(235 244 255 / 85%);
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease-out, visibility 240ms;
}

.home-earth-visual[data-earth-presentation="loading"]::after {
  opacity: 0.9;
  visibility: visible;
  animation: conpera-earth-spinner 900ms linear infinite;
}

.home-earth-visual[data-earth-presentation] .home-board-agy-earth-canvas {
  opacity: 0;
  visibility: hidden;
}

.home-earth-visual[data-earth-presentation="animated"][data-earth-ready="true"] .home-board-agy-earth-canvas {
  visibility: visible;
  opacity: 1;
  animation: conpera-earth-reveal 1100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* A static frame also covers devices where the existing renderer is disabled. */
.home-earth-visual[data-earth-presentation]::before {
  position: absolute;
  inset: -14% -28% -10% -8%;
  z-index: 1;
  width: 136%;
  height: 124%;
  content: "";
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background-position: center;
  background-repeat: no-repeat;
  background-size: auto 100%;
  filter: saturate(1.08) contrast(1.07) brightness(1.04);
}

.home-earth-visual[data-earth-presentation="poster"]::before {
  background-image: url("/assets/home/earth-poster-6bb3eb947d.webp");
  visibility: visible;
  opacity: 1;
  animation: conpera-earth-reveal 1100ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes conpera-earth-spinner {
  to { transform: rotate(360deg); }
}

@keyframes conpera-earth-reveal {
  from { opacity: 0; filter: blur(22px) saturate(1.08) contrast(1.07) brightness(1.04); }
  to { opacity: 1; filter: blur(0) saturate(1.08) contrast(1.07) brightness(1.04); }
}

@media (max-width: 820px) {
  .home-earth-visual[data-earth-presentation]::before {
    inset: -24% -72% -18% -8%;
    width: 180%;
    height: 142%;
  }
  .home-earth-visual[data-earth-presentation]::after { left: 64%; }
}

@media (prefers-reduced-motion: reduce) {
  .home-earth-visual[data-earth-presentation]::after,
  .home-earth-visual[data-earth-presentation="poster"]::before,
  .home-earth-visual[data-earth-presentation="animated"][data-earth-ready="true"] .home-board-agy-earth-canvas {
    animation: none;
    transition: none;
  }
}
