/* Layered motion stays inside the hero; individual transforms preserve its layout. */
.hero-visual .hero-mascot {
  animation: none;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-visual.hero-motion-ready {
    --hero-workspace-lift: -8px;
    --hero-mascot-lift: -16px;
    --hero-mascot-sway: 3deg;
    --hero-badge-lift: -7px;
    --hero-arrow-push: 3px;
    --hero-orbit-sway: 9deg;
    --hero-orbit-counter-sway: -12deg;
    --hero-spark-scale: 1.22;
  }

  .hero-visual.hero-motion-ready .hero-workspace {
    animation: hero-workspace-hover 7.6s ease-in-out infinite;
  }

  .hero-visual.hero-motion-ready .hero-mascot {
    transform-origin: 50% 75%;
    animation: hero-mascot-hover 4.6s ease-in-out infinite;
  }

  /* The light travels along the query's lower edge, clear of its text. */
  .hero-visual.hero-motion-ready .workspace-query {
    position: relative;
    overflow: hidden;
  }

  .hero-visual.hero-motion-ready .workspace-query::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 42%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #abb4ff, #ffffff, transparent);
    box-shadow: 0 -2px 9px #9da9f65c;
    pointer-events: none;
    animation: hero-query-light 5.4s ease-in-out infinite;
  }

  .hero-visual.hero-motion-ready .connected-badge {
    animation: hero-badge-hover 6.2s -2.1s ease-in-out infinite;
  }

  .hero-visual.hero-motion-ready .connected-mark {
    animation: hero-arrow-nudge 3.6s -.8s ease-in-out infinite;
  }

  .hero-visual.hero-motion-ready .orbit {
    animation: hero-orbit-drift 18s ease-in-out infinite;
  }

  .hero-visual.hero-motion-ready .orbit-two {
    animation-name: hero-orbit-counter-drift;
    animation-duration: 22s;
    animation-delay: -7s;
  }

  .hero-visual.hero-motion-ready .orbit::before {
    content: "";
    position: absolute;
    left: 15%;
    top: 14%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a4b0ed;
    box-shadow: 0 0 11px 3px #a4b0ed66;
    pointer-events: none;
    animation: hero-point-breathe 4.8s ease-in-out infinite;
  }

  .hero-visual.hero-motion-ready .orbit-two::before {
    left: auto;
    right: 15%;
    background: #baa7e9;
    animation-delay: -2.4s;
  }

  .hero-visual.hero-motion-ready .visual-spark {
    animation: hero-spark-breathe 4.2s ease-in-out infinite;
  }

  .hero-visual.hero-motion-ready .spark-two {
    animation-delay: -2.1s;
  }

  .hero-visual.hero-motion-ready .workspace-status i {
    box-shadow: 0 0 5px #78b19b66;
    animation: hero-point-breathe 3.6s -1s ease-in-out infinite;
  }

  .hero-visual.hero-motion-ready.hero-motion-suspended,
  .hero-visual.hero-motion-ready.hero-motion-suspended::before,
  .hero-visual.hero-motion-ready.hero-motion-suspended::after,
  .hero-visual.hero-motion-ready.hero-motion-suspended *,
  .hero-visual.hero-motion-ready.hero-motion-suspended *::before,
  .hero-visual.hero-motion-ready.hero-motion-suspended *::after {
    animation-play-state: paused !important;
  }

  @keyframes hero-workspace-hover {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 var(--hero-workspace-lift); }
  }

  @keyframes hero-mascot-hover {
    0%, 100% { translate: 0 0; rotate: calc(-1 * var(--hero-mascot-sway)); }
    50% { translate: 0 var(--hero-mascot-lift); rotate: var(--hero-mascot-sway); }
  }

  @keyframes hero-query-light {
    0%, 12% { translate: -110% 0; opacity: 0; }
    24%, 65% { opacity: .95; }
    82%, 100% { translate: 350% 0; opacity: 0; }
  }

  @keyframes hero-badge-hover {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 var(--hero-badge-lift); }
  }

  @keyframes hero-arrow-nudge {
    0%, 65%, 100% { translate: 0 0; }
    32% { translate: var(--hero-arrow-push) calc(-1 * var(--hero-arrow-push)); }
  }

  @keyframes hero-orbit-drift {
    0%, 100% { rotate: 0deg; }
    50% { rotate: var(--hero-orbit-sway); }
  }

  @keyframes hero-orbit-counter-drift {
    0%, 100% { rotate: 0deg; }
    50% { rotate: var(--hero-orbit-counter-sway); }
  }

  @keyframes hero-spark-breathe {
    0%, 100% { opacity: .45; scale: .86; }
    50% { opacity: 1; scale: var(--hero-spark-scale); }
  }

  @keyframes hero-point-breathe {
    0%, 100% { opacity: .45; scale: .8; }
    50% { opacity: 1; scale: 1.15; }
  }

  @media (max-width: 760px) {
    .hero-visual.hero-motion-ready {
      --hero-workspace-lift: -4px;
      --hero-mascot-lift: -10px;
      --hero-mascot-sway: 2deg;
      --hero-badge-lift: -4px;
      --hero-arrow-push: 2px;
      --hero-orbit-sway: 5deg;
      --hero-orbit-counter-sway: -6deg;
      --hero-spark-scale: 1.12;
    }
  }
}
