/* Outer ring */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border: 1px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%) scale(1);
  will-change: transform, border-color, border-width;
  mix-blend-mode: difference;
}

/* Inner dot */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 7px;
  height: 7px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%) scale(1);
  will-change: transform;
  mix-blend-mode: difference;
}

/* Cursor chip label */
.cursor-chip {
  position: fixed;
  top: 0;
  left: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: #7ff2c6;
  color: #000;
  font-family: "Space Grotesk", Courier, monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10001;
  opacity: 0;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}
/* Legacy pages keep their established, larger pointer dimensions. */
body:not(.experience-page):not(.writing-page):not(.lab-page) .cursor { width:60px; height:60px; border-width:2px; }
body:not(.experience-page):not(.writing-page):not(.lab-page) .cursor-dot { width:13px; height:13px; }
body:not(.experience-page):not(.writing-page):not(.lab-page) .cursor-chip { background:#D4FF00; }

/* A manual popover keeps the pointer above native dialog top layers. */
.cursor-layer[popover] {
  position: fixed;
  inset: 0;
  display: none;
  width: 100vw;
  height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  mix-blend-mode: difference;
  overflow: visible;
  pointer-events: none;
}
.cursor-layer[popover]:popover-open { display: block; }
.cursor-layer::backdrop { background: transparent; pointer-events: none; }

@media (pointer: coarse) {
  .cursor,
  .cursor-dot,
  .cursor-chip {
    display: none;
  }

  html,
  body {
    cursor: auto;
  }
}

/* The head bootstrap hides the native pointer before the enhanced controller loads. */
html.cursor-pending,
.cursor-pending *,
html.custom-cursor,
.custom-cursor * {
  cursor: none !important;
}
.cursor-pending .contact-drawer::backdrop,.custom-cursor .contact-drawer::backdrop { cursor:none !important; }
.cursor,
.cursor-dot,
.cursor-chip {
  display: none;
}
.custom-cursor .cursor,
.custom-cursor .cursor-dot,
.custom-cursor .cursor-chip {
  display: block;
}
body:not(.cursor-present) :is(.cursor, .cursor-dot, .cursor-chip) {
  visibility: hidden;
}
.hero-node-hover .cursor {
  visibility: hidden;
}
.hero-node-hover .cursor-dot { background:#fff; mix-blend-mode:difference; }
@media (pointer: coarse), (max-width: 900px) {
  .cursor,
  .cursor-dot,
  .cursor-chip {
    display: none !important;
  }
  html.custom-cursor,
  .custom-cursor * {
    cursor: auto !important;
  }
}

.sculpture-hover .cursor,.sculpture-hover .cursor-chip { visibility: hidden !important; }
.sculpture-hover .cursor-dot { width: 3px; height: 3px; background:#fff; mix-blend-mode:difference; }

/* The loader keeps both pieces hidden until its exit completes. */
.brand-entering :is(.cursor,.cursor-dot,.cursor-chip) { visibility:hidden !important; }
/* Native fallback for browsers that cannot raise the cursor above a modal dialog. */
.cursor-dialog-fallback .contact-drawer,.cursor-dialog-fallback .contact-drawer * { cursor:auto !important; }
.cursor-dialog-fallback .contact-drawer :is(input:not([type]),input:is([type=text],[type=email],[type=search],[type=url],[type=tel],[type=number],[type=password]),textarea) { cursor:text !important; }
.cursor-dialog-fallback :is(.cursor,.cursor-dot,.cursor-chip) { visibility:hidden !important; }
