/* ==========================================================================
   PRIYANSHU VISHWAKARMA — PREMIUM INTERACTIVE PORTFOLIO
   Design System & Styling Rules (CSS3 + Tailwind Utilities Overlay)
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Dark Theme Palette (Default) */
  --bg-primary: #07080c;
  --bg-secondary: #0d0e17;
  --bg-tertiary: #121424;
  --bg-card: rgba(15, 18, 32, 0.65);
  --bg-card-hover: rgba(22, 27, 48, 0.85);
  --bg-glass: rgba(13, 14, 23, 0.75);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(96, 165, 250, 0.3);
  --border-active: rgba(34, 211, 238, 0.5);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Accent Gradients & Glows */
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-violet: #8b5cf6;
  
  --blue-glow: rgba(59, 130, 246, 0.15);
  --cyan-glow: rgba(6, 182, 212, 0.15);
  --violet-glow: rgba(139, 92, 246, 0.15);
  
  --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #06b6d4 50%, #8b5cf6 100%);
  --gradient-text: linear-gradient(135deg, #60a5fa 0%, #22d3ee 50%, #a78bfa 100%);
  --gradient-card-border: linear-gradient(135deg, rgba(96, 165, 250, 0.4), rgba(34, 211, 238, 0.1), rgba(167, 139, 250, 0.4));
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.2);
  
  --font-sans: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --cursor-size: 8px;
  --cursor-follower-size: 36px;
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-glass: rgba(248, 250, 252, 0.85);
  
  --border-color: rgba(15, 23, 42, 0.08);
  --border-highlight: rgba(37, 99, 235, 0.3);
  --border-active: rgba(8, 145, 178, 0.5);
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --blue-glow: rgba(37, 99, 235, 0.1);
  --cyan-glow: rgba(8, 145, 178, 0.1);
  --violet-glow: rgba(124, 58, 237, 0.1);
  
  --gradient-text: linear-gradient(135deg, #1d4ed8 0%, #0891b2 50%, #6d28d9 100%);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Reset & Core Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.4s ease;
  position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* Ambient Mouse Spotlight Light */
#mouse-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.07) 0%, rgba(6, 182, 212, 0.03) 40%, rgba(0,0,0,0) 70%);
  transform: translate(-50%, -50%);
  z-index: 1;
  transition: opacity 0.3s ease;
}

/* Custom Cursor (Desktop Only) */
@media (min-width: 1025px) {
  body {
    cursor: none;
  }
  a, button, input, textarea, select, [role="button"] {
    cursor: none;
  }
}

#custom-cursor-dot {
  position: fixed;
  width: var(--cursor-size);
  height: var(--cursor-size);
  background-color: var(--accent-cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
}

#custom-cursor-follower {
  position: fixed;
  width: var(--cursor-follower-size);
  height: var(--cursor-follower-size);
  border: 1.5px solid rgba(34, 211, 238, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease-out, width 0.2s ease, height 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

body.cursor-hover #custom-cursor-dot {
  width: 12px;
  height: 12px;
  background-color: var(--accent-blue);
}

body.cursor-hover #custom-cursor-follower {
  width: 52px;
  height: 52px;
  border-color: var(--accent-blue);
  background-color: rgba(59, 130, 246, 0.08);
}

/* Scroll Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-accent);
  width: 0%;
  z-index: 10000;
  transition: width 0.1s linear;
}

/* Background Grid Overlay */
.bg-grid-pattern {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}
[data-theme="light"] .bg-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
}

/* Glassmorphism Cards & Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.glass-nav {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

/* Typography Gradient Utility */
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Monogram Logo */
.brand-logo {
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: -0.05em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border-highlight);
  background-color: rgba(59, 130, 246, 0.05);
}
.brand-logo::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 11px;
  background: var(--gradient-card-border);
  z-index: -1;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}
.brand-logo:hover::after {
  opacity: 1;
}

/* Badges & Pills */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  color: var(--accent-cyan);
  font-size: 0.85rem;
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}
.tech-tag:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

/* Hero Visual Canvas Container */
.hero-visual-container {
  position: relative;
  width: 100%;
  min-height: 420px;
  background: rgba(13, 14, 23, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.hero-node {
  position: absolute;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(18, 21, 36, 0.9);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  z-index: 5;
}
.hero-node:hover {
  transform: scale(1.08);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

/* Code Snippet Overlay in Hero Visual */
.code-terminal-snippet {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(5, 6, 10, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  line-height: 1.4;
  pointer-events: none;
}

/* Interactive Research Pipeline Diagram */
.pipeline-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  position: relative;
}

.pipeline-node {
  flex: 1 1 180px;
  max-width: 220px;
  background: rgba(18, 21, 36, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  position: relative;
  transition: var(--transition-smooth);
}
.pipeline-node:hover {
  border-color: var(--accent-cyan);
  background: rgba(22, 27, 48, 0.95);
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}

.pipeline-arrow {
  color: var(--accent-blue);
  font-size: 1.2rem;
  animation: pulse-arrow 1.5s infinite alternate ease-in-out;
}
@keyframes pulse-arrow {
  from { transform: translateX(0); opacity: 0.6; }
  to { transform: translateX(4px); opacity: 1; }
}

/* SHAP Feature Importance Bars */
.shap-bar-bg {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  height: 10px;
  width: 100%;
  overflow: hidden;
  position: relative;
}
.shap-bar-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: 6px;
  width: 0%;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Metric Bar Visuals */
.metric-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Filter Tab Buttons */
.filter-btn {
  padding: 8px 18px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}
.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-highlight);
  background: rgba(59, 130, 246, 0.1);
}
.filter-btn.active {
  background: var(--gradient-accent);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-highlight);
  border-radius: 24px;
  width: 100%;
  max-width: 850px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

/* Timeline Components */
.timeline-item {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid var(--border-color);
  margin-bottom: 40px;
  transition: var(--transition-smooth);
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan);
  transition: var(--transition-smooth);
}
.timeline-item:hover::before {
  transform: scale(1.4);
  background: var(--accent-blue);
  box-shadow: 0 0 18px var(--accent-blue);
}

/* Animation Reveal Classes */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #mouse-spotlight, #custom-cursor-dot, #custom-cursor-follower {
    display: none !important;
  }
}
