/* A thin travelling highlight; the button surface and hit area stay unchanged. */
@property --fm-glint-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:where(button, .btn, .module-download-button, .languages a, .back-top, summary) {
  position: relative;
}

@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
  :where(button, .btn, .module-download-button, .languages a, .back-top, summary)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 1.5px;
    border-radius: inherit;
    pointer-events: none;
    background: conic-gradient(from var(--fm-glint-angle),
      transparent 0deg 270deg, #83b7ff45 300deg,
      #a8d4ffd9 333deg, #f2fbff 350deg, transparent 360deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity .18s ease;
  }

  @media (hover: hover) and (pointer: fine) {
    :where(button, .btn, .module-download-button, .languages a, .back-top, summary):not(:disabled):not([aria-disabled="true"]):hover::before {
      opacity: 1;
      animation: fm-button-glint 1.8s linear infinite;
    }
  }
  :where(button, .btn, .module-download-button, .languages a, .back-top, summary):not(:disabled):not([aria-disabled="true"]):focus-visible::before {
    opacity: 1;
    animation: fm-button-glint 1.8s linear infinite;
  }
}

@keyframes fm-button-glint {
  to { --fm-glint-angle: 360deg; }
}

/* Respect both OS accessibility settings and the site's animation switch. */
@media (prefers-reduced-motion: reduce) {
  :where(button, .btn, .module-download-button, .languages a, .back-top, summary)::before {
    animation: none !important;
    transition: none !important;
  }
}
.no-motion :where(button, .btn, .module-download-button, .languages a, .back-top, summary)::before {
  animation: none !important;
  transition: none !important;
}
