/* Haipai marketing actions, adapted from Uiverse button references.
   Sources and MIT notices: ./action-buttons-LICENSE.txt */

body .hp-action {
  --hp-action-ink: #0e1d49;
  --hp-action-accent: #ed7422;
  position: relative;
  display: inline-flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: fit-content;
  max-width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--hp-action-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: var(--font-weight-label);
  line-height: 1.5;
  letter-spacing: .02em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

body .hp-action--inverse { --hp-action-ink: #fff; }

body .hp-action .hp-action__label { position: relative; }

body .hp-action .hp-action__arrow {
  display: block;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  color: inherit;
  transition: transform 300ms ease;
}

body .hp-action--primary {
  padding: 12px 22px;
  border: 1px solid var(--hp-action-accent);
  border-radius: 4px;
  overflow: hidden;
  isolation: isolate;
  transition: color 350ms ease;
}

body .hp-action--primary::before,
body .hp-action--primary::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 160%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--hp-action-accent);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 350ms cubic-bezier(.2, .7, .3, 1);
}

body .hp-action--primary::before { top: 0; left: 0; }
body .hp-action--primary::after { top: 100%; left: 100%; }

body .hp-action--text {
  padding: 10px 0;
  overflow: visible;
}

body .hp-action--text .hp-action__label::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 1px;
  background: var(--hp-action-accent);
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 250ms ease-out;
}

body .hp-action:focus-visible {
  outline: 2px solid var(--hp-action-accent);
  outline-offset: 5px;
}

body .hp-action--primary:focus-visible { color: #0e1d49; }
body .hp-action--primary:focus-visible::before,
body .hp-action--primary:focus-visible::after {
  transform: translate(-50%, -50%) scale(1);
}

body .hp-action--text:focus-visible .hp-action__label::after,
body a:focus-visible .hp-action--text .hp-action__label::after {
  transform: scaleX(1);
  transform-origin: left;
}

body .hp-action--text:focus-visible .hp-action__arrow,
body a:focus-visible .hp-action--text .hp-action__arrow {
  transform: translateX(6px);
}

@media (hover: hover) {
  body .hp-action--primary:hover { color: #0e1d49; }
  body .hp-action--primary:hover::before,
  body .hp-action--primary:hover::after {
    transform: translate(-50%, -50%) scale(1);
  }
  body .hp-action--text:hover .hp-action__label::after,
  body a:hover .hp-action--text .hp-action__label::after {
    transform: scaleX(1);
    transform-origin: left;
  }
  body .hp-action--text:hover .hp-action__arrow,
  body a:hover .hp-action--text .hp-action__arrow {
    transform: translateX(6px);
  }
}

body .hp-action--primary:active { background: var(--hp-action-accent); color: #0e1d49; }

@media (prefers-reduced-motion: reduce) {
  body .hp-action,
  body .hp-action::before,
  body .hp-action::after,
  body .hp-action .hp-action__label::after,
  body .hp-action .hp-action__arrow { transition: none; }
  body .hp-action--text:is(:hover, :focus-visible) .hp-action__arrow,
  body a:is(:hover, :focus-visible) .hp-action--text .hp-action__arrow { transform: none; }
}
