/* Precision Lab: one-shot scroll choreography, progressively enhanced by motion.js. */
:root {
  --motion-duration: 700ms;
  --motion-photo-duration: 920ms;
  --motion-distance: 24px;
  --motion-side: 18px;
  --motion-delay: 0ms;
  --motion-photo-base-scale: 1;
  --motion-photo-enter-scale: 1.045;
}

.hero-photo .photo-frame > img {
  animation: motion-photo-zoom 980ms var(--ease-out) both;
}
.hero-intro {
  animation: motion-hero-intro 650ms var(--ease-out) 160ms both;
}
.detail-interior img {
  --motion-photo-base-scale: 1.25;
}

.treatment-item,
.method-list > div {
  position: relative;
  border-top-color: transparent;
}
.treatment-item::before,
.method-list > div::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: -1px;
  height: 1px;
  background: var(--color-rule);
  transform-origin: left center;
}

[data-motion-state="pending"]:not([data-motion="contact"]) {
  opacity: 0;
}
[data-motion-state="pending"][data-motion="service"]::before,
[data-motion-state="pending"][data-motion="method"]::before {
  transform: scaleX(0);
}
[data-motion-state="running"] {
  animation: motion-fade-up var(--motion-duration) var(--ease-out)
    var(--motion-delay) both;
}
[data-motion-state="running"][data-motion="fade"] {
  animation-name: motion-fade;
}
[data-motion-state="running"][data-motion="side"],
[data-motion-state="running"][data-motion="method"] {
  animation-name: motion-side;
}
[data-motion-state="running"][data-motion="contact"] {
  animation-name: motion-contact;
  animation-duration: 520ms;
}
[data-motion-state="running"][data-motion="service"]::before,
[data-motion-state="running"][data-motion="method"]::before {
  animation: motion-line 650ms var(--ease-out) var(--motion-delay) both;
}

[data-motion-state="running"][data-motion^="photo-"] {
  animation: motion-fade 280ms var(--ease-out) var(--motion-delay) both;
}
[data-motion-state="running"][data-motion="photo-y"] .photo-frame {
  animation: motion-mask-y var(--motion-photo-duration) var(--ease-out)
    var(--motion-delay) both;
}
[data-motion-state="running"][data-motion="photo-x"] .photo-frame {
  animation: motion-mask-x var(--motion-photo-duration) var(--ease-out)
    var(--motion-delay) both;
}
[data-motion-state="running"][data-motion^="photo-"] .photo-frame > img {
  animation: motion-photo-zoom var(--motion-photo-duration) var(--ease-out)
    var(--motion-delay) both;
  will-change: transform;
}
[data-motion-state="running"][data-motion="photo-depth"] .photo-frame {
  animation: motion-photo-depth var(--motion-photo-duration) var(--ease-out)
    var(--motion-delay) both;
}
[data-motion-state="running"][data-motion^="photo-"] .photo-caption {
  animation: motion-fade 500ms var(--ease-out) calc(var(--motion-delay) + 160ms)
    both;
}

[data-motion-state]:focus-within {
  opacity: 1 !important;
  transform: none !important;
}

@keyframes motion-hero-intro {
  from {
    opacity: 0.55;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes motion-fade-up {
  from {
    opacity: 0;
    transform: translateY(var(--motion-distance));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes motion-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes motion-side {
  from {
    opacity: 0;
    transform: translate3d(calc(-1 * var(--motion-side)), 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
@keyframes motion-contact {
  from {
    opacity: 0.72;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes motion-line {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes motion-mask-x {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes motion-mask-y {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}
@keyframes motion-photo-zoom {
  from {
    transform: scale(
      calc(var(--motion-photo-base-scale) * var(--motion-photo-enter-scale))
    );
  }
  to {
    transform: scale(var(--motion-photo-base-scale));
  }
}
@keyframes motion-photo-depth {
  from {
    opacity: 0.3;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  :root {
    --motion-distance: 16px;
    --motion-side: 0px;
    --motion-photo-enter-scale: 1.025;
    --motion-duration: 620ms;
    --motion-photo-duration: 800ms;
  }
}
@media (prefers-reduced-motion: reduce), print {
  [data-motion-state] {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  [data-motion-state]::before {
    transform: scaleX(1) !important;
    animation: none !important;
  }
  [data-motion-state] .photo-frame {
    clip-path: none !important;
    transform: none !important;
    animation: none !important;
  }
  [data-motion-state] .photo-frame > img,
  [data-motion-state] .photo-caption,
  .hero-photo .photo-frame > img,
  .hero-intro {
    animation: none !important;
    will-change: auto;
  }
}
