
/*--------------------------------------------------------------
# Cursor Follower
--------------------------------------------------------------*/

/* Hide native cursor when custom cursor is active - only on devices with fine pointer */
@media (pointer: fine) and (hover: hover) {
  .has-custom-cursor,
  .has-custom-cursor *,
  .has-custom-cursor .glightbox-container,
  .has-custom-cursor .glightbox-container * {
    cursor: none !important;
  }
  
  /* Restore cursor for inputs where text selection is needed */
  .has-custom-cursor input,
  .has-custom-cursor textarea,
  .has-custom-cursor [contenteditable="true"] {
    cursor: text !important;
  }
}

.cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  background-color: rgba(var(--cursor-color-rgb), 0.15);
  border: 1px solid rgba(var(--cursor-color-rgb), 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000000;
  /* Use transform for GPU acceleration - avoid translate3d(0,0,0) as initial */
  transform: translate(-50%, -50%);
  /* Only transition properties that change on hover, not transform */
  transition: width 0.2s ease-out, height 0.2s ease-out, background-color 0.2s ease-out, border-color 0.2s ease-out, opacity 0.2s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cursor-text-color);
  font-size: 14px;
  box-shadow: 0 0 10px rgba(var(--cursor-color-rgb), 0.15);
  /* Performance: isolate the element's rendering */
  will-change: transform;
  contain: layout style size;
  /* Prevent subpixel rendering issues */
  backface-visibility: hidden;
}

/* Hover state - expanded cursor */
.cursor-follower.is-hovering {
  width: 60px;
  height: 60px;
  background-color: rgba(var(--cursor-color-rgb), 0.08);
  border-color: transparent;
}

/* Active/clicking state */
.cursor-follower.is-active {
  transform: translate(-50%, -50%) scale(0.85);
}

.cursor-follower i {
  display: block;
  opacity: 0.8;
  /* Simpler animation - less GPU intensive */
  animation: none;
}

.cursor-follower.is-hovering i {
  opacity: 1;
}

#cursor-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999998;
  contain: strict;
  opacity: 1;
  transition: opacity 0.2s ease-out;
}

#global-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.6;
  z-index: -1;
  contain: strict;
}

/* Hide on touch devices and when reduced motion is preferred */
@media (hover: none), (prefers-reduced-motion: reduce) {
  .cursor-follower {
    display: none !important;
  }
  
  .has-custom-cursor,
  .has-custom-cursor * {
    cursor: auto !important;
  }
}
