@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --gradient-angle-offset {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@property --gradient-percent {
  syntax: "<percentage>";
  initial-value: 5%;
  inherits: false;
}

@property --gradient-shine {
  syntax: "<color>";
  initial-value: white;
  inherits: false;
}

.shiny-cta {
  --shiny-cta-bg: #000000;
  --shiny-cta-bg-subtle: #1a1818;
  --shiny-cta-fg: #ffffff;
  /* Logo #003048 → muted accent */
  --shiny-cta-highlight: #2a5f73;
  --shiny-cta-highlight-subtle: #3d7f96;
  --animation: gradient-angle linear infinite;
  --duration: 8s;
  --shadow-size: 2px;
  --transition: 1.2s cubic-bezier(0.25, 1, 0.5, 1);

  isolation: isolate;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  outline-offset: 4px;
  padding: 1.25rem 2.5rem;
  font-family: "Switzer", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.2;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--shiny-cta-fg);
  background: linear-gradient(var(--shiny-cta-bg), var(--shiny-cta-bg)) padding-box,
    conic-gradient(
      from calc(var(--gradient-angle) - var(--gradient-angle-offset)),
      transparent,
      var(--shiny-cta-highlight) var(--gradient-percent),
      var(--gradient-shine) calc(var(--gradient-percent) * 2),
      var(--shiny-cta-highlight) calc(var(--gradient-percent) * 3),
      transparent calc(var(--gradient-percent) * 4)
    )
    border-box;
  box-shadow: inset 0 0 0 1px var(--shiny-cta-bg-subtle);
  transition:
    transform 160ms cubic-bezier(0.23, 1, 0.32, 1),
    var(--transition);
  transition-property: transform, --gradient-angle-offset, --gradient-percent, --gradient-shine;
}

.shiny-cta::before,
.shiny-cta::after,
.shiny-cta > span::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 50%;
  translate: -50% -50%;
  z-index: -1;
}

.shiny-cta:active {
  transform: scale(0.97);
  translate: none;
}

.shiny-cta::before {
  --size: calc(100% - var(--shadow-size) * 3);
  --position: 2px;
  --space: calc(var(--position) * 2);
  width: var(--size);
  height: var(--size);
  background: radial-gradient(
      circle at var(--position) var(--position),
      white calc(var(--position) / 4),
      transparent 0
    )
    padding-box;
  background-size: var(--space) var(--space);
  background-repeat: space;
  mask-image: conic-gradient(
    from calc(var(--gradient-angle) + 45deg),
    black,
    transparent 10% 90%,
    black
  );
  border-radius: inherit;
  opacity: 0.4;
  z-index: -1;
}

.shiny-cta::after {
  --animation: shimmer linear infinite;
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(-50deg, transparent, var(--shiny-cta-highlight), transparent);
  mask-image: radial-gradient(circle at bottom, transparent 40%, black);
  opacity: 0.35;
}

.shiny-cta > span {
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  line-height: 1;
}

.shiny-cta__arrow {
  position: relative;
  top: -0.1em;
  font-size: 1.05em;
  line-height: 1;
}

.shiny-cta > span::before {
  --size: calc(100% + 1rem);
  width: var(--size);
  height: var(--size);
  box-shadow: inset 0 -1ex 2rem 4px var(--shiny-cta-highlight);
  opacity: 0;
  transition: opacity var(--transition);
  animation: calc(var(--duration) * 1.5) breathe linear infinite;
}

.shiny-cta,
.shiny-cta::before,
.shiny-cta::after {
  animation: var(--animation) var(--duration), var(--animation) calc(var(--duration) / 0.4) reverse
    paused;
  animation-composition: add;
}

.shiny-cta:focus-visible {
  outline: 1px solid rgba(200, 164, 90, 0.45);
  outline-offset: 3px;
}

.shiny-cta:is(:hover, :focus-visible) {
  --gradient-percent: 20%;
  --gradient-angle-offset: 95deg;
  --gradient-shine: var(--shiny-cta-highlight-subtle);
}

.shiny-cta:is(:hover, :focus-visible),
.shiny-cta:is(:hover, :focus-visible)::before,
.shiny-cta:is(:hover, :focus-visible)::after {
  animation-play-state: running;
}

.shiny-cta:is(:hover, :focus-visible) > span::before {
  opacity: 1;
}

@keyframes gradient-angle {
  to {
    --gradient-angle: 360deg;
  }
}

@keyframes shimmer {
  to {
    rotate: 360deg;
  }
}

@keyframes breathe {
  from,
  to {
    scale: 1;
  }
  50% {
    scale: 1.2;
  }
}

/* Hero secondary — near primary height, faint white glow */
.outline-cta {
  isolation: isolate;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.1rem 2.1rem;
  font-family: "Switzer", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.2;
  font-weight: 500;
  border-radius: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  transition:
    transform 160ms cubic-bezier(0.23, 1, 0.32, 1),
    color 0.45s ease,
    border-color 0.45s ease,
    background 0.45s ease,
    box-shadow 0.5s ease;
}

.outline-cta::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: -4px;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(
    ellipse 85% 75% at 50% 50%,
    rgba(255, 255, 255, 0.07),
    transparent 78%
  );
  filter: blur(4px);
  transition: opacity 0.5s ease;
}

.outline-cta > span {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  line-height: 1.2;
}

.outline-cta__dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  background: #3d7f96;
  box-shadow:
    0 0 4px rgba(61, 127, 150, 0.7),
    0 0 8px rgba(42, 95, 115, 0.35);
  transition: box-shadow 0.45s ease;
}

.outline-cta:focus-visible {
  outline: 1px solid rgba(200, 164, 90, 0.55);
  outline-offset: 3px;
}

.outline-cta:is(:hover, :focus-visible) {
  color: rgba(255, 255, 255, 0.98);
  border-color: rgba(200, 164, 90, 0.42);
  background: rgba(255, 255, 255, 0.02);
  box-shadow:
    0 0 10px 1px rgba(200, 164, 90, 0.08),
    inset 0 0 12px rgba(255, 255, 255, 0.03);
}

.outline-cta:is(:hover, :focus-visible)::before {
  opacity: 0.85;
}

.outline-cta:is(:hover, :focus-visible) .outline-cta__dot {
  background: #c8a45a;
  box-shadow:
    0 0 5px rgba(200, 164, 90, 0.95),
    0 0 10px rgba(200, 164, 90, 0.45);
}

.outline-cta:active {
  transform: scale(0.97);
  translate: none;
}

@media (prefers-reduced-motion: reduce) {
  .shiny-cta,
  .shiny-cta::before,
  .shiny-cta::after,
  .shiny-cta > span::before {
    animation: none;
  }

  .shiny-cta:active,
  .outline-cta:active {
    transform: none;
  }
}
