/* Custom cursor (see js/core/cursor.js). Fixed, outside the smoothed content,
   and never a click target. */

.cursor {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: var(--z-cursor);
  pointer-events: none;
  transition: opacity var(--cursor-fade, 0.2s) ease;
}

.cursor--hidden {
  opacity: 0;
}

.cursor__dot,
.cursor__ring {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  translate: -50% -50%; /* GSAP moves x/y; this keeps the shapes centred on the pointer */
}

.cursor__dot {
  width: 6px;
  height: 6px;
  background: var(--color-text);
}

.cursor__ring {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--color-text) 45%, transparent);
  transition:
    width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.35s ease,
    border-color 0.35s ease;
}

.cursor__label {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--color-bg);
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Over links and buttons: the ring grows, the dot steps back */
.cursor--link .cursor__ring {
  width: 56px;
  height: 56px;
  border-color: var(--color-accent);
}

.cursor--link .cursor__dot {
  opacity: 0;
}

/* Over images and videos: a filled disc with a label */
.cursor--media .cursor__ring {
  width: 84px;
  height: 84px;
  border-color: transparent;
  background: var(--color-text);
}

.cursor--media .cursor__label {
  opacity: 1;
}

.cursor--media .cursor__dot {
  opacity: 0;
}

/* Hide the system cursor only while the custom one is running (JS adds the class) */
.has-custom-cursor,
.has-custom-cursor * {
  cursor: none;
}

/* …but keep the text caret where people type */
.has-custom-cursor input,
.has-custom-cursor textarea,
.has-custom-cursor [contenteditable="true"] {
  cursor: text;
}
