:root {
  --cta-ink: #faf7ff;
  --cta-focus: #bca0ff;
  --cta-rim: #9e83d1;
  --cta-face: linear-gradient(115deg, #392850, #21182f 64%, #30223f);
}
[data-theme="light"] { --cta-focus: #6540a4; }

/* The signal travels through the lettering once per interaction. */
body :is(.btn.btn-primary, .mcta .mcta-cta, .head-cta, .contact-primary, .s2-email-copy) {
  min-height: 44px;
  border: 1px solid var(--cta-rim);
  border-radius: 999px;
  background: var(--cta-face);
  color: var(--cta-ink);
  box-shadow: inset 0 1px 0 #e5d1ff2b, inset 0 -2px 5px #08050d66, 0 5px 22px -9px #a77bff70;
  font-weight: 600;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
body .cta-with-signal {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 22px);
  min-height: 52px;
  padding: 5px 5px 5px 23px;
  text-align: start;
  -webkit-tap-highlight-color: transparent;
}
body .hero-cta .cta-with-signal {
  min-height: 58px;
  font-size: .98rem;
  box-shadow: inset 0 1px 0 #e5d1ff38, inset 0 -2px 5px #08050d66, 0 8px 32px -12px #ab83ff85;
}
body .cta-with-signal > .cta-label {
  position: relative;
  z-index: 1;
  min-width: 0;
  white-space: normal;
  line-height: 1.3;
}
.cta-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.cta-word, .cta-glyph { display: inline-block; }
.cta-glyph { color: var(--cta-ink); }
body :is(.hero-cta, .nav-right, .first-offer__request, .mobile-menu, .mcta, .s2-case-cta) .cta-with-signal {
  justify-content: space-between;
}
body .cta-with-signal::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  top: -30%;
  bottom: -30%;
  left: -55%;
  width: 42%;
  background: linear-gradient(90deg, transparent, #b99bff12 30%, #deceff38 56%, #b8fff927 62%, transparent);
  transform: skewX(-22deg);
  opacity: 0;
}
body .cta-with-signal::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
  inset: 0 22% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, #eee0ffcc, #9cf5eaaa, transparent);
  opacity: .65;
}
.cta-terminal {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #fff9;
  background: linear-gradient(145deg, #f6edff, #d7befb 56%, #ae8ee3);
  color: #211331;
  box-shadow: inset 0 1px 2px #fff, 0 2px 7px #0a051955;
  transition: background .3s ease, box-shadow .3s ease, transform .3s ease;
}
body .hero-cta .cta-terminal { flex-basis: 46px; width: 46px; height: 46px; }
.cta-terminal svg {
  width: 20px;
  height: 20px;
  transform: rotate(-38deg);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
body :is(.btn.btn-primary, .mcta .mcta-cta, .head-cta, .contact-primary, .s2-email-copy):focus-visible,
body .hero-cta .btn.btn-ghost:focus-visible {
  outline: 2px solid var(--cta-focus);
  outline-offset: 4px;
}
body .cta-with-signal:active:not(:disabled) { transform: scale(.985); border-color: #c0ffee; }
body .cta-with-signal:active:not(:disabled) .cta-terminal { background: #c9fff0; transform: scale(.94); }
body .hero-cta .btn.btn-ghost {
  min-height: 44px;
  border-color: transparent;
  border-radius: 5px;
  padding-inline: 4px;
  background: transparent;
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
body .hero-cta .btn.btn-ghost > span { color: var(--muted); }
body .hero-cta .btn.btn-ghost:hover { background: transparent; color: var(--ink); text-decoration: underline; }
body .cta-box > .btn-primary:not(.cta-with-signal)::after { display: none; }
body .cta-box > .cta-with-signal::after {
  display: block;
  inset: 0 22% auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: none;
  opacity: .65;
}
@keyframes s2-letter-wave {
  0%, 100% { transform: translateY(0); color: #faf7ff; text-shadow: none; }
  28% { color: #c4a4ff; text-shadow: 0 0 12px #ab7fff99; }
  48% { transform: translateY(-2px); color: #fff; text-shadow: 0 0 9px #f9edffcc; }
  65% { color: #91ffe9; text-shadow: 0 0 12px #6fffea88; }
}
@keyframes s2-glass-sweep {
  0% { transform: translateX(0) skewX(-22deg); opacity: 0; }
  15%, 85% { opacity: 1; }
  100% { transform: translateX(400%) skewX(-22deg); opacity: 0; }
}
@media (hover: hover) and (pointer: fine) {
  body :is(.btn.btn-primary, .mcta .mcta-cta, .head-cta, .contact-primary, .s2-email-copy):hover:not(:disabled),
  #s2-connected .btn.btn-primary:hover:not(:disabled) {
    background: var(--cta-face);
    color: var(--cta-ink);
    border-color: #ddc5ff;
    box-shadow: inset 0 1px #f5eaff4d, inset 0 -2px 5px #08050d66, 0 0 0 4px #b899ff0b, 0 9px 35px -10px #b38aff88;
  }
  body .cta-with-signal:hover:not(:disabled) .cta-terminal {
    background: linear-gradient(145deg, #fff, #ddcdff 50%, #b1eadf);
    box-shadow: inset 0 1px 2px #fff, 0 0 17px #cebbff55;
  }
  body .cta-with-signal:hover:not(:disabled) .cta-terminal svg { transform: rotate(0deg); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body .cta-with-signal:hover:not(:disabled) .cta-glyph { animation: s2-letter-wave .62s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 17ms) both; }
  body .cta-with-signal:hover:not(:disabled)::before { animation: s2-glass-sweep 1.1s .06s ease both; }
}
@media (prefers-reduced-motion: no-preference) {
  body .cta-with-signal:focus-visible:not(:disabled) .cta-glyph { animation: s2-letter-wave .62s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 17ms) both; }
  body .cta-with-signal:focus-visible:not(:disabled)::before { animation: s2-glass-sweep 1.1s .06s ease both; }
}
@media (max-width: 600px) {
  body .cta-with-signal { padding-inline-start: 17px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  body :is(.btn.btn-primary, .mcta .mcta-cta, .head-cta, .contact-primary, .s2-email-copy), .cta-terminal, .cta-terminal svg { transition: none; }
  body .cta-with-signal:active:not(:disabled), body .cta-with-signal:active:not(:disabled) .cta-terminal { transform: none; }
}
@media (forced-colors: active) {
  body .cta-with-signal { border: 1px solid ButtonText; background: ButtonFace; }
  .cta-terminal { border-color: ButtonText; background: ButtonFace; color: ButtonText; }
  body .cta-with-signal .cta-glyph { color: ButtonText; animation: none !important; text-shadow: none; }
  body .cta-with-signal::before, body .cta-with-signal::after { display: none; }
}

/* Replay the original sweep once when a touch user first sees the button. */
@media (hover: none) and (pointer: coarse) and (prefers-reduced-motion: no-preference) {
  body .cta-with-signal.is-first-signal .cta-glyph {
    animation: s2-letter-wave .62s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 17ms) both;
  }
  body .cta-with-signal.is-first-signal::before {
    animation: s2-glass-sweep 1.1s .06s ease both;
  }
}
