/* Shiny CTA: the primary button (and round button) of every hero, site wide.
   A vanilla-CSS port of the supplied React "ShinyButton" (shadcn style) to this
   static site, in the Hammer Brand Identity palette instead of black/blue:
     fill     Tertiary BG #0D2031      inner ring  Hammer Accent #113855
     label    #F2F2F2, Montserrat Medium (the brand's secondary text; the
              component's Inter import is dropped)
     sweep    Hammer Secondary #2E8ED1, shine #F2F2F2 at rest, a light brand
              blue #86BBE0 (Secondary mixed with #F2F2F2) on hover
   main.js builds it from each hero's first a.button / button.button and its
   a.round-link (no markup changes in the pages) and toggles .is-live while the
   button is on screen: the loops only run then. Reduced motion: static.
   Kept in its own file because theme-dark.css is generated from style.css and
   would remap these colours. */
@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:#f2f2f2;inherits:false}

.shiny-cta{
  --shiny-cta-bg:#0d2031;
  --shiny-cta-bg-subtle:#113855;
  --shiny-cta-fg:#f2f2f2;
  --shiny-cta-highlight:#2e8ed1;
  --shiny-cta-highlight-subtle:#86bbe0;
  --animation:gradient-angle linear infinite;
  --duration:3s;
  --shadow-size:2px;
  --transition:800ms cubic-bezier(.25,1,.5,1);
  isolation:isolate;position:relative;overflow:hidden;cursor:pointer;outline-offset:4px;
  display:inline-block;max-width:100%;text-align:center;white-space:nowrap;text-decoration:none;
  padding:1.05rem 2.2rem;font:500 1rem/1.2 var(--heading,'Montserrat',sans-serif);letter-spacing:0;text-transform:none;
  border:1px solid transparent;border-radius:360px;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:var(--transition);transition-property:--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{translate:0 1px}
/* dots pattern */
.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),#f2f2f2 calc(var(--position) / 4),transparent 0) padding-box;
  background-size:var(--space) var(--space);background-repeat:space;
  -webkit-mask-image:conic-gradient(from calc(var(--gradient-angle) + 45deg),#000,transparent 10% 90%,#000);
  mask-image:conic-gradient(from calc(var(--gradient-angle) + 45deg),#000,transparent 10% 90%,#000);
  border-radius:inherit;opacity:.4;z-index:-1}
/* inner shimmer */
.shiny-cta::after{
  --animation:shimmer linear infinite;width:100%;aspect-ratio:1;
  background:linear-gradient(-50deg,transparent,var(--shiny-cta-highlight),transparent);
  -webkit-mask-image:radial-gradient(circle at bottom,transparent 40%,#000);mask-image:radial-gradient(circle at bottom,transparent 40%,#000);
  opacity:.6}
.shiny-cta span{z-index: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}
/* animate */
.shiny-cta,.shiny-cta::before,.shiny-cta::after{
  animation:var(--animation) var(--duration),var(--animation) calc(var(--duration) / .4) reverse paused;
  animation-composition:add}
.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}
.shiny-cta:focus-visible{outline:2px solid var(--shiny-cta-highlight)}
/* nothing loops while the button is off screen (main.js sets .is-live) */
.shiny-cta:not(.is-live),.shiny-cta:not(.is-live)::before,.shiny-cta:not(.is-live)::after,.shiny-cta:not(.is-live) span::before{animation-play-state:paused}
@keyframes gradient-angle{to{--gradient-angle:360deg}}
@keyframes shimmer{to{rotate:360deg}}
@keyframes breathe{from,to{scale:1}50%{scale:1.2}}

/* round variant: the heroes' scroll arrows */
.shiny-cta--round{width:58px;height:58px;padding:0;display:inline-grid;place-items:center;font-size:1.15rem;line-height:1;flex:0 0 auto}

@media (max-width:640px){.shiny-cta:not(.shiny-cta--round){padding:.95rem 1.8rem;font-size:.95rem}}
@media (prefers-reduced-motion:reduce){
  .shiny-cta,.shiny-cta::before,.shiny-cta::after,.shiny-cta span::before{animation:none;transition:none}
}
