/* The hero's live demo: two player windows side by side, the cursor, the signal, the auras. */
.stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding: 24px 0 8px;
  perspective: 1600px;
}

.aura {
  position: absolute;
  z-index: -1;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.32;
  animation: float 14s ease-in-out infinite alternate;
}

.aura-a {
  top: 0;
  left: 0;
  background: var(--pink);
}

.aura-b {
  right: 0;
  bottom: 0;
  background: #6d2bd9;
  animation-name: float-back;
}

.window {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--raised);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.window-a {
  transform: rotateY(5deg) rotateZ(-1deg);
}

.window-b {
  margin-top: 44px;
  transform: rotateY(-5deg) rotateZ(1deg);
}

.window.is-receiving {
  box-shadow: 0 0 0 2px var(--pink), 0 30px 80px -30px rgba(255, 59, 92, 0.6);
}

.cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 22px;
  height: 22px;
  background: #fff;
  clip-path: polygon(0 0, 0 78%, 24% 60%, 42% 100%, 56% 94%, 40% 56%, 72% 56%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  opacity: 0;
  pointer-events: none;
  transition: transform 0.75s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.3s ease;
}

.cursor.is-active {
  opacity: 1;
}

/* On touch screens the demo is driven by a fingertip, not an arrow. */
@media (hover: none) {
  .cursor {
    width: 30px;
    height: 30px;
    margin: -11px 0 0 -11px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    clip-path: none;
  }
}

.signal {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.signal path {
  fill: none;
  stroke: var(--pink);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(255, 59, 92, 0.8));
}

.spark {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 18px 4px rgba(255, 59, 92, 0.7);
  opacity: 0;
  pointer-events: none;
}

.stage-hint {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 1rem;
}

@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(6%, 4%) scale(0.9); }
}

@keyframes float-back {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-6%, -4%) scale(0.9); }
}

@media (max-width: 900px) {
  .stage {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .window-a,
  .window-b {
    margin-top: 0;
    transform: none;
  }

  .window-b {
    margin-left: 8%;
  }

  .window-a {
    margin-right: 8%;
  }
}

@media (max-width: 520px) {
  .episode {
    display: none;
  }

  .window-a,
  .window-b {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aura {
    animation: none;
  }

  .window,
  .cursor {
    transition: none;
  }
}
