/* MAKKY_OS motion layer: added on top of the original styles.
   Uses the individual translate/scale properties so it never fights the
   original transform-based hover effects. Honors the site's motion-off flag. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: mxVtOut .22s ease both; }
::view-transition-new(root) { animation: mxVtIn .38s cubic-bezier(.22,.9,.3,1) both; }
@keyframes mxVtOut { to { opacity: 0; } }
@keyframes mxVtIn { from { opacity: 0; } }

/* scroll progress bar */
.mx-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 9999; pointer-events: none;
  background: linear-gradient(90deg, var(--mx-a, #3ce0ff), var(--mx-b, #2dd4bf), var(--mx-a, #3ce0ff));
  background-size: 200% 100%; transform-origin: left center; scale: 0 1;
  animation: mxFlow 4s linear infinite; }
[dir="rtl"] .mx-progress { transform-origin: right center; }
@keyframes mxFlow { to { background-position: -200% 0; } }

/* entrance: hidden only after JS has tagged the element */
html.mx-on [data-mx] { opacity: 0; }
html.mx-on [data-mx].mx-in {
  animation-duration: var(--mx-dur, .7s);
  animation-delay: var(--mx-d, 0s);
  animation-timing-function: cubic-bezier(.22,.9,.3,1);
  animation-fill-mode: both;
}
[data-mx="up"].mx-in    { animation-name: mxUp; }
[data-mx="down"].mx-in  { animation-name: mxDown; }
[data-mx="left"].mx-in  { animation-name: mxLeft; }
[data-mx="right"].mx-in { animation-name: mxRight; }
[data-mx="zoom"].mx-in  { animation-name: mxZoom; }
[data-mx="pop"].mx-in   { animation-name: mxPop; animation-timing-function: cubic-bezier(.34,1.56,.64,1); }
[data-mx="blur"].mx-in  { animation-name: mxBlur; }
[data-mx="clip"].mx-in  { animation-name: mxClip; }
@keyframes mxUp    { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: 0 0; } }
@keyframes mxDown  { from { opacity: 0; translate: 0 -22px; } to { opacity: 1; translate: 0 0; } }
@keyframes mxLeft  { from { opacity: 0; translate: -34px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes mxRight { from { opacity: 0; translate: 34px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes mxZoom  { from { opacity: 0; scale: .92; } to { opacity: 1; scale: 1; } }
@keyframes mxPop   { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }
@keyframes mxBlur  { from { opacity: 0; filter: blur(10px); translate: 0 14px; } to { opacity: 1; filter: blur(0); translate: 0 0; } }
@keyframes mxClip  { from { opacity: 0; clip-path: inset(0 0 100% 0); scale: 1.06; } to { opacity: 1; clip-path: inset(0 0 0 0); scale: 1; } }

/* hover / press micro-interactions (translate+scale only) */
.btn, .ibtn, .tbtn, .pbuild, .proj__open, .mailbox, .snav__link, .seg__btn, .chip, .ptile, .pcard, .kcard, .crow, .citem, .ai-fab, .nav a, .brand {
  transition-property: translate, scale, box-shadow, background-color, border-color, color, filter, opacity;
  transition-duration: .22s; transition-timing-function: cubic-bezier(.22,.9,.3,1);
}
.btn:hover, .tbtn:hover, .pbuild:hover, .mailbox:hover, .ptile:hover, .pcard:hover, .kcard:hover, .chip:hover { translate: 0 -3px; }
.ibtn:hover, .seg__btn:hover { scale: 1.08; }
.btn:active, .ibtn:active, .tbtn:active, .pbuild:active, .proj__open:active, .seg__btn:active, .ptile:active, .pcard:active, .ai-fab:active { scale: .95; translate: 0 0; }
.ai-fab:hover { scale: 1.1; }
.snav__link:hover { translate: -4px 0; }
[dir="ltr"] .snav__link:hover { translate: 4px 0; }
.proj, .card, .chart-card, .window, .proj--xl { transition: box-shadow .35s ease, border-color .35s ease; }
.proj:hover, .card:hover, .chart-card:hover { box-shadow: 0 14px 40px -14px rgba(60,224,255,.28); }

/* shine sweep on primary buttons */
.btn--primary, .btn--acc { position: relative; overflow: hidden; isolation: isolate; }
.btn--primary::after, .btn--acc::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%);
  translate: -120% 0; transition: translate .7s ease; }
.btn--primary:hover::after, .btn--acc:hover::after { translate: 120% 0; }

/* cursor spotlight on cards */
.mx-spot { position: relative; }
.mx-spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(260px circle at var(--sx, 50%) var(--sy, 50%), rgba(60,224,255,.13), transparent 60%);
  opacity: 0; transition: opacity .3s; }
.mx-spot:hover::before { opacity: 1; }

/* section title underline draws in */
.section__title { position: relative; }
.section__title::after { content: ""; display: block; height: 3px; width: 56px; margin-top: 10px; border-radius: 3px;
  background: linear-gradient(90deg, var(--mx-a, #3ce0ff), var(--mx-b, #2dd4bf)); transform-origin: left center; scale: 0 1;
  transition: scale .9s cubic-bezier(.22,.9,.3,1) .25s; }
[dir="rtl"] .section__title::after { transform-origin: right center; }
.section__title.mx-in::after { scale: 1 1; }

/* gentle idle float on avatars / logos */
.ws-avi, .login__logo, .shop-brand__logo, .done__icon { animation: mxFloat 5s ease-in-out infinite; }
@keyframes mxFloat { 50% { translate: 0 -5px; } }

/* number badges bump when their value changes */
.mx-bump { animation: mxBump .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes mxBump { 40% { scale: 1.35; } }

/* view switch in demos */
.view.mx-view { animation: mxViewIn .45s cubic-bezier(.22,.9,.3,1) both; }
@keyframes mxViewIn { from { opacity: 0; translate: 0 14px; filter: blur(4px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }

/* modals, drawers, toasts */
.modal.show .modal__box, .modal.open .modal__box { animation: mxModal .38s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes mxModal { from { opacity: 0; scale: .9; translate: 0 18px; } to { opacity: 1; scale: 1; translate: 0 0; } }
.toasts > * { animation: mxToast .45s cubic-bezier(.34,1.4,.64,1) both; }
@keyframes mxToast { from { opacity: 0; translate: 0 24px; scale: .94; } to { opacity: 1; translate: 0 0; scale: 1; } }

/* bar / progress fills grow */
.tp-row__fill, .bar__fill { transform-origin: left center; animation: mxGrow 1s cubic-bezier(.22,.9,.3,1) both; }
[dir="rtl"] .tp-row__fill, [dir="rtl"] .bar__fill { transform-origin: right center; }
@keyframes mxGrow { from { scale: 0 1; } to { scale: 1 1; } }

/* chart svg: bars rise, lines draw, donut spins in */
.chart-box svg rect { transform-box: fill-box; transform-origin: bottom center; animation: mxBar .9s cubic-bezier(.22,.9,.3,1) both; }
.chart-box svg path[stroke]:not([fill]):not([fill="none"]) { }
.chart-box svg circle[stroke-dasharray], .chart-box svg path { animation: mxFade .9s ease both; }
@keyframes mxBar { from { scale: 1 0; opacity: .2; } to { scale: 1 1; opacity: 1; } }
@keyframes mxFade { from { opacity: 0; } to { opacity: 1; } }

/* kept for accessibility: the site's own opt-out */
html.motion-off [data-mx], html.motion-off .mx-progress { opacity: 1 !important; animation: none !important; }
html.motion-off * { translate: none !important; scale: none !important; }
@media print { html.mx-on [data-mx] { opacity: 1 !important; animation: none !important; } .mx-progress { display: none; } }
