.aim-cursor {
  --cursor-x: 50vw;
  --cursor-y: 50vh;
  --cursor-w: 22px;
  --cursor-h: 22px;
  z-index: 1000;
  position: fixed;
  top: 0;
  left: 0;
  width: var(--cursor-w);
  height: var(--cursor-h);
  border: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(var(--cursor-x), var(--cursor-y), 0) translate(-50%, -50%);
  transition:
    width var(--duration-hover-out) var(--ease-in-out),
    height var(--duration-hover-out) var(--ease-in-out),
    opacity var(--duration-instant) ease;
  will-change: width, height, transform;
}

.aim-cursor[data-visible="true"] {
  opacity: 1;
}

.aim-cursor[data-locked="true"] {
  transition:
    width var(--cursor-expand-duration) var(--ease-in-out) var(--cursor-expand-delay),
    height var(--cursor-expand-duration) var(--ease-in-out) var(--cursor-expand-delay),
    opacity var(--duration-instant) ease;
}

.cursor-frame {
  position: absolute;
  inset: 0;
  transform: rotate(var(--cursor-rotation, 0deg));
  will-change: transform;
}

.aim-cursor i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--accent);
  transition:
    width var(--duration-hover-out) var(--ease-in-out),
    height var(--duration-hover-out) var(--ease-in-out);
}

.aim-cursor i:nth-child(1) {
  top: -2px;
  left: -2px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.aim-cursor i:nth-child(2) {
  top: -2px;
  right: -2px;
  border-top: 2px solid;
  border-right: 2px solid;
}

.aim-cursor i:nth-child(3) {
  right: -2px;
  bottom: -2px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.aim-cursor i:nth-child(4) {
  bottom: -2px;
  left: -2px;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.aim-cursor::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 1px;
  background: var(--text);
  content: "";
  transform: translate(-50%, -50%);
  transition: background var(--duration-fast) ease;
}

.aim-cursor::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1px;
  height: 11px;
  background: var(--text);
  content: "";
  transform: translate(-50%, -50%);
  transition: background var(--duration-fast) ease;
}

.aim-cursor[data-locked="true"] i {
  width: 14px;
  height: 14px;
}

.aim-cursor[data-kind="passive"] i {
  width: 11px;
  height: 11px;
  border-color: var(--text);
}

.aim-cursor[data-kind="interactive"] i {
  border-color: var(--accent);
}

.aim-cursor[data-locked="true"]::before,
.aim-cursor[data-locked="true"]::after {
  opacity: 0;
}

.aim-cursor[data-pressed="true"] {
  opacity: 0.62;
}

.pointer-origin {
  z-index: 1001;
  position: fixed;
  top: 0;
  left: 0;
  width: 5px;
  height: 5px;
  border: 1px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--text) 22%, transparent),
    0 0 8px rgb(var(--accent-rgb) / 72%);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-20px, -20px, 0) translate(-50%, -50%);
  transition: opacity var(--duration-instant) ease;
  will-change: transform;
}

.pointer-origin[data-visible="true"] {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  html.has-aim-cursor,
  html.has-aim-cursor * {
    cursor: none !important;
  }
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .aim-cursor,
  .pointer-origin {
    display: none;
  }
}

