/* Motion shared by the drafts, from transitions.dev (tabs sliding, error shake), in Terayt's square look. No blur: DESIGN.md keeps it for paid content. */

/* a dark highlight that slides between the options of a two-way control; motion.js adds .has-pill and the .pill */
.has-pill { position: relative; }
.has-pill > :not(.pill) { position: relative; background: none !important; transition: color 250ms cubic-bezier(.22, 1, .36, 1); }
.pill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--ink); pointer-events: none;
  transition: transform 250ms cubic-bezier(.22, 1, .36, 1), width 250ms cubic-bezier(.22, 1, .36, 1); }

/* a field that was just refused. Only the movement: the error colour and message stay until the field is edited. */
:root { --shake-distance: 6px; --shake-overshoot: 4px; --shake-dur-a: 80ms; --shake-dur-b: 60ms; --shake-ease: cubic-bezier(.22, 1, .36, 1); }
.is-shaking { animation: t-input-shake calc(var(--shake-dur-a) * 2 + var(--shake-dur-b) * 2) linear; }
@keyframes t-input-shake {
  0%     { transform: translateX(0); animation-timing-function: var(--shake-ease); }
  28.57% { transform: translateX(var(--shake-distance)); animation-timing-function: var(--shake-ease); }
  57.14% { transform: translateX(calc(var(--shake-distance) * -1)); animation-timing-function: var(--shake-ease); }
  78.57% { transform: translateX(var(--shake-overshoot)); animation-timing-function: var(--shake-ease); }
  100%   { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .pill, .has-pill > :not(.pill) { transition: none !important; }
  .is-shaking { animation: none !important; }
}
