/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(168, 85, 247, 0.8); }

/* Custom Cursor */
#custom-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 32px; height: 32px;
  background-color: rgba(168, 85, 247, 0.3);
  border: 1px solid rgba(168, 85, 247, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1), 
              height 0.3s cubic-bezier(0.25, 1, 0.5, 1), 
              background-color 0.3s ease, border 0.3s ease;
  will-change: transform, width, height;
}

#custom-cursor.text-hover {
  width: 70px; height: 70px;
  background-color: rgba(168, 85, 247, 0.1);
  border: 1px dashed rgba(168, 85, 247, 0.8);
}

#custom-cursor.view-hover {
  width: 80px; height: 80px;
  background-color: rgba(168, 85, 247, 0.9);
  border: none;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

/* Typing Effect Cursor */
#typewriter { animation: blink 0.7s infinite; }
@keyframes blink { 0%, 100% { border-color: transparent; } 50% { border-color: #a855f7; } }

/* Fix: Instant 3D Tilt Cards (No Delay) */
.perspective-1000 { perspective: 1000px; }
.tilt-card { 
  transform-style: preserve-3d; 
  will-change: transform; 
  /* Instantly follows cursor movement but smoothly resets out on mouseleave */
  transition: transform 0.1s ease-out, box-shadow 0.3s ease; 
}
.tilt-card:hover { z-index: 10; box-shadow: 0 20px 40px -10px rgba(168, 85, 247, 0.15); }

/* Scroll Parallax Elements */
.scroll-parallax {
  will-change: transform;
}

/* ScrollSpy Active Dot */
.scroll-dot.active-dot {
  background-color: #a855f7;
  border-color: #a855f7;
  transform: scale(1.3);
}

/* Scroll Animations */
.reveal { opacity: 0; transform: translateY(50px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

.reveal-zoom { opacity: 0; transform: scale(0.5); transition: opacity 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.reveal-zoom.active { opacity: 1; transform: scale(1); }

.slide-right { transform: translateX(-50px); }
.slide-left { transform: translateX(50px); }
.slide-right.active, .slide-left.active { transform: translateX(0); }

/* Animation Delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }

/* Masonry Grid Setup */
.masonry-grid { column-count: 1; column-gap: 1.5rem; }
@media (min-width: 750px) { .masonry-grid { column-count: 2; } }
@media (min-width: 900px) { .masonry-grid { column-count: 3; } }
.masonry-item { break-inside: avoid; margin-bottom: 1.5rem; }

/* Portfolio Filters */
.filter-btn .active-indicator { opacity: 0; transform: scaleX(0); transition: all 0.3s ease; }
.filter-btn.active .active-indicator { opacity: 1; transform: scaleX(1); }