/* Start trading buttons: solid orange that lifts and glows on hover, with a sliding arrow on the hero button,
   and a slight press-down when clicked or tapped. Add-on to .button in homepage-styles-v3.css, which keeps
   the sizes and the dark text on orange. */

.cta {
  transition:
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.25s,
    background-color 0.2s,
    border-color 0.2s;
}

/* Hover only on devices with a mouse, so the glow doesn't stick after a tap on phones.
   Fixed hover colour: --orange-light turns dark in light mode and would make the text hard to read. */
@media (hover: hover) {
  .cta:hover {
    background: #ff7e2b;
    border-color: #ff7e2b;
    transform: translateY(-2px);
    box-shadow:
      0 10px 28px -8px rgba(241, 90, 37, 0.75),
      0 0 0 1px rgba(255, 126, 43, 0.55);
  }

  .cta:hover .cta-arrow {
    transform: translateX(4px);
  }
}

.cta:active {
  transform: scale(0.97);
}

.cta-arrow {
  width: 16px;
  height: 16px;
  margin-left: 8px;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* homepage-styles-v3.css already switches transitions off for reduced motion; also skip the movement */
@media (prefers-reduced-motion: reduce) {
  .cta:hover,
  .cta:active,
  .cta:hover .cta-arrow {
    transform: none;
  }
}

/* Header Start trading only: a light that travels round the border all the time.
   It follows the footer's "Pause background" control (background-motion.js), stops while the tab is hidden,
   and stays still for reduced-motion visitors. 3.2s is the time for one lap. */
@property --cta-beam-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.cta-beam {
  position: relative;
}

.cta-beam::before {
  content: "";
  position: absolute;
  inset: -4px;
  padding: 1.5px; /* beam thickness */
  border-radius: 12px;
  background:
    conic-gradient(from var(--cta-beam-angle), transparent 0 68%, #ff7e2b 86%, #fff1e6 97%, transparent 100%),
    linear-gradient(rgba(241, 90, 37, 0.22), rgba(241, 90, 37, 0.22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: cta-beam 3.2s linear infinite paused;
  pointer-events: none;
}

body[data-background-motion="on"] .cta-beam::before {
  animation-play-state: running;
}

body[data-background-paused="true"] .cta-beam::before {
  animation-play-state: paused;
}

@keyframes cta-beam {
  to {
    --cta-beam-angle: 360deg;
  }
}
