/* One press language for native controls and button-like links. Independent
   scale composes with the site's existing magnetic and reveal transforms. */
body :is(button, [role="button"], .logo, .site-nav a, [data-hover-fill],
  .archive-list__link, .entry-page__foot a,
  .ew-contents a, .ew-example-nav a, .ew-example__use, .ew-colophon a,
  .slop-download, .slop-gallery__foot a, .cl-preview, .site-footer__top, .role__label,
  .site-footer__version, .goal__media-link, .ew-skip, .system-nav a,
  .admin-button, .admin-nav__link, .admin-publications__row, .admin-knowledge-list__row) {
  --press-scale: .965;
  --press-release: cubic-bezier(.22, 1, .36, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: scale var(--press-duration, 200ms) var(--press-release), background-color 160ms ease,
    border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

body :is([data-hover-fill], .archive-list__link, .cl-preview, .admin-publications__row, .admin-knowledge-list__row):is(a, button),
body [role="button"].fact {
  --press-scale: .99;
}
body :is(a, button)[data-hover-fill] {
  transition: scale var(--press-duration, 200ms) var(--press-release), background-color .35s ease,
    color var(--hover-fill-duration, .16s) var(--hover-fill-ease, ease),
    border-color 160ms ease, box-shadow 160ms ease;
}

body :is(button, [role="button"], .logo, .site-nav a, [data-hover-fill],
  .archive-list__link, .entry-page__foot a,
  .ew-contents a, .ew-example-nav a, .ew-example__use, .ew-colophon a,
  .slop-download, .slop-gallery__foot a, .cl-preview, .site-footer__top, .role__label,
  .site-footer__version, .goal__media-link, .ew-skip, .system-nav a,
  .admin-button, .admin-nav__link, .admin-publications__row, .admin-knowledge-list__row):not(:disabled):not([aria-disabled="true"]):is(:active, .is-pressed) {
  scale: var(--press-scale);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 24%, transparent);
  --press-duration: 80ms;
}

body .hero .role__label {
  transition: scale var(--press-duration, 200ms) var(--press-release),
    background-position .45s ease, rotate .45s ease;
}
body button.language-switch {
  transition: scale var(--press-duration, 200ms) var(--press-release),
    color .25s ease, opacity .25s ease, box-shadow 160ms ease;
}

body:not(.admin-body) :is(button, [role="button"]):focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 4px;
}

/* Menu entry motion stays independent from the immediate press response. */
@media (max-width: 768px) {
  body .site-header .site-nav a {
    transition: scale var(--press-duration, 200ms) var(--press-release), background-color 160ms ease,
      color 160ms ease, box-shadow 160ms ease, opacity .3s ease, transform .3s ease;
  }
  .site-header.is-nav-open .site-nav a:nth-child(n) { transition-delay: 0s; }
}

@media (prefers-reduced-motion: reduce) {
  body .is-pressed,
  body :is(button, [role="button"], a, .role__label):active {
    scale: none !important;
  }
  body :is(button, [role="button"], a, .role__label) { transition: none !important; }
}
