/* Disable text selection site-wide (keep forms usable) */
html,
body,
body * {
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

input,
textarea,
select,
[contenteditable="true"] {
  -webkit-user-select: text;
     -moz-user-select: text;
      -ms-user-select: text;
          user-select: text;
}

/* Custom cursor — dynamics matched to theme /src */
.site-cursor,
.site-cursor-before,
.site-cursor-arrow {
  display: none;
  pointer-events: none;
}

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

body.has-site-cursor .site-cursor,
body.has-site-cursor .site-cursor-before,
body.has-site-cursor .site-cursor-arrow {
  display: block;
}

.site-cursor {
  width: 20px;
  height: 20px;
  margin-left: -10px;
  margin-top: -10px;
  border-radius: 100px;
  background: #fff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483646;
  mix-blend-mode: difference;
  /* Size animates; position is instant (same as src) */
  transition: all ease-out 0.1s, transform linear 0s;
}

.site-cursor-before {
  width: 60px;
  height: 60px;
  margin-left: -30px;
  margin-top: -30px;
  border-radius: 50%;
  border: 1px solid #fff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483645;
  opacity: 0.35;
  mix-blend-mode: difference;
  /* Includes transform → ring trails the pointer (src feel) */
  transition: all cubic-bezier(0.23, 1, 0.32, 1) 0.6s;
}

.site-cursor.click {
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  margin-top: -7.5px;
}

.site-cursor.link {
  width: 60px;
  height: 60px;
  margin-left: -30px;
  margin-top: -30px;
  background: #fff;
  opacity: 0.35;
  border: 1px solid #fff;
}

.site-cursor.link.has-arrow {
  opacity: 1;
  background: #fff;
}

.site-cursor-before.link {
  opacity: 0;
}

/* Arrow sits in its own layer so it can trail slightly */
.site-cursor-arrow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483647;
  width: 22px;
  height: 21px;
  margin-left: -11px;
  margin-top: -10.5px;
  color: #fff;
  opacity: 0;
  mix-blend-mode: difference;
  transform: translate3d(-100px, -100px, 0) scale(0.94);
  /* Tiny lag + soft scale — less than the outer ring */
  transition: opacity 0.15s ease-out,
    transform 0.16s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.site-cursor-arrow.is-visible .site-cursor-icon,
.site-cursor-arrow .site-cursor-icon {
  display: block;
  width: 100%;
  height: 100%;
}

.site-cursor-arrow.is-click {
  opacity: 0;
  transition-duration: 0.1s;
}

@media (hover: none) and (pointer: coarse) {
  body.has-site-cursor,
  body.has-site-cursor * {
    cursor: auto !important;
  }

  body.has-site-cursor .site-cursor,
  body.has-site-cursor .site-cursor-before,
  body.has-site-cursor .site-cursor-arrow {
    display: none !important;
  }
}

/* iPhone / iPad (incl. iPadOS desktop UA) */
html.no-site-cursor .site-cursor,
html.no-site-cursor .site-cursor-before,
html.no-site-cursor .site-cursor-arrow {
  display: none !important;
}

html.no-site-cursor,
html.no-site-cursor * {
  cursor: auto !important;
}
