/* ═══════════════════════════════════════════════════════════════════════
   NexStone — custom cursor, every page.

   Its own sheet rather than a block in home-landing.css (front page only)
   or pages.css (everything else), because the ring is site furniture and
   both of those sheets are scoped layers. Sibling of css/menu.css, which
   is loaded sitewide on the same reasoning.

   js/cursor.js gates creation behind (hover:hover), (pointer:fine) and
   prefers-reduced-motion, so the element simply never exists where it
   should not - no media guard is needed here.
   ═══════════════════════════════════════════════════════════════════════ */

.nex-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-cursor);
  pointer-events: none;
  will-change: transform;
  /* Hidden until the first pointermove places it: otherwise the ring sits
     at the viewport's top-left corner from paint until the pointer moves,
     and on a page the visitor scrolls without moving the mouse it stays
     there. .is-placed is dropped again when the pointer leaves the window. */
  opacity: var(--alpha-00);
}
.nex-cursor.is-placed {
  opacity: 1;
}

.nex-cursor__ring {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--cursor-size);
  height: var(--cursor-size);
  margin-top: calc(var(--cursor-size) / -2);
  margin-left: calc(var(--cursor-size) / -2);
  border: var(--border-width-hairline) solid var(--color-text-accent);
  border-radius: var(--radius-pill);
  transition: width var(--duration-quick) var(--ease-soft),
              height var(--duration-quick) var(--ease-soft),
              margin var(--duration-quick) var(--ease-soft),
              background var(--duration-quick) var(--ease-soft);
}
.nex-cursor.is-active .nex-cursor__ring {
  width: var(--cursor-size-active);
  height: var(--cursor-size-active);
  margin-top: calc(var(--cursor-size-active) / -2);
  margin-left: calc(var(--cursor-size-active) / -2);
  background: var(--cursor-fill-active);
}

/* The native pointer is redundant once the ring is drawing.
   .has-custom-cursor is added only when js/cursor.js actually created one.

   The overlay is included. --z-cursor (90) is already above --z-menu (70),
   so the ring draws over it; the menu is the one surface where hovering is
   the entire interaction, and dropping back to the system arrow there was
   the most visible place the custom cursor appeared broken.

   This wins on specificity, not source order - (0,2,0) against the (0,1,0)
   of .btn in pages.css and .menu-trigger in menu.css. That matters because
   menu.css is deliberately enqueued last, so an order-dependent rule here
   would lose to it exactly the way .nav-toggle once lost to .menu-trigger. */
body.has-custom-cursor,
body.has-custom-cursor * {
  cursor: none;
}
