/**
 * Premium Custom Cursor – States via body:has() für kontextsensitive Skalierung.
 * mix-blend-mode: difference sorgt für Kontrast auf hell/dunkel ohne Farblogik im JS.
 */

.cursor-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 9999px;
  pointer-events: none;
  will-change: transform;
}

/* Innerer Punkt: präzise Position */
.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: #fff;
}

/* Äußerer Ring */
.cursor-ring {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  transition:
    width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;
}

/* Interaktion: Links, Buttons, sichtbare Fokuszustände */
body.cursor-enabled:has(a:hover) .cursor-ring,
body.cursor-enabled:has(button:hover) .cursor-ring,
body.cursor-enabled:has([role="button"]:hover) .cursor-ring,
body.cursor-enabled:has(input[type="submit"]:hover) .cursor-ring,
body.cursor-enabled:has(summary:hover) .cursor-ring {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  opacity: 0.95;
}

body.cursor-enabled:has(img:hover) .cursor-ring,
body.cursor-enabled:has(figure:hover) .cursor-ring,
body.cursor-enabled:has(article:hover) .cursor-ring {
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 22%;
}

body.cursor-enabled:has(textarea:hover) .cursor-ring,
body.cursor-enabled:has(input:hover) .cursor-ring,
body.cursor-enabled:has(select:hover) .cursor-ring {
  width: 4px;
  height: 28px;
  margin: -14px 0 0 -2px;
  border-radius: 4px;
}

body.cursor-enabled:has(a:focus-visible) .cursor-ring,
body.cursor-enabled:has(button:focus-visible) .cursor-ring {
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-color: rgba(255, 255, 255, 1);
}

/* Klick-Feedback */
body.cursor-enabled.is-pressing .cursor-dot {
  transform: scale(0.65);
}

body.cursor-enabled.is-pressing .cursor-ring {
  transform: scale(0.88);
}

body.cursor-enabled.ak-modal-open .cursor-root {
  opacity: 0;
  pointer-events: none;
}

