/* A small CSS 3D scene keeps the decorative orbit lightweight on phones. */
.hero-grid {
  align-items: start;
}

.hero-copy {
  padding-top: 20px;
}

.visual-column {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.motion-stage {
  --orbit-radius: 137px;
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 360px;
  overflow: hidden;
  border: 1px solid #fff7b51c;
  border-radius: 20px;
  background: radial-gradient(
    ellipse at 50% 45%,
    #363f30 0%,
    #182019 58%,
    #101611 100%
  );
}

.motion-caption {
  position: absolute;
  top: 22px;
  left: 24px;
  color: var(--yellow);
  font:
    600 12px/1.5 system-ui,
    sans-serif;
  letter-spacing: 0.14em;
}

.motion-scene {
  position: absolute;
  inset: 0;
  perspective: 850px;
  pointer-events: none;
}

.scene-depth {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.money-bag {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 214px;
  height: 214px;
  object-fit: contain;
  transform: translate(-50%, -47%) rotate(-3deg);
  animation: bag-float 6s ease-in-out infinite;
  animation-play-state: paused;
}

.bag-shadow {
  position: absolute;
  left: 50%;
  bottom: 47px;
  width: 176px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #0009, transparent 70%);
  transform: translateX(-50%);
}

.orbit-tilt {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: rotateX(-18deg) rotateZ(-16deg);
  transform-style: preserve-3d;
}

.currency-orbit {
  position: absolute;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  transform: rotateY(18deg);
  animation: currency-turn 18s linear infinite;
  animation-play-state: paused;
}

.orbit-word {
  position: absolute;
  top: -22px;
  left: -56px;
  width: 112px;
  height: 44px;
  color: var(--yellow);
  font:
    900 39px/44px system-ui,
    sans-serif;
  letter-spacing: -0.055em;
  text-align: center;
  transform: rotateY(var(--angle)) translateZ(var(--orbit-radius));
  transform-style: preserve-3d;
}

.text-layer {
  position: absolute;
  inset: 0;
  color: #b8970d;
  transform: translateZ(var(--depth));
  backface-visibility: visible;
}

.text-layer:last-child {
  color: var(--yellow);
  text-shadow: 0 1px 0 #fff4a2;
}

.motion-stage.is-running .currency-orbit,
.motion-stage.is-running .money-bag {
  animation-play-state: running;
}

.motion-toggle {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #ffe22960;
  border-radius: 50%;
  background: #172019;
  color: var(--yellow);
}

.motion-toggle:hover {
  background: #353b23;
}

.motion-toggle .play-icon,
.motion-stage.is-paused .pause-icon {
  display: none;
}

.motion-stage.is-paused .play-icon {
  display: block;
}

@keyframes currency-turn {
  from {
    transform: rotateY(18deg);
  }
  to {
    transform: rotateY(378deg);
  }
}

@keyframes bag-float {
  0%,
  100% {
    transform: translate(-50%, -47%) rotate(-3deg);
  }
  50% {
    transform: translate(-50%, -51%) rotate(3deg);
  }
}

@media (max-width: 850px) {
  .motion-stage {
    --orbit-radius: 109px;
    height: 310px;
  }
  .money-bag {
    width: 188px;
    height: 188px;
  }
  .orbit-word {
    font-size: 32px;
  }
}

@media (max-width: 640px) {
  .hero-grid {
    display: flex;
    flex-direction: column;
    padding-top: 24px;
    gap: 0;
  }
  .hero-copy,
  .visual-column {
    display: contents;
  }
  .hero-copy .eyebrow {
    order: 0;
  }
  .hero-copy h1 {
    order: 1;
  }
  .hero-copy .intro {
    order: 3;
  }
  .hero-copy .zh {
    order: 4;
  }
  .hero-copy .actions {
    order: 5;
    width: 100%;
    margin-bottom: 24px;
  }
  .visual-column .transfer {
    order: 6;
    width: 100%;
  }
  .motion-stage {
    order: 2;
    flex: none;
    margin: 8px 0 24px;
    --orbit-radius: 115px;
    height: 290px;
    border-radius: 16px;
  }
  .money-bag {
    width: 190px;
    height: 190px;
  }
  .bag-shadow {
    bottom: 30px;
  }
  .motion-caption {
    top: 16px;
    left: 18px;
  }
  .orbit-word {
    font-size: 34px;
  }
}

@media (max-width: 360px) {
  .motion-stage {
    --orbit-radius: 100px;
    height: 260px;
  }
  .money-bag {
    width: 168px;
    height: 168px;
  }
  .orbit-word {
    font-size: 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .money-bag,
  .currency-orbit {
    animation: none;
  }
  .motion-toggle {
    display: none;
  }
}
