/* Custom Design System & Glassmorphism Utilities */

@layer utilities {
  .glass-panel {
    background: rgba(11, 17, 26, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(16, 185, 129, 0.18);
  }
  
  .glass-card {
    background: rgba(8, 12, 19, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .glass-card:hover {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 16px 40px -12px rgba(16, 185, 129, 0.22), 0 0 20px -2px rgba(16, 185, 129, 0.15);
    transform: translateY(-4px);
  }

  .emerald-glow {
    box-shadow: 0 0 50px -10px rgba(16, 185, 129, 0.45);
  }

  .text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #a7f3d0 45%, #10b981 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .text-gradient-emerald {
    background: linear-gradient(135deg, #6ee7b7 0%, #10b981 50%, #047857 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .border-beam {
    position: relative;
  }

  .border-beam::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.8), transparent);
    border-radius: inherit;
    z-index: -1;
    animation: beam 4s linear infinite;
  }
}

/* Background Ambient Grid & Modern Perspective Plane */
.bg-grid-pattern {
  background-size: 48px 48px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

.perspective-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 600px;
  background-image: 
    linear-gradient(to right, rgba(16, 185, 129, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 185, 129, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, #000 70%, transparent 100%);
  transform: perspective(600px) rotateX(45deg);
  transform-origin: top center;
  pointer-events: none;
}

/* Moving Data Line Animation in SVG Flowcharts */
@keyframes dashFlow {
  to {
    stroke-dashoffset: -40;
  }
}

.animate-dash-flow {
  stroke-dasharray: 6 6;
  animation: dashFlow 1.2s linear infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.4;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.02);
  }
}

.animate-pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
}

::-webkit-scrollbar-track {
  background: #030609;
}

::-webkit-scrollbar-thumb {
  background: #141f2e;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #10b981;
}

/* Hide scrollbar for clean horizontal marquee */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Scanline / Modern CRT micro effect on terminal */
.scanline {
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.03),
    rgba(0, 255, 0, 0.01),
    rgba(0, 0, 255, 0.03)
  );
  background-size: 100% 3px, 6px 100%;
}

/* =============================================
   CUSTOM CURSOR — Minimal Luxury Ring Cursor
   ============================================= */

/* Hide the default system cursor across the whole page */
*, *::before, *::after {
  cursor: none !important;
}

/* Small precise dot — tracks pointer position immediately */
#cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: width 0.15s ease, height 0.15s ease, background 0.2s ease;
  will-change: left, top;
}

/* Larger trailing ring — follows with a lerp lag */
#cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border: 1.5px solid rgba(16, 185, 129, 0.65);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease,
              border-color 0.25s ease, background 0.25s ease;
  will-change: left, top;
}

/* Hover state — ring expands and softly fills */
body.cursor-hover #cursor-dot {
  width: 8px;
  height: 8px;
  background: #34d399;
}
body.cursor-hover #cursor-ring {
  width: 46px;
  height: 46px;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
}

/* Click state — brief compression pulse */
body.cursor-click #cursor-dot {
  width: 4px;
  height: 4px;
  background: #6ee7b7;
}
body.cursor-click #cursor-ring {
  width: 22px;
  height: 22px;
  border-color: rgba(110, 231, 183, 0.85);
}
