/* Koox logo motion set — pairs with koox-logo.js. Needs tokens.css (springs). */
.kx-logo { display: block; width: 100%; height: auto; overflow: visible; fill: currentColor; stroke: currentColor; stroke-linecap: round; }
.kx-logo line { stroke-width: 74; }
.kx-logo .dot, .kx-logo .o { stroke: none; }
.kx-logo .dot, .kx-logo .o, .kx-logo .pupil, .kx-logo .ogroup { transform-box: fill-box; transform-origin: center; }

/* 1. Intro: dots pop, strokes spring in along their diagonals, O's bounce, pupils open */
.kx-logo.is-intro .dot   { animation: kx-pop .75s .6s var(--kx-spring) both; }
.kx-logo.is-intro .kl    { animation: kx-kl .9s var(--kx-spring) both; }
.kx-logo.is-intro .ks    { animation: kx-ks .9s .12s var(--kx-spring) both; }
.kx-logo.is-intro .xl    { animation: kx-xl .9s .06s var(--kx-spring) both; }
.kx-logo.is-intro .xs    { animation: kx-xs .9s .18s var(--kx-spring) both; }
.kx-logo.is-intro .o     { animation: kx-pop .85s .25s var(--kx-spring) both; }
.kx-logo.is-intro .pupil { animation: kx-pop .7s 1s var(--kx-spring) both; }

/* 2. Blink */
.kx-logo.is-blink .pupil { animation: kx-blink .28s ease-in-out; }

/* 3. Loader: O's breathe while the pupils orbit (orbit is driven by JS) */
.kx-logo.is-loading .ogroup { animation: kx-breathe 1.6s var(--kx-glide) infinite; }

/* 4. Outro (before leaving a page): O's close, everything drops */
.kx-logo.is-outro .pupil { animation: kx-close .35s ease-in both; }
.kx-logo.is-outro .o     { animation: kx-shrink .5s .2s var(--kx-glide) both; }
.kx-logo.is-outro .dot, .kx-logo.is-outro line { animation: kx-fade .4s .1s ease-in both; }

@keyframes kx-pop     { from { transform: scale(0); } to { transform: none; } }
@keyframes kx-kl      { from { transform: translate(-110px, 110px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kx-ks      { from { transform: translate(70px, 70px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kx-xl      { from { transform: translate(110px, 110px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kx-xs      { from { transform: translate(-70px, 70px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kx-blink   { 50% { transform: scaleY(.08); } }
@keyframes kx-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(.93); } }
@keyframes kx-close   { to { transform: scaleY(.05); } }
@keyframes kx-shrink  { to { transform: scale(.6); opacity: 0; } }
@keyframes kx-fade    { to { opacity: 0; } }

/* Aperture page transition layer */
.kx-aperture { position: fixed; inset: 0; z-index: 1000; display: none; place-items: center; background: var(--kx-stage); }
.kx-aperture canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.kx-aperture .kx-logo { position: relative; width: min(240px, 46vw); color: var(--kx-bone); }

@media (prefers-reduced-motion: reduce) {
  .kx-logo *, .kx-logo { animation: none !important; }
}
