/* Independent Custom Cursor Module: Precision Dot + Ring + Contextual Label + Trailing Glow */

html.has-custom-cursor,
html.has-custom-cursor * {
  cursor: none !important;
}

.custom-cursor-glow,
.custom-cursor-ring,
.custom-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  will-change: transform, width, height, opacity;
  transition:
    opacity 0.35s var(--ease-out-expo),
    width 0.32s var(--ease-out-expo),
    height 0.32s var(--ease-out-expo),
    margin-left 0.32s var(--ease-out-expo),
    margin-top 0.32s var(--ease-out-expo),
    border-color 0.32s var(--ease-out-expo),
    background-color 0.32s var(--ease-out-expo),
    backdrop-filter 0.32s var(--ease-out-expo);
}

.custom-cursor-glow {
  z-index: var(--z-cursor-glow);
  width: 132px;
  height: 132px;
  margin-left: -66px;
  margin-top: -66px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--shell-accent) 28%, rgba(255, 255, 255, 0.12)) 0%,
    color-mix(in srgb, var(--shell-accent) 10%, transparent) 44%,
    transparent 72%
  );
  filter: blur(10px);
}

.custom-cursor-dot {
  z-index: calc(var(--z-cursor-ring) + 2);
  width: 4px;
  height: 4px;
  margin-left: -2px;
  margin-top: -2px;
  background-color: var(--ink-primary);
  transition:
    opacity 0.25s ease,
    width 0.2s var(--ease-out-expo),
    height 0.2s var(--ease-out-expo),
    margin-left 0.2s var(--ease-out-expo),
    margin-top 0.2s var(--ease-out-expo),
    background-color 0.25s ease;
}

.custom-cursor-ring {
  z-index: var(--z-cursor-ring);
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  border: 1px solid rgba(241, 238, 232, 0.72);
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-cursor-label {
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-primary);
  opacity: 0;
  transform: scale(0.84);
  transition:
    opacity 0.24s ease,
    transform 0.32s var(--ease-out-expo);
}

.custom-cursor-glow.is-visible,
.custom-cursor-ring.is-visible,
.custom-cursor-dot.is-visible {
  opacity: 1;
}

/* Hover enlargement state */
.custom-cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  margin-left: -28px;
  margin-top: -28px;
  border-color: var(--shell-accent);
  background-color: color-mix(in srgb, var(--shell-accent) 12%, transparent);
}

.custom-cursor-glow.is-hover {
  width: 196px;
  height: 196px;
  margin-left: -98px;
  margin-top: -98px;
}

/* Contextual labeled cursor states */
.custom-cursor-ring.has-label {
  border-color: color-mix(in srgb, var(--shell-accent) 82%, rgba(255, 255, 255, 0.35));
  background-color: rgba(12, 13, 15, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.custom-cursor-ring.has-label .custom-cursor-label {
  opacity: 1;
  transform: scale(1);
}

.custom-cursor-dot.has-label {
  opacity: 0;
}

.custom-cursor-ring.is-label-view {
  width: 78px;
  height: 78px;
  margin-left: -39px;
  margin-top: -39px;
}

.custom-cursor-ring.is-label-zoom {
  width: 72px;
  height: 72px;
  margin-left: -36px;
  margin-top: -36px;
}

.custom-cursor-ring.is-label-action {
  width: 66px;
  height: 66px;
  margin-left: -33px;
  margin-top: -33px;
}

/* Pointer press feedback */
.custom-cursor-ring.is-pressed {
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-color: var(--ink-primary);
}

.custom-cursor-ring.is-hover.is-pressed {
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
}

.custom-cursor-ring.has-label.is-pressed {
  width: 60px;
  height: 60px;
  margin-left: -30px;
  margin-top: -30px;
}

.custom-cursor-dot.is-pressed {
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  background-color: var(--shell-accent);
}

/* Disable custom cursor on touch devices or reduced motion */
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  html.has-custom-cursor,
  html.has-custom-cursor * {
    cursor: auto !important;
  }

  .custom-cursor-glow,
  .custom-cursor-ring,
  .custom-cursor-dot {
    display: none !important;
  }
}
