/* nuspace.net page motion, after SIGE.eat's and SIGE.chat's sites (assets/css/motion.css there),
   which follow anilan.ai's: scroll progress, a motion switch, a canvas network, pointer-lit sections,
   reveal on scroll, self-drawing strokes, an orbit of what we do around the mark, and a scroll-pinned
   chapter. Everything here is decorative. Nothing is hidden unless motion.js has switched motion on
   (html.mo), and body.motion-off or prefers-reduced-motion puts every element at rest. */

:root {
  --mo-blue: 31, 111, 184;
  --mo-coral: 242, 84, 91;
  --mo-ink: 20, 33, 61;
  --mo-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Scroll progress ---------- */
.mo-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1100; pointer-events: none;
  background: linear-gradient(90deg, rgb(var(--mo-blue)), rgb(var(--mo-coral)));
}

/* ---------- Motion switch ---------- */
.mo-toggle {
  position: fixed;
  left: calc(16px + env(safe-area-inset-left, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1100;
  font: 700 0.72rem/1 var(--font);
  letter-spacing: 0.06em;
  color: rgb(var(--mo-ink));
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(var(--mo-ink), 0.16);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(var(--mo-ink), 0.12);
}
.mo-toggle:focus-visible { outline: 3px solid rgba(var(--mo-blue), 0.5); outline-offset: 2px; }

/* ---------- Hero: network, pointer light, depth ---------- */
.hero.mo-hero { overflow: hidden; isolation: isolate; }
.mo-field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.mo-light {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; transition: opacity .4s;
  background: radial-gradient(520px circle at calc(50% + var(--pointer-offset-x, 0px)) var(--pointer-y, 30%),
      rgba(var(--mo-blue), 0.12), transparent 62%);
}
body.motion-off .mo-light { opacity: 0; }
html.mo .hero-copy { will-change: transform; }

/* ---------- The orbit: what we do, circling the mark ---------- */
html.mo .hero-media { animation: mo-rise 1.1s var(--mo-ease) .25s both; }
@keyframes mo-rise {
  from { opacity: 0; transform: translate3d(0, 48px, 0) scale(.94); }
  to { opacity: 1; transform: none; }
}
.mo-orbit { position: relative; aspect-ratio: 1; width: 100%; will-change: transform; }
.mo-orbit .hero-mark { position: absolute; inset: 22%; max-width: none; margin: 0; z-index: 2; }
.mo-ring {
  position: absolute; border-radius: 50%; border: 1.5px dashed rgba(var(--mo-ink), 0.14);
}
.mo-ring.r1 { inset: 9%; }
.mo-ring.r2 { inset: 0; border-style: solid; border-color: rgba(var(--mo-blue), 0.12); }
html.mo .hero-mark { animation: mo-breathe 5s ease-in-out infinite; }
@keyframes mo-breathe {
  0%, 100% { box-shadow: 0 30px 60px -24px rgba(var(--mo-ink), .3), 0 0 0 0 rgba(var(--mo-coral), .0); }
  50% { box-shadow: 0 30px 60px -24px rgba(var(--mo-ink), .3), 0 0 0 18px rgba(var(--mo-coral), .08); }
}
.mo-chip {
  position: absolute; left: 50%; top: 50%; z-index: 3;
  padding: 7px 13px; border-radius: 999px; white-space: nowrap;
  font-size: .85rem; font-weight: 700;
  background: var(--white); color: rgb(var(--mo-blue));
  border: 1px solid rgba(var(--mo-blue), .2);
  box-shadow: 0 8px 20px -8px rgba(var(--mo-ink), .3);
  translate: -50% -50%;
}
.mo-chip:nth-child(odd) { color: rgb(var(--mo-coral)); border-color: rgba(var(--mo-coral), .25); }

/* ---------- Section-local pointer light ---------- */
.mo-glow-zone { position: relative; isolation: isolate; }
.mo-glow-zone::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at calc(50% + var(--pointer-offset-x, 0px)) var(--pointer-y, 50%),
      rgba(var(--mo-blue), 0.10), transparent 65%);
}
.mo-glow-zone.is-pointer-lit::before { opacity: 1; }

/* ---------- Reveal on scroll ---------- */
html.mo .mo-reveal { opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity .7s var(--mo-ease), transform .7s var(--mo-ease); }
html.mo .mo-reveal.mo-visible { opacity: 1; transform: none; }

/* ---------- Self-drawing strokes ---------- */
.mo-underline { display: block; width: min(220px, 50%); height: 14px; margin: 2px 0 14px; overflow: visible; }
.mo-underline path { fill: none; stroke: rgb(var(--mo-coral)); stroke-width: 3; stroke-linecap: round; }
html.mo .mo-draw path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s var(--mo-ease) .15s; }
html.mo .mo-draw.mo-drawn path { stroke-dashoffset: 0; }

/* ---------- How we work: a pinned chapter ---------- */
.mo-rail { display: none; }
@media (min-width: 1025px) {
  html.mo .steps.mo-pinned { height: 260vh; padding: 0; overflow-x: clip; }
  html.mo .steps.mo-pinned > .wrap { position: sticky; top: 0; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
  html.mo .steps.mo-pinned .steps-list { position: relative; grid-template-columns: repeat(4, 1fr); }
  html.mo .steps.mo-pinned .mo-rail {
    display: block; position: absolute; left: 12.5%; right: 12.5%; top: 24px; height: 4px;
    border-radius: 2px; background: rgba(var(--mo-ink), .1); z-index: 0;
  }
  html.mo .steps.mo-pinned .mo-rail::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(90deg, rgb(var(--mo-coral)), rgb(var(--mo-blue)));
    transform-origin: 0 50%; transform: scaleX(var(--rail, 0));
  }
  html.mo .steps.mo-pinned .step { position: relative; z-index: 1; will-change: translate, opacity; }
  html.mo .steps.mo-pinned .step .step-number { transition: transform .4s var(--mo-ease), box-shadow .4s; }
  html.mo .steps.mo-pinned .step.is-active .step-number {
    transform: scale(1.14);
    box-shadow: 0 0 0 8px rgba(var(--mo-blue), .16), 0 4px 10px rgba(var(--mo-blue), .3);
  }
}

/* ---------- At rest ---------- */
@media (prefers-reduced-motion: reduce) {
  .mo-progress, .mo-light { display: none; }
}
body.motion-off .hero-media, body.motion-off .hero-mark { animation: none; }
