/* Desktop-only 120s seamless hero atmosphere (WebGL canvas) */

.hero-bg-loop {
  display: none;
}

@media screen and (min-width: 768px) {
  .hero-bg-loop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
  }

  /* Beat theme-dark `.landing-content-section > * { position: relative }` */
  html[data-theme="dark"] .landing-content-section > .hero-bg-loop,
  html.hero-bg-loop-active .landing-content-section > .hero-bg-loop {
    position: absolute !important;
    inset: 0;
    z-index: 0 !important;
  }

  /* Keep CSS still as underpaint until the canvas is drawing */
  html.hero-bg-loop-active.hero-bg-loop-playing .landing-content-section {
    background-image: none;
  }

  html.hero-bg-loop-active.hero-bg-loop-playing[data-theme="dark"] .landing-content-section {
    background-image: none;
    background-color: #010106;
  }

  .hero-bg-loop__poster,
  .hero-bg-loop__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .hero-bg-loop__poster {
    object-fit: cover;
    object-position: 50% 0;
    opacity: 0;
    transition: opacity 0.45s ease;
  }

  .hero-bg-loop__poster[src] {
    opacity: 1;
  }

  .hero-bg-loop__poster--dark {
    display: none;
  }

  html[data-theme="dark"] .hero-bg-loop__poster--light {
    display: none;
  }

  html[data-theme="dark"] .hero-bg-loop__poster--dark {
    display: block;
  }

  .hero-bg-loop__canvas {
    display: block;
    opacity: 0;
    transition: opacity 0.9s ease;
  }

  .hero-bg-loop__canvas.is-playing {
    opacity: 1;
  }

  .landing-content-section > .landing-content-section-container {
    position: relative;
    z-index: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bg-loop__canvas {
    display: none !important;
  }
}
