/* Optional motion layer. Content stays visible if JavaScript is unavailable. */
:root { --motion-ease: cubic-bezier(.2,.75,.2,1); }

@media (prefers-reduced-motion: no-preference) {
  /* Native page changes retain the old frame until the next page is ready.
     Text and navigation switch immediately; only visual panels cross-fade. */
  @view-transition { navigation: auto; }
  ::view-transition { pointer-events: none; }
  .hero-art { view-transition-name: home-art; }
  .spray-stage { view-transition-name: about-art; }
  .partners-art { view-transition-name: partners-art; }
  .menu-section .product-card:nth-child(1) .product-visual img { view-transition-name: menu-photo-one; }
  .menu-section .product-card:nth-child(2) .product-visual img { view-transition-name: menu-photo-two; }
  .menu-section .product-card:nth-child(3) .product-visual img { view-transition-name: menu-photo-three; }
  #corsa .location-photo { view-transition-name: corsa-photo; }
  #chucho .location-photo { view-transition-name: chucho-photo; }
  ::view-transition-group(*) { animation-duration: .32s; animation-timing-function: var(--motion-ease); }
  ::view-transition-old(*) { display: none; animation: none; }
  ::view-transition-new(*) { animation: nibrew-page-in .32s ease both; }
  ::view-transition-group(root),
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
  ::view-transition-old(root) { display: none; }
  ::view-transition-new(root) { opacity: 1; }
  .motion-active .motion-reveal {
    --reveal-y: 38px;
    opacity: 0;
    translate: var(--magnet-x, 0px) calc(var(--reveal-y) + var(--magnet-y, 0px));
    transition:
      opacity .7s ease var(--motion-delay, 0ms),
      translate .95s var(--motion-ease) var(--motion-delay, 0ms),
      scale .95s var(--motion-ease) var(--motion-delay, 0ms),
      transform .5s var(--motion-ease),
      box-shadow .4s ease, border-color .3s ease,
      background .25s ease, color .25s ease;
  }
  .motion-active h1.motion-reveal { --reveal-y: 52px; }
  .motion-active .motion-visual.motion-reveal { scale: .965; }
  .motion-active .motion-reveal.is-revealed {
    --reveal-y: 0px;
    opacity: 1;
  }
  .motion-active .motion-visual.motion-reveal.is-revealed { scale: 1; }
  .motion-active .motion-reveal:not(.is-revealed) { will-change: opacity, translate; }

  .motion-active .motion-depth {
    transform: perspective(1100px) translate3d(0, var(--depth-y, 0px), 0)
      rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  }
  .motion-active .spray-stage > img,
  .motion-active .partners-products > img {
    animation: nibrew-drift 6.5s ease-in-out infinite alternate;
    animation-play-state: paused;
  }
  .motion-active .partner-cup { animation-delay: -3.8s; animation-duration: 7.7s; }
  .motion-active .spray-stage.is-on-screen > img,
  .motion-active .is-on-screen .partners-products > img { animation-play-state: running; }
  .motion-active.motion-idle .spray-stage > img,
  .motion-active.motion-idle .partners-products > img { animation-play-state: paused; }

  .motion-active .button:not(.motion-reveal) {
    translate: var(--magnet-x, 0px) var(--magnet-y, 0px);
    transition: translate .3s var(--motion-ease), scale .25s ease,
      transform .3s var(--motion-ease), background .25s ease, color .25s ease;
  }
  .motion-active .button:active { scale: .97; }
  .motion-active .filter { transition: background .25s ease, scale .25s ease; }
  .motion-active .filter:active { scale: .95; }
  .motion-active .product-visual img,
  .motion-active .retailer-visual img,
  .motion-active .location-photo img,
  .motion-active .pod-photo-card img {
    transition: scale .7s var(--motion-ease), transform .7s var(--motion-ease);
  }
  .motion-active .product-detail-button svg,
  .motion-active .opportunity .icon {
    transition: rotate .45s var(--motion-ease), scale .4s var(--motion-ease),
      background .25s ease;
  }
  .motion-active .partnership-row .text-link,
  .motion-active .pod-photo-card {
    transition: transform .5s var(--motion-ease), border-color .3s ease;
  }

  @media (hover: hover) and (pointer: fine) {
    .motion-active .button:hover { scale: 1.025; }
    .motion-active .product-card:hover { transform: translateY(-8px); }
    .motion-active .product-card:hover,
    .motion-active .location-card:hover,
    .motion-active .retailer-card:hover { box-shadow: 0 16px 35px rgba(34,56,65,.1); }
    .motion-active .location-card:hover,
    .motion-active .retailer-card:hover,
    .motion-active .pod-photo-card:hover { transform: translateY(-5px); }
    .motion-active .product-card:hover .product-visual img { scale: 1.035; }
    .motion-active .pack-card:hover .pack-layer img { scale: 1; transform: none; }
    .motion-active .retailer-card:hover .retailer-visual img { scale: 1.08; }
    .motion-active .location-card:hover .location-photo img { scale: 1.025; }
    .motion-active .pod-photo-card:hover img { scale: 1.025; }
    .motion-active .product-detail-button:hover svg { rotate: 90deg; scale: 1.1; }
    .motion-active .partnership-row:hover .opportunity .icon { rotate: -8deg; scale: 1.14; }
    .motion-active .partnership-row:hover .text-link { transform: translateX(4px); }
  }
  @media (max-width: 600px) {
    .motion-active .motion-reveal { --reveal-y: 25px; }
    .motion-active h1.motion-reveal { --reveal-y: 34px; }
    .motion-active .motion-reveal.is-revealed { --reveal-y: 0px; }
  }
}

@keyframes nibrew-drift {
  from { translate: 0 -7px; }
  to { translate: 0 7px; }
}

@keyframes nibrew-page-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .motion-reveal { opacity: 1 !important; translate: none !important; scale: none !important; }
  .motion-depth { transform: none !important; }
  .button:hover, .product-card:hover, .product-card:hover .product-visual img { transform: none; }
}
