/* Ring cursor (see js/cursor.js). Colors come from tokens only. Motion uses transform and opacity. */

.cursor {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms;
}

.cursor.is-visible {
  opacity: 1;
}

.cursor.is-visible.is-typing {
  opacity: 0;
}

.cursor-follow {
  position: absolute;
  top: 0;
  left: 0;
}

.cursor-ring,
.cursor-dot,
.cursor-label {
  position: absolute;
  top: 0;
  left: 0;
  translate: -50% -50%;
}

.cursor-ring {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--cursor-ring);
  border-radius: 50%;
  /* A hairline shadow keeps the ring readable over the bright clouds. */
  box-shadow: 0 0 3px color-mix(in oklch, var(--scene-veil) 45%, transparent);
  transition: transform 250ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 250ms;
}

.cursor-dot {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background-color: var(--scene-ink);
  box-shadow: 0 0 6px color-mix(in oklch, var(--scene-veil) 45%, transparent);
  /* Resting size is a 10px dot; only a labelled target opens the full disc. */
  transform: scale(0.14);
  transition: transform 250ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cursor-label {
  color: var(--scene-veil);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 150ms;
}

.cursor.is-active .cursor-ring {
  transform: scale(1.6);
}

/* Over a control the dot would sit on top of its text. */
.cursor.is-active .cursor-dot {
  transform: scale(0);
}

.cursor.is-pressed .cursor-ring {
  transform: scale(0.8);
}

.cursor.is-labelled .cursor-ring {
  transform: scale(2.2);
}

.cursor.is-labelled .cursor-dot {
  transform: scale(1);
}

.cursor.is-labelled .cursor-label {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .cursor,
  .cursor-ring,
  .cursor-dot,
  .cursor-label {
    transition: none;
  }
}
