/* Physical Analytics: button motion (PROPOSAL). Needs tokens.css.
   Works on its own as the pure-CSS version. buttons.gsap.js, if loaded, adds class "gsap-btn" to <html>
   and takes over the motion; the CSS-only hover/active rules then step aside.
   Only transform and opacity ever change. The glow is a blurred layer whose OPACITY fades; box-shadow is never animated. */

@property --glow{syntax:"<number>";inherits:true;initial-value:0}  /* inherits:true so the ::before/::after layers can read it */

.btn{position:relative;isolation:isolate;-webkit-tap-highlight-color:transparent;touch-action:manipulation;user-select:none;
  --halo:rgba(31,90,69,.42);--sheen:rgba(255,255,255,.20)}
/* soft outer glow: a blurred ring that sits OUTSIDE the button face (inner area masked out), only its opacity changes */
.btn::before{content:"";position:absolute;inset:-14px;z-index:-1;padding:14px;border-radius:calc(var(--r-md) + 14px);
  background:var(--halo);filter:blur(10px);opacity:var(--glow);pointer-events:none;
  -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)}
/* inner sheen */
.btn::after{content:"";position:absolute;inset:0;border-radius:inherit;background:linear-gradient(180deg,var(--sheen),transparent 65%);
  opacity:var(--glow);pointer-events:none}
.btn-ghost,.ghost{--halo:rgba(31,90,69,.30);--sheen:rgba(31,90,69,.08)}
.dark .btn,.on-dark .btn,.btn-on-dark,
.hs-a .btn,.site-head .btn,.close .btn,.phead .btn,.pricing .btn{--halo:rgba(232,163,61,.50)}   /* second line = today's dark sections on the live pages; rename to .on-dark when tokens land */
.dark .btn-ghost,.on-dark .btn-ghost{--halo:rgba(238,243,239,.28);--sheen:rgba(238,243,239,.10)}
.btn-fire{--halo:rgba(192,48,28,.5)}

/* Ripple layer: clips the ripple to the button without clipping the glow or focus ring */
.btn-fx{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none;z-index:0}
.btn-ripple{position:absolute;border-radius:50%;background:currentColor;opacity:0;transform:scale(0);pointer-events:none}

/* ---- Focus ring: always an instant outline (never animated, survives forced-colors) ---- */
.btn:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.dark .btn:focus-visible,.on-dark .btn:focus-visible{outline-color:var(--focus-on-dark)}
@media (forced-colors:active){.btn::before,.btn::after{display:none}}

/* ---- Pure-CSS motion (used when GSAP is not loaded, or as the fallback) ---- */
@media (prefers-reduced-motion:no-preference){
  html:not(.gsap-btn) .btn{transition:transform .38s cubic-bezier(.34,1.56,.64,1),--glow .18s ease-out}
  @media (hover:hover){
    html:not(.gsap-btn) .btn:hover{transform:translateY(-2px);--glow:1;transition:transform .18s var(--ease-out),--glow .18s ease-out}
  }
  html:not(.gsap-btn) .btn:focus-visible{transform:translateY(-2px);--glow:1}
  html:not(.gsap-btn) .btn:not([data-click="ripple"]):active,html:not(.gsap-btn) .btn:not([data-click="ripple"]).is-pressed{transform:translateY(0) scale(.96);transition-duration:.07s,.07s}
  .btn-ripple.is-css{animation:pa-ripple .6s ease-out forwards}
}
@keyframes pa-ripple{from{transform:scale(0);opacity:.38}to{transform:scale(1);opacity:0}}

/* ---- Reduced motion: no movement, no fading. State changes are instant. ---- */
@media (prefers-reduced-motion:reduce){
  .btn{transition:none}
  .btn:hover,.btn:focus-visible{--glow:1}
  .btn:active,.btn.is-pressed{box-shadow:inset 0 0 0 999px rgba(0,0,0,.14)}   /* instant darker face, not animated */
  .btn-ripple{display:none}
}
.btn[disabled],.btn[aria-disabled="true"]{pointer-events:none;opacity:.55}
