:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #3b82f6;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-body: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-light: #f1f5f9;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(37, 99, 235, 0.2);
  color: var(--text-primary);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: var(--bg-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Navbar */
.navbar {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1rem 0;
  transition: var(--transition);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.navbar.scrolled {
  padding: 0.6rem 0;
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  color: #fff !important;
  letter-spacing: -0.5px;
}

.navbar-nav .nav-link {
  color: rgba(255,255,255,0.75) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,0.1);
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hero Section */
.hero-section {
  padding: 140px 0 80px;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1e3a5f 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.profile-image-wrapper {
  position: relative;
  display: inline-block;
}

.profile-image {
  width: 240px;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 4px solid rgba(255,255,255,0.2);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.social-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.social-links-list a {
  color: rgba(255,255,255,0.85);
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}

.social-links-list a:hover {
  color: #fff;
}

.hero-content {
  padding-left: 2rem;
}

.hero-name {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.hero-title {
  font-size: 1.2rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  margin-bottom: 0.5rem;
}

.hero-affiliation a {
  color: var(--accent);
  font-weight: 500;
}

.hero-affiliation a:hover {
  color: #93c5fd;
}

.inline-logo {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-left: 4px;
}

.hero-email {
  margin-top: 1rem;
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
}

.hero-email i {
  margin-right: 8px;
  color: var(--accent);
}

.hero-email a {
  color: rgba(255,255,255,0.9);
}

/* Section Styles */
section {
  padding: 80px 0;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 50px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

/* About Section */
.about-section {
  background: white;
}

.about-content p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

.about-content a,
.project-card a,
.timeline-card a,
.achievement-text a {
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.3);
  text-underline-offset: 2px;
  transition: var(--transition);
}

.about-content a:hover,
.project-card a:hover,
.timeline-card a:hover,
.achievement-text a:hover {
  text-decoration-color: var(--primary);
}

/* Interests Section */
.interests-section {
  background: var(--bg-body);
}

.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.interest-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.interest-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.interest-card i {
  font-size: 1.3rem;
  color: var(--primary);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.interest-card span {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text-primary);
}

/* Education Section */
.education-section {
  background: white;
}

.education-grid {
  display: grid;
  gap: 24px;
}

.education-card {
  display: flex;
  gap: 24px;
  padding: 28px;
  background: var(--bg-body);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.education-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.edu-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.edu-details h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.edu-school {
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.edu-field {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.edu-thesis {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 4px;
}

.edu-supervisor {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.edu-year {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Page Header */
.page-header {
  padding: 140px 0 60px;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1e3a5f 100%);
  color: white;
  text-align: center;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.page-header p {
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* Timeline */
.timeline {
  position: relative;
  padding: 20px 0;
}

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

.timeline-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 40px;
}

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

.timeline-card {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.timeline-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.timeline-company {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-role {
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.timeline-date {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.timeline-card ul {
  list-style: none;
  padding: 0;
  margin-top: 12px;
}

.timeline-card ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

/* Company logo in timeline */
.company-logo {
  height: 1.4em;
  vertical-align: middle;
  margin-right: 8px;
}

/* Publications */
.pub-list {
  display: grid;
  gap: 20px;
}

.pub-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.pub-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.pub-venue {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pub-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.5;
}

.pub-authors .me {
  font-weight: 600;
  color: var(--primary);
}

.pub-journal {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
}

.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-right: 8px;
  transition: var(--transition);
}

.pub-links a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pub-links a i {
  font-size: 0.75rem;
}

/* Research Project Cards */
.research-org {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.research-org h3 {
  font-size: 1.4rem;
  font-weight: 700;
}

.research-org img {
  height: 2em;
}

.research-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.research-meta span i {
  margin-right: 6px;
  color: var(--primary);
}

.project-card {
  background: var(--bg-body);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.project-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.project-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.project-card ul {
  list-style: none;
  padding: 0;
}

.project-card ul li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.project-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

/* CV Section */
.cv-container {
  text-align: center;
  padding: 40px 0;
}

.cv-container iframe {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 900px;
  height: 800px;
}

.cv-download {
  margin-top: 24px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-download:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-item p {
  padding: 14px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
}

.gallery-section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 40px 0 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.skill-category {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.skill-category h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-category h4 i {
  color: var(--primary);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  padding: 5px 12px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Achievements */
.achievement-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  transition: var(--transition);
}

.achievement-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.achievement-icon {
  width: 44px;
  height: 44px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.achievement-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.achievement-text strong {
  color: var(--text-primary);
}

.achievement-text a {
  font-weight: 500;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.45);
}

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

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

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.5);
  padding: 30px 0;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* Content section (for inner pages) */
.content-section {
  padding: 60px 0;
  background: var(--bg-body);
}

.content-section.alt {
  background: white;
}

/* Subsection titles */
.subsection-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* Service / Talks */
.info-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.info-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card ul li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.info-card ul li:last-child {
  border-bottom: none;
}

/* Publication Stats */
.pub-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1rem;
  padding: 6px 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}

.pub-stats i {
  color: rgba(255,255,255,0.6);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-section {
    padding: 120px 0 60px;
  }

  .hero-content {
    padding-left: 0;
    text-align: center;
    margin-top: 2rem;
  }

  .hero-name {
    font-size: 1.8rem;
  }

  .hero-title {
    font-size: 1rem;
  }

  .profile-image {
    width: 180px;
    height: 225px;
  }

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

  .page-header h1 {
    font-size: 1.8rem;
  }

  .education-card {
    flex-direction: column;
    gap: 16px;
  }

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

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

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

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

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

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

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

  .cv-container iframe {
    height: 500px;
  }
}

@media (max-width: 576px) {
  section {
    padding: 50px 0;
  }

  .hero-section {
    padding: 100px 0 50px;
  }

  .timeline-card {
    padding: 20px;
  }

  .pub-card {
    padding: 18px;
  }

  .navbar-nav {
    padding-top: 1rem;
  }

  .navbar-nav .nav-link {
    padding: 0.7rem 1rem !important;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .interests-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
