/* Pixels Motion: animated showcase (home section + motion.html). Pure CSS, one brand variable. */
.mo {
  --mo-brand: #2563eb;
  --mo-tint: color-mix(in srgb, var(--mo-brand) 14%, #fff);
  --mo-soft: color-mix(in srgb, var(--mo-brand) 7%, #fff);
  --mo-card: #fff;
  --mo-ink: #101828;
  --mo-ink-2: #667085;
  --mo-line: #eaecf0;
  --mo-bg: radial-gradient(120% 90% at 0% 0%, var(--mo-soft), transparent 60%), linear-gradient(160deg, #f8faff, #f3f4ff);
  position: relative;
  min-width: 0;
}
:root[data-px-theme='dark'] .mo {
  --mo-tint: color-mix(in srgb, var(--mo-brand) 26%, #14161b);
  --mo-soft: color-mix(in srgb, var(--mo-brand) 14%, #0b0c0f);
  --mo-card: #14161b;
  --mo-ink: #f5f6f8;
  --mo-ink-2: #9aa3b2;
  --mo-line: #262b35;
  --mo-bg: radial-gradient(120% 90% at 0% 0%, var(--mo-soft), transparent 60%), #0e1014;
}
.mo-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--mo-line);
  border-radius: 24px;
  background: var(--mo-bg);
  overflow: hidden;
}
.mo-stage::before {
  /* soft brand glow that follows the chosen color */
  content: '';
  position: absolute;
  inset: auto -20% -40% auto;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--mo-brand);
  opacity: 0.12;
  filter: blur(60px);
  transition: background 0.4s;
}
.mo-card {
  position: relative;
  z-index: 1;
  padding: 16px;
  border: 1px solid var(--mo-line);
  border-radius: 18px;
  background: var(--mo-card);
  color: var(--mo-ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 18px 40px -24px rgba(16, 24, 40, 0.35);
  animation: mo-float 7s ease-in-out infinite;
}
.mo-card:nth-child(2) {
  animation-delay: -2.3s;
}
.mo-card:nth-child(3) {
  animation-delay: -4.6s;
}
.mo-tag {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--mo-tint);
  color: var(--mo-brand);
  font-size: 11px;
  font-weight: 600;
  transition: background 0.4s, color 0.4s;
}
.mo-k {
  color: var(--mo-ink-2);
  font-size: 11.5px;
}

/* --- E-commerce: add to cart --- */
.mo-shop {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 330px;
}
.mo-shop__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mo-cart {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--mo-soft);
  color: var(--mo-ink);
  animation: mo-cart 4s ease-in-out infinite;
}
.mo-cart svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mo-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: block;
  width: 18px;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--mo-brand);
  color: #fff;
  font-size: 10.5px;
  font-style: normal;
  line-height: 18px;
  text-align: center;
  animation: mo-pop 4s ease-in-out infinite;
}
.mo-badge i {
  display: block;
  font-style: normal;
  animation: mo-count 4s ease-in-out infinite;
}
.mo-shop__img {
  position: relative;
  flex: 1;
  min-height: 140px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--mo-tint), var(--mo-soft));
  overflow: hidden;
  transition: background 0.4s;
}
.mo-shop__item {
  position: relative;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 28% 42% 34% 40%;
  background: linear-gradient(140deg, var(--mo-brand), color-mix(in srgb, var(--mo-brand) 55%, #fff));
  box-shadow: 0 24px 30px -18px color-mix(in srgb, var(--mo-brand) 70%, #000);
  animation: mo-spin 8s ease-in-out infinite;
}
.mo-shop__item::after {
  content: '';
  position: absolute;
  inset: 18% 20% auto auto;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}
.mo-shop__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: mo-shine 4s ease-in-out infinite;
}
.mo-lines {
  display: grid;
  gap: 6px;
}
.mo-lines i {
  display: block;
  height: 8px;
  width: 70%;
  border-radius: 4px;
  background: var(--mo-line);
}
.mo-lines i + i {
  width: 45%;
}
.mo-shop__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mo-shop__row b {
  font-size: 20px;
}
.mo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--mo-brand);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  animation: mo-press 4s ease-in-out infinite;
  transition: background 0.4s;
}
.mo-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mo-fly {
  position: absolute;
  right: 56px;
  bottom: 30px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mo-brand);
  opacity: 0;
  animation: mo-fly 4s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}

/* --- Healthcare: heart rate + booking --- */
.mo-health {
  display: grid;
  gap: 10px;
}
.mo-health__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mo-heart {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--mo-tint);
  color: var(--mo-brand);
  animation: mo-beat 1.2s ease-in-out infinite;
}
.mo-heart svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.mo-bpm b {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}
.mo-ecg {
  width: 100%;
  height: 46px;
  fill: none;
  stroke: var(--mo-brand);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 320;
  animation: mo-ecg 2.4s linear infinite;
  transition: stroke 0.4s;
}
.mo-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--mo-soft);
  font-size: 12px;
  font-weight: 500;
  animation: mo-toast 4.8s ease-in-out infinite;
}
.mo-toast span {
  display: inline-flex;
  flex: none;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #12b76a;
  color: #fff;
}
.mo-toast svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Finance: balance + chart --- */
.mo-fin {
  display: grid;
  gap: 8px;
}
.mo-fin__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}
.mo-fin__head b {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}
.mo-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-size: 11px;
  font-weight: 600;
  animation: mo-chip 6s ease-in-out infinite;
}
:root[data-px-theme='dark'] .mo-chip {
  background: rgba(18, 183, 106, 0.16);
  color: #47cd89;
}
.mo-chart {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 64px;
}
.mo-chart i {
  flex: 1;
  height: var(--h);
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(var(--mo-brand), color-mix(in srgb, var(--mo-brand) 45%, transparent));
  transform-origin: bottom;
  animation: mo-bar 6s cubic-bezier(0.2, 0.7, 0.2, 1) infinite;
  animation-delay: calc(var(--k) * 90ms);
}
.mo-chart svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--mo-ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 260;
  opacity: 0.7;
  animation: mo-line 6s ease-in-out infinite;
}

/* --- Brand color switcher --- */
.mo-swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--ink-2, #475467);
  font-size: 13px;
}
.mo-swatches button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.15);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.mo-swatches button:hover {
  transform: scale(1.1);
}
.mo-swatches button[aria-pressed='true'] {
  box-shadow: 0 0 0 2px var(--c);
}
.mo-swatches button:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 3px;
}
.mo-swatches code {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--line-soft, #f2f4f7);
  color: var(--ink, #101828);
  font-size: 12px;
}

/* Paused when off screen (js/motion.js) or when the user asks for less motion */
.mo.is-paused *,
.mo.is-paused .mo-card {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  .mo *,
  .mo .mo-card {
    animation: none !important;
  }
}

/* --- keyframes --- */
@keyframes mo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes mo-spin {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50% { transform: rotate(6deg) translateY(-8px); }
}
@keyframes mo-shine {
  0%, 20% { transform: translateX(-100%); }
  45%, 100% { transform: translateX(100%); }
}
@keyframes mo-press {
  0%, 30%, 44%, 100% { transform: scale(1); filter: none; }
  36% { transform: scale(0.93); filter: brightness(0.88); }
}
@keyframes mo-fly {
  0%, 36% { opacity: 0; transform: translate(0, 0) scale(1); }
  40% { opacity: 1; }
  58% { opacity: 1; transform: translate(34px, -268px) scale(0.6); }
  62%, 100% { opacity: 0; transform: translate(34px, -268px) scale(0.3); }
}
@keyframes mo-cart {
  0%, 56%, 72%, 100% { transform: rotate(0); }
  60% { transform: rotate(-12deg) scale(1.08); }
  66% { transform: rotate(8deg); }
}
@keyframes mo-pop {
  0%, 56%, 70%, 100% { transform: scale(1); }
  62% { transform: scale(1.35); }
}
@keyframes mo-count {
  0%, 57% { transform: translateY(0); }
  61%, 96% { transform: translateY(-18px); }
  100% { transform: translateY(0); }
}
@keyframes mo-beat {
  0%, 30%, 100% { transform: scale(1); }
  10% { transform: scale(1.18); }
  20% { transform: scale(1.04); }
  25% { transform: scale(1.12); }
}
@keyframes mo-ecg {
  from { stroke-dashoffset: 320; }
  to { stroke-dashoffset: -320; }
}
@keyframes mo-toast {
  0%, 30% { opacity: 0; transform: translateY(8px); }
  38%, 88% { opacity: 1; transform: translateY(0); }
  96%, 100% { opacity: 0; transform: translateY(-4px); }
}
@keyframes mo-bar {
  0% { transform: scaleY(0.15); }
  25%, 80% { transform: scaleY(1); }
  100% { transform: scaleY(0.15); }
}
@keyframes mo-line {
  0%, 10% { stroke-dashoffset: 260; }
  40%, 80% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -260; }
}
@keyframes mo-chip {
  0%, 30% { opacity: 0; transform: scale(0.6); }
  38%, 85% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.9); }
}


.mo-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.mo-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mo-eyebrow b {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--px-color-content-neutral-primary, #101828);
  color: var(--px-color-surface-default, #fff);
  font-size: 11px;
}
@media (max-width: 560px) {
  .mo-stage {
    grid-template-columns: minmax(0, 1fr);
    padding: 14px;
    gap: 12px;
  }
  .mo-shop {
    grid-row: auto;
  }
}
.mo-tag {
  justify-self: start;
}

/* DNA particle showcase (js/dna.js) */
.dna {
  position: relative;
  min-height: 460px;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border: 1px solid var(--line, #eaecf0);
  border-radius: 24px;
  background:
    radial-gradient(60% 55% at 55% 50%, rgba(236, 72, 153, 0.08), transparent 70%),
    radial-gradient(70% 60% at 80% 10%, rgba(99, 102, 241, 0.1), transparent 70%),
    linear-gradient(160deg, #ffffff, #f7f5ff);
  box-shadow: 0 30px 60px -40px rgba(124, 58, 237, 0.45);
}
:root[data-px-theme='dark'] .dna {
  border-color: #262b35;
  background:
    radial-gradient(60% 55% at 55% 50%, rgba(236, 72, 153, 0.14), transparent 70%),
    radial-gradient(70% 60% at 80% 10%, rgba(99, 102, 241, 0.16), transparent 70%),
    #0e1014;
}
.dna canvas {
  position: absolute;
  inset: 0;
  display: block;
}
@media (max-width: 560px) {
  .dna {
    min-height: 340px;
    aspect-ratio: 4 / 5;
  }
}
/* DNA floats on the page: no card around it */
.dna,
:root[data-px-theme='dark'] .dna {
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}
.dna canvas {
  -webkit-mask-image: radial-gradient(ellipse 70% 72% at 50% 50%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 72% at 50% 50%, #000 55%, transparent 100%);
}
.dna canvas {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20%, #000 80%, transparent 100%), linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 20%, #000 80%, transparent 100%), linear-gradient(to right, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-composite: intersect;
}
