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

html.has-cursor :is(input, textarea, select, [contenteditable="true"]) {
  cursor: auto !important;
}

.cursor,
.cursor-label {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
}

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

.cursor.is-away,
.cursor.is-native,
.cursor-label.is-away,
.cursor-label.is-native {
  opacity: 0;
}

.cursor {
  color: #ffffff;
  mix-blend-mode: difference;
}

html[data-chapter="accent"]:not(.detail-open) .cursor {
  color: var(--page-fg);
  mix-blend-mode: normal;
}

.cursor__pin {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.cursor__cross {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 17px;
  height: 17px;
  transition: transform 600ms var(--ease-out);
}

.cursor__cross::before,
.cursor__cross::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.cursor__cross::before {
  top: 8px;
  left: 0;
  width: 100%;
  height: 1px;
  transform: scaleX(var(--sx, 1));
}

.cursor__cross::after {
  top: 0;
  left: 8px;
  width: 1px;
  height: 100%;
  transform: scaleY(var(--sy, 1));
}

.cursor.is-hover .cursor__cross {
  transform: rotate(90deg) scale(1.7);
}

.cursor.is-labelled .cursor__cross {
  transform: rotate(90deg) scale(0.7);
}

.cursor.is-pressed .cursor__cross {
  transform: rotate(90deg) scale(0.45);
}

.cursor-label {
  overflow: hidden;
  white-space: nowrap;
  will-change: transform;
}

.cursor-label__text {
  display: block;
  padding: 4px 6px 3px;
  color: var(--page-bg);
  background: var(--page-fg);
  visibility: hidden;
  transform: translate3d(0, 110%, 0);
  transition: transform 500ms var(--ease-out), visibility 0s linear 500ms;
}

html.detail-open .cursor-label__text {
  color: var(--white);
  background: var(--black);
}

.cursor-label.is-labelled .cursor-label__text {
  visibility: visible;
  transform: none;
  transition: transform 500ms var(--ease-out), visibility 0s;
}
