/* Shared presentation for the TheoryWorks established demo. */

.hero {
  position: relative;
  overflow: hidden;
  --focal-x: 72%;
  --focal-y: 50%;
}

.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.hero-particles.is-ready {
  opacity: 1;
}

.hero-particles canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
}

.hero-glow {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  width: min(32rem, 80vw);
  height: min(32rem, 80vw);
  left: var(--focal-x);
  top: var(--focal-y);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
}

.hero-grid,
.hero > .wrap {
  position: relative;
  z-index: 2;
}

/* Soft cushion so particles don't wash out the type. */
.hero-grid::before {
  content: "";
  position: absolute;
  inset: -2.5rem -2rem;
  background: radial-gradient(ellipse at 30% 40%,
    color-mix(in srgb, var(--bg) 78%, transparent),
    transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.mark-block {
  fill: var(--accent);
  color: var(--accent);
}

.hero-particles.is-static {
  opacity: 1;
  transition: none;
  background: radial-gradient(
    ellipse 48% 46% at var(--focal-x) var(--focal-y),
    var(--accent-soft),
    transparent 70%
  );
}

@media (prefers-reduced-motion: reduce) {
  .hero-particles {
    opacity: 1;
    transition: none;
    background: radial-gradient(
      ellipse 48% 46% at var(--focal-x) var(--focal-y),
      var(--accent-soft),
      transparent 70%
    );
  }

  .hero-grid::before,
  .hero-glow {
    transition: none;
  }
}
