.motion-stack {
  margin: 30px 0 70px;
  position: relative;
}
.stack-sticky {
  padding-top: 60px;
  padding-bottom: 45px;
}
.stack-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 35px;
}
.stack-heading .eyebrow {
  font-size: 9px;
  margin-bottom: 14px;
}
.stack-heading h2 {
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.05em;
  line-height: 1.1;
  margin: 0;
  max-width: 780px;
}
.stack-heading h2 em {
  color: #365bfa;
  font-style: normal;
}
.stack-skip {
  flex-shrink: 0;
  font-size: 11px;
  color: #60718d;
  padding-bottom: 5px;
  display: flex;
  gap: 22px;
}
.stack-skip:hover {
  color: #365bfa;
}
.stack-deck {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  position: relative;
}
.perspective-card {
  min-width: 0;
  height: 480px;
  border-radius: 16px;
  border: 1px solid #34445f;
  background: radial-gradient(ellipse at 75% 55%, #172d52, #0b1426 75%);
  color: #eaf0ff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 20px 45px -30px #0b173a77;
}
.perspective-card[data-perspective="1"] {
  background: radial-gradient(ellipse at 70% 65%, #3c3c68, #141c33 75%);
  border-color: #525779;
}
.perspective-card[data-perspective="2"] {
  background: radial-gradient(ellipse at 70% 65%, #183f50, #102432 75%);
  border-color: #3b6478;
}
.perspective-card[data-perspective="3"] {
  background: radial-gradient(ellipse at 70% 65%, #30396b, #182440 75%);
  border-color: #536993;
}
.perspective-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  margin: 0 28px;
  padding: 16px 0;
  border-bottom: 1px solid #c4d5ff15;
  font: 8px monospace;
  letter-spacing: 0.1em;
  color: #a8bddf;
}
.perspective-bar > span:last-child {
  opacity: 0.5;
}
.perspective-copy {
  position: absolute;
  left: 28px;
  top: 75px;
  width: 45%;
  z-index: 2;
  pointer-events: none;
}
.perspective-kicker {
  color: #91aef3;
  font-size: 7px;
  letter-spacing: 0.1em;
  margin: 0 0 14px;
}
.perspective-copy h3 {
  font-weight: 500;
  font-size: clamp(29px, 3.4vw, 51px);
  line-height: 1.05;
  letter-spacing: -0.055em;
  margin: 0 0 20px;
}
.perspective-copy > p:last-child {
  font-size: 12px;
  line-height: 1.85;
  color: #a8b7ce;
  max-width: 265px;
  margin: 0;
}
.perspective-art {
  position: absolute;
  inset: 55px 0 50px 32%;
  z-index: 1;
  pointer-events: none;
}
.perspective-art canvas,
.perspective-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.perspective-art canvas {
  z-index: 2;
}
.perspective-art.has-art .stack-fallback {
  display: none;
}
.perspective-foot {
  position: absolute;
  bottom: 25px;
  left: 28px;
  color: #8ea8cf;
  font: 8px monospace;
  letter-spacing: 0.015em;
}
.stack-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  min-height: 49px;
}
.stack-scroll-hint {
  font: 8px monospace;
  letter-spacing: 0.1em;
  color: #8394ae;
}
.stack-scroll-hint > span {
  margin-left: 12px;
}
.stack-navigation {
  display: flex;
  gap: 10px;
}
.stack-navigation button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 3px;
  color: #97a5bd;
  border: 0;
  background: none;
  cursor: pointer;
  font: 9px monospace;
}
.stack-navigation i {
  display: block;
  width: 24px;
  height: 2px;
  background: #d5deef;
}
.stack-navigation button[aria-current] {
  color: #365bfa;
}
.stack-navigation button[aria-current] i {
  background: #365bfa;
}
.stack-navigation[hidden] {
  display: none;
}
.stack-bottom .stack-motion {
  position: static;
  color: #617594;
  border: 0;
  background: none;
  margin: 0;
  padding: 0;
}
.motion-stack a:focus-visible,
.motion-stack button:focus-visible {
  outline: 2px solid #365bfa;
  outline-offset: 5px;
}
/* Every card remains in normal document flow until enhancement is ready. */
.motion-stack.is-pinned {
  height: 350svh;
}
.is-pinned .stack-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  padding-top: 40px;
  padding-bottom: 28px;
}
.is-pinned .stack-heading {
  flex-shrink: 0;
  margin-bottom: 24px;
}
.is-pinned .stack-deck {
  display: block;
  flex: 1;
  min-height: 0;
  perspective: 1600px;
}
.is-pinned .perspective-card {
  position: absolute;
  inset: 0;
  height: calc(100% - 108px);
  transform-origin: center bottom;
  will-change: transform, opacity;
  box-shadow: 0 18px 35px -22px #0b173a99;
}
.is-pinned .perspective-bar {
  padding: 12px 0;
  margin: 0 36px;
  height: 37px;
}
.is-pinned .perspective-copy {
  left: 44px;
  top: 50%;
  transform: translateY(-50%);
  width: 34%;
}
.is-pinned .perspective-copy h3 {
  font-size: clamp(38px, 4.3vw, 64px);
}
.is-pinned .perspective-copy > p:last-child {
  max-width: 295px;
  font-size: 13px;
}
.is-pinned .perspective-art {
  inset: 35px 0 22px 32%;
}
.is-pinned .perspective-foot {
  left: 44px;
  bottom: 24px;
}
.stack-fallback {
  position: absolute;
  inset: 10% 10%;
  display: grid;
  place-items: center;
}
.stack-fallback i {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border: 1px solid #7196f7;
  border-radius: 50%;
  transform: rotate(-30deg) scaleY(0.7);
}
.stack-fallback i:nth-child(2) {
  transform: rotate(-30deg) scale(0.85, 0.55);
  opacity: 0.6;
}
.stack-fallback i:nth-child(3) {
  transform: rotate(-30deg) scale(1.12, 0.82);
  opacity: 0.35;
}
.fallback-particles i {
  border: 6px dotted #7da6f7;
}
.fallback-ribbon i {
  width: 60%;
  border: 16px solid #b8c9ed;
  box-shadow:
    inset 3px 4px 8px #f0f7ff99,
    3px 4px 15px #00103388;
}
.fallback-ribbon i:nth-child(2) {
  transform: rotate(40deg) scale(0.75, 1);
  opacity: 1;
}
.fallback-ribbon i:nth-child(3) {
  transform: rotate(120deg) scale(0.75, 1);
  opacity: 1;
}
.fallback-orbit i {
  transform: rotate(-50deg) scaleY(0.4);
}
.fallback-orbit i:nth-child(2) {
  transform: rotate(15deg) scaleY(0.4);
}
.fallback-orbit i:nth-child(3) {
  transform: rotate(85deg) scaleY(0.4);
}
.fallback-orbit b {
  width: 24%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #f1f7ff, #6f99da 50%, #28395e);
  box-shadow: 0 0 30px #82b3ff33;
}
.fallback-tunnel i {
  border-radius: 15%;
  transform: rotate(10deg);
}
.fallback-tunnel i:nth-child(2) {
  transform: rotate(30deg) scale(0.7);
}
.fallback-tunnel i:nth-child(3) {
  transform: rotate(50deg) scale(0.4);
}
@media (max-width: 959px), (max-height: 759px) {
  .stack-heading h2 {
    max-width: 600px;
  }
  .perspective-card {
    height: 590px;
  }
  .perspective-copy {
    width: auto;
    right: 28px;
  }
  .perspective-copy h3 {
    font-size: 34px;
  }
  .perspective-copy > p:last-child {
    font-size: 11px;
    max-width: 320px;
  }
  .perspective-art {
    inset: 305px 0 35px;
  }
}
@media (max-width: 700px) {
  .motion-stack {
    margin: 0 0 20px;
  }
  .stack-sticky {
    padding-top: 35px;
  }
  .stack-heading {
    align-items: start;
    gap: 16px;
  }
  .stack-heading h2 {
    font-size: 29px;
    max-width: 260px;
  }
  .stack-skip {
    font-size: 9px;
    gap: 8px;
    margin-top: 28px;
  }
  .stack-deck {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .perspective-card {
    height: 620px;
  }
  .perspective-copy {
    top: 70px;
  }
  .perspective-copy h3 {
    font-size: 37px;
    margin-bottom: 14px;
  }
  .perspective-art {
    top: 320px;
  }
  .stack-bottom {
    flex-wrap: wrap;
    gap: 12px;
  }
  .stack-scroll-hint {
    display: none;
  }
  .stack-navigation {
    gap: 8px;
  }
  .stack-navigation i {
    width: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .motion-stack .perspective-card {
    will-change: auto;
  }
}
.perspective-art:has(canvas) img {
  visibility: hidden;
}
