@layer motion {
  .reveal {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    transition: opacity 520ms var(--ease-out), transform 560ms var(--ease-out);
    will-change: opacity, transform;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .hero-ambient {
    position: absolute;
    inset: -18% 0 auto;
    max-width: 100%;
    height: 520px;
    background: radial-gradient(620px 380px at 22% 30%, var(--accent-soft), transparent 70%);
    pointer-events: none;
    animation: ambient-breathe 10s ease-in-out infinite alternate;
    will-change: transform, opacity;
  }

  @keyframes ambient-breathe {
    from { opacity: 0.72; transform: translate3d(0, 0, 0) scale(1); }
    to { opacity: 1; transform: translate3d(10px, 6px, 0) scale(1.03); }
  }

  .spotlight-surface { position: relative; --mx: 50%; --my: 50%; }

  @media (hover: hover) and (pointer: fine) {
    .spotlight-surface::before {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      background: radial-gradient(360px circle at var(--mx) var(--my), var(--accent-soft), transparent 65%);
      opacity: 0;
      transition: opacity 240ms var(--ease-out);
      pointer-events: none;
    }
    .spotlight-surface:hover::before { opacity: 1; }
    .pose-chip:hover { transform: translateY(-3px); border-color: var(--accent); }
  }

  .stage-progress-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.16);
  }

  .stage-progress-fill {
    height: 100%;
    background: var(--accent);
    transform-origin: left center;
    transform: scaleX(0);
  }

  .stage-progress-fill.is-running { animation: cycle-progress 4.5s linear infinite; }
  .kiosk-frame.is-paused .stage-progress-fill { animation-play-state: paused; opacity: 0.35; }

  @keyframes cycle-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }

  .marquee-shell {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: clip;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  }

  .marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 42s linear infinite;
    will-change: transform;
  }

  .marquee-shell:hover .marquee-track,
  .marquee-shell:focus-within .marquee-track { animation-play-state: paused; }

  @keyframes marquee-scroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
  }

  .marquee-group { display: flex; gap: 12px; padding-right: 12px; }

  .pose-chip {
    margin: 0;
    width: 162px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 200ms var(--ease-out), border-color 200ms var(--ease-out);
  }

  .pose-chip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
  .pose-chip figcaption { padding: 7px 10px; font-size: 0.76rem; font-weight: 600; color: var(--muted); text-align: center; }

  .pipe-pulse {
    position: absolute;
    top: -1px;
    left: 0;
    width: 28px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent);
    animation: wire-flow 2.2s var(--ease-out) infinite;
  }

  @keyframes wire-flow {
    0% { transform: translateX(-100%); opacity: 0; }
    25% { opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateX(350%); opacity: 0; }
  }

  @keyframes modal-in {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
  }

  @media (prefers-reduced-transparency: reduce) {
    .site-header,
    .floating-theme-btn {
      background: var(--surface);
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
    .hero-ambient,
    .pipe-pulse,
    .stage-progress-fill.is-running { animation: none !important; }
    .marquee-shell { -webkit-mask-image: none; mask-image: none; }
    .marquee-track { animation: none !important; width: 100%; flex-wrap: wrap; justify-content: center; }
    .marquee-group[aria-hidden="true"] { display: none; }
    .marquee-group { flex-wrap: wrap; justify-content: center; padding: 0 20px; }
    *,
    *::before,
    *::after { transition-duration: 0.01ms !important; }
  }
}
