:root {
    /* Theme: Deep Academic Navy (Premium Dark) */
    --primary-color: #0b1121; /* Deep Navy */
    --secondary-color: #1e293b; /* Slate 800 */
    --accent-color: #06b6d4; /* Cyan 500 */
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%); /* Cyan to Blue */
    
    --text-primary: #f1f5f9; /* Slate 100 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --border-color: #334155; /* Slate 700 */
    
    --card-bg: rgba(30, 41, 59, 0.7); /* Slate 800 with opacity */
    --card-hover-shadow: 0 20px 40px -15px rgba(6, 182, 212, 0.2);

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Spacing */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 5rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Header Background */
    --header-bg: rgba(11, 17, 33, 0.85);

    /* Text Gradient */
    --text-gradient: linear-gradient(to right, #f8fafc, #94a3b8);
}

/* Light Theme (Clean Academic) */
[data-theme="light"] {
    --primary-color: #f8fafc; /* Slate 50 */
    --secondary-color: #ffffff; /* White */
    --accent-color: #4f46e5; /* Indigo 600 */
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%); /* Indigo to Sky */
    
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --border-color: #cbd5e1; /* Slate 300 */
    
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-hover-shadow: 0 20px 40px -15px rgba(79, 70, 229, 0.15);
    
    --header-bg: rgba(248, 250, 252, 0.9);
    --text-gradient: linear-gradient(to right, #0f172a, #334155);
}

/* High Contrast Theme */
[data-theme="contrast"] {
  --primary-color: #000000;
  --secondary-color: #000000;
  --accent-color: #ffff00;
  /* Yellow */
  --text-primary: #ffffff;
  --text-secondary: #ffffff;
  --border-color: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

body {
  font-family: var(--font-main);
  background-color: var(--primary-color);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.8;
  /* Improved from 1.6 for better readability */
  overflow-x: hidden;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #22d3ee;
  /* Lighter cyan */
  text-decoration: underline;
}

/* Button Style */
.btn {
  display: inline-block;
  background: var(--accent-gradient);
  color: var(--primary-color);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 225, 255, 0.3);
  text-decoration: none;
  color: var(--primary-color);
}

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

/* Header / Navigation */
header {
  background-color: var(--header-bg);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  padding: var(--spacing-md) 0;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: var(--spacing-lg);
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .hamburger {
    display: block;
    margin-left: auto;
    margin-right: 1rem;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%;
    max-width: 300px;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 99;
  }

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

  .nav-links li {
    margin: 1.5rem 0;
  }

  .nav-links a {
    font-size: 1.2rem;
  }
}

/* Hero Section */
.hero {
  padding: var(--spacing-xl) 0;
  text-align: center;
  background:
    radial-gradient(circle at top right, #1e293b 0%, transparent 40%),
    radial-gradient(circle at bottom left, #1e293b 0%, transparent 40%);
  position: relative;
  overflow: hidden;
  /* Ensure particles don't spill out */
}

/* Background Animation Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Behind everything */
  pointer-events: none;
  background: var(--primary-color);
}

/* Ensure content sits above particles */
main,
header,
footer {
  position: relative;
  z-index: 1;
}

.hero-card {
  background-color: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 4rem 3rem;
  /* Increased from 3rem 2rem */
  max-width: 1000px;
  /* Increased from 900px */
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.hero h1 {
    font-size: 4rem; /* Increased size for impact */
    font-weight: 800; /* Extra bold */
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    background: var(--text-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.35rem;
  /* Increased from 1.25rem */
  color: var(--text-secondary);
  line-height: 1.7;
  /* Added for better readability */
  max-width: 600px;
  margin: 0 auto var(--spacing-lg);
}

/* Specific styling for bio */
#profile-bio {
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 850px;
  /* Wider than titles */
  margin: 0 auto var(--spacing-lg);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.social-icon {
  font-size: 2.5rem;
  color: var(--text-secondary);
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}

.social-icon:hover {
  color: var(--accent-color);
  transform: translateY(-2px);
}

/* Sections */
section {
  padding: 5rem 0;
  /* Increased from 4rem for better breathing room */
  border-bottom: 1px solid var(--border-color);
}

section h2 {
    font-size: 2.5rem; /* Standardized sizing */
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

section h2::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 120px;
  /* Longer underline from 100px */
  height: 5px;
  /* Thicker from 4px */
  background: var(--accent-gradient);
  border-radius: 2px;
}

/* Cards (Publications, Experience) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  align-items: stretch;
  /* Ensure cards stretch to same height */
}

/* Card Styling Improvements */
.card {
  background-color: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 2.5rem;
  /* Increased from 2rem for better breathing room */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 280px;
  /* Minimum height for consistency */
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 4px solid var(--accent-color);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0.03),
    transparent
  );
  pointer-events: none;
}

.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--card-hover-shadow);
  border-color: var(--accent-color);
}

.card h3 {
    color: var(--accent-color);
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.card h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    opacity: 0.95;
}

.card .meta {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card p,
.card li {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  /* Increased from 1.7 for better readability */
  margin-bottom: 1rem;
  /* Increased from 0.5rem */
}

.card ul {
  padding-left: 1.2rem;
  margin-top: 1rem;
  /* Increased from 0.5rem */
  margin-bottom: 1rem;
  /* Added bottom margin */
  list-style-position: inside;
  color: var(--text-secondary);
}

.card ul li {
  margin-bottom: 0.75rem;
  /* Increased from 0.5rem for better spacing */
  line-height: 1.7;
}

/* Skills */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  /* Increased from 1rem for better spacing */
  list-style: none;
}

.skill-tag {
  background-color: rgba(6, 182, 212, 0.1);
  color: var(--accent-color);
  padding: 0.625rem 1.25rem;
  /* Increased padding for better touch targets */
  border-radius: 9999px;
  font-size: 0.95rem;
  /* Slightly larger from 0.9rem */
  font-weight: 500;
  border: 1px solid rgba(6, 182, 212, 0.2);
  transition: all 0.2s ease;
  /* Added transition */
}

.skill-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

/* Footer */
footer {
  text-align: center;
  padding: var(--spacing-xl) 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Profile Photo with Animation */
.profile-photo-container {
  margin-bottom: 2.5rem;
  /* Increased from 2rem */
  position: relative;
  display: inline-block;
}

.profile-photo {
  width: 200px;
  /* Increased from 180px */
  height: 200px;
  /* Increased from 180px */
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent-color);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  /* CNN Training Animation Effect */
  animation: pulse-glow 3s infinite ease-in-out;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
    border-color: var(--accent-color);
  }

  50% {
    box-shadow:
      0 0 40px rgba(6, 182, 212, 0.6),
      0 0 80px rgba(6, 182, 212, 0.2);
    border-color: #22d3ee;
    /* Lighter cyan */
  }

  100% {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
    border-color: var(--accent-color);
  }
}

.profile-photo:hover {
  transform: scale(1.05);
  animation: none;
  /* Pause animation on hover */
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.8);
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent-color);
}

/* Certificates Section */
/* Uses standard card styles now */

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }



  nav {
    justify-content: space-between;
  }

  .theme-toggle {
    margin-left: auto;
  }
}

/* Section-Specific Card Heights for Better Consistency */
/* Removed specific overrides to ensure uniform card appearance */

/* Responsive Grid Improvements */
@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    /* 3 columns on large screens */
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns on medium screens */
  }
}

@media (max-width: 767px) {
  .card-grid {
    grid-template-columns: 1fr;
    /* Single column on mobile */
  }

  .card {
    min-height: auto;
    /* Remove min-height on mobile */
    padding: 2rem;
    /* Reduce padding on mobile */
  }

  .hero h1 {
    font-size: 2.5rem;
    /* Adjusted from 2rem */
  }

  .hero p {
    font-size: 1.1rem;
  }

  section {
    padding: 3rem 0;
    /* Reduce section padding on mobile */
  }

  section h2 {
    font-size: 2.25rem;
    /* Smaller on mobile */
  }
}
