/* ===== CUSTOM CURSOR ===== */

/* Hide default cursor site-wide */
*, *::before, *::after {
  cursor: none !important;
}

#cursor-dot,
#cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}

/* Inner dot — sharp, instant */
#cursor-dot {
  width: 5px;
  height: 5px;
  background: #1c2e1e;
  transition: width 200ms cubic-bezier(0.22, 1, 0.36, 1),
              height 200ms cubic-bezier(0.22, 1, 0.36, 1),
              background 200ms ease,
              opacity 200ms ease;
}

/* Outer ring — hollow, lagging */
#cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(28, 46, 30, 0.45);
  background: transparent;
  transition: width 280ms cubic-bezier(0.22, 1, 0.36, 1),
              height 280ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 280ms ease,
              opacity 200ms ease,
              background 280ms ease;
}

/* --- Hover state: links, buttons --- */
body.cursor--hover #cursor-dot {
  width: 8px;
  height: 8px;
  background: #4d6d47;
}

body.cursor--hover #cursor-ring {
  width: 52px;
  height: 52px;
  border-color: rgba(77, 109, 71, 0.6);
  background: rgba(77, 109, 71, 0.06);
}

/* --- Click state --- */
body.cursor--click #cursor-dot {
  width: 4px;
  height: 4px;
  background: #4d6d47;
  transition-duration: 80ms;
}

body.cursor--click #cursor-ring {
  width: 26px;
  height: 26px;
  border-color: rgba(77, 109, 71, 0.9);
  transition-duration: 80ms;
}

/* --- Text/input state: I-beam feel — ring compresses to thin line --- */
body.cursor--text #cursor-dot {
  width: 2px;
  height: 18px;
  border-radius: 1px;
  background: #1c2e1e;
}

body.cursor--text #cursor-ring {
  width: 2px;
  height: 28px;
  border-radius: 1px;
  border-width: 0;
  background: rgba(28, 46, 30, 0.15);
}

/* --- Hidden when leaving window --- */
body.cursor--out #cursor-dot,
body.cursor--out #cursor-ring {
  opacity: 0;
}

/* Touch devices — restore default, hide custom cursor elements */
@media (hover: none) and (pointer: coarse) {
  *, *::before, *::after {
    cursor: auto !important;
  }
  #cursor-dot,
  #cursor-ring {
    display: none;
  }
}

/* Reduced motion — disable lag animation */
@media (prefers-reduced-motion: reduce) {
  #cursor-ring {
    transition: none !important;
  }
}
