/* ================================================================
   COMPONENT: CUSTOM CURSOR — single-element architecture

   .cursor  →  position: fixed, positioned directly in root
               stacking context so mix-blend-mode: difference
               blends against the page (not a transparent parent).

   Position + visual state both live on the same element.
   JS writes the full transform string (translate + optional scale)
   so there is no CSS individual `scale` property — eliminating the
   compositing bug that caused a jump to (-200, -200) on click.
   ================================================================ */

html,
* {
  cursor: none !important;
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  pointer-events: none;
  z-index: var(--z-cursor);

  background: #ffffff;
  mix-blend-mode: difference;

  will-change: transform;
  transform: translate(-200px, -200px);

  transition:
    width      var(--dur-fast)  var(--ease-spring),
    height     var(--dur-fast)  var(--ease-spring),
    background var(--dur-fast)  var(--ease-out),
    opacity    var(--dur-fast)  var(--ease-out);
  /* No `scale` in transitions — press scale is composed into
     the JS transform string to avoid compositing conflicts. */
}

/* -- Hover: teal glass, larger ---------------------------------- */
.cursor--hover {
  width: 38px;
  height: 38px;
  background: rgba(0, 170, 144, 0.42);
  mix-blend-mode: normal;
  backdrop-filter: invert(1) saturate(1.2);
}

/* -- Viewing: same material, wider ------------------------------ */
.cursor--viewing {
  width: 64px;
  height: 64px;
  background: rgba(0, 170, 144, 0.38);
  mix-blend-mode: normal;
  backdrop-filter: invert(1) saturate(1.2);
}

/* -- Left viewport ---------------------------------------------- */
.cursor--hidden {
  opacity: 0;
}

/* -- Mobile: hide custom cursor, restore default ---------------- */
@media (hover: none), (pointer: coarse) {
  html,
  * {
    cursor: auto !important;
  }

  .cursor {
    display: none !important;
  }
}
