File size: 12,032 Bytes
e927672
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
/* ═══════════════════════════════════════════════════════════════════════════
   CustomCursor.css β€” QUANTUM THEME-REACTIVE v5.0
   PASTE THIS β†’ src/components/CustomCursor.css

   How theme reactivity works:
   β€’ All cursor colors use CSS variables (--cursor-dot-color, etc.)
   β€’ ThemeContext sets [data-theme='dark'|'light'] on <html>
   β€’ global.css defines different values per theme
   β€’ All cursor elements inherit the right color INSTANTLY on toggle
   β€’ Zero JS needed for color β€” pure CSS variable propagation
═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   BASE DOT β€” inner precision core
───────────────────────────────────────────────────────────── */
.c-dot {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  top: 0; left: 0;
  transform: translate(-50%, -50%);

  width: var(--cursor-dot-size, 8px);
  height: var(--cursor-dot-size, 8px);
  border-radius: 50%;

  background: var(--cursor-dot-color);
  box-shadow: var(--cursor-glow);

  mix-blend-mode: var(--cursor-blend, screen);

  /* Color transitions follow theme-toggle speed */
  transition:
    background    0.55s cubic-bezier(0.4,0,0.2,1),
    box-shadow    0.55s cubic-bezier(0.4,0,0.2,1),
    mix-blend-mode 0.55s ease,
    width         0.18s cubic-bezier(0.34,1.56,0.64,1),
    height        0.18s cubic-bezier(0.34,1.56,0.64,1),
    opacity       0.18s ease;

  will-change: left, top, width, height;
}

/* ─────────────────────────────────────────────────────────────
   OUTER RING β€” lagged follower
───────────────────────────────────────────────────────────── */
.c-ring {
  position: fixed;
  pointer-events: none;
  z-index: 99998;
  top: 0; left: 0;
  transform: translate(-50%, -50%);

  width: 38px;
  height: 38px;
  border-radius: 50%;

  border: var(--cursor-ring-border, 2px solid rgba(0,255,238,0.65));
  box-shadow: var(--cursor-ring-glow);

  mix-blend-mode: var(--cursor-blend, screen);

  transition:
    border-color  0.55s cubic-bezier(0.4,0,0.2,1),
    box-shadow    0.55s cubic-bezier(0.4,0,0.2,1),
    background    0.35s ease,
    mix-blend-mode 0.55s ease,
    width         0.32s cubic-bezier(0.34,1.56,0.64,1),
    height        0.32s cubic-bezier(0.34,1.56,0.64,1),
    opacity       0.22s ease;

  will-change: left, top, width, height;
}

/* ─────────────────────────────────────────────────────────────
   EXPANDED STATE β€” on hover of interactive elements
───────────────────────────────────────────────────────────── */
.c-ring.expand {
  width: 62px;
  height: 62px;
  border: var(--cursor-ring-expand-border, 2px solid rgba(191,0,255,0.85));
  box-shadow: var(--cursor-expand-glow);
  background: rgba(124,58,237,0.06);
}

/* Dark expand bg */
[data-theme='dark'] .c-ring.expand {
  background: rgba(191,0,255,0.10);
}
/* Light expand bg β€” warm gold tint */
[data-theme='light'] .c-ring.expand {
  background: rgba(217,119,6,0.10);
}

/* ─────────────────────────────────────────────────────────────
   MAGNETIC DOT STATE β€” on links (dashed spinner)
───────────────────────────────────────────────────────────── */
.c-ring.on-link {
  animation: ringMagSpin 1.6s linear infinite;
  border-style: dashed;
  border-width: 1.5px;
}
@keyframes ringMagSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ─────────────────────────────────────────────────────────────
   TRAIL RING β€” furthest lag, dreamy echo
───────────────────────────────────────────────────────────── */
.c-trail {
  position: fixed;
  pointer-events: none;
  z-index: 99997;
  top: 0; left: 0;
  transform: translate(-50%, -50%);

  width: 70px;
  height: 70px;
  border-radius: 50%;

  border: 1px solid var(--cursor-trail-color);
  box-shadow: var(--cursor-trail-glow);
  opacity: 0.55;

  mix-blend-mode: var(--cursor-blend, screen);

  transition:
    border-color  0.55s ease,
    box-shadow    0.55s ease,
    width         0.5s ease,
    height        0.5s ease,
    opacity       0.5s ease;

  will-change: left, top;
}

/* ─────────────────────────────────────────────────────────────
   CLICK BURST β€” dot pulses
───────────────────────────────────────────────────────────── */
.c-dot.clicking {
  animation: dotQuantumBurst 0.38s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes dotQuantumBurst {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
  35%  { transform: translate(-50%, -50%) scale(3.2); opacity: 0.5; }
  65%  { transform: translate(-50%, -50%) scale(1.5); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

/* ─────────────────────────────────────────────────────────────
   CLICK BURST β€” ring ripples
───────────────────────────────────────────────────────────── */
.c-ring.clicking {
  animation: ringQuantumBurst 0.45s cubic-bezier(0.19,1,0.22,1);
}
@keyframes ringQuantumBurst {
  0%   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
  45%  { transform: translate(-50%, -50%) scale(2.2); opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

/* ─────────────────────────────────────────────────────────────
   PARTICLE BURST β€” spawned on click via JS
───────────────────────────────────────────────────────────── */
.c-particle {
  position: fixed;
  pointer-events: none;
  z-index: 99996;
  top: 0; left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cursor-particle-color);
  box-shadow: var(--cursor-glow);
  transform: translate(-50%, -50%);
  animation: particleQuantum 0.7s ease-out forwards;
  transition: background 0.55s ease, box-shadow 0.55s ease;
}
@keyframes particleQuantum {
  0%   { opacity: 1; transform: translate(calc(-50% + 0px), calc(-50% + 0px)) scale(1); }
  100% {
    opacity: 0;
    transform: translate(
      calc(-50% + var(--px, 30px)),
      calc(-50% + var(--py, -30px))
    ) scale(0.2);
  }
}

/* ─────────────────────────────────────────────────────────────
   MAGNETIC TRAIL DOTS β€” fading orbs left behind
───────────────────────────────────────────────────────────── */
.c-mag-dot {
  position: fixed;
  pointer-events: none;
  z-index: 99995;
  border-radius: 50%;
  background: var(--cursor-dot-color);
  transform: translate(-50%, -50%);
  animation: magTrailFade 0.55s ease-out forwards;
  transition: background 0.55s ease;
}
@keyframes magTrailFade {
  0%   { opacity: 0.55; width: 6px; height: 6px; }
  100% { opacity: 0;    width: 2px; height: 2px; }
}

/* ─────────────────────────────────────────────────────────────
   SCAN LINE β€” sweeps across cursor area on theme toggle
───────────────────────────────────────────────────────────── */
.c-scan {
  position: fixed;
  pointer-events: none;
  z-index: 99994;
  top: 0; left: -100%;
  width: 200px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cursor-dot-color), transparent);
  box-shadow: var(--cursor-glow);
  animation: scanSweep 0.6s ease-out forwards;
  transition: background 0.55s ease;
}
@keyframes scanSweep {
  0%   { left: -200px; opacity: 1; }
  100% { left: calc(100vw + 200px); opacity: 0; }
}

/* ─────────────────────────────────────────────────────────────
   TEXT CURSOR STATE β€” when hovering text
───────────────────────────────────────────────────────────── */
.c-dot.on-text {
  width: 3px;
  height: 20px;
  border-radius: 2px;
  animation: textCursorBlink 1.1s step-end infinite;
}
@keyframes textCursorBlink {
  50% { opacity: 0; }
}

/* ─────────────────────────────────────────────────────────────
   IMAGE CURSOR STATE β€” crosshair on images
───────────────────────────────────────────────────────────── */
.c-dot.on-image {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 2px solid var(--cursor-dot-color);
  box-shadow: var(--cursor-ring-glow), inset 0 0 8px rgba(0,255,238,0.15);
}
.c-dot.on-image::before,
.c-dot.on-image::after {
  content: '';
  position: absolute;
  background: var(--cursor-dot-color);
}
.c-dot.on-image::before {
  width: 1px; height: 12px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.c-dot.on-image::after {
  width: 12px; height: 1px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

/* ─────────────────────────────────────────────────────────────
   HIDE ON MOBILE / TOUCH
───────────────────────────────────────────────────────────── */
@media (max-width: 768px),
       (hover: none),
       (pointer: coarse) {
  .c-dot,
  .c-ring,
  .c-trail,
  .c-particle,
  .c-mag-dot,
  .c-scan {
    display: none !important;
  }
}