/* motion-<pack>.html: one Motion pack */
.ap-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: center;
  padding: 48px 0 56px;
}
.ap-hero__msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.ap-crumbs {
  display: flex;
  gap: 8px;
  color: var(--ink-3);
  font-size: 13.5px;
}
.ap-crumbs a {
  color: var(--ink-2);
}
.ap-crumbs a:hover {
  color: var(--brand);
}
.ap-crumbs [aria-current] {
  color: var(--ink);
  font-weight: 500;
}
.ap-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 !important;
  padding: 0;
  list-style: none;
}
.ap-facts li {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--dk-bg-ffffff, #fff);
  color: var(--ink-2);
  font-size: 13px;
}
.ap-facts b {
  color: var(--ink);
}
.ap-soon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 13px;
}
.ap-soon span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f79009;
  box-shadow: 0 0 0 4px rgba(247, 144, 9, 0.15);
}
.ap-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 60%),
    linear-gradient(150deg, color-mix(in srgb, var(--c) 16%, #fff), color-mix(in srgb, var(--c) 4%, #fff));
  overflow: hidden;
}
:root[data-px-theme='dark'] .ap-cover {
  background: radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--c) 34%, transparent), transparent 60%), #14161b;
}
.ap-cover .mp-ic {
  position: relative;
  z-index: 1;
  width: 88px;
  height: 88px;
  margin: 0;
  border-radius: 24px;
  background: var(--dk-bg-ffffff, #fff);
  color: var(--c);
  box-shadow: 0 20px 40px -18px color-mix(in srgb, var(--c) 80%, #000);
}
.ap-cover .mp-ic svg {
  width: 40px;
  height: 40px;
}
.ap-cover > span:not(.mp-ic) {
  position: absolute;
  border-radius: 14px;
  background: var(--dk-bg-ffffff, #fff);
  box-shadow: 0 10px 24px -14px rgba(16, 24, 40, 0.35);
  animation: ap-float 6s ease-in-out infinite;
}
.ap-cover__a {
  left: 9%;
  top: 14%;
  width: 34%;
  height: 16%;
}
.ap-cover__b {
  right: 8%;
  bottom: 14%;
  width: 30%;
  height: 22%;
  animation-delay: -2s !important;
}
.ap-cover__c {
  left: 14%;
  bottom: 18%;
  width: 12%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 50% !important;
  background: var(--c) !important;
  opacity: 0.35;
  animation-delay: -4s !important;
}
@keyframes ap-float {
  50% {
    transform: translateY(-8px);
  }
}

/* grid of animations */
.ap-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
}
.ap-head .lead {
  margin-top: 6px;
}
.ap-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand);
  font-weight: 600;
  font-size: 14px;
}
.ap-all .pc-arrow {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.ap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.ap-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--dk-bg-ffffff, #fff);
  box-shadow: var(--card-shadow);
  transition: transform 0.16s, box-shadow 0.16s;
}
.ap-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}
.ap-prev {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 4 / 3;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 12%, #fff), color-mix(in srgb, var(--c) 3%, #fff));
  overflow: hidden;
}
:root[data-px-theme='dark'] .ap-prev {
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 22%, #14161b), #14161b);
}
.ap-num {
  position: absolute;
  top: 10px;
  left: 12px;
  color: color-mix(in srgb, var(--c) 70%, #101828);
  font: 600 11px/1 ui-monospace, Menlo, monospace;
  opacity: 0.7;
}
.ap-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(16, 24, 40, 0.75);
  color: #fff;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.15s, transform 0.15s;
}
.ap-play svg {
  width: 11px;
  height: 11px;
  margin-left: 2px;
  fill: currentColor;
}
.ap-card:hover .ap-play {
  opacity: 1;
  transform: none;
}
.ap-meta {
  display: grid;
  gap: 2px;
  padding: 12px 14px 14px;
}
.ap-meta h3 {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
}
.ap-meta span {
  color: var(--ink-3);
  font-size: 12.5px;
}

/* placeholder previews: still by default, play on hover */
.ap-card:not(:hover) .ap-prev * {
  animation: none !important;
}
.ap-ring,
.ap-dot {
  position: absolute;
  border-radius: 50%;
}
.ap-ring {
  width: 44%;
  aspect-ratio: 1;
  border: 2px solid var(--c);
  opacity: 0.35;
  animation: ap-ring 1.6s ease-out infinite;
}
.ap-dot {
  width: 18%;
  aspect-ratio: 1;
  background: var(--c);
  animation: ap-dot 1.6s ease-in-out infinite;
}
.ap-bar {
  display: block;
  width: 18%;
  height: 22%;
  border-radius: 8px;
  background: var(--c);
  opacity: 0.85;
  animation: ap-slide 1.8s ease-in-out infinite;
}
.ap-bar:nth-child(2) {
  opacity: 0.6;
  animation-delay: 0.12s;
}
.ap-bar:nth-child(3) {
  opacity: 0.4;
  animation-delay: 0.24s;
}
.ap-sq {
  width: 30%;
  aspect-ratio: 1;
  border-radius: 26%;
  background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 50%, #fff));
  animation: ap-spin 2.4s ease-in-out infinite;
}
.ap-orb {
  position: absolute;
  width: 9%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  opacity: 0.5;
  animation: ap-orbit 2.4s linear infinite;
}
.ap-col {
  display: block;
  align-self: flex-end;
  width: 10%;
  height: calc(var(--h) * 0.6);
  margin-bottom: 16%;
  border-radius: 6px 6px 2px 2px;
  background: var(--c);
  transform-origin: bottom;
  animation: ap-rise 1.8s cubic-bezier(0.2, 0.7, 0.2, 1) infinite;
}
.ap-col:nth-child(2) {
  animation-delay: 0.1s;
}
.ap-col:nth-child(3) {
  animation-delay: 0.2s;
}
.ap-col:nth-child(4) {
  animation-delay: 0.3s;
}
.ap-check {
  width: 36%;
  fill: none;
  stroke: var(--c);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ap-check circle {
  stroke-dasharray: 140;
  opacity: 0.35;
  animation: ap-draw 1.8s ease-in-out infinite;
}
.ap-check path {
  stroke-dasharray: 40;
  animation: ap-draw2 1.8s ease-in-out infinite;
}
.ap-toast {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 62%;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--dk-bg-ffffff, #fff);
  box-shadow: 0 8px 20px -12px rgba(16, 24, 40, 0.4);
  transform: translateY(-14px);
  animation: ap-toast 2.2s ease-in-out infinite;
}
.ap-toast--2 {
  width: 50%;
  opacity: 0.6;
  transform: translateY(26px);
  animation-delay: 0.2s;
}
.ap-toast i {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c);
}
.ap-toast b {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
@keyframes ap-ring {
  from { transform: scale(0.6); opacity: 0.6; }
  to { transform: scale(1.5); opacity: 0; }
}
@keyframes ap-dot {
  50% { transform: scale(1.2); }
}
@keyframes ap-slide {
  0%, 100% { transform: translateX(-20%); }
  50% { transform: translateX(20%); }
}
@keyframes ap-spin {
  50% { transform: rotate(90deg) scale(0.9); }
  100% { transform: rotate(180deg); }
}
@keyframes ap-orbit {
  from { transform: rotate(0) translateX(180%) rotate(0); }
  to { transform: rotate(360deg) translateX(180%) rotate(-360deg); }
}
@keyframes ap-rise {
  0% { transform: scaleY(0.2); }
  40%, 100% { transform: scaleY(1); }
}
@keyframes ap-draw {
  0% { stroke-dashoffset: 140; }
  50%, 100% { stroke-dashoffset: 0; }
}
@keyframes ap-draw2 {
  0%, 35% { stroke-dashoffset: 40; }
  70%, 100% { stroke-dashoffset: 0; }
}
@keyframes ap-toast {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-prev *,
  .ap-cover > span {
    animation: none !important;
  }
}
@media (max-width: 1100px) {
  .ap-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .ap-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .ap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 420px) {
  .ap-grid {
    gap: 12px;
  }
  .ap-meta {
    padding: 10px 12px 12px;
  }
}
.ap-dna {
  min-height: 0;
  aspect-ratio: 4 / 3;
}

/* Live signature animations (css/motion-packs.css) */
.ap-grid--live {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.ap-card--live {
  overflow: hidden;
}
.ap-card--live .ma {
  border-bottom: 1px solid var(--line-soft, #eaecf0);
}
.ap-card--live .ap-meta {
  display: grid;
  gap: 4px;
  padding: 14px 16px 16px;
}
.ap-card--live .ap-meta h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 15px;
}
.ap-meta__n {
  color: var(--ink-3, #98a2b3);
  font: 500 11px/1 ui-monospace, Menlo, monospace;
}
.ap-card--live .ap-meta p {
  margin: 0;
  color: var(--ink-2, #475467);
  font-size: 13px;
  line-height: 1.45;
}
.ap-card--live .ap-meta > span {
  margin-top: 4px;
  color: var(--ink-3, #98a2b3);
  font-size: 11px;
}
.ap-card--live:not(:hover) .ma * {
  animation-play-state: running;
}
.ap-head {
  flex-wrap: wrap;
  gap: 16px;
}
.ap-tint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 14px;
  border: 1px solid var(--line-soft, #eaecf0);
  border-radius: 99px;
  background: var(--px-color-surface-default, #fff);
  font-size: 13px;
  color: var(--ink-2, #475467);
}
.ap-tint > span {
  margin-inline-end: 4px;
}
.ap-tint button,
.ap-tint__pick {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: var(--sw);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.08);
}
.ap-tint button[aria-pressed='true'] {
  box-shadow: 0 0 0 2px var(--px-color-surface-default, #fff), 0 0 0 4px var(--sw);
}
.ap-tint__pick {
  overflow: hidden;
  background: conic-gradient(#f04438, #fdb022, #12b76a, #2e90fa, #7a5af8, #ee46bc, #f04438);
}
.ap-tint__pick input {
  position: absolute;
  inset: -8px;
  width: 40px;
  height: 40px;
  opacity: 0;
  cursor: pointer;
}
@media (max-width: 640px) {
  .ap-tint > span {
    display: none;
  }
}
/* live packs */
.ap-soon.is-live span {
  background: #12b76a;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.16);
}
/* preview tools: colour, device frame, theme */
.ap-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.ap-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--px-color-surface-sunken, #f2f4f7);
  box-shadow: inset 0 0 0 1px var(--px-color-border-neutral-default, #eaecf0);
}
.ap-seg button {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2, #475467);
  font: 500 12.5px/1 inherit;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.ap-seg button:hover {
  color: var(--ink, #101828);
}
.ap-seg button[aria-pressed='true'] {
  background: var(--px-color-surface-default, #fff);
  color: var(--ink, #101828);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 0 0 1px rgba(16, 24, 40, 0.06);
}
.ap-seg button:focus-visible {
  outline: 2px solid var(--c, #2563eb);
  outline-offset: 1px;
}
.ap-card--live {
  transition: box-shadow 0.35s, translate 0.35s;
}
.ap-card--live:hover {
  translate: 0 -2px;
}
/* preview tools float as a dock at the bottom while the animation grid is on screen (like the Storybook accent bar) */
.ap-tools {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 60;
  flex-wrap: nowrap;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--px-color-surface-default, #fff) 86%, transparent);
  box-shadow: 0 18px 48px -16px rgb(16 24 40 / 0.4), 0 0 0 1px rgb(16 24 40 / 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  translate: -50% calc(100% + 30px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: translate 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s, visibility 0s 0.45s;
  overflow-x: auto;
  scrollbar-width: none;
}
.ap-tools::-webkit-scrollbar {
  display: none;
}
.ap-tools.is-on {
  translate: -50% 0;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}
.ap-tools .ap-tint {
  flex: none;
  padding: 0 4px 0 10px;
  border: 0;
  background: none;
  box-shadow: none;
}
.ap-tools .ap-seg {
  flex: none;
}
.ap-tools > * + * {
  position: relative;
}
:root[data-px-theme='dark'] .ap-tools {
  background: rgb(22 27 38 / 0.86);
  box-shadow: 0 18px 48px -16px rgb(0 0 0 / 0.7), 0 0 0 1px rgb(255 255 255 / 0.08);
}
@media (max-width: 760px) {
  .ap-tools {
    bottom: 12px;
    flex-wrap: wrap;
    justify-content: center;
    width: calc(100vw - 24px);
    overflow: visible;
  }
  .ap-tools .ap-tint > span {
    display: none;
  }
  .ap-tools .ap-tint button,
  .ap-tools .ap-tint__pick {
    width: 22px;
    height: 22px;
  }
  .ap-tools {
    gap: 6px;
  }
  .ap-seg button {
    height: 26px;
    padding: 0 7px;
    font-size: 11.5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ap-tools {
    transition: none;
  }
}
