:root {
  /* Colors - Premium Futuristic Palette */
  --bg-color: #f7f9fc; /* Soft white/light gray base */
  --surface-color: rgba(255, 255, 255, 0.7); /* Glass surface */
  --surface-dark: rgba(255, 255, 255, 0.9);
  
  --primary-color: #0a0a0f; /* Near black for heavy contrast */
  --primary-light: #2d2d35;
  --text-dark: #111118;
  --text-muted: #6b7280;
  --text-light: #ffffff;
  
  /* Gradient Accents (Blue -> Purple -> Pink as requested) */
  --glow-blue: #3b82f6;
  --glow-purple: #8b5cf6;
  --glow-pink: #ec4899;
  
  --brand-gradient: linear-gradient(135deg, var(--glow-blue) 0%, var(--glow-purple) 50%, var(--glow-pink) 100%);
  --brand-gradient-hover: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #db2777 100%);
  
  /* Borders */
  --glass-border: 1px solid rgba(255, 255, 255, 0.4);
  --glass-border-light: 1px solid rgba(255, 255, 255, 0.2);
  --glass-border-hover: 1px solid rgba(255, 255, 255, 0.8);
  
  /* Shadows - Soft, diffused, modern */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255,255,255,0.6);
  --shadow-md: 0 12px 24px -4px rgba(0, 0, 0, 0.04), 0 4px 8px -2px rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255,255,255,0.8);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.08), 0 12px 24px -8px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255,255,255,1);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.2), 0 0 40px rgba(59, 130, 246, 0.1);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Spacing */
  --container-max-width: 1200px;
  --container-padding: 2rem;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Base animated background container that will sit behind everything */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  background: var(--bg-color);
}

/* Floating animated blobs */
.blob {
  position: absolute;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.6;
  border-radius: 50%;
  animation: float-blob 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.blob-1 {
  width: 60vw;
  height: 60vh;
  top: -10vh;
  left: -10vw;
  background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(59,130,246,0) 70%);
  animation-delay: 0s;
}

.blob-2 {
  width: 50vw;
  height: 50vh;
  bottom: -10vh;
  right: -10vw;
  background: radial-gradient(circle, rgba(236,72,153,0.3) 0%, rgba(236,72,153,0) 70%);
  animation-delay: -5s;
}

.blob-3 {
  width: 55vw;
  height: 55vh;
  top: 30vh;
  left: 30vw;
  background: radial-gradient(circle, rgba(139,92,246,0.25) 0%, rgba(139,92,246,0) 70%);
  animation-delay: -10s;
}

@keyframes float-blob {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(5%, 5%) scale(1.05); }
  66% { transform: translate(-5%, 10%) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Utilities */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: 8rem 0;
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  margin-bottom: 5rem;
}

.section-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--primary-color);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.25rem;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.7;
}

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

/* Buttons - Premium Feel */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  outline: none;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--brand-gradient);
  color: var(--text-light);
  box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.39);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--brand-gradient-hover);
  z-index: -1;
  transition: opacity var(--transition-fast);
  opacity: 0;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  color: var(--text-light);
}

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

.btn-outline {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--primary-color);
  border: var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background: var(--surface-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border: var(--glass-border-hover);
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--surface-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  border: var(--glass-border);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
  z-index: 2;
}

.glass-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  border-color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.8);
}

/* Form Styles */
.form-group {
  margin-bottom: 2rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: var(--font-family);
  font-size: 1rem;
  background-color: rgba(255, 255, 255, 0.5);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  color: var(--text-dark);
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-control:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.8);
  border-color: var(--glow-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Floating Navigation Bar (Vercel Style) */
.navbar {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 900px;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: var(--glass-border);
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
  padding: 0.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.navbar.scrolled {
  top: 1rem;
  background-color: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-md);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  max-width: 100%;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1001; /* Ensure brand is clickable above everything */
  perspective: 1000px; /* Enable 3D perspective for children */
}

/* Advanced Logo Styling & Animation (Always Active) */
.navbar-brand img {
  height: 55px; /* Significantly increased size */
  width: auto;
  transform-style: preserve-3d;
  animation: advanced-logo-anim 6s ease-in-out infinite;
  transform-origin: center;
}

/* Optional hover interaction - speeds up the animation slightly when interacting */
.navbar-brand:hover img {
  animation: advanced-logo-anim 3s ease-in-out infinite;
}

@keyframes advanced-logo-anim {
  0% { 
    transform: scale(1) translateY(0) rotateY(-5deg) rotateX(5deg);
    filter: drop-shadow(0 4px 10px rgba(139, 92, 246, 0.4)) drop-shadow(0 0 15px rgba(59, 130, 246, 0.3)); 
  }
  33% {
    transform: scale(1.08) translateY(-4px) rotateY(10deg) rotateX(-5deg);
    filter: drop-shadow(0 15px 30px rgba(139, 92, 246, 0.7)) drop-shadow(0 0 25px rgba(236, 72, 153, 0.6));
  }
  66% { 
    transform: scale(1.05) translateY(-2px) rotateY(-10deg) rotateX(0deg);
    filter: drop-shadow(0 8px 20px rgba(59, 130, 246, 0.6)) drop-shadow(0 0 20px rgba(139, 92, 246, 0.5)); 
  }
  100% { 
    transform: scale(1) translateY(0) rotateY(-5deg) rotateX(5deg);
    filter: drop-shadow(0 4px 10px rgba(139, 92, 246, 0.4)) drop-shadow(0 0 15px rgba(59, 130, 246, 0.3)); 
  }
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
  padding: 0.5rem 0;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--brand-gradient);
  transition: width var(--transition-fast);
  border-radius: 2px;
}

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

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--primary-color);
  cursor: pointer;
}

.desktop-nav {
  display: flex;
}

/* Minimal Modern Footer */
.footer {
  padding: 6rem 0 3rem;
  position: relative;
  overflow: hidden;
  border-top: var(--glass-border);
  background: rgba(255,255,255,0.3);
  backdrop-filter: blur(20px);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-brand img {
  height: 40px;
  margin-bottom: 1.5rem;
}

.footer-brand p {
  line-height: 1.6;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-links h4 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--surface-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  border: var(--glass-border);
  color: var(--text-muted);
}

.social-link:hover {
  background: var(--primary-color);
  color: var(--text-light);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: var(--glass-border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Animations - Scroll Reveal */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Utilities & Media Queries */

@media (max-width: 1200px) {
    :root {
        --container-max-width: 95%;
    }
}

@media (max-width: 1024px) {
    .section-title {
        font-size: 3rem;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }

    .features-grid, .footer-content {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --container-padding: 1.5rem;
    }

    .section {
        padding: 5rem 0;
    }

    .section-header {
        margin-bottom: 3rem;
    }

    .section-title {
        font-size: 2.25rem;
    }

    .section-subtitle {
        font-size: 1.1rem;
    }

    /* Navbar Responsiveness */
    .navbar {
        width: 92%;
        top: 1rem;
        padding: 0.6rem 1.25rem;
    }

    .navbar-brand img {
        height: 40px;
    }

    .mobile-menu-btn {
        display: block;
        font-size: 1.5rem;
    }

    .desktop-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 999;
    }

    .desktop-nav.active {
        right: 0;
    }

    .navbar-nav {
        flex-direction: column;
        gap: 2.5rem;
        text-align: center;
    }

    .nav-link {
        font-size: 1.5rem;
        font-weight: 700;
    }

    /* Hero Section */
    .hero-content {
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.75rem;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    .hero-btns .btn {
        width: 100%;
    }

    /* Grid Layouts */
    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .footer-brand {
        align-items: center;
    }

    /* Projects & Blog Grid (common IDs used in pages) */
    #projects-grid, #blog-grid, .projects-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.85rem;
    }

    .hero-content h1 {
        font-size: 2.25rem;
    }

    .glass-card {
        padding: 1.5rem;
    }

    .navbar {
        width: 95%;
        padding: 0.5rem 1rem;
    }

    .navbar-brand span {
        display: none; /* Hide text brand on very small screens, keep logo */
    }
}

/* =============================================
   ACCESSIBILITY — Focus Visible Styles
   Only shows outline when navigating via keyboard
   ============================================= */
:focus-visible {
    outline: 3px solid var(--glow-blue);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Remove default focus outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Skip-to-content link for screen readers */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--glow-blue);
    color: white;
    font-weight: 700;
    border-radius: var(--radius-md);
    z-index: 9999;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 1rem;
}

/* =============================================
   PERFORMANCE — Respect Reduced Motion Preference
   ============================================= */
@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;
    }

    .blob {
        animation: none;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
