* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 60px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: #f8f9fa;
  color: #2E3436;
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6em;
}

/* ── Navigation ─────────────────────────────────────────── */

#menu {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background-color: #1D3E84;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 6px 20px;
}

#menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}

#menu ul li {
  margin-top: 0;
  margin-bottom: 0;
}

#menu ul li a {
  display: block;
  color: #ffffff;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s ease;
}

#menu ul li a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

#menu ul li a.nav-active {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* ── Page wrapper ────────────────────────────────────────── */

.page-wrapper {
  max-width: 1024px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

/* ── Hero section ────────────────────────────────────────── */

.hero-section {
  background: linear-gradient(135deg, #e8f4f8 0%, #d4e9f3 100%);
  padding: 40px 30px;
  margin-bottom: 30px;
  border-radius: 12px;
  color: #1D3E84;
  box-shadow: 0 4px 12px rgba(29, 62, 132, 0.1);
}

.hero-container {
  display: flex;
  gap: 36px;
  align-items: center;
}

.profile-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 28px rgba(29, 62, 132, 0.3);
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-img:hover {
  transform: scale(1.05);
  box-shadow: 0 14px 36px rgba(29, 62, 132, 0.4);
}

.hero-content {
  flex: 1;
}

.hero-content h2 {
  margin: 0 0 12px 0;
  font-size: 28px;
  font-weight: 700;
  color: #1D3E84;
}

.hero-content p {
  margin: 6px 0;
  line-height: 1.8;
  color: #1D3E84;
}

.contact-btn {
  display: inline-block;
  background: #1D3E84;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 6px;
  margin-top: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-btn:hover {
  background: #0f2654;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29, 62, 132, 0.3);
}

/* ── Typography & general ────────────────────────────────── */

a {
  color: #008cba;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #1D3E84;
}

h2 {
  color: #1D3E84;
  font-weight: 700;
  font-size: 22px;
  padding-bottom: 8px;
  border-bottom: 3px solid #008cba;
  display: inline-block;
  margin-top: 40px;
  margin-bottom: 20px;
}

li {
  margin-top: 15px;
  margin-bottom: 15px;
}

hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #ddd, transparent);
  margin: 40px 0;
}

img {
  vertical-align: bottom;
}

/* ── Publications ────────────────────────────────────────── */

.pub-title {
  font-weight: 600;
  font-size: 16px;
}

.pub-links {
  font-weight: 600;
  float: right;
}

.pub-conf {
  font-style: italic;
  color: #555;
}

.pub-item {
  background: white;
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 8px;
  border-left: 4px solid #1D3E84;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pub-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(29, 62, 132, 0.12);
  border-left-color: #008cba;
}

.conf-badge {
  display: inline-block;
  background: #e8f0f7;
  color: #1D3E84;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
}

/* ── Collapsible ─────────────────────────────────────────── */

.collapsible {
  cursor: pointer;
}

.collapsible:hover {
  background-color: #f1f1f1;
}

.collapsible:hover::after {
  font-weight: bold;
  float: right;
  content: '\2913';
}

.active::after {
  font-weight: bold;
  float: right;
  content: "\2912";
}

.active:hover::after {
  font-weight: bold;
  float: right;
  content: "\2912";
}

.content {
  padding: 0 18px;
  display: none;
  overflow: hidden;
}

/* ── Code blocks ─────────────────────────────────────────── */

pre {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  overflow: auto;
  background-color: #f5f5f5;
}

/* ── Fade-in animation ───────────────────────────────────── */

.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* ── Back to top ─────────────────────────────────────────── */

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #1D3E84;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(29, 62, 132, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 99;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(29, 62, 132, 0.4);
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .page-wrapper {
    padding: 20px 15px 40px;
  }

  #menu ul li a {
    padding: 12px 14px;
    font-size: 14px;
  }

  .hero-section {
    padding: 28px 20px;
  }

  .hero-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
  }

  .profile-img {
    width: 150px;
    height: 150px;
  }

  .hero-content h2 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }

  .pub-item {
    padding: 12px;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    font-size: 18px;
    bottom: 20px;
    right: 20px;
  }

  hr {
    margin: 30px 0;
  }
}

@media (max-width: 480px) {
  .page-wrapper {
    padding: 15px 12px 30px;
  }

  body {
    font-size: 14px;
  }

  #menu ul {
    flex-wrap: wrap;
  }

  #menu ul li a {
    padding: 10px 12px;
    font-size: 13px;
  }

  .hero-section {
    padding: 20px 15px;
  }

  .profile-img {
    width: 120px;
    height: 120px;
  }

  .hero-content h2 {
    font-size: 20px;
  }

  .pub-item {
    padding: 10px;
    margin-bottom: 10px;
  }

  .back-to-top {
    width: 36px;
    height: 36px;
    font-size: 16px;
    bottom: 15px;
    right: 15px;
  }
}
