/*
 * 3D intro. Without the "ll-3d" class (JS off, reduced motion, no WebGL) the scenes are plain stacked sections.
 * Colours come from the Lapis tokens only; intro.js reads the same tokens for the canvas.
 */
.ll-canvas {
  display: none;
}

.ll-scene {
  position: relative;
  z-index: 1;
}

.ll-card {
  transform: perspective(1200px) rotateX(4deg) rotateY(-8deg);
}

@keyframes ll-arrive {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

.ll-mark {
  animation: ll-arrive 800ms var(--ease-out) both;
}

/* 3D mode: the canvas paints the backgrounds, copy fades up (24px) as each scene arrives. */
.ll-3d .ll-canvas {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 0;
}

.ll-3d .ll-scene {
  background: transparent;
}

/* The cabin: extra scroll so the interior stays on screen before its copy arrives (see "stay" in intro.js). */
.ll-3d .ll-hold {
  min-height: 200dvh;
}

/* Where copy sits over the jet or the cabin, a soft scrim from the scene colour keeps it readable. */
.ll-3d .ll-scrim::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Clear at the very bottom too, so two scenes on screen at once don't show a seam. */
  background: linear-gradient(
    to top,
    transparent 0%,
    color-mix(in srgb, var(--surface) 88%, transparent) 14%,
    color-mix(in srgb, var(--surface) 70%, transparent) 34%,
    transparent 64%
  );
}

.ll-3d .ll-copy,
.ll-3d .ll-card,
.ll-3d .ll-card-line {
  transition:
    opacity 800ms var(--ease-out),
    transform 800ms var(--ease-out);
}

.ll-3d .ll-card-line {
  transform-origin: left;
}

.ll-3d .ll-scene:not(.is-in) .ll-copy {
  opacity: 0;
  transform: translateY(24px);
}

.ll-3d .ll-scene:not(.is-in) .ll-card {
  opacity: 0;
  transform: perspective(1200px) rotateX(18deg) rotateY(-40deg);
}

.ll-3d .ll-scene:not(.is-in) .ll-card-line {
  transform: scaleX(0);
}

@media (prefers-reduced-motion: reduce) {
  .ll-card {
    transform: none;
  }

  .ll-mark {
    animation: none;
  }
}
