/* Pixels Motion scene, rebuilt from the product film (Healthcare pack). Used on Home and the Motion page.
   js/motion-scene.js writes the markup into [data-mv-scene], scales the 1100px scene to fit its box, and
   plays it when it scrolls into view, then again every few seconds. Each dark label names the animation. */

/* the scene is drawn at 1100 x 640 and scaled to the box, like a screenshot that moves */
.mv-fit {
  position: relative;
  width: 100%;
  aspect-ratio: 1100 / 640;
}
.mv-fit .mv {
  position: absolute;
  top: 0;
  left: 0;
  width: 1100px;
  height: 640px;
  transform-origin: 0 0;
  scale: var(--mv-s, 1);
}

/* ---------- the window ---------- */
.mv {
  --mv-ink: #0f1222;
  --mv-ink-2: #5b6170;
  --mv-violet: var(--mv-ink); /* text, buttons and labels are black: no colored or gradient text */
  --mv-pink: #db2777;
  position: relative;
  overflow: hidden;
  border: 1px solid #e7e5f0;
  border-radius: 20px;
  background:
    radial-gradient(45% 60% at 72% 55%, rgba(236, 72, 153, 0.07), transparent 70%),
    radial-gradient(40% 50% at 95% 10%, rgba(99, 102, 241, 0.08), transparent 70%),
    #fcfcfe;
  box-shadow: 0 1px 2px rgba(15, 18, 34, 0.04), 0 50px 90px -50px rgba(76, 29, 149, 0.35);
  color: var(--mv-ink);
  opacity: 0;
  transform: translateY(24px);
}
.mv-nav {
  display: flex;
  align-items: center;
  gap: 40px;
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid #efedf5;
  opacity: 0;
}
.mv-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
}
.mv-logo i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899, #7c3aed 60%, #3b82f6);
}
.mv-links {
  display: flex;
  gap: 24px;
  color: var(--mv-ink-2);
  font-size: 14px;
}
.mv-book {
  margin-inline-start: auto;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--mv-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.mv-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: 575px;
}
.mv-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 52px 0 40px 56px;
}
.mv .mv-kick {
  position: relative;
  color: var(--mv-violet);
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
}
.mv .mv-h {
  margin-top: 18px;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.04em;
}
.mv-h .w {
  display: inline-block;
  opacity: 0;
  filter: blur(6px);
  transform: translateY(0.5em);
}
.mv-g {
  color: var(--mv-ink);
}
.mv .mv-p {
  max-width: 420px;
  margin-top: 18px;
  color: var(--mv-ink-2);
  font-size: 16px;
  line-height: 1.6;
  opacity: 0;
}
.mv-ctas {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  opacity: 0;
}
.mv-btn,
.mv-btn2 {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
}
.mv-btn {
  position: relative;
  background: var(--mv-violet);
  color: #fff;
}
.mv-btn::after {
  /* cta.pulse */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(15, 18, 34, 0.35);
}
.mv-btn2 {
  border: 1px solid #e3e1ea;
  background: #fff;
}
.mv-cards {
  display: flex;
  gap: 16px;
  margin-top: 36px;
}
.mv-card {
  position: relative;
  padding: 16px 18px;
  border: 1px solid #efedf5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px -18px rgba(15, 18, 34, 0.25);
  opacity: 0;
  transform: translateY(16px);
}
.mv .mv-card__l {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--mv-ink-2);
  font-size: 13px;
}
.mv-hr {
  width: 220px;
}
.mv-heart {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fdf2f8;
  color: #db2777;
  font-size: 12px;
}
.mv .mv-bpm {
  margin-top: 4px;
  color: var(--mv-ink-2);
  font-size: 13px;
}
.mv-bpm b {
  color: var(--mv-ink);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.mv-ecg {
  display: block;
  width: 100%;
  height: 34px;
  margin-top: 6px;
  fill: none;
  stroke: #db2777;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-dasharray: 360;
  stroke-dashoffset: 360;
}
.mv-lab {
  width: 250px;
}
.mv-lab ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.mv-lab li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8f7fb;
  font-size: 14px;
  opacity: 0;
  transform: translateX(-10px);
}
.mv-lab li i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.mv-lab li b {
  margin-inline-start: auto;
  font-size: 12px;
  font-weight: 600;
}
.mv-lab .ok {
  color: #059669;
}
.mv-lab .rv {
  color: #d97706;
}

/* right side: DNA particles and the glass card */
.mv-vis {
  position: relative;
  min-width: 0;
}
.mv-vis .dna {
  position: absolute;
  inset: -20px -20px 0 0;
  min-height: 0;
  aspect-ratio: auto;
  opacity: 0;
  transform: scale(0.94);
}
.mv-glass {
  position: absolute;
  right: 32px;
  bottom: 36px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px -20px rgba(76, 29, 149, 0.35);
  opacity: 0;
  filter: blur(8px);
  transform: translateX(40px);
}
.mv-doc {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ec4899, #a855f7);
}
.mv-glass__t {
  display: grid;
  gap: 2px;
}
.mv-glass__t b {
  font-size: 16px;
  font-weight: 600;
}
.mv-glass__t small {
  color: var(--mv-ink-2);
  font-size: 13px;
}
.mv-join {
  margin-inline-start: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--mv-violet);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* the dark labels that name each animation */
.mv-tag {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 8px;
  background: #0f1222;
  color: #fff;
  font: 500 12.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.8);
}
.mv-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a78bfa;
}
.mv-kick .mv-tag {
  left: calc(100% + 16px);
  top: -6px;
}
.mv-ctas .mv-tag {
  position: static;
  margin-inline-start: 14px;
}
.mv-tag--top {
  top: -14px;
  right: 14px;
}
.mv-tag--dna {
  top: 8%;
  left: 18%;
}

/* ---------- the timeline ---------- */
.mv.is-on {
  animation: mv-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.mv.is-on .mv-nav {
  animation: mv-fade 0.5s 0.3s ease forwards;
}
.mv.is-on .mv-kick {
  animation: mv-fade 0.5s 0.6s ease forwards;
}
.mv.is-on .mv-h .w {
  animation: mv-word 0.7s calc(0.75s + var(--i) * 0.13s) cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.mv.is-on .mv-p {
  animation: mv-up 0.6s 1.5s ease forwards;
}
.mv.is-on .mv-ctas {
  animation: mv-up 0.6s 1.8s ease forwards;
}
.mv.is-on .mv-btn::after {
  animation: mv-pulse 2s 2.6s ease-out infinite;
}
.mv.is-on .mv-card {
  animation: mv-up 0.6s 2.2s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.mv.is-on .mv-lab {
  animation-delay: 2.35s;
}
.mv.is-on .mv-ecg {
  animation:
    mv-draw 1.4s 2.6s ease forwards,
    mv-beat 2.4s 4s linear infinite;
}
.mv.is-on .mv-heart {
  animation: mv-heart 1s 2.8s ease-in-out infinite;
}
.mv.is-on .mv-lab li {
  animation: mv-slide 0.45s calc(2.7s + var(--j) * 0.18s) ease forwards;
}
.mv.is-on .mv-vis .dna {
  animation: mv-dna 1.4s 1s ease forwards;
}
.mv.is-on .mv-glass {
  animation: mv-glass 0.9s 3.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.mv.is-on .mv-tag {
  animation: mv-tag 0.35s calc(var(--d) * 1s + 0.4s) cubic-bezier(0.3, 1.4, 0.5, 1) forwards;
}

@keyframes mv-in {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes mv-fade {
  to {
    opacity: 1;
  }
}
@keyframes mv-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes mv-word {
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}
@keyframes mv-slide {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes mv-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 18, 34, 0.35);
  }
  70%,
  100% {
    box-shadow: 0 0 0 14px rgba(15, 18, 34, 0);
  }
}
@keyframes mv-draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes mv-beat {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -720;
  }
}
@keyframes mv-heart {
  0%,
  100% {
    transform: scale(1);
  }
  15% {
    transform: scale(1.2);
  }
  30% {
    transform: scale(1);
  }
}
@keyframes mv-dna {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes mv-glass {
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}
@keyframes mv-tag {
  to {
    opacity: 1;
    transform: none;
  }
}
/* replays: the window and its nav stay put, only the content plays again */
.mv.is-again,
.mv.is-again .mv-nav {
  opacity: 1;
  transform: none;
  animation: none !important;
}

/* visitors who prefer less motion see the finished scene */
@media (prefers-reduced-motion: reduce) {
  .mv,
  .mv *,
  .mv *::after {
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
  .mv-ecg {
    stroke-dashoffset: 0 !important;
  }
}
