/* ==========================================================================
   FIGMA WEBSITE MULTIPLAYER CURSOR
   Pixel-perfect Figma vector arrow pointer + collaborator name badge
   Smooth 60-120fps tracking, tactile click feedback & smart hover context
   Fully cross-browser compatible: Chrome, Safari, Firefox, Edge, Opera
   ========================================================================== */

:root {
  --figma-cursor-color: #0C8CE9;
  --figma-cursor-purple: #7B61FF;
  --figma-cursor-coral: #F24E1E;
  --figma-cursor-green: #10A958;
  --figma-cursor-brand: #DE0606;
  --figma-active-color: var(--figma-cursor-color);
}

/* Hide default OS cursor ONLY when custom cursor is actively tracking mouse */
body.has-custom-cursor,
body.has-custom-cursor * {
  cursor: none !important;
}

/* Always allow native text selection cursor in form inputs */
body.has-custom-cursor input,
body.has-custom-cursor textarea {
  cursor: text !important;
}

/* Figma Cursor Container */
#customCursor,
.figma-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  background: none;
  background-color: transparent;
  border: none;
  border-radius: 0;
  pointer-events: none;
  z-index: 9999999;
  mix-blend-mode: normal;
  opacity: 0;
  margin: 0;
  padding: 0;
  will-change: left, top;
  transition: opacity 0.18s ease;
}

#customCursor.is-visible,
.figma-cursor.is-visible {
  opacity: 1;
}

#customCursor.is-hidden,
.figma-cursor.is-hidden {
  opacity: 0;
}

/* Neutralize any legacy .active / .revealed classes from old scripts */
#customCursor.active,
#customCursor.revealed {
  width: auto;
  height: auto;
  background: none;
  background-color: transparent;
  mix-blend-mode: normal;
  border-radius: 0;
  border: none;
}

/* Cursor Follower / Click Ripple Ping */
#cursorFollower,
.figma-cursor-ping {
  position: fixed;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--figma-active-color, #0C8CE9);
  background: transparent;
  pointer-events: none;
  z-index: 9999998;
  opacity: 0;
  margin: 0;
  padding: 0;
  transform: translate(-50%, -50%) scale(0.2);
}

#cursorFollower.active {
  background: transparent;
  border-color: transparent;
}

#cursorFollower.is-pinging,
.figma-cursor-ping.is-pinging {
  animation: figmaClickPing 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes figmaClickPing {
  0% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(0.25);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.7);
  }
}

/* Cursor Inner Wrapper */
.figma-cursor-wrapper {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  pointer-events: none;
  transform-origin: 0 0;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

/* The Authentic Figma Vector Arrow Pointer */
.figma-cursor-arrow {
  display: block;
  width: 22px;
  height: 22px;
  overflow: visible;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transform-origin: 0 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.figma-arrow-path {
  transition: fill 0.22s ease;
  stroke: rgba(0, 0, 0, 0.4);
  stroke-width: 1px;
  stroke-linejoin: round;
}

/* The Iconic Figma Collaborator Name Badge */
.figma-cursor-badge {
  position: absolute;
  left: 12px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3.5px 8.5px 3.5px 8px;
  color: #FFFFFF;
  border-radius: 0 7px 7px 7px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2);
  font-family: 'Season Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transform-origin: 0 0;
  transition: background-color 0.22s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.figma-cursor-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  display: inline-block;
  flex-shrink: 0;
}

.figma-cursor-name {
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  display: inline-block;
}

/* Click / MouseDown State */
#customCursor.is-pressed .figma-cursor-wrapper,
.figma-cursor.is-pressed .figma-cursor-wrapper {
  transform: scale(0.9) translate(1px, 1px);
}

/* Hovering Interactive Links / Buttons */
#customCursor.is-hovering .figma-cursor-arrow,
.figma-cursor.is-hovering .figma-cursor-arrow {
  transform: rotate(-6deg) scale(1.05);
}

#customCursor.is-hovering .figma-cursor-badge,
.figma-cursor.is-hovering .figma-cursor-badge {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.42);
}

/* Disable on touch-only mobile and coarse pointer devices */
@media (hover: none) and (pointer: coarse), (max-width: 600px) and (hover: none) {
  #customCursor,
  #cursorFollower,
  .figma-cursor,
  .figma-cursor-ping {
    display: none !important;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .figma-cursor-wrapper,
  .figma-cursor-arrow,
  .figma-cursor-badge,
  .figma-cursor-ping {
    transition: none !important;
    animation: none !important;
  }
}
