/* Custom cursor: a blend-difference ring and dot that lag the pointer and
   bloom over interactive targets. Fine-pointer devices only; the native cursor
   stays for touch, coarse pointers, reduced motion, and the no-JS path.
   mix-blend-mode: difference means the mark reads bone over ink and ink over
   the paper footer, so it honors the page's single inversion for free. */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-cursor);
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.25s var(--ease-out);
}

/* Only shows once JS has confirmed a fine pointer and seen it move. */
.cursor-on .cursor {
  opacity: 1;
}
/* Fades out while the pointer is outside the window (class wins on specificity,
   so there is no inline-style fight with the cursor-on rule above). */
.cursor-on .cursor.is-hidden {
  opacity: 0;
}
.cursor-on,
.cursor-on * {
  cursor: none;
}

.cursor-ring,
.cursor-dot {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform;
}

/* The ring lags a touch behind the dot, so the pair reads as one physical
   object being dragged, not two sprites. Size eases on state change. */
.cursor-ring {
  width: 38px;
  height: 38px;
  border: 1px solid var(--paper);
  transition: width 0.32s var(--ease-out), height 0.32s var(--ease-out),
    background-color 0.32s var(--ease-out), border-color 0.32s var(--ease-out);
}

.cursor-dot {
  width: 5px;
  height: 5px;
  background: var(--paper);
  transition: opacity 0.25s var(--ease-out);
}

/* Over links, buttons and the contact CTAs the ring blooms and fills faintly,
   the dot recedes: the cursor becomes a target, not a pointer. */
.cursor.is-active .cursor-ring {
  width: 62px;
  height: 62px;
  background: rgba(242, 240, 236, 0.12);
}
.cursor.is-active .cursor-dot {
  opacity: 0;
}

/* A small press tell on click. */
.cursor.is-down .cursor-ring {
  width: 30px;
  height: 30px;
}
.cursor.is-active.is-down .cursor-ring {
  width: 54px;
  height: 54px;
}

@media (pointer: coarse), (hover: none) {
  .cursor {
    display: none;
  }
}
