/* ===== CSS Variables ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #0ea5e9;
  --accent: #f472b6;
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
  --gradient-accent: linear-gradient(135deg, #f472b6 0%, #6366f1 100%);
  --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: var(--transition);
  background: transparent;
}

.navbar.scrolled {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  padding: 12px 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 40px;
}

.nav-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: var(--transition);
}

.nav-menu a:hover {
  color: var(--text-primary);
}

.nav-menu a:hover::after {
  width: 100%;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary-light);
  box-shadow: none;
}

.btn-primary:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.lang-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  border: 1px solid transparent;
}

.lang-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.lang-btn svg {
  width: 18px;
  height: 18px;
  color: currentColor;
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.1);
}

/* ===== Hero Section ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 100px 24px 60px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.9)),
    url("assets/images/hero-bg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
      circle at 30% 30%,
      rgba(99, 102, 241, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 70%,
      rgba(14, 165, 233, 0.1) 0%,
      transparent 50%
    );
  animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  50% {
    transform: translate(-2%, -2%) rotate(5deg);
  }
}

.hero-content {
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-text {
  animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.greeting {
  display: inline-block;
  color: var(--primary-light);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.name {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 16px;
}

.tagline {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-weight: 500;
}

.description {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 500px;
  margin-bottom: 32px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeInUp 1s ease-out 0.3s backwards;
}

.avatar-container {
  position: relative;
}

.avatar-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background: var(--gradient-primary);
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.4;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.6;
  }
}

.avatar {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-glow);
}

.avatar span {
  font-size: 4rem;
  font-weight: 700;
  color: white;
  letter-spacing: 2px;
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  animation: bounceDown 2s infinite;
}

@keyframes bounceDown {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
}

/* ===== Section Styles ===== */
.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 60px;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* ===== About Section ===== */
.about {
  padding: 120px 0;
  background: var(--bg-darker);
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.about.visible {
  opacity: 1;
  transform: translateY(0);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.9;
  margin-bottom: 20px;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.research-interests-title {
  font-size: 1.2rem;
  margin: 24px 0 12px;
  color: var(--text-primary);
}

.research-interests {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.research-interests li {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--primary-light);
}

/* ===== Skills Section ===== */
.skills {
  padding: 120px 0;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.skills.visible {
  opacity: 1;
  transform: translateY(0);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 24px;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: var(--transition);
}

.skill-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.skill-card:hover::before {
  transform: scaleX(1);
}

.skill-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.skill-card h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.skill-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Publications Section ===== */
.publications {
  padding: 120px 0;
  background: var(--bg-darker);
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.publications.visible {
  opacity: 1;
  transform: translateY(0);
}

.publications-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.publication-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  gap: 24px;
  transition: var(--transition);
}

.publication-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateX(8px);
}

.publication-year {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-light);
  min-width: 80px;
}

.publication-content {
  flex: 1;
}

.publication-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: var(--text-primary);
  line-height: 1.4;
}

.publication-authors {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.publication-journal {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 12px;
}

.publication-links {
  display: flex;
  gap: 12px;
}

.publication-link {
  padding: 6px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--primary);
  border-radius: 50px;
  color: var(--primary-light);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.publication-link:hover {
  background: var(--primary);
  color: white;
}

/* ===== Blog Section ===== */
.blog {
  padding: 120px 0;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.blog.visible {
  opacity: 1;
  transform: translateY(0);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: var(--transition);
}

.blog-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: var(--primary);
}

.blog-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.blog-card:hover .blog-image img {
  transform: scale(1.1);
}

.blog-content {
  padding: 24px;
}

.blog-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.blog-date {
  color: var(--text-muted);
}

.blog-category {
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.blog-title {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--text-primary);
  line-height: 1.4;
}

.blog-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.blog-link {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.blog-link:hover {
  color: var(--text-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: var(--primary);
}

.project-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.project-status {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-status.completed {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}

.project-status.ongoing {
  background: rgba(245, 158, 11, 0.9);
  color: white;
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-info {
  padding: 24px;
}

.project-info h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.project-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.9rem;
}

/* ===== Contact Section ===== */
.contact {
  padding: 120px 0;
  background: var(--bg-darker);
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.contact.visible {
  opacity: 1;
  transform: translateY(0);
}

.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-description {
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 40px;
  line-height: 1.8;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.contact-link:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-3px);
}

.contact-icon {
  font-size: 1.4rem;
}

/* ===== Footer ===== */
.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-domain {
  color: var(--primary-light);
  margin-top: 8px;
  font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text {
    order: 2;
  }

  .hero-visual {
    order: 1;
  }

  .description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Mobile Navigation Toggle ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  background: transparent;
  border: none;
  z-index: 1001;
}

.hamburger {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  position: relative;
  transition: var(--transition);
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  left: 0;
  transition: var(--transition);
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  top: 8px;
}

.nav-toggle.active .hamburger {
  background: transparent;
}

.nav-toggle.active .hamburger::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-toggle.active .hamburger::after {
  transform: rotate(-45deg);
  top: 0;
}

/* ===== Hero Affiliation ===== */
.affiliation {
  color: var(--primary-light);
  font-size: 1.1rem;
  margin-bottom: 16px;
  font-weight: 500;
}

/* ===== Section Subtitle ===== */
.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-top: -40px;
  margin-bottom: 40px;
  font-size: 1.1rem;
}

/* ===== Subsection Title ===== */
.subsection-title {
  font-size: 1.2rem;
  margin: 32px 0 16px;
  color: var(--text-primary);
}

/* ===== Education Timeline ===== */
.education-timeline {
  margin-bottom: 24px;
}

.education-item {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-left: 2px solid var(--primary);
  padding-left: 20px;
  margin-left: 8px;
  position: relative;
}

.education-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 22px;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
}

.education-year {
  min-width: 110px;
  color: var(--primary-light);
  font-weight: 600;
  font-size: 0.9rem;
}

.education-details h4 {
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 1rem;
}

.education-details p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ===== ORCID Card ===== */
.orcid-card {
  display: flex;
  justify-content: center;
  align-items: center;
}

.orcid-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.orcid-link:hover {
  color: var(--text-primary);
}

.orcid-link img {
  width: 20px;
  height: 20px;
}

/* ===== Google Scholar Card ===== */
.scholar-card {
  grid-column: 1 / -1;
  /* Span full width (3 columns) */
  display: flex;
  justify-content: center;
  align-items: center;
  height: 300px;
  /* Taller height for the graph */
  width: 100%;
}

.scholar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.scholar-link:hover {
  color: var(--text-primary);
}

.scholar-icon {
  font-size: 1.5rem;
}

/* ===== Project Tags ===== */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.project-tags .tag {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--primary);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--primary-light);
}

/* ===== Publications Footer ===== */
.publications-footer {
  text-align: center;
  margin-top: 40px;
}

/* ===== Responsive Styles ===== */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.98);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    padding: 80px 24px;
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu a {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .avatar {
    width: 180px;
    height: 180px;
  }

  .avatar span {
    font-size: 3rem;
  }

  .publication-card {
    flex-direction: column;
    gap: 12px;
  }

  .education-item {
    flex-direction: column;
    gap: 8px;
  }

  .education-year {
    min-width: auto;
  }
}

/* ===== Page Header (for secondary pages) ===== */
.page-header {
  padding: 160px 0 80px;
  background: var(--bg-darker);
  text-align: center;
}

.page-header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Publications Page ===== */
.publications-page {
  padding: 80px 0;
}

/* ===== Blog Page ===== */
.blog-page {
  padding: 80px 0;
}

/* ===== Blog Footer ===== */
.blog-footer {
  text-align: center;
  margin-top: 40px;
}

/* ===== External Links Section ===== */
.external-links {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.external-links h3 {
  font-size: 1.3rem;
  margin-bottom: 24px;
  color: var(--text-secondary);
}

.profile-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== Active Nav Link ===== */
.nav-menu a.active {
  color: var(--primary-light);
}

.nav-menu a.active::after {
  width: 100%;
}

/* ===== Blog Post Page ===== */
.blog-post {
  padding-top: 80px;
}

.post-header {
  padding: 80px 0 40px;
  background: var(--bg-darker);
  text-align: center;
}

.post-header .post-meta {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.post-header .post-category {
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.15);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.post-header .post-date {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.3;
  max-width: 800px;
  margin: 0 auto 16px;
  color: var(--text-primary);
}

.post-header .post-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.post-featured-image {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.post-featured-image img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.post-content {
  padding: 60px 0;
}

.container-narrow {
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.post-content h2 {
  font-size: 1.8rem;
  margin: 40px 0 16px;
  color: var(--text-primary);
}

.post-content h2:first-child {
  margin-top: 0;
}

.post-content p {
  margin-bottom: 20px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
}

.post-content ul,
.post-content ol {
  margin: 20px 0;
  padding-left: 24px;
  color: var(--text-secondary);
}

.post-content li {
  margin-bottom: 10px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.post-content strong {
  color: var(--text-primary);
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
}

.post-content a {
  color: var(--primary-light);
  text-decoration: underline;
  text-decoration-color: rgba(99, 102, 241, 0.4);
  text-underline-offset: 3px;
  transition: var(--transition);
}

.post-content a:hover {
  color: var(--primary);
  text-decoration-color: var(--primary);
}

.post-tags {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.post-navigation {
  padding: 40px 0;
  background: var(--bg-darker);
  text-align: center;
}

/* ===== Loading State ===== */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.error-message {
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
}

/* ===== Responsive for Post Pages ===== */
@media (max-width: 768px) {
  .blog-post {
    padding-top: 60px;
  }

  .post-header {
    padding: 60px 16px 30px;
  }

  .post-header h1 {
    font-size: 1.6rem;
    padding: 0 8px;
  }

  .post-header .post-subtitle {
    font-size: 0.95rem;
    padding: 0 8px;
  }

  .post-header .post-meta {
    flex-wrap: wrap;
    gap: 10px;
  }

  .post-featured-image {
    padding: 0 16px;
  }

  .post-content {
    padding: 40px 0;
  }

  .container-narrow {
    padding: 0 16px;
  }

  .post-content h2 {
    font-size: 1.3rem;
    margin: 30px 0 12px;
    word-wrap: break-word;
  }

  .post-content p,
  .post-content li {
    font-size: 0.95rem;
    line-height: 1.7;
    word-wrap: break-word;
  }

  .post-content ul,
  .post-content ol {
    padding-left: 20px;
  }

  .post-tags {
    margin-top: 30px;
    padding-top: 20px;
    justify-content: center;
  }

  .post-navigation {
    padding: 30px 0;
  }

  /* Mobile TOC - sticky dropdown with equal spacing */
  .toc-sidebar {
    display: block;
    position: sticky;
    top: 70px;
    z-index: 100;
    margin: 0 16px 24px 16px; /* Equal left/right spacing */
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }

  .toc-sidebar h4 {
    margin: 0;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.3s ease;
  }

  .toc-sidebar.expanded h4 {
    border-bottom-color: var(--border);
  }

  .toc-sidebar h4::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    transition: transform 0.3s ease;
  }

  .toc-sidebar.expanded h4::after {
    transform: rotate(180deg);
  }

  .toc-list {
    display: none;
    padding: 8px 0 16px;
    max-height: 220px; /* Show ~5 items before scrolling */
    overflow-y: auto;
    flex-direction: column;
    gap: 0;
    list-style: none;
  }

  .toc-sidebar.expanded .toc-list {
    display: flex;
  }

  .toc-list li {
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
  }

  .toc-list li:last-child {
    border-bottom: none;
  }

  .toc-list a {
    display: block;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    background: transparent;
    border-radius: 0;
    border-left: none;
    transition: color 0.2s ease, background 0.2s ease;
  }

  .toc-list a:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--text-primary);
  }

  .toc-list a.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.08);
  }

  /* Code blocks - full width within padded container */
  .code-block,
  .post-content pre {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }

  .post-layout {
    display: block;
    padding: 0 16px; /* Equal left/right padding for content */
  }
}

/* ===== Language Switcher ===== */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 20px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.lang-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: var(--text-primary);
}

.lang-btn svg {
  width: 16px;
  height: 16px;
}

.lang-btn .flag {
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .lang-switcher {
    margin-left: auto;
    margin-right: 12px;
    order: 2;
  }

  .lang-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .lang-btn svg {
    width: 14px;
    height: 14px;
  }
}

/* ===== Blog Post Layout with TOC ===== */
.post-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ===== Table of Contents Sidebar ===== */
.toc-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.toc-sidebar h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  display: block;
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: var(--transition);
  line-height: 1.4;
}

.toc-list a:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.toc-list a.active {
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.15);
  border-left-color: var(--primary);
}

/* ===== Code Blocks ===== */
.code-block {
  position: relative;
  margin: 24px 0;
  border-radius: 12px;
  overflow: hidden;
}

.code-block pre {
  margin: 0;
  padding: 20px 24px;
  background: #1e293b;
  border-radius: 12px;
  overflow-x: auto;
}

.code-block code {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e2e8f0;
  background: none;
  padding: 0;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
  color: #a5b4fc;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.copy-btn:hover {
  background: rgba(99, 102, 241, 0.4);
  border-color: var(--primary);
  color: white;
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.3);
  border-color: #10b981;
  color: #6ee7b7;
}

/* Inline Code */
.post-content code:not(.code-block code) {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.85em;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 4px;
  color: var(--primary-light);
}

/* Legacy pre/code blocks (fallback) */
.post-content pre:not(.code-block pre) {
  margin: 24px 0;
  padding: 20px 24px;
  background: #1e293b;
  border-radius: 12px;
  overflow-x: auto;
}

.post-content pre:not(.code-block pre) code {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e2e8f0;
  background: none;
  padding: 0;
}

/* ===== Responsive: TOC & Code Blocks ===== */
@media (max-width: 992px) {
  .post-layout {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }

  /* Tablet TOC - sticky dropdown (same as mobile) */
  .toc-sidebar {
    display: block;
    position: sticky;
    top: 70px;
    z-index: 100;
    margin: 0 0 24px 0;
    padding: 0;
    max-height: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  }

  .toc-sidebar h4 {
    margin: 0;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.3s ease;
  }

  .toc-sidebar.expanded h4 {
    border-bottom-color: var(--border);
  }

  .toc-sidebar h4::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    transition: transform 0.3s ease;
  }

  .toc-sidebar.expanded h4::after {
    transform: rotate(180deg);
  }

  .toc-list {
    display: none;
    padding: 0;
    margin: 0;
    max-height: 240px;
    overflow-y: auto;
    flex-direction: column;
    gap: 0;
    list-style: none;
    flex-wrap: nowrap;
  }

  .toc-sidebar.expanded .toc-list {
    display: flex;
  }

  .toc-list li {
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
  }

  .toc-list li:last-child {
    border-bottom: none;
  }

  .toc-list a {
    display: block;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    background: transparent;
    border-radius: 0;
    border-left: none;
    transition: color 0.2s ease, background 0.2s ease;
  }

  .toc-list a:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--text-primary);
  }

  .toc-list a.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.08);
  }
}

@media (max-width: 768px) {
  .code-block {
    margin: 16px -16px;
    border-radius: 0;
    max-width: 100vw;
  }

  .code-block pre,
  .post-content pre:not(.code-block pre) {
    padding: 16px;
    font-size: 0.8rem;
    border-radius: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .code-block code,
  .post-content pre:not(.code-block pre) code {
    font-size: 0.8rem;
    white-space: pre;
    word-break: normal;
  }

  .copy-btn {
    padding: 4px 10px;
    font-size: 0.7rem;
    top: 8px;
    right: 8px;
  }

  .post-content code:not(.code-block code) {
    font-size: 0.8em;
    padding: 2px 6px;
    word-break: break-word;
  }
}

/* ===== Blog Filters Section ===== */
.blog-filters {
  padding: 40px 0 20px;
  background: var(--bg-darker);
}

.search-container {
  position: relative;
  max-width: 500px;
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  padding: 14px 20px 14px 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-pill {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.category-pill:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.1);
}

.category-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Also update filter-select-pill if it exists separately or just handle sort-select */
.filter-select-pill,
.sort-select {
  padding: 10px 36px 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-select-pill:hover,
.sort-select:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  background-color: rgba(99, 102, 241, 0.1);
}

.filter-select-pill:focus,
.sort-select:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-select-pill option,
.sort-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.clear-filters-btn {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.clear-filters-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(244, 114, 182, 0.1);
}

.results-count {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Blog Tags */
.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.blog-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.blog-tag:hover {
  color: var(--primary-light);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 80px 20px;
}

.no-results-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.no-results h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.no-results p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Blog Filters Responsive */
@media (max-width: 768px) {
  .filter-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .filter-group {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .category-pills {
    width: 100%;
  }

  .sort-select,
  .clear-filters-btn {
    width: 100%;
  }

  .search-container {
    max-width: 100%;
  }
}

/* ===== Social Icons ===== */
.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  transition: var(--transition);
}

.social-icon:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.social-icon svg {
  width: 22px;
  height: 22px;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */

/* ----- Navigation Toggle (Hamburger Menu) ----- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger {
  position: relative;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  top: 8px;
}

.nav-toggle.active .hamburger {
  background: transparent;
}

.nav-toggle.active .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle.active .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ----- Tablet Breakpoint (768px) ----- */
@media (max-width: 768px) {
  /* Container */
  .container {
    padding: 0 20px;
  }

  /* Navigation Container - flex order for mobile */
  .nav-container {
    position: relative;
  }

  /* Navigation */
  .nav-toggle {
    display: flex;
    order: 1;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-darker);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 100px 32px 32px;
    gap: 0;
    transition: right 0.3s ease-in-out;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu a {
    display: block;
    padding: 16px 0;
    font-size: 1.1rem;
  }

  .nav-menu a::after {
    display: none;
  }

  /* Hero Section */
  .hero {
    padding: 100px 20px 60px;
    min-height: auto;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-text {
    order: 2;
  }

  .hero-visual {
    order: 1;
  }

  .name {
    font-size: 2.5rem;
  }

  .tagline {
    font-size: 1.2rem;
  }

  .description {
    font-size: 1rem;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .avatar {
    width: 180px;
    height: 180px;
  }

  .avatar-glow {
    width: 220px;
    height: 220px;
  }

  .scroll-indicator {
    display: none;
  }

  /* Section Titles */
  .section-title {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  .section-subtitle {
    margin-top: -20px;
    margin-bottom: 30px;
    font-size: 1rem;
  }

  /* About Section */
  .about {
    padding: 60px 0;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-text p {
    font-size: 1rem;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 20px 12px;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .scholar-card {
    grid-column: 1 / -1;
    min-height: 180px;
  }

  .education-item {
    flex-direction: column;
    gap: 8px;
  }

  .education-year {
    min-width: auto;
  }

  /* Skills Section */
  .skills {
    padding: 60px 0;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .skill-card {
    padding: 24px 16px;
  }

  .skill-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
  }

  .skill-card h3 {
    font-size: 1rem;
  }

  .skill-card p {
    font-size: 0.8rem;
  }

  /* Publications Section */
  .publications {
    padding: 60px 0;
  }

  .publication-card {
    flex-direction: column;
    gap: 12px;
    padding: 20px;
  }

  .publication-year {
    font-size: 1.2rem;
    min-width: auto;
  }

  .publication-title {
    font-size: 1rem;
  }

  .publication-authors,
  .publication-journal {
    font-size: 0.85rem;
  }

  .publication-links {
    flex-wrap: wrap;
    gap: 8px;
  }

  .publication-link {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* Blog Section */
  .blog {
    padding: 60px 0;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .blog-card:hover {
    transform: translateY(-5px);
  }

  .blog-title {
    font-size: 1.1rem;
  }

  /* Contact Section */
  .contact {
    padding: 60px 0;
  }

  .contact-content {
    padding: 0 10px;
  }

  .contact-description {
    font-size: 1rem;
    margin-bottom: 30px;
  }

  .social-icons {
    gap: 16px;
  }

  .social-icon {
    width: 44px;
    height: 44px;
  }

  .social-icon svg {
    width: 20px;
    height: 20px;
  }

  /* Footer */
  .footer {
    padding: 30px 0;
  }

  .footer p {
    font-size: 0.9rem;
  }

  /* Publications Page Specific */
  .publications-header {
    padding: 100px 20px 40px;
  }

  .publications-header h1 {
    font-size: 2rem;
  }

  /* Blog Page Specific */
  .blog-header {
    padding: 100px 20px 40px;
  }

  .blog-header h1 {
    font-size: 2rem;
  }

  /* Blog Post Layout */
  .post-layout {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }

  .post-sidebar {
    display: none;
  }

  /* Buttons */
  .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }

  .hero-buttons .btn {
    padding: 12px 28px;
  }
}

/* ----- Mobile Breakpoint (480px) ----- */
@media (max-width: 480px) {
  /* Navigation */
  .nav-logo img {
    height: 32px !important;
  }

  .nav-menu {
    width: 100%;
    right: -100%;
  }

  /* Hero Section */
  .hero {
    padding: 80px 16px 40px;
  }

  .name {
    font-size: 2rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .affiliation {
    font-size: 0.95rem;
  }

  .description {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .avatar {
    width: 150px;
    height: 150px;
  }

  .avatar-glow {
    width: 180px;
    height: 180px;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero-buttons .btn {
    width: 100%;
    text-align: center;
  }

  /* Section Titles */
  .section-title {
    font-size: 1.6rem;
    margin-bottom: 32px;
  }

  .section-title::after {
    width: 40px;
    height: 3px;
  }

  /* About Section */
  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 16px 8px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .research-interests {
    justify-content: center;
  }

  .research-interests li {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .subsection-title,
  .research-interests-title {
    font-size: 1rem;
  }

  /* Skills Section */
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .skill-card {
    padding: 20px 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 16px;
  }

  .skill-icon {
    font-size: 2rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .skill-card h3 {
    margin-bottom: 4px;
  }

  /* Publications Section */
  .publication-card {
    padding: 16px;
  }

  .publication-links {
    justify-content: flex-start;
  }

  /* Blog Section */
  .blog-content {
    padding: 16px;
  }

  .blog-meta {
    flex-direction: column;
    gap: 8px;
  }

  /* Contact Section */
  .social-icons {
    gap: 12px;
  }

  .social-icon {
    width: 40px;
    height: 40px;
  }

  .social-icon svg {
    width: 18px;
    height: 18px;
  }

  /* Footer */
  .footer {
    padding: 24px 0;
  }

  .footer-domain {
    font-size: 0.85rem;
  }

  /* Buttons */
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .publications-footer,
  .blog-footer {
    margin-top: 24px;
  }
}

/* ----- Touch-friendly Improvements ----- */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .stat-card:hover,
  .skill-card:hover,
  .publication-card:hover,
  .blog-card:hover,
  .project-card:hover {
    transform: none;
  }

  /* Keep tap feedback */
  .btn:active,
  .publication-link:active,
  .social-icon:active {
    transform: scale(0.95);
    opacity: 0.9;
  }

  /* Increase tap target sizes */
  .nav-menu a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .publication-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ----- Landscape Mode Adjustments ----- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 80px 24px 40px;
  }

  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .avatar {
    width: 120px;
    height: 120px;
  }

  .avatar-glow {
    width: 150px;
    height: 150px;
  }

  .name {
    font-size: 2rem;
  }

  .scroll-indicator {
    display: none;
  }
}

/* ----- Print Styles ----- */
@media print {
  .navbar,
  .nav-toggle,
  .scroll-indicator,
  .hero-buttons,
  .social-icons,
  .publication-links,
  .blog-footer,
  .publications-footer {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding: 40px 0;
  }

  body {
    background: white;
    color: black;
  }

  .section-title,
  .name,
  .stat-number {
    background: none;
    -webkit-text-fill-color: inherit;
    color: black;
  }
}
