/* Material 3 Expressive-inspired shape feedback on PLAB's soft surfaces. */
body :is(button, .button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):not([data-squishy="off"]) {
  --plab-button-radius: 28px;
  --plab-button-pressed-radius: 12px;
  border-radius: var(--plab-button-radius);
  transform-origin: center;
  -webkit-tap-highlight-color: transparent;
  transition: scale 160ms cubic-bezier(.2, .8, .2, 1),
    translate 160ms ease,
    border-radius 180ms cubic-bezier(.2, .8, .2, 1),
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

body :is(button, .button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):not([data-squishy="off"]):not(:disabled):not([aria-disabled="true"]):is(:active, .plab-squishy-pressed) {
  scale: .985 .95;
  translate: 0 1px;
  border-radius: var(--plab-button-pressed-radius);
  box-shadow: var(--inset, var(--shadow-in, inset 3px 3px 7px #073d5626, inset -3px -3px 7px #ffffffb3));
  transition-duration: 80ms;
}

body :is(button, .button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):not([data-squishy="off"]).plab-squishy-releasing {
  animation: plab-button-rebound 420ms linear;
}

/* Individual scale/translate keep existing selected-state transforms and child icons. */
@keyframes plab-button-rebound {
  0% { scale: .985 .95; translate: 0 1px; border-radius: var(--plab-button-pressed-radius); }
  34% { scale: 1.015 1.035; translate: 0 -1px; border-radius: var(--plab-button-radius); }
  62% { scale: .997 .985; translate: 0 0; }
  82% { scale: 1.003 1.008; }
  100% { scale: 1; translate: 0 0; border-radius: var(--plab-button-radius); }
}

body :is(button, .button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):is(:disabled, [aria-disabled="true"]) {
  animation: none;
  scale: 1;
  translate: 0 0;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  body :is(button, .button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):not([data-squishy="off"]) {
    animation: none !important;
    transition: none !important;
    scale: 1 !important;
    translate: 0 0 !important;
    transform: none !important;
    border-radius: var(--plab-button-radius) !important;
  }
}
