/* Mockup detail, share preview, and object landing pages */

.detail-mockup-preview-wrapper {
  width: min(100%, calc((100vh - 230px) * var(--mockup-w) / var(--mockup-h)));
  aspect-ratio: var(--mockup-w) / var(--mockup-h);
}

.detail-mockup-preview .detail-image {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.detail-mockup-preview .mockup-detail-preview {
  padding-top: 0;
  margin-bottom: 0;
  width: 100%;
  height: 100%;
  background: none;
  border-radius: 0;
  overflow: visible;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.loading-indicator svg {
  animation: spin 2s linear infinite;
}

#object-cta .loading-indicator svg {
  animation: spin 1s linear infinite;
}

/* Share page preview */
.share-checker {
  position: absolute;
  inset: 0;
  background-size: cover;
  pointer-events: none;
  opacity: 0;
}

.mockup-detail-preview.is-loaded .share-checker {
  opacity: 1;
}

.share-mockup .detail-image {
  transition: 0.3s;
  pointer-events: none;
}

.share-mockup .detail-image.loading-hide {
  opacity: 0;
  transition: 0s;
}

.share-mockup .loading-spinner.w-embed {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  display: none;
  transition: opacity 0.3s 0.3s;
  opacity: 0;
}

.share-mockup .loading-spinner-svg-animation {
  animation: loading-spinner 0.8s infinite linear;
}

/* mockup detail onboarding arrow
   Shape and timing from arrow-onboarding.json: 30fps, draw on frames 0-39,
   hold to frame 60, play once. Positions are that file's rendered matrices. */

.onboarding-animation svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* display:flex on .onboarding-block beats the hidden attribute. */
.onboarding-block[hidden] {
  display: none;
}

.onboarding-stroke {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: onboarding-draw 2s linear forwards;
}

.onboarding-pointer {
  transform-box: view-box;
  transform-origin: 0 0;
  transform: matrix(0.06074, 0.99815, -0.99815, 0.06074, 234, 626);
  animation: onboarding-pointer 2s linear forwards;
}

@keyframes onboarding-draw {
  0% {
    stroke-dashoffset: 100;
  }
  1.667% {
    stroke-dashoffset: 100;
  }
  3.333% {
    stroke-dashoffset: 99.62;
  }
  5% {
    stroke-dashoffset: 99.09;
  }
  6.667% {
    stroke-dashoffset: 98.3;
  }
  8.333% {
    stroke-dashoffset: 97.18;
  }
  10% {
    stroke-dashoffset: 95.69;
  }
  11.667% {
    stroke-dashoffset: 93.75;
  }
  13.333% {
    stroke-dashoffset: 91.25;
  }
  15% {
    stroke-dashoffset: 88.07;
  }
  16.667% {
    stroke-dashoffset: 84.08;
  }
  18.333% {
    stroke-dashoffset: 79.11;
  }
  20% {
    stroke-dashoffset: 73.06;
  }
  21.667% {
    stroke-dashoffset: 66.04;
  }
  23.333% {
    stroke-dashoffset: 58.43;
  }
  25% {
    stroke-dashoffset: 50.83;
  }
  26.667% {
    stroke-dashoffset: 43.77;
  }
  28.333% {
    stroke-dashoffset: 37.52;
  }
  30% {
    stroke-dashoffset: 32.09;
  }
  31.667% {
    stroke-dashoffset: 27.42;
  }
  33.333% {
    stroke-dashoffset: 23.4;
  }
  35% {
    stroke-dashoffset: 19.94;
  }
  36.667% {
    stroke-dashoffset: 16.94;
  }
  38.333% {
    stroke-dashoffset: 14.33;
  }
  40% {
    stroke-dashoffset: 12.07;
  }
  41.667% {
    stroke-dashoffset: 10.09;
  }
  43.333% {
    stroke-dashoffset: 8.38;
  }
  45% {
    stroke-dashoffset: 6.88;
  }
  46.667% {
    stroke-dashoffset: 5.59;
  }
  48.333% {
    stroke-dashoffset: 4.47;
  }
  50% {
    stroke-dashoffset: 3.51;
  }
  51.667% {
    stroke-dashoffset: 2.69;
  }
  53.333% {
    stroke-dashoffset: 2;
  }
  55% {
    stroke-dashoffset: 1.43;
  }
  56.667% {
    stroke-dashoffset: 0.97;
  }
  58.333% {
    stroke-dashoffset: 0.6;
  }
  60% {
    stroke-dashoffset: 0.33;
  }
  61.667% {
    stroke-dashoffset: 0.14;
  }
  63.333% {
    stroke-dashoffset: 0.04;
  }
  65% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes onboarding-pointer {
  0% {
    transform: matrix(0.06074, 0.99815, -0.99815, 0.06074, 234, 626);
  }
  1.667% {
    transform: matrix(-0.38842, 0.92148, -0.92148, -0.38842, 234, 626);
  }
  3.333% {
    transform: matrix(-0.37033, 0.9289, -0.9289, -0.37033, 245.01, 631.04);
  }
  5% {
    transform: matrix(-0.35196, 0.93601, -0.93601, -0.35196, 260.2, 637.6);
  }
  6.667% {
    transform: matrix(-0.32969, 0.94409, -0.94409, -0.32969, 283.43, 647.03);
  }
  8.333% {
    transform: matrix(-0.30188, 0.95335, -0.95335, -0.30188, 316.27, 659.36);
  }
  10% {
    transform: matrix(-0.26626, 0.9639, -0.9639, -0.26626, 360.81, 674.43);
  }
  11.667% {
    transform: matrix(-0.2196, 0.97559, -0.97559, -0.2196, 419.74, 691.61);
  }
  13.333% {
    transform: matrix(-0.15485, 0.98794, -0.98794, -0.15485, 496.53, 709.34);
  }
  15% {
    transform: matrix(-0.06044, 0.99817, -0.99817, -0.06044, 595.57, 724.07);
  }
  16.667% {
    transform: matrix(0.08509, 0.99637, -0.99637, 0.08509, 721.52, 727.73);
  }
  18.333% {
    transform: matrix(0.31615, 0.94871, -0.94871, 0.31615, 876.04, 702.98);
  }
  20% {
    transform: matrix(0.72491, 0.68885, -0.68885, 0.72491, 1044.2, 616.76);
  }
  21.667% {
    transform: matrix(0.85445, -0.51953, 0.51953, 0.85445, 1082.56, 414.4);
  }
  23.333% {
    transform: matrix(-0.21506, -0.9766, 0.9766, -0.21506, 872.04, 337.49);
  }
  25% {
    transform: matrix(-0.7379, -0.67491, 0.67491, -0.7379, 665.65, 451.84);
  }
  26.667% {
    transform: matrix(-0.97242, -0.23323, 0.23323, -0.97242, 549.21, 638.98);
  }
  28.333% {
    transform: matrix(-0.73967, 0.67297, -0.67297, -0.73967, 582.02, 825.33);
  }
  30% {
    transform: matrix(-0.19432, 0.98094, -0.98094, -0.19432, 728.13, 908.75);
  }
  31.667% {
    transform: matrix(0.10405, 0.99457, -0.99457, 0.10405, 874.51, 919.65);
  }
  33.333% {
    transform: matrix(0.28151, 0.95956, -0.95956, 0.28151, 999.52, 899.51);
  }
  35% {
    transform: matrix(0.40004, 0.9165, -0.9165, 0.40004, 1103.57, 865.97);
  }
  36.667% {
    transform: matrix(0.46493, 0.88535, -0.88535, 0.46493, 1190.04, 827.47);
  }
  38.333% {
    transform: matrix(0.47064, 0.88232, -0.88232, 0.47064, 1264.05, 791.73);
  }
  40% {
    transform: matrix(0.47462, 0.88019, -0.88019, 0.47462, 1328.23, 760.28);
  }
  41.667% {
    transform: matrix(0.47488, 0.88005, -0.88005, 0.47488, 1384.04, 732.74);
  }
  43.333% {
    transform: matrix(0.46736, 0.88407, -0.88407, 0.46736, 1432.71, 708.93);
  }
  45% {
    transform: matrix(0.44428, 0.89589, -0.89589, 0.44428, 1475.35, 688.87);
  }
  46.667% {
    transform: matrix(0.39355, 0.9193, -0.9193, 0.39355, 1512.97, 672.89);
  }
  48.333% {
    transform: matrix(0.30936, 0.95094, -0.95094, 0.30936, 1546.36, 661.45);
  }
  50% {
    transform: matrix(0.21603, 0.97639, -0.97639, 0.21603, 1575.83, 654.4);
  }
  51.667% {
    transform: matrix(0.14697, 0.98914, -0.98914, 0.14697, 1601.35, 650.58);
  }
  53.333% {
    transform: matrix(0.10628, 0.99434, -0.99434, 0.10628, 1622.98, 648.59);
  }
  55% {
    transform: matrix(0.08449, 0.99642, -0.99642, 0.08449, 1640.95, 647.51);
  }
  56.667% {
    transform: matrix(0.07278, 0.99735, -0.99735, 0.07278, 1655.54, 646.89);
  }
  58.333% {
    transform: matrix(0.06645, 0.99779, -0.99779, 0.06645, 1667, 646.51);
  }
  60% {
    transform: matrix(0.06298, 0.99801, -0.99801, 0.06298, 1675.57, 646.26);
  }
  61.667% {
    transform: matrix(0.06076, 0.99815, -0.99815, 0.06076, 1681.47, 646.11);
  }
  63.333% {
    transform: matrix(0.06009, 0.99819, -0.99819, 0.06009, 1684.89, 646.03);
  }
  65% {
    transform: matrix(0.0367, 0.99933, -0.99933, 0.0367, 1686, 646);
  }
  100% {
    transform: matrix(0.0367, 0.99933, -0.99933, 0.0367, 1686, 646);
  }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-stroke,
  .onboarding-pointer {
    animation: none;
  }

  .onboarding-stroke {
    stroke-dashoffset: 0;
  }

  .onboarding-pointer {
    transform: matrix(0.0367, 0.99933, -0.99933, 0.0367, 1686, 646);
  }
}
