/* TROY pointer — two modes, decided at runtime by cursor.js.

   1. plain  (default, and every weak/unknown machine): the system arrow drawn a
      little larger, pure CSS, no extra nodes, no JS loop. Gated by
      `body.cursor-plain` on the arrow rule in app.css.
   2. custom (only when the device passes the capability + frame-time probe): a
      7 px amber dot plus a trailing ring that swells into an amber disc over
      buttons. Scoped to `body.cursor-on`, which cursor.js adds only after the
      probe passed — so a JS failure, a slow CPU or reduced-motion all fall back
      to the arrow and never leave the visitor cursorless.

   Everything animated here is transform or opacity. The first version animated
   width / height / box-shadow, which forces layout + repaint on every hover and
   is exactly what stalled low-end laptops. Do not reintroduce those. */

.cursor-dot, .cursor-ring { display: none }

body.cursor-on,
body.cursor-on a, body.cursor-on button, body.cursor-on summary, body.cursor-on label,
body.cursor-on .card, body.cursor-on .btn, body.cursor-on .chip,
body.cursor-on .pcard, body.cursor-on .cat, body.cursor-on .news-card { cursor: none }

body.cursor-on input, body.cursor-on textarea, body.cursor-on select,
body.cursor-on [contenteditable="true"] { cursor: auto }

body.cursor-on .cursor-dot,
body.cursor-on .cursor-ring {
  display: block; position: fixed; left: 0; top: 0; z-index: 9999;
  pointer-events: none; box-sizing: border-box; border-radius: 50%;
  will-change: transform; backface-visibility: hidden;
  transform: translate3d(-100px, -100px, 0) translate(-50%, -50%) scale(1);
}

body.cursor-on .cursor-dot {
  width: 7px; height: 7px; background: var(--amber, #FFB000);
  transition: opacity .14s linear;
}

body.cursor-on .cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(255, 176, 0, .55);
  transition: border-color .16s linear, opacity .14s linear;
}

/* the amber disc is a child that fades in — no size animation, so hovering a
   button costs one opacity change on a compositor layer */
body.cursor-on .cursor-ring::before {
  content: ""; position: absolute; inset: -1.5px; border-radius: 50%;
  background: var(--amber, #FFB000); opacity: 0; transition: opacity .14s linear;
}

body.cursor-on.cursor-hot .cursor-dot { opacity: 0 }
body.cursor-on.cursor-hot .cursor-ring { border-color: rgba(8, 9, 11, .55) }
body.cursor-on.cursor-hot .cursor-ring::before { opacity: 1 }

body.cursor-out .cursor-dot,
body.cursor-out .cursor-ring,
body.cursor-field .cursor-dot,
body.cursor-field .cursor-ring { opacity: 0 }

body.cursor-on-light .cursor-dot { background: var(--amber-2, #C98600) }
body.cursor-on-light .cursor-ring { border-color: rgba(201, 134, 0, .75) }
body.cursor-on-light .cursor-ring::before { background: var(--amber-2, #C98600) }

@media (prefers-reduced-motion: reduce) {
  .cursor-dot, .cursor-ring { display: none !important }
  body.cursor-on, body.cursor-on a, body.cursor-on button, body.cursor-on summary,
  body.cursor-on label, body.cursor-on .card, body.cursor-on .btn,
  body.cursor-on .chip, body.cursor-on .pcard, body.cursor-on .cat,
  body.cursor-on .news-card { cursor: auto !important }
}
@media print { .cursor-dot, .cursor-ring { display: none !important } }
