/* ============================================================
   CUSTOM CURSOR — cyan dot + lagging ring + label.
   Red on hover, inverts to white on dark sections, hidden on touch.
   Behaviour driven by site.js (toggles body classes).
   ============================================================ */

#cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  background: var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, width 0.25s ease, height 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  /* Always-visible outline so cursor never gets lost on any bg */
  box-shadow: 0 0 0 2px rgba(0,0,0,0.35), 0 0 8px rgba(0,181,226,0.6);
}

#cursor-ring {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.08s linear, width 0.3s ease, height 0.3s ease, border-color 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
  opacity: 0.7;
  /* Subtle dark halo keeps ring visible on white */
  box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
}

#cursor-label {
  position: fixed;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--navy);
  padding: 4px 10px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 9997;
  transform: translate(20px, -50%);
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

body.cursor-hover #cursor {
  width: 8px; height: 8px;
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5), 0 0 10px rgba(239,51,64,0.5);
}
body.cursor-hover #cursor-ring { width: 56px; height: 56px; border-color: var(--red); opacity: 0.5; box-shadow: 0 0 0 1px rgba(0,0,0,0.15); }
body.cursor-hover #cursor-label { opacity: 1; }

/* On dark sections: flip to white dot with dark halo */
body.cursor-on-dark #cursor {
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.5), 0 0 8px rgba(255,255,255,0.3);
}
body.cursor-on-dark #cursor-ring {
  border-color: rgba(255,255,255,0.6);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}
/* On dark + hover: red with white halo */
body.cursor-on-dark.cursor-hover #cursor {
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5), 0 0 10px rgba(239,51,64,0.6);
}

/* Touch devices: no custom cursor */
@media (hover: none) {
  #cursor, #cursor-ring, #cursor-label { display: none; }
  body { cursor: auto; }
}
