/* Vertical Systems: site-wide cursor trail and custom pointer
   (site/css/cursor-trail.css). Pairs with site/js/cursor-trail.js, which
   creates the canvas and the pointer elements itself. The trail takes its
   colours from the theme tokens at draw time (see the JS). */

#vs-cursor-trail {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* Custom pointer: accent-orange dot plus a green ring (the second module in
   site/js/cursor-trail.js). The native cursor is hidden only while
   html.vs-cursor-on is set, which the script adds on a fine pointer. */
html.vs-cursor-on,
html.vs-cursor-on * {
  cursor: none !important;
}

html.vs-cursor-on input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]),
html.vs-cursor-on textarea,
html.vs-cursor-on [contenteditable=""],
html.vs-cursor-on [contenteditable="true"] {
  cursor: text !important;
}

html.vs-cursor-on select,
html.vs-cursor-on iframe,
html.vs-cursor-on video {
  cursor: auto !important;
}

#vs-cursor {
  --vs-cursor-dot: var(--sc-accent, #DF5F0A);
  /* Mani asked for a green ring; it borrows the theme's green. */
  --vs-cursor-ring: var(--vs-ok, #2B7340);
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

#vs-cursor.is-visible { opacity: 1; }
#vs-cursor.is-native { opacity: 0; }

.vs-cursor__dot,
.vs-cursor__ring {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.vs-cursor__dot {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--vs-cursor-dot);
  box-shadow: 0 0 0 1.5px rgba(239, 237, 229, 0.9);
}

/* The ring's size changes on a pseudo-element, so the eased translate on the
   ring itself never fights the scale transition. */
.vs-cursor__ring {
  width: 0;
  height: 0;
}

.vs-cursor__ring::before {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  left: -17px;
  top: -17px;
  border-radius: 50%;
  border: 1.5px solid var(--vs-cursor-ring);
  box-shadow: 0 0 0 1px rgba(239, 237, 229, 0.55);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), background-color 220ms ease;
}

#vs-cursor.is-hover .vs-cursor__ring::before {
  transform: scale(1.55);
  background-color: color-mix(in srgb, var(--vs-cursor-ring) 10%, transparent);
}

#vs-cursor.is-down .vs-cursor__ring::before {
  transform: scale(0.78);
}

#vs-cursor.is-hover.is-down .vs-cursor__ring::before {
  transform: scale(1.3);
}

@media (forced-colors: active) {
  #vs-cursor { display: none !important; }
  html.vs-cursor-on,
  html.vs-cursor-on * { cursor: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  .vs-cursor__ring::before { transition: none; }
  /* Defensive backstop: the script already refuses to create the trail
     canvas under reduced motion, but this hides it too if one ever slips
     through. The pointer itself stays, without easing. */
  #vs-cursor-trail { display: none !important; }
}
