/* CSS Variables */
:root {
  --primary-color: #0070f3;
  --secondary-color: #7928ca;
  --accent-color: #00d4ff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #8b8b8b;
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f5f5f5;
  --border-color: #e1e1e1;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --primary-color: #0070f3;
  --secondary-color: #7928ca;
  --accent-color: #00d4ff;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #666666;
  --bg-primary: #070b14;
  --bg-secondary: #0d1525;
  --bg-tertiary: #152236;
  --border-color: #1e2d45;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.5);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: var(--transition);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Navigation */
.nav-bar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: var(--transition);
}

[data-theme="dark"] .nav-bar {
  background: rgba(10, 10, 10, 0.95);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.nav-menu-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.nav-logo:hover {
  transform: scale(1.05);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

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

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

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

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

.theme-toggle {
  background: none;
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.bar {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: var(--transition);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 0;
  background:
    linear-gradient(to bottom, transparent 75%, var(--bg-primary) 100%),
    linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.hero-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-image {
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero-image .portrait {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary-color);
  box-shadow: var(--shadow-medium);
  transition: var(--transition);
}

.hero-image .portrait:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-heavy);
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--text-secondary);
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.cta-button {
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.cta-button.primary {
  background: var(--primary-color);
  color: white;
}

.cta-button.secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.scroll-indicator {
  font-size: 1.5rem;
  color: var(--text-muted);
  animation: bounce 2s infinite;
}

/* Section Styles */
section {
  padding: 5rem 0;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-primary);
}

/* About Section */
.about {
  background: var(--bg-primary);
}

.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-intro {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.about-details {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.stat {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
}

.stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
}

.stat h3 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat p {
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
}

/* Research Section */
.research {
  background: var(--bg-primary);
}

.research-cards {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.research-card {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

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

.phd-card {
  background: linear-gradient(135deg, var(--bg-primary), rgba(0, 212, 255, 0.02));
  box-shadow: 0 0 0 1.75px rgba(0, 212, 255, 0.25), 0 4px 20px rgba(0, 212, 255, 0.12);
  border: none;
}

.phd-card:hover {
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.5), 0 8px 30px rgba(0, 212, 255, 0.25);
}

.thesis-card {
  box-shadow: 0 0 0 1.75px rgba(0, 112, 243, 0.25), 0 4px 20px rgba(0, 112, 243, 0.1);
  border: none;
}

.thesis-card:hover {
  box-shadow: 0 0 0 2px rgba(0, 112, 243, 0.5), 0 8px 30px rgba(0, 112, 243, 0.2);
}

.research-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.research-icon {
  font-size: 2rem;
  color: var(--accent-color);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.research-meta {
  flex: 1;
  min-width: 0;
}

.research-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.research-title-row h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.research-affiliation {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.research-date {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 500;
}

.research-body {
  margin-bottom: 1.25rem;
}

.research-body p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.research-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.research-badge.active {
  background: rgba(0, 212, 255, 0.15);
  color: var(--accent-color);
}

.research-badge.ongoing {
  background: rgba(0, 112, 243, 0.1);
  color: var(--primary-color);
}

.research-title-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Projects Section */
.projects {
  background: var(--bg-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  max-width: 905px;
  margin: 0 auto;
}

.project-card {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

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

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.project-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.project-header .project-link {
  flex-shrink: 0;
  margin-top: -0.125rem;
}

.project-link {
  color: var(--text-muted);
  font-size: 1.5rem;
  transition: var(--transition);
}

.project-link:hover {
  color: var(--primary-color);
  transform: scale(1.1);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  padding: 0.3rem 0.8rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.project-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

.project-bullets {
  padding-left: 1.2rem;
  margin: 0.5rem 0 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.project-bullets li {
  margin-bottom: 0.4rem;
}

.project-bullets li:last-child {
  margin-bottom: 0;
}

/* Skills Section */
.skills {
  background: var(--bg-primary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  max-width: 905px;
  margin: 0 auto;
}

.skill-category {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  padding: 2rem;
  transition: var(--transition);
}

.skill-category:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
}

.skill-category h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  padding: 0.5rem 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 25px;
  font-weight: 500;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
}

.skill-tag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  background: var(--primary-color);
  color: white;
}

/* Achievements Section */
.achievements-intro {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

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

.achievement-card {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  border-left: 4px solid var(--primary-color);
}

.achievement-card.excellence {
  border-left-color: #00d4ff;
  background: linear-gradient(135deg, var(--bg-primary), rgba(0, 212, 255, 0.05));
}

.achievement-card.high-distinction {
  border-left-color: var(--primary-color);
}

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

.achievement-score {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  min-width: 60px;
}

.achievement-card.excellence .achievement-score {
  color: #00d4ff;
}

.achievement-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.achievement-content h5 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.achievement-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Work Experience */
.work {
  padding: 5rem 0;
  background: var(--bg-primary);
}

.work .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.experience-card {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  border: 1px solid transparent;
  max-width: 800px;
  margin: 0 auto 2rem;
  transition: var(--transition);
}

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

.experience-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.experience-icon {
  font-size: 2rem;
  color: var(--primary-color);
  flex-shrink: 0;
}

.experience-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.experience-info h4 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.experience-date {
  font-size: 0.95rem;
  color: var(--primary-color);
  font-weight: 500;
}

.experience-content {
  color: var(--text-secondary);
  line-height: 1.6;
}

.experience-content p {
  margin-bottom: 0;
}

/* Contact Section */
.contact {
  background: var(--bg-primary);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 10rem;
  width: fit-content;
  margin: 0 auto;
  padding-left: 5rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.contact-item {
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.contact-item i {
  font-size: 1.25rem;
  min-width: 24px;
}

.contact-item:hover {
  color: var(--primary-color);
}


.social-link i {
  font-size: 1.5rem;
}

/* Footer */
.footer {
  background: linear-gradient(to bottom, var(--bg-primary) 0%, var(--bg-tertiary) 75%);
  padding: 1.75rem 0;
  text-align: center;
}

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


/* Dark mode: elevate cards above bg-primary sections */
[data-theme="dark"] .research-card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .experience-card,
[data-theme="dark"] .skill-category {
  background: var(--bg-secondary);
}

[data-theme="dark"] .experience-card {
  border-color: var(--border-color);
}

[data-theme="dark"] .phd-card {
  background: linear-gradient(135deg, var(--bg-secondary), rgba(0, 212, 255, 0.02));
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: var(--bg-primary);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: var(--shadow-medium);
    padding: 2rem 0;
    gap: 1rem;
  }

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

  .hamburger {
    display: flex;
  }

  .hamburger.active .bar:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

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

  .about-content {
    grid-template-columns: 1fr;
  }

  .about-stats {
    display: none;
  }

  .contact-content {
    grid-template-columns: 1fr;
    padding-left: 0;
  }

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

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

  .research-title-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .research-title-actions {
    flex-direction: row;
  }

  .research-header {
    gap: 1rem;
  }

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

  .container {
    padding: 0 1rem;
  }

  .nav-container {
    padding: 0 1rem;
  }

  .hero-container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-image .portrait {
    width: 150px;
    height: 150px;
  }

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

  .about-stats {
    grid-template-columns: 1fr;
  }

  .experience-header {
    flex-direction: column;
    text-align: center;
  }
  
  .experience-icon {
    margin: 0 auto;
  }

  .achievement-card {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-height: 850px) {
  .hero {
    padding-top: 90px;
    align-items: flex-start;
  }

  .hero-container {
    margin-top: auto;
    margin-bottom: auto;
  }
}

/* Scroll animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Subtle inline links */
.inline-link {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--text-muted);
  text-underline-offset: 3px;
  transition: var(--transition);
}

.inline-link:hover {
  color: var(--primary-color);
  text-decoration-color: var(--primary-color);
  text-decoration-style: solid;
}

/* Focus styles for accessibility */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}