/* ========================================================================
   VARIABLES & ROOT STYLES
   ======================================================================== */

:root {
  /* Color System - Light Mode */
  --bg-primary: #FFFFFF;
  --bg-secondary: #FAFAFA;
  --bg-alt: #F0F9FF;

  --text-primary: #000000;
  --text-secondary: #1F2937;
  --text-muted: #6B7280;

  --accent-primary: #2563EB;
  --accent-primary-dark: #1D4ED8;
  --accent-success: #10B981;
  --accent-code: #7C3AED;

  --border-color: #E5E7EB;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing (8px grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 32px;
  --space-xl: 64px;

  /* Layout */
  --max-width: 1200px;
  --radius: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-alt: #1E293B;

  --text-primary: #F9FAFB;
  --text-secondary: #E5E7EB;
  --text-muted: #9CA3AF;

  --accent-primary: #3B82F6;
  --accent-primary-dark: #2563EB;
  --accent-success: #34D399;
  --accent-code: #A78BFA;

  --border-color: #374151;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* ========================================================================
   RESET & BASE STYLES
   ======================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  transition: var(--transition);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
  margin-bottom: var(--space-md);
  line-height: 1.8;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-primary-dark);
}

/* ========================================================================
   UTILITIES
   ======================================================================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-xl) 0;
}

.section-alt {
  background-color: var(--bg-secondary);
}

.section-title {
  text-align: center;
  margin-bottom: var(--space-xl);
  position: relative;
  padding-bottom: var(--space-md);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-dark));
  border-radius: var(--radius);
}

/* ========================================================================
   NAVIGATION
   ======================================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  padding: var(--space-md) 0;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

[data-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.95);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand a {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width 0.3s ease;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 25px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}


/* ========================================================================
   HERO SECTION
   ======================================================================== */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-alt) 100%);
  padding-top: calc(80px + var(--space-xl));
}

.hero-content {
  text-align: center;
}

.hero-title {
  margin-bottom: var(--space-md);
  animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-tagline {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto var(--space-lg);
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  margin-bottom: var(--space-lg);
  animation: fadeInUp 0.8s ease 0.3s both;
}

.hero-links {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  font-size: 1.5rem;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-links a {
  color: var(--text-secondary);
  transition: transform 0.3s ease, color 0.3s ease;
}

.hero-links a:hover {
  color: var(--accent-primary);
  transform: translateY(-3px);
}

/* ========================================================================
   BUTTONS
   ======================================================================== */

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.btn-secondary:hover {
  background: var(--accent-primary);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  padding: 10px 24px;
}

.btn-outline:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* ========================================================================
   ABOUT SECTION
   ======================================================================== */

.no-wrap {
  white-space: nowrap;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.125rem;
}

/* ========================================================================
   EXPERIENCE/TIMELINE
   ======================================================================== */

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-left: 80px;
  margin-bottom: var(--space-xl);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 4px var(--border-color);
}

.timeline-date {
  position: absolute;
  left: 60px;
  top: 0;
  background: var(--accent-primary);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.timeline-content {
  background: var(--bg-primary);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.timeline-content h3 {
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
}

.timeline-content h4 {
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.experience-highlights {
  list-style: none;
}

.experience-highlights li {
  position: relative;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.experience-highlights li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: bold;
}

.metric {
  color: var(--accent-success);
  font-weight: 700;
}

/* ========================================================================
   PUBLICATIONS
   ======================================================================== */

.publications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--space-lg);
}

.publication-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  transition: var(--transition);
}

.publication-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.publication-badge {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark));
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.publication-card h3 {
  padding-right: 120px;
}

.publication-authors {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
}

.publication-abstract {
  margin-bottom: var(--space-lg);
}

.publication-metrics {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.metric-badge {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-success);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
}

/* ========================================================================
   PROJECTS
   ======================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-lg);
}

.project-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}

.project-status {
  background: rgba(251, 191, 36, 0.1);
  color: #F59E0B;
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
}

.project-description {
  flex-grow: 1;
  margin-bottom: var(--space-lg);
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.tech-badge {
  background: var(--bg-alt);
  color: var(--accent-code);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

.project-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.project-links {
  display: flex;
  gap: var(--space-sm);
}

.coming-soon {
  background: linear-gradient(135deg, var(--bg-alt), var(--bg-secondary));
  border: 2px dashed var(--border-color);
}

/* ========================================================================
   SKILLS
   ======================================================================== */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
}

.skill-category {
  background: var(--bg-primary);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.skill-category h3 {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  color: var(--accent-primary);
}

.skill-category h3 i {
  font-size: 1.25rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.skill-tag {
  background: var(--bg-alt);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.skill-tag:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* ========================================================================
   EDUCATION
   ======================================================================== */

.education-grid {
  display: grid;
  gap: var(--space-lg);
  max-width: 800px;
  margin: 0 auto;
}

.education-card {
  background: var(--bg-primary);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.education-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
}

.education-date {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.education-card h4 {
  color: var(--accent-primary);
}

.gpa-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-success);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.coursework {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* ========================================================================
   FOOTER
   ======================================================================== */

.footer {
  background: var(--bg-secondary);
  padding: var(--space-xl) 0;
  margin-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
}

.footer-content {
  text-align: center;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  margin-bottom: var(--space-lg);
  font-size: 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: var(--transition);
}

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

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

/* ========================================================================
   ANIMATIONS
   ======================================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 60px;
    right: -100%;
    width: 100%;
    background: var(--bg-primary);
    flex-direction: column;
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
    transition: right 0.3s ease;
  }

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

  .nav-toggle {
    display: flex;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .timeline::before {
    left: 10px;
  }

  .timeline-item {
    padding-left: 40px;
  }

  .timeline-item::before {
    left: 2px;
  }

  .timeline-date {
    position: relative;
    left: 0;
    margin-bottom: var(--space-sm);
  }

  .publications-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .education-header {
    flex-direction: column;
  }

  .publication-badge {
    position: relative;
    top: auto;
    right: auto;
    display: inline-block;
    margin-bottom: var(--space-md);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero-links {
    gap: var(--space-md);
  }
}