/* =========================================================
   Custom Cursor Design System:
   1. Default: Empty Curly Braces { } (No Dot)
   2. Clickable Target: 45° tilted pointer icon with smooth scale
   3. Continuous Fading Line Trail: BLACK (rgba(0, 0, 0, alpha))
   ========================================================= */

/* Force native cursor to none across all elements */
html,
body,
body * {
  cursor: none !important;
}

/* Fading Black Line Trail Canvas */
#custom-cursor-trail-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999998;
}

/* Master Cursor Container */
#custom-bracket-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999999;
  user-select: none;
  will-change: transform;
}

/* 1. Default State: { } with clean space, no dot */
.cursor-bracket-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.cursor-brace {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}

/* 2. Clickable State: Real Mouse Pointer tilted 45 degrees */
.cursor-pointer-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 26px;
  height: 26px;
  /* Origin top-left where the tip of the arrow is */
  transform-origin: 2px 2px;
  transform: translate(0, 0) rotate(45deg) scale(0);
  opacity: 0;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.cursor-pointer-svg {
  width: 100%;
  height: 100%;
  fill: #ffffff;
  stroke: #111827;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

/* Transition to Clickable: Hide { }, Reveal & Tilt Pointer 45deg */
#custom-bracket-cursor.cursor-hovering .cursor-bracket-wrapper {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
}

#custom-bracket-cursor.cursor-hovering .cursor-pointer-icon {
  opacity: 1;
  transform: translate(0, 0) rotate(45deg) scale(1);
}

/* Micro click feedback */
#custom-bracket-cursor.cursor-clicking .cursor-bracket-wrapper {
  transform: translate(-50%, -50%) scale(0.8);
}
#custom-bracket-cursor.cursor-clicking .cursor-pointer-icon {
  transform: translate(0, 0) rotate(45deg) scale(0.88);
}
