/* Light sweeps and particles use the full atmospheric intensity. */
:root {
  --motion-intensity: 0.5;
  --atmospheric-intensity: 1;
}

.motion-visuals, .motion-light, .motion-particles, .motion-underline {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .release-media {
    overflow: hidden;
  }

  [data-site-parallax] .hero-artwork {
    overflow: clip;
  }

  [data-site-motion] .motion-visuals {
    position: absolute;
    z-index: -1;
    inset: 0;
    display: block;
    overflow: clip;
    pointer-events: none;
    mask-image: linear-gradient(180deg, #000 0 54%, transparent 92%);
  }

  .motion-light {
    display: none;
    position: absolute;
    top: -5%;
    width: min(66%, 62rem);
    height: 92%;
    mix-blend-mode: screen;
  }

  .motion-light-cyan {
    left: 0;
    background: radial-gradient(ellipse 44% 50% at 48% 47%, #22d9ffc9, #007cc78c 46%, transparent 98%);
  }

  .motion-light-magenta {
    right: 0;
    background: radial-gradient(ellipse 42% 52% at 51% 46%, #ee45dbba, #9a137d80 46%, transparent 98%);
  }

  [data-site-motion] .motion-light-cyan {
    display: block;
    animation: motion-cyan-sweep 38s ease-in-out infinite;
  }

  [data-site-motion] .motion-light-magenta {
    display: block;
    animation: motion-magenta-sweep 43s ease-in-out infinite;
  }

  @keyframes motion-cyan-sweep {
    0%, 100% { opacity: calc(0.39 + 0.24 * var(--atmospheric-intensity)); transform: translate(-9%, 2%); }
    34% { opacity: calc(0.50 + 0.24 * var(--atmospheric-intensity)); transform: translate(calc(14% + 54% * var(--atmospheric-intensity)), -10%); }
    73% { opacity: calc(0.39 + 0.24 * var(--atmospheric-intensity)); transform: translate(6%, 10%); }
  }

  @keyframes motion-magenta-sweep {
    0%, 100% { opacity: calc(0.38 + 0.22 * var(--atmospheric-intensity)); transform: translate(8%, 8%); }
    32% { opacity: calc(0.47 + 0.22 * var(--atmospheric-intensity)); transform: translate(calc(-16% - 37% * var(--atmospheric-intensity)), -2%); }
    69% { opacity: calc(0.52 + 0.22 * var(--atmospheric-intensity)); transform: translate(calc(-9% - 17% * var(--atmospheric-intensity)), -17%); }
  }

  .is-entering .hero-artwork { animation: motion-enter 1100ms ease both; }
  .is-entering .hero-copy h1 { animation: motion-enter 1100ms 610ms ease both; }
  .is-entering .hero-copy p { animation: motion-enter 940ms 1330ms ease both; }
  .is-entering .hero-actions { animation: motion-enter 960ms 2150ms ease both; }

  .is-entering .hero-actions:focus-within {
    opacity: 1 !important;
    transform: none !important;
  }

  @keyframes motion-enter {
    from { opacity: 0; transform: translateY(calc(12px * var(--motion-intensity))); }
    to { opacity: 1; transform: none; }
  }

  [data-site-motion] .release-card > a {
    transition: border-color 260ms ease, box-shadow 260ms ease;
  }

  [data-site-motion] .release-art, [data-site-motion] .release-action, [data-site-motion] .release-caption::before {
    transition: transform 280ms ease, filter 280ms ease;
  }

  [data-site-motion] .release-card > a:is(:hover, :focus-visible) {
    box-shadow: 0 0 calc(22px * var(--motion-intensity)) color-mix(in srgb, var(--release-accent) calc(42% * var(--motion-intensity)), transparent);
  }

  [data-site-motion] .release-card > a:is(:hover, :focus-visible) .release-art {
    transform: scale(calc(1 + 0.04 * var(--motion-intensity)));
  }

  [data-site-motion] .release-card > a:is(:hover, :focus-visible) .release-caption::before {
    filter: brightness(calc(1 + 0.5 * var(--motion-intensity)));
  }

  [data-site-motion] .release-card > a:is(:hover, :focus-visible) .release-action {
    transform: translate(calc(6px * var(--motion-intensity)), calc(-5px * var(--motion-intensity)));
  }

  [data-site-motion] .site-nav {
    position: relative;
  }

  [data-site-motion] .site-nav [aria-current] {
    border-bottom-color: transparent;
  }

  [data-site-motion] .motion-underline {
    position: absolute;
    inset: auto auto 0 0;
    display: block;
    width: var(--motion-underline-width, 0);
    height: 2px;
    transform: translateX(var(--motion-underline-x, 0px));
    background: var(--cyan);
    pointer-events: none;
    transition: width 240ms ease, transform 240ms ease;
  }

  [data-site-motion] .site-nav a {
    transition: color 200ms ease;
  }

  [data-site-motion] .site-header::before, [data-site-motion] .site-header::after {
    opacity: calc(1 - 0.38 * var(--motion-intensity));
    transition: opacity 280ms ease;
  }

  [data-site-motion] .site-header:is(:hover, :focus-within)::before,
  [data-site-motion] .site-header:is(:hover, :focus-within)::after {
    opacity: 1;
  }

  .is-revealing {
    animation: motion-reveal 1050ms calc(120ms + var(--motion-delay, 0ms)) ease both;
  }

  .release-card:nth-child(2) { --motion-delay: 110ms; }
  .release-card:nth-child(3) { --motion-delay: 220ms; }

  .is-revealing:focus-within {
    opacity: 1 !important;
    transform: none !important;
  }

  @keyframes motion-reveal {
    from { opacity: calc(1 - clamp(0.4, 1.4 * var(--motion-intensity), 0.82)); transform: translateY(calc(36px * var(--motion-intensity))); }
    to { opacity: 1; transform: none; }
  }

  :is(.catalogue, [data-reveals]) .reveal-from-below {
    --reveal-offset: calc(36px * var(--motion-intensity));
  }

  :is(.catalogue, [data-reveals]) .reveal-from-above {
    --reveal-offset: calc(-36px * var(--motion-intensity));
  }

  :is(.catalogue, [data-reveals]) :is(.reveal-from-above, .reveal-from-below) > :is(a:not(:focus), [data-reveal-content]) {
    animation: catalogue-reveal 1350ms cubic-bezier(.22, .61, .36, 1) both;
  }

  @keyframes catalogue-reveal {
    from { opacity: calc(0.5 * (1 - clamp(0.4, 1.4 * var(--motion-intensity), 0.82))); transform: translateY(var(--reveal-offset)); }
    to { opacity: 1; transform: none; }
  }

  [data-site-parallax] .hero-artwork img {
    translate: var(--motion-x, 0px) var(--motion-y, 0px);
    scale: 1.03;
    transition: translate 180ms ease-out;
  }

  .motion-particles {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: none;
    pointer-events: none;
  }

  [data-site-motion] .motion-particles {
    display: block;
  }

  .motion-particle {
    position: absolute;
    inset: var(--dot-top) auto auto var(--dot-left);
    width: var(--dot-size);
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--dot-color);
    box-shadow: 0 0 4px color-mix(in srgb, var(--dot-color) 66%, transparent);
    animation: motion-particle-drift var(--dot-duration) var(--dot-delay) ease-in-out infinite alternate both;
  }

  @keyframes motion-particle-drift {
    0% { opacity: calc(var(--dot-brightness) * (0.59 + var(--atmospheric-intensity) * 0.42)); transform: translate(0, 0); }
    53% { opacity: calc(var(--dot-brightness) * (0.76 + var(--atmospheric-intensity) * 0.4)); }
    100% { opacity: calc(var(--dot-brightness) * (0.51 + var(--atmospheric-intensity) * 0.46)); transform: translate(calc(var(--dot-x) * var(--atmospheric-intensity)), calc(var(--dot-y) * var(--atmospheric-intensity))); }
  }

  @media (max-width: 40rem) {
    .motion-particle:nth-child(n + 33) {
      display: none;
    }
  }

  [data-site-hidden] :is(.hero-artwork, .motion-light, .hero-copy h1, .hero-copy p, .hero-actions, .is-revealing, .motion-particle) {
    animation-play-state: paused;
  }
}
