/* Tenax Motion v1 styles (goes with tx-motion.js). Sites set --tx-good (success), --tx-err (real errors only) and
   --tx-dim (the stage dim colour). No pink anywhere: errors are a clear red, warnings are clay. */
:root { --tx-good: #9fd3a6; --tx-err: #ff5c4d; --tx-clay: #c9774f; --tx-dim: rgba(10, 9, 8, .52); }

/* 1. Success ring */
.tx-ring { position: fixed; z-index: 2147483000; pointer-events: none; will-change: transform, opacity;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tx-good) 88%, transparent), 0 0 22px -4px color-mix(in srgb, var(--tx-good) 70%, transparent); }

/* 2. A panel that is growing out of (or back into) its card is solid while it moves */
.tx-moving { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; will-change: transform, clip-path; }

/* 3. A label that changed comes into focus */
.tx-refocus { animation: tx-focus .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes tx-focus { from { color: transparent; text-shadow: 0 0 7px var(--tx-fc, currentColor); } }

/* 4. Rubber band: the browser's own overscroll glow is replaced by the stretch */
[data-rubber] { overscroll-behavior: contain; }

/* 5. Reveals: a wipe with the fade, never the fade alone. Hidden only once the script is running. */
.tx-js [data-reveal]:not(.tx-in) { opacity: 0; }
[data-reveal].tx-in:not(.tx-done) { animation: tx-rise .5s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes tx-rise { from { opacity: 0; transform: translateY(14px); clip-path: inset(0 0 46% 0 round 18px); }
  to { opacity: 1; transform: none; clip-path: inset(-40px -40px -40px -40px round 0); } }
@keyframes tx-wipe { from { opacity: 0; transform: translateY(8px); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(-30px); } }

/* 6. Stage the focus: whatever is marked .tx-stage recedes behind an open sheet or viewer */
.tx-stage { transition: transform .42s cubic-bezier(.2, .9, .25, 1), filter .42s ease; transform-origin: 50% 40vh; }
.tx-staged .tx-stage { transform: scale(.965) translateY(6px); filter: brightness(.72) saturate(.9); }

/* 8. Doherty: the press shows at pointerdown and springs back on release; slow actions pulse */
:where(button, a[href], [role=button], summary, .tx-tap) { transition: transform .38s cubic-bezier(.3, 1.6, .5, 1); }
.tx-press { transform: translateY(1.5px) scale(.975) !important; transition: transform .05s ease-out !important; }
.tx-busy { animation: tx-pulse 1.1s ease-in-out infinite; cursor: progress; }
@keyframes tx-pulse { 50% { opacity: .62; } }

/* 7. Fitts: helper for small visual controls that need a 44 px target without changing their look */
.tx-hit { position: relative; }
.tx-hit::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }

@media (prefers-reduced-motion: reduce) {
  .tx-stage, .tx-press, :where(button, a[href], [role=button], summary, .tx-tap) { transition: none !important; }
  .tx-staged .tx-stage { transform: none; }
  [data-reveal].tx-in, .tx-refocus, .tx-busy { animation: none !important; }
  .tx-js [data-reveal]:not(.tx-in) { opacity: 1; }
}
