/* ===========================
   SHARED DESIGN SYSTEM
   mnxtr.github.io
   Elegant & Sophisticated Theme
   =========================== */

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

/* ── CSS Custom Properties ── */
:root {
  /* Elegant Color Palette */
  --primary: #6366F1;
  --primary-light: #818CF8;
  --primary-dark: #4F46E5;
  --accent: #8B5CF6;
  --accent-light: #A78BFA;
  --secondary: #EC4899;
  --secondary-light: #F472B6;
  
  /* Neutral Colors */
  --dark-bg: #0F172A;
  --dark-surface: #1E293B;
  --dark-elevated: #334155;
  --dark-text: #E2E8F0;
  --dark-text-muted: #94A3B8;
  --dark-text-subtle: #64748B;
  
  /* Glass Effects */
  --glass-bg: rgba(15, 23, 42, 0.75);
  --glass-border: rgba(99, 102, 241, 0.15);
  --glass-border-hover: rgba(139, 92, 246, 0.4);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(139, 92, 246, 0.4) 100%);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.25);
  --shadow-glow-accent: 0 0 40px rgba(139, 92, 246, 0.3);
  
  /* Spacing & Sizing */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-spring: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ── Base Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--dark-bg);
  color: var(--dark-text);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

code, pre {
  font-family: 'JetBrains Mono', monospace;
}

/* ── Selection ── */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: #fff;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--dark-elevated);
  border-radius: var(--radius-full);
  border: 2px solid var(--dark-bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ── Gradient Text ── */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Glassmorphism Card ── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

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

/* ── Glow Button ── */
.btn-glow {
  position: relative;
  overflow: hidden;
  background: var(--gradient-primary);
  border: none;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-decoration: none;
  transition: all var(--transition-base);
}

.btn-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-primary);
  border-radius: inherit;
  z-index: -1;
  filter: blur(20px);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn-glow:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-glow-accent);
}

.btn-glow:hover::before {
  opacity: 1;
}

.btn-glow:hover::after {
  opacity: 0.6;
}

.btn-glow:active {
  transform: translateY(0) scale(0.98);
}

/* ── Secondary Button ── */
.btn-outline {
  position: relative;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.025em;
  text-decoration: none;
  transition: all var(--transition-base);
  overflow: hidden;
}

.btn-outline::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-subtle);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline:hover::before {
  opacity: 1;
}

/* ── Avatar Glow Ring ── */
@keyframes ringPulse {
  0%, 100% { 
    box-shadow: 
      0 0 0 4px rgba(99, 102, 241, 0.4), 
      0 0 0 8px rgba(99, 102, 241, 0.1),
      0 0 40px rgba(139, 92, 246, 0.3);
  }
  50% { 
    box-shadow: 
      0 0 0 6px rgba(139, 92, 246, 0.5), 
      0 0 0 12px rgba(139, 92, 246, 0.15),
      0 0 60px rgba(236, 72, 153, 0.3);
  }
}

.avatar-glow {
  animation: ringPulse 4s ease-in-out infinite;
}

/* ── Ambient Background Orbs ── */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  animation: orbFloat 10s ease-in-out infinite alternate;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  top: -200px;
  left: -150px;
  animation-duration: 12s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  bottom: -150px;
  right: -100px;
  animation-duration: 14s;
  animation-delay: 2s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
  top: 50%;
  left: 60%;
  animation-duration: 10s;
  animation-delay: 1s;
  opacity: 0.08;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  100% { transform: translate(40px, 30px) scale(1.1) rotate(10deg); }
}

/* ── Animated Gradient Text for Typewriter cursor ── */
.typewriter-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--primary);
  margin-left: 2px;
  font-weight: 300;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ── Nav Underline Hover ── */
.nav-link {
  position: relative;
  padding-bottom: 4px;
  font-weight: 500;
  transition: color var(--transition-base);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-base);
  border-radius: var(--radius-full);
}

.nav-link:hover {
  color: #fff;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ── Nav Active Color ── */
.nav-link.active {
  color: var(--primary-light);
  font-weight: 600;
}

/* ── Hamburger Mobile Menu ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  z-index: 100;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  transform-origin: center;
}

.hamburger.open span:nth-child(1) { 
  transform: translateY(7px) rotate(45deg); 
}
.hamburger.open span:nth-child(2) { 
  opacity: 0; 
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) { 
  transform: translateY(-7px) rotate(-45deg); 
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  animation: slideDown 0.3s ease;
}

.mobile-menu.open {
  display: flex;
}

@keyframes slideDown {
  from { 
    opacity: 0; 
    transform: translateY(-16px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.mobile-menu a {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition-base);
}

.mobile-menu a:hover {
  color: var(--primary-light);
  padding-left: 0.5rem;
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .desktop-nav { display: none !important; }
}

/* ── Badge Chips ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid;
  letter-spacing: 0.03em;
  transition: all var(--transition-base);
}

.badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ── Stats Strip ── */
.stat-divider {
  width: 1px;
  height: 48px;
  background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

/* ── Progress Bar Shimmer ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.progress-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.3) 50%,
    rgba(255,255,255,0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
}

/* ── Progress Bar Animation ── */
@keyframes progressFill {
  from { width: 0; }
}

.progress-bar {
  animation: progressFill 1.4s ease-out forwards;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: shimmer 2.5s infinite;
  background-size: 200% 100%;
}

/* ── Light mode overrides ── */
.light {
  --dark-bg: #F8FAFC;
  --dark-surface: #FFFFFF;
  --dark-elevated: #F1F5F9;
  --dark-text: #1E293B;
  --dark-text-muted: #475569;
  --dark-text-subtle: #64748B;
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(99, 102, 241, 0.2);
}

.light .glass-card {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(99, 102, 241, 0.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.light .glass-card:hover {
  box-shadow: 0 8px 40px rgba(99, 102, 241, 0.15);
}

.light .orb {
  opacity: 0.06;
}

.light .bg-darkBg {
  background-color: var(--dark-bg);
}

.light .text-darkText {
  color: var(--dark-text);
}

.light .text-white {
  color: #1E293B;
}

.light .text-gray-400 {
  color: var(--dark-text-muted);
}

.light .text-gray-300 {
  color: var(--dark-text-subtle);
}

.light .bg-gray-700,
.light .bg-gray-800 {
  background-color: #E2E8F0;
}

.light .border-gray-500 {
  border-color: #CBD5E1;
}

.light input,
.light textarea {
  background-color: #F1F5F9 !important;
  color: #1E293B !important;
}

/* ── Footer with Social ── */
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: var(--gradient-subtle);
  transition: all var(--transition-base);
}

.footer-social a:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-glow);
}

/* ── Project Card Enhancements ── */
.project-card {
  transition: all var(--transition-slow);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
}

.project-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow-accent);
  transform: translateY(-8px);
}

.project-card.hidden-card {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  position: absolute;
}

/* ── Filter Buttons ── */
.filter-btn {
  transition: all var(--transition-base);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.filter-btn.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-glow);
  border-color: transparent;
}

.filter-btn:not(.active):hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: var(--gradient-subtle);
}

/* ── Form Inputs ── */
input, textarea {
  transition: all var(--transition-base);
}

input:focus, textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

/* ── Hover Link Effects ── */
a {
  transition: color var(--transition-base);
}

/* ── Card Hover Glow Effect ── */
.hover-glow {
  position: relative;
}

.hover-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: var(--gradient-primary);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  filter: blur(16px);
  transition: opacity var(--transition-base);
}

.hover-glow:hover::before {
  opacity: 0.4;
}

/* ── Floating Animation ── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.float {
  animation: float 6s ease-in-out infinite;
}

/* ── Pulse Animation ── */
@keyframes pulse-glow {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  50% { 
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
  }
}

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ── Section Divider ── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
  margin: 3rem 0;
}

/* ── Tooltip ── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 0.5rem 0.75rem;
  background: var(--dark-surface);
  color: var(--dark-text);
  font-size: 0.75rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--glass-border);
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ── Skeleton Loading ── */
@keyframes skeleton {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, 
    var(--dark-elevated) 0%, 
    var(--dark-surface) 50%, 
    var(--dark-elevated) 100%
  );
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}
