/* Route stack transition */
.route-stack-stage {
  display: grid;
  min-height: 76vh;
  grid-template-columns: minmax(280px, 0.62fr) minmax(320px, 1fr);
  gap: clamp(24px, 6vw, 78px);
  align-items: center;
  overflow: hidden;
  padding: 32px max(16px, calc((100vw - 1180px) / 2));
  perspective: 1200px;
}

.route-stack-lab {
  display: grid;
  min-height: clamp(430px, 56vw, 640px);
  place-items: center;
  perspective: 1200px;
}

.route-stack {
  position: relative;
  width: min(82vw, 620px);
  height: min(72vw, 500px);
  transform-style: preserve-3d;
  will-change: transform;
}

.route-page {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(17, 19, 21, 0.15);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 28px 76px rgba(17, 19, 21, 0.18);
  padding: clamp(18px, 4vw, 34px);
  transform-style: preserve-3d;
  will-change: transform, opacity;
}

.route-page::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(135deg, var(--tone), transparent 68%),
    linear-gradient(rgba(17, 19, 21, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 21, 0.035) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  pointer-events: none;
}

.route-page > * {
  position: relative;
  z-index: 2;
}

.route-page small {
  color: rgba(17, 19, 21, 0.58);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.route-page h2 {
  max-width: 8ch;
  margin: 0;
  font-size: clamp(38px, 7vw, 84px);
  line-height: 0.88;
}

.route-page p {
  max-width: 32ch;
}

@media (max-width: 840px) {
  .route-stack-stage {
    grid-template-columns: 1fr;
  }

  .route-stack {
    width: min(88vw, 430px);
    height: 430px;
  }
}
