body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #333;
  line-height: 1.6;
}
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}
.site-header {
  background: #fff;
  text-align: left;
  padding: 1.1rem 0;
  min-height: 48px;
  box-shadow: none;
  /* border-bottom: 1px solid #eee; */
}
.header-flex {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  max-width: 900px;
  margin: 0 auto;
  padding: 0.3rem 1rem;
  border-bottom: 1px solid #eee;
  position: relative;
}
.header-title {
  margin-left: 0.5rem;
  font-size: 1.6rem;
  font-weight: 400;
  color: #222;
  letter-spacing: 0.5px;
}
.mobile-menu-btn {
  margin-left: 0;
}
.header-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 0;
}
.header-nav a {
  margin-left: 1.5rem;
  padding: 0;
  border-radius: 0;
  background: none;
  color: #333;
  font-size: 1.25rem;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s;
}
.header-nav a:hover {
  color: #0077b6;
  background: none;
}
.avatar {
  max-width: 180px;
  max-height: 180px;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto 1rem auto;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.site-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin: 0.5rem 0 0.2rem 0;
  letter-spacing: 1px;
}
.subtitle {
  margin: 0.5rem 0 1.2rem 0;
  color: #666;
  font-size: 1.2rem;
}
.social-links {
  margin-top: 0.5rem;
}
.social-links a {
  margin: 0 0.7rem;
  text-decoration: none;
  color: inherit;
}
.social-links i {
  font-size: 2rem;
  vertical-align: middle;
  transition: color 0.2s;
}
.social-links a:hover i {
  color: #0077b6;
}
.project-list {
  list-style: none;
  padding: 0;
}
.project-list li {
  margin-bottom: 1.2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.site-footer {
  text-align: center;
  padding: 1rem 0;
  background: none;
  margin-top: 2rem;
  color: #888;
  font-size: 0.85rem;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
}
.site-footer p {
  margin: 0;
}

.profile-block {
  text-align: left;
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

main.container {
  margin-top: 0;
}

.profile-horizontal {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2.5rem;
  margin-top: 1rem;
  margin-bottom: 2.5rem;
  margin-left: 80px;
}
.avatar-rect {
  max-width: 250px;
  max-height: 250px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  object-fit: cover;
  display: block;
}
.profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin-left: 80px;
}
.profile-info h1 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  main.container {
    padding: 1rem 0.5rem;
  }
  .site-header h1 {
    font-size: 1.5rem;
  }
  section h2 {
    font-size: 1.1rem;
    padding-left: 0.4rem;
  }
  .header-flex {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 0.5rem;
  }
  .header-nav {
    flex-direction: column;
    width: 100vw;
    background: #fff;
    position: fixed;
    top: 56px;
    left: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    z-index: 2000;
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1);
    padding: 0;
    border-bottom: none;
  }
  .header-nav.open {
    max-height: 500px;
    pointer-events: auto;
  }
  .header-nav a {
    padding: 0.7rem 1.2rem;
    font-size: 1.1rem;
    width: 100%;
    text-align: left;
    border-bottom: none;
  }
  .header-nav a:last-child {
    border-bottom: none;
  }
  .mobile-menu-btn {
    display: block;
    margin-left: 0;
    margin-right: 0.5rem;
  }
  .header-title {
    margin-left: 0;
    font-size: 1.2rem;
  }
  .lang-toggle-container {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    gap: 0.4rem;
    z-index: 1100;
  }
}
@media (max-width: 800px) {
  .profile-horizontal {
    flex-direction: column;
    gap: 1.5rem;
    margin-left: 0;
    align-items: center;
    width: 100%;
  }
  .avatar-rect {
    width: 180px;
    height: 240px;
    max-width: 100%;
    max-height: 300px;
  }
  .profile-info {
    align-items: center;
    margin-left: 0;
    width: 100%;
  }
}
@media (max-width: 700px) {
  .site-footer .container {
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
  }
  .template-credit {
    text-align: center;
    width: 100%;
  }
}

#about a {
  color: #0077b6;
  text-decoration: none;
  font-weight: 500;
  transition: text-decoration 0.2s, color 0.2s;
}
#about a:hover {
  text-decoration: underline;
  color: #005f99;
}

.template-credit {
  position: static;
  right: auto;
  bottom: auto;
  font-size: 0.85rem;
  color: #888;
  background: none;
  text-align: right;
  z-index: auto;
}
.template-credit a {
  color: #0077b6;
  text-decoration: none;
}
.template-credit a:hover {
  text-decoration: underline;
}

#Publications a {
  color: #0077b6;
  text-decoration: none;
  font-weight: 500;
  transition: text-decoration 0.2s, color 0.2s;
}
#Publications a:hover {
  text-decoration: underline;
  color: #005f99;
}

.publication-item {
  display: flex;
  align-items: stretch;
  gap: 1.1rem;
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  padding: 1rem;
  margin-bottom: 1.2rem;
  min-height: 100px;
  height: 100px;
}
.pub-thumb {
  /* max-width: 100px; */
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  background: #eee;
  margin-right: 0.5rem;
  display: block;
}
.pub-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.pub-details p {
  margin-top: 0;
  margin-bottom: 0;
}

.lang-toggle-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  margin-left: 1.5rem;
  position: static;
  right: auto;
  top: auto;
  transform: none;
  z-index: auto;
}

.lang-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: #666;
  transition: color 0.2s;
}

.lang-label.active {
  color: #0077b6;
  font-weight: 600;
}

.lang-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  background: #ddd;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s;
  padding: 0;
  box-sizing: border-box;
}

.lang-toggle.active {
  background: #0077b6;
}

.lang-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.lang-toggle.active .lang-slider {
  transform: translateX(16px);
}

.lang-toggle:hover {
  background: #ccc;
}

.lang-toggle.active:hover {
  background: #005f99;
}

/* --- Improved mobile responsiveness --- */

@media (max-width: 600px) {
  .publication-item {
    flex-direction: column;
    align-items: center;
    height: auto;
    min-height: 0;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  .pub-thumb {
    max-width: 100%;
    max-height: 120px;
    margin: 0 0 0.5rem 0;
  }
  .pub-details {
    align-items: center;
    text-align: center;
  }
}

/* Make images responsive */
.avatar-rect, .pub-thumb {
  max-width: 100%;
  height: auto;
  width: auto;
}

/* Hamburger menu styles */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #333;
  margin-left: 1rem;
}

@media (max-width: 600px) {
  .mobile-menu-btn {
    display: block;
  }
  .header-nav {
    flex-direction: column;
    width: 100%;
    background: #fff;
    position: absolute;
    top: 100%;
    left: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 1000;
    border-bottom: 1px solid #eee;
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1);
    padding: 0 0.5rem;
  }
  .header-nav.open {
    max-height: 300px;
    pointer-events: auto;
  }
  .header-flex {
    position: relative;
  }
}