/* Two machined cards expand from, then settle into, one physical stack. */
.motion-stack {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  container-type: size;
  --stack-duration: 12s;
  --stack-ease: cubic-bezier(.45, 0, .18, 1);
}

.motion-stack .stack-ambient {
  position: absolute;
  inset: 7% 2%;
  background: radial-gradient(ellipse at 51% 44%, #dce8b10b, transparent 64%);
}

.motion-stack .stack-ground {
  position: absolute;
  left: 19%;
  right: 9%;
  bottom: 9%;
  height: 13%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #0009, #0000 68%);
  transform: rotate(-14deg);
  animation: stack-ground var(--stack-duration) var(--stack-ease) infinite;
}

.motion-stack .stack-perspective {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(94cqw, 100cqh);
  height: min(94cqw, 100cqh);
  transform: translate(-50%, -50%);
  container-type: inline-size;
  perspective: 1100px;
  perspective-origin: 50% 38%;
}

.motion-stack .stack-deck {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: translateY(-1%) rotateX(25deg) rotateZ(-22deg);
  animation: stack-breathe var(--stack-duration) var(--stack-ease) infinite;
}

.motion-stack .stack-card {
  position: absolute;
  left: 17.5%;
  top: 38%;
  width: 65%;
  height: 25%;
  border-radius: clamp(10px, 2.6cqw, 18px);
  transform-style: preserve-3d;
  transform: translate3d(var(--open-x), var(--open-y), var(--open-z));
  animation: stack-assemble var(--stack-duration) var(--stack-ease) infinite;
  animation-delay: calc(var(--card-index) * 120ms);
}


.motion-stack .stack-card-1 { --open-x: -6%; --open-y: -65%; --open-z: 24px; --closed-x: -2%; --closed-y: -5%; --closed-z: 16px; z-index: 2; }
.motion-stack .stack-card-2 { --open-x: 6%; --open-y: 65%; --open-z: 0px; --closed-x: 2%; --closed-y: 8%; --closed-z: 0px; z-index: 1; }

.motion-stack .stack-card-edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, #6a7565, #273025 48%, #b3c48b 75%, #404c37);
  border: 1px solid #cbd9ac52;
  transform: translate3d(0, 5px, -5px);
  box-shadow: 0 4px 0 #11160f, 0 14px 20px -8px #000a;
}

.motion-stack .stack-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: clamp(32px, 10cqw, 58px) 1fr auto;
  align-items: center;
  column-gap: clamp(10px, 3cqw, 20px);
  padding: 0 clamp(12px, 3.7cqw, 23px);
  overflow: hidden;
  border: 1px solid #d8e2c33d;
  border-radius: inherit;
  background: linear-gradient(125deg, #394038 0%, #282f28 47%, #1b211b 100%);
  box-shadow: inset 0 1px 0 #e7f0d52c, inset 0 -1px 0 #0008, 0 7px 24px #0002;
}

.motion-stack .stack-card-face::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 15%, #f1f7e310 32%, transparent 50%);
  transform: translateX(-110%);
  animation: stack-surface-light var(--stack-duration) ease-in-out infinite;
  animation-delay: calc(var(--card-index) * 120ms);
}

.motion-stack .stack-logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background: #141914;
  box-shadow: 0 0 0 1px #ffffff12, 0 3px 7px #0004;
}

.motion-stack .stack-logo img {
  display: block;
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.motion-stack .stack-logo-anthropic { background: #f4f0e8; }
.motion-stack .stack-logo-anthropic img { width: 70%; height: 70%; }
.motion-stack .stack-logo-nvidia { background: white; }
.motion-stack .stack-logo-nvidia img { width: 100%; height: 100%; }

.motion-stack .stack-card-copy {
  position: relative;
  min-width: 0;
  color: #f0f2e9;
  white-space: nowrap;
}

.motion-stack .stack-card-copy strong {
  display: block;
  font-size: clamp(11px, 3.2cqw, 19px);
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.2;
}

.motion-stack .stack-card-copy > span {
  display: block;
  margin-top: clamp(3px, 1cqw, 7px);
  font-size: clamp(9px, 2.1cqw, 12px);
  line-height: 1;
  color: #aab4a5;
}

.motion-stack .stack-leverage {
  position: relative;
  font-size: clamp(21px, 6cqw, 36px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.055em;
  color: #e1eab8;
  padding-bottom: 4%;
}

.motion-stack .stack-face-rule {
  position: absolute;
  bottom: 0;
  left: 7%;
  width: 22%;
  height: 2px;
  background: #d6e5a6;
  box-shadow: 0 0 9px #d6e5a621;
}

.motion-stack .stack-sleeve {
  position: absolute;
  left: 17.5%;
  top: 38.5%;
  width: 67%;
  height: 30%;
  border: 1px solid #d9e8ac88;
  border-radius: clamp(13px, 3cqw, 21px);
  transform: translateZ(-8px);
  background: linear-gradient(130deg, #a5b98014, #d7e6ac02);
  box-shadow: inset 0 -3px 0 #cbdba647, 0 12px 20px #0007;
  opacity: 0;
  animation: stack-sleeve var(--stack-duration) var(--stack-ease) infinite;
}

.motion-stack .stack-sleeve > span {
  position: absolute;
  right: 6%;
  bottom: 5%;
  font-size: clamp(8px, 1.7cqw, 11px);
  letter-spacing: .18em;
  color: #cbd8b1;
}

.motion-stack .stack-sleeve > i {
  position: absolute;
  bottom: 9%;
  left: 7%;
  width: 5%;
  height: 2px;
  background: #d4e5a2;
}
.motion-stack .stack-sleeve > i:nth-of-type(2) { left: 14%; }
.motion-stack .stack-sleeve > i:nth-of-type(3) { left: 21%; }
.motion-stack .stack-sleeve > i:nth-of-type(4) { left: 28%; }

@keyframes stack-assemble {
  0%, 14%, 88%, 100% { transform: translate3d(var(--open-x), var(--open-y), var(--open-z)); }
  40%, 61% { transform: translate3d(var(--closed-x), var(--closed-y), var(--closed-z)); }
}

@keyframes stack-breathe {
  0%, 14%, 88%, 100% { transform: translateY(-1%) rotateX(25deg) rotateZ(-22deg); }
  40%, 61% { transform: translateY(-2%) rotateX(32deg) rotateZ(-26deg); }
}

@keyframes stack-sleeve {
  0%, 25%, 75%, 100% { opacity: 0; }
  41%, 60% { opacity: 1; }
}

@keyframes stack-ground {
  0%, 14%, 88%, 100% { opacity: .8; transform: rotate(-14deg) scaleX(1); }
  40%, 61% { opacity: .6; transform: rotate(-14deg) scaleX(.8); }
}

@keyframes stack-surface-light {
  0%, 16%, 100% { transform: translateX(-110%); }
  39%, 63% { transform: translateX(110%); }
  64% { transform: translateX(-110%); }
}

.motion-stack.is-paused *,
.motion-stack.is-paused *::before,
.motion-stack.is-paused *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .motion-stack *, .motion-stack *::before, .motion-stack *::after { animation: none !important; }
  .motion-stack .stack-card { transform: translate3d(var(--open-x), var(--open-y), var(--open-z)); }
  .motion-stack .stack-sleeve { opacity: 0; }
}
