/* Motion enhances the original DOM. All media and links are visible by default. */
@media (prefers-reduced-motion: no-preference) {
  .estuary-aperture img {
    clip-path: inset(var(--estuary-aperture-y, 0%) var(--estuary-aperture-x, 0%) round 2px);
  }

  .estuary-aperture:focus-within img,
  a.estuary-aperture:focus-visible img {
    clip-path: none;
  }

  .catalog-chapter.estuary-reading .catalog-chapter-heading::after {
    display: block;
    content: '';
    width: min(8rem, 80%);
    height: 2px;
    margin-top: 20px;
    background:
      linear-gradient(90deg, #f944bb, #89b7ff) left / var(--estuary-chapter-progress, 0%) 100% no-repeat,
      #8b7fa76b;
  }

  .showcase-index-row.estuary-entered li,
  .product-category[open] > .product-category-links li {
    animation: estuary-settle .42s cubic-bezier(.18,.7,.25,1) backwards;
  }

  :is(.showcase-index-row.estuary-entered, .product-category[open]) li:nth-child(2) { animation-delay: 32ms; }
  :is(.showcase-index-row.estuary-entered, .product-category[open]) li:nth-child(3) { animation-delay: 56ms; }
  :is(.showcase-index-row.estuary-entered, .product-category[open]) li:nth-child(n+4) { animation-delay: 80ms; }

  .showcase-index-row li a,
  .product-category-links a {
    position: relative;
  }

  .showcase-index-row li a::after,
  .product-category-links a::after {
    position: absolute;
    content: '';
    pointer-events: none;
    inset: auto 3px 5px 0;
    height: 1px;
    background: linear-gradient(90deg, currentColor, transparent);
    opacity: .58;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform .28s cubic-bezier(.18,.7,.25,1);
  }

  .product-category-links a::after { inset-inline: 12px; }
  :is(.showcase-index-row li a, .product-category-links a):is(:hover, :focus-visible)::after {
    transform: scaleX(1);
  }

  .showcase-index-row li a span:last-child { transition: transform .25s ease; }
  .showcase-index-row li a:is(:hover, :focus-visible) span:last-child { transform: translate(2px, -2px); }

  .section-kicker.estuary-entered::before,
  .mint-rule.estuary-entered {
    transform-origin: left;
    animation: estuary-rule .72s cubic-bezier(.18,.7,.25,1);
  }

  .product-overview-heading.estuary-entered > :is(h2, p) {
    animation: estuary-lift .6s cubic-bezier(.18,.7,.25,1) backwards;
  }
  .product-overview-heading.estuary-entered > p { animation-delay: .08s; }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .estuary-depth img {
    transition: transform .32s cubic-bezier(.2,.72,.24,1);
    transform-origin: 50% 58%;
  }
  .estuary-depth.estuary-pointed img {
    transform: perspective(950px) rotateX(var(--estuary-tilt-x, 0deg)) rotateY(var(--estuary-tilt-y, 0deg)) scale(.987);
  }
  .estuary-depth:focus-within img,
  a.estuary-depth:focus-visible img {
    transform: none;
  }
}

@keyframes estuary-settle {
  from { transform: translateX(-8px); opacity: .76; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes estuary-lift {
  from { transform: translateY(8px); opacity: .78; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes estuary-rule {
  from { transform: scaleX(.18); }
  to { transform: scaleX(1); }
}
