/*
 * Motion layer
 * Loaded after the page-specific styles. JavaScript adds .motion-enabled only
 * when the visitor has not requested reduced motion.
 */

:root {
  --motion-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --motion-ease-in: cubic-bezier(0.55, 0, 1, 0.45);
}

/* Opening sequence and in-page reveals */

.motion-enabled .motion-intro {
  animation: motion-intro-in 900ms var(--motion-ease-out) both;
  animation-delay: var(--intro-delay, 0ms);
}

.motion-enabled .motion-reveal {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity 780ms var(--motion-ease-soft),
    transform 900ms var(--motion-ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.motion-enabled .motion-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.motion-enabled article.motion-reveal[data-reveal="image"],
.motion-enabled figure.motion-reveal[data-reveal="image"] {
  clip-path: inset(0 0 9% 0);
  transition:
    opacity 780ms var(--motion-ease-soft),
    transform 900ms var(--motion-ease-out),
    clip-path 1100ms var(--motion-ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.motion-enabled article.motion-reveal[data-reveal="image"].is-visible,
.motion-enabled figure.motion-reveal[data-reveal="image"].is-visible {
  clip-path: inset(0 0 0 0);
}

.motion-enabled .motion-reveal.motion-settled,
.motion-enabled article.motion-reveal[data-reveal="image"].motion-settled,
.motion-enabled figure.motion-reveal[data-reveal="image"].motion-settled {
  clip-path: none;
  will-change: auto;
}

.motion-enabled article.motion-reveal[data-reveal="image"]:focus-within,
.motion-enabled figure.motion-reveal[data-reveal="image"]:focus-within {
  clip-path: none !important;
}

@keyframes motion-intro-in {
  from {
    opacity: 0;
    transform: translate3d(0, 15px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* Hero scene: pointer and scroll values are supplied as pixel custom props. */

.motion-enabled .hero-art-window {
  overflow: hidden;
}

.motion-enabled .hero-art-window > img {
  transform: translate3d(
      var(--scene-x, 0px),
      calc(var(--scene-y, 0px) + var(--scene-scroll, 0px)),
      0
    )
    scale(1.065);
  transform-origin: 50% 50%;
  transition: transform 160ms cubic-bezier(0.2, 0.65, 0.3, 1);
  will-change: transform;
}

.motion-enabled .hero-wordmark {
  transform: translate3d(var(--title-x, 0px), var(--title-y, 0px), 0);
  transition: transform 220ms var(--motion-ease-soft);
  will-change: transform;
}

/* Pointer aura. Native cursors remain visible. */

.motion-enabled .pointer-aura {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  margin: -14px;
  border: 1px solid var(--ink, #273d49);
  border-radius: 50%;
  opacity: 0;
  scale: 1;
  pointer-events: none;
  transition:
    opacity 240ms ease,
    scale 420ms var(--motion-ease-out),
    border-color 240ms ease;
  will-change: transform, opacity, scale;
}

.motion-enabled .pointer-aura.is-visible {
  opacity: 0.45;
}

.motion-enabled .pointer-aura.is-over-art {
  border-color: color-mix(in srgb, var(--paper, #f5f6f3) 75%, transparent);
  scale: 2.2;
}

/* Artwork response. Tilt and pan affect only the image, never the hit area. */

.motion-enabled .motion-tilt {
  isolation: isolate;
}

.motion-enabled .record-art.motion-tilt img,
.motion-enabled .member-portrait.motion-tilt img,
.motion-enabled .merch-page .product-art.motion-tilt img {
  transform: perspective(950px) rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg))
    translate3d(var(--art-x, 0px), var(--art-y, 0px), 0);
  transform-origin: 50% 50%;
  scale: 1.025;
  transition:
    transform 300ms var(--motion-ease-out),
    scale 650ms var(--motion-ease-out);
  will-change: transform, scale;
}

.motion-enabled .record-art.motion-tilt.is-tracking img,
.motion-enabled .member-portrait.motion-tilt.is-tracking img,
.motion-enabled .record-art.motion-tilt:hover img,
.motion-enabled .record-art.motion-tilt:focus-visible img,
.motion-enabled .merch-page .product-art.motion-tilt.is-tracking img,
.motion-enabled .merch-page .product-art.motion-tilt:hover img,
.motion-enabled .merch-page .product-art.motion-tilt:focus-visible img {
  scale: 1.045;
}

.motion-enabled .motion-tilt::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: radial-gradient(
    circle at var(--light-x, 50%) var(--light-y, 50%),
    rgb(255 255 255 / 72%) 0,
    rgb(255 255 255 / 24%) 18%,
    transparent 52%
  );
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

.motion-enabled .motion-tilt.is-tracking::before,
.motion-enabled .motion-tilt:hover::before,
.motion-enabled .motion-tilt:focus-visible::before {
  opacity: 0.12;
}

.motion-enabled .record-art .art-open {
  z-index: 2;
  transition:
    opacity 240ms ease,
    transform 500ms var(--motion-ease-out),
    background-color 240ms ease,
    color 240ms ease;
}

.motion-enabled .record-art:hover .art-open,
.motion-enabled .record-art:focus-visible .art-open {
  transform: translate3d(0, 0, 0) rotate(90deg);
}

/* Magnetic movement belongs to the arrow glyph inside the circle. */

.motion-enabled .circle-arrow.motion-magnet {
  translate: var(--magnet-x, 0px) var(--magnet-y, 0px);
  transition: translate 260ms var(--motion-ease-out);
  will-change: translate;
}

/* Links, navigation, controls, and rows */

.motion-enabled .nav-link::after {
  opacity: 0;
  transform: translate3d(-7px, 0, 0) scale(0.65);
  transition:
    opacity 260ms ease,
    transform 420ms var(--motion-ease-out);
}

.motion-enabled .nav-link:hover::after,
.motion-enabled .nav-link:focus-visible::after,
.motion-enabled .nav-link[aria-current]::after {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.motion-enabled .inline-link,
.motion-enabled .footer-bottom a,
.motion-enabled .social-links a,
.motion-enabled .contact-email,
.motion-enabled .merch-contact,
.motion-enabled .product-open,
.motion-enabled .product-dialog .dialog-x,
.motion-enabled .product-dialog .dialog-done {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 100% 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition:
    background-size 450ms var(--motion-ease-out),
    color 220ms ease;
}

.motion-enabled .inline-link:hover,
.motion-enabled .inline-link:focus-visible,
.motion-enabled .footer-bottom a:hover,
.motion-enabled .social-links a:hover,
.motion-enabled .social-links a:focus-visible,
.motion-enabled .contact-email:hover,
.motion-enabled .contact-email:focus-visible,
.motion-enabled .merch-contact:hover,
.motion-enabled .merch-contact:focus-visible,
.motion-enabled .footer-bottom a:focus-visible,
.motion-enabled .product-open:hover,
.motion-enabled .product-open:focus-visible,
.motion-enabled .product-dialog .dialog-x:hover,
.motion-enabled .product-dialog .dialog-x:focus-visible,
.motion-enabled .product-dialog .dialog-done:hover,
.motion-enabled .product-dialog .dialog-done:focus-visible {
  background-position: 0 100%;
  background-size: 100% 1px;
}

.motion-enabled .inline-link,
.motion-enabled .product-open,
.motion-enabled .product-dialog .dialog-x,
.motion-enabled .product-dialog .dialog-done {
  border-bottom-color: transparent;
}

.motion-enabled .circle-arrow {
  transition:
    background-color 320ms ease,
    border-color 320ms ease,
    color 320ms ease,
    scale 420ms var(--motion-ease-out);
}

.motion-enabled a:hover .circle-arrow,
.motion-enabled button:hover .circle-arrow,
.motion-enabled a:focus-visible .circle-arrow,
.motion-enabled button:focus-visible .circle-arrow {
  scale: 1.06;
}

.motion-enabled .form-field input,
.motion-enabled .form-field select,
.motion-enabled .form-field textarea {
  box-shadow: inset 0 -1px 0 transparent;
  transition:
    border-color 280ms ease,
    box-shadow 480ms var(--motion-ease-out),
    color 220ms ease;
}

.motion-enabled .form-field input:hover,
.motion-enabled .form-field select:hover,
.motion-enabled .form-field textarea:hover {
  border-bottom-color: var(--quiet);
}

.motion-enabled .form-field input:focus,
.motion-enabled .form-field select:focus,
.motion-enabled .form-field textarea:focus {
  border-bottom-color: var(--blue);
  box-shadow: inset 0 -1px 0 var(--blue);
}

.motion-enabled .live-tabs button {
  transition:
    color 240ms ease,
    border-color 360ms ease;
}

.motion-enabled .live-row {
  transition:
    border-color 300ms ease,
    padding-inline 500ms var(--motion-ease-out);
}

.motion-enabled .live-row:hover {
  border-color: color-mix(in srgb, var(--ink) 45%, var(--rule));
  padding-inline: 8px;
}

/* Panels, dialogs, and mobile navigation */

.motion-enabled .live-panel:not([hidden]) {
  animation: live-panel-in 560ms var(--motion-ease-out) both;
}

@keyframes live-panel-in {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.motion-enabled .detail-dialog[open],
.motion-enabled .product-dialog[open] {
  animation: dialog-in 420ms var(--motion-ease-out) both;
}

.motion-enabled .detail-dialog[open]::backdrop,
.motion-enabled .product-dialog[open]::backdrop {
  animation: dialog-backdrop-in 240ms ease both;
}

.motion-enabled .detail-dialog.is-closing,
.motion-enabled .product-dialog.is-closing {
  animation: dialog-out 180ms var(--motion-ease-in) both;
}

.motion-enabled .detail-dialog.is-closing::backdrop,
.motion-enabled .product-dialog.is-closing::backdrop {
  animation: dialog-backdrop-out 180ms ease both;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes dialog-out {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.994);
  }
}

@keyframes dialog-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes dialog-backdrop-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* A small, occasional breeze once these illustrations enter the page. */

.motion-enabled .live-panel:not([hidden]) .little-window svg {
  animation: window-breeze 8s ease-in-out 900ms infinite;
  transform-origin: 50% 82%;
}

.motion-enabled .merch-teaser-art.is-visible svg,
.motion-enabled .is-visible .merch-teaser-art svg {
  animation: merch-breeze 8s ease-in-out 700ms infinite;
  transform-origin: 52% 88%;
}

@keyframes window-breeze {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  48% {
    transform: translate3d(1px, -1px, 0) rotate(0.7deg);
  }
  74% {
    transform: translate3d(-0.5px, 0, 0) rotate(-0.3deg);
  }
}

@keyframes merch-breeze {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-7deg);
  }
  48% {
    transform: translate3d(1px, -1px, 0) rotate(-6.3deg);
  }
  74% {
    transform: translate3d(-0.5px, 0, 0) rotate(-7.25deg);
  }
}

@media (max-width: 700px) {
  .motion-enabled .menu-lines {
    transition:
      height 260ms ease,
      transform 420ms var(--motion-ease-out);
  }

  .motion-enabled .primary-nav.is-open {
    animation: mobile-nav-in 340ms var(--motion-ease-out) both;
  }

  .motion-enabled .primary-nav.is-closing {
    display: flex;
    animation: mobile-nav-out 180ms var(--motion-ease-in) both;
    pointer-events: none;
  }

  .motion-enabled .primary-nav.is-open .nav-link {
    animation: mobile-nav-link-in 440ms var(--motion-ease-out) both;
  }

  .motion-enabled .primary-nav.is-open .nav-link:nth-child(2) {
    animation-delay: 35ms;
  }

  .motion-enabled .primary-nav.is-open .nav-link:nth-child(3) {
    animation-delay: 70ms;
  }

  .motion-enabled .primary-nav.is-open .nav-link:nth-child(4) {
    animation-delay: 105ms;
  }

  @keyframes mobile-nav-in {
    from {
      opacity: 0;
      transform: translate3d(0, -9px, 0);
    }
    to {
      opacity: 1;
      transform: translate3d(0, 0, 0);
    }
  }

  @keyframes mobile-nav-out {
    from {
      opacity: 1;
      transform: translate3d(0, 0, 0);
    }
    to {
      opacity: 0;
      transform: translate3d(0, -7px, 0);
    }
  }

  @keyframes mobile-nav-link-in {
    from {
      opacity: 0;
      transform: translate3d(-7px, 0, 0);
    }
    to {
      opacity: 1;
      transform: translate3d(0, 0, 0);
    }
  }
}

@media (hover: none), (pointer: coarse) {
  .motion-enabled .pointer-aura {
    display: none;
  }
}

/* Safety net for a preference change, an early paint, or delayed JavaScript. */

@media (prefers-reduced-motion: reduce) {
  .motion-intro,
  .motion-reveal,
  article.motion-reveal[data-reveal="image"],
  figure.motion-reveal[data-reveal="image"] {
    clip-path: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .motion-enabled .hero-art-window > img,
  .motion-enabled .hero-wordmark,
  .motion-tilt img,
  .record-art:hover img,
  .record-art:focus-visible img,
  .merch-page .product-art:hover img,
  .merch-page .product-art:focus-visible img {
    transform: none !important;
    scale: 1 !important;
    transition: none !important;
  }

  .motion-magnet {
    translate: 0 0 !important;
  }

  .pointer-aura,
  .motion-tilt::before {
    display: none !important;
  }

  .primary-nav.is-closing {
    display: none !important;
  }
}
