/* ===========================
   Reset & Base
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #333;
  background-color: #fff;
  margin: 0;
  padding: 0;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ===========================
   Layout
   =========================== */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  padding: 2.5rem 0 4rem;
  min-height: calc(100vh - 130px);
}

/* ===========================
   Header & Navigation
   =========================== */
.site-header {
  background: #1e3a5f;
  color: #fff;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-title:hover {
  color: #93c5fd;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: #cbd5e1;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  border-bottom-color: #93c5fd;
  text-decoration: none;
}

/* ===========================
   Profile / Home Page
   =========================== */
.profile {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-avatar img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.avatar-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #94a3b8;
  border: 3px solid #cbd5e1;
}

.profile-info {
  flex: 1;
}

.profile-info h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 0.3rem;
}

.profile-info .position {
  font-size: 1.05rem;
  color: #475569;
  margin: 0 0 0.15rem;
}

.profile-info .institution {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0 0 1rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #475569;
  background: #f8fafc;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.profile-link:hover {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #fff;
  text-decoration: none;
}

/* ===========================
   Section Headings
   =========================== */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e3a5f;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.4rem;
  margin: 2.5rem 0 1.2rem;
}

/* ===========================
   Publications
   =========================== */
.publications-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.publication-item {
  padding: 1.2rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.publication-item:last-child {
  border-bottom: none;
}

.publication-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e3a5f;
  margin: 0 0 0.25rem;
}

.publication-title a {
  color: #1e3a5f;
}

.publication-title a:hover {
  color: #2563eb;
}

.publication-authors {
  font-size: 0.9rem;
  color: #475569;
  margin: 0 0 0.2rem;
}

.publication-authors .author-self {
  font-weight: 600;
  color: #333;
}

.publication-venue {
  font-size: 0.875rem;
  color: #64748b;
  font-style: italic;
  margin: 0 0 0.4rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.pub-link {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #2563eb;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.pub-link:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  text-decoration: none;
}

.publication-year {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.15rem;
}

/* ===========================
   Teaching
   =========================== */
.teaching-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.teaching-item {
  padding: 1rem 0;
  border-bottom: 1px solid #f1f5f9;
}

.teaching-item:last-child {
  border-bottom: none;
}

.teaching-course {
  font-size: 1rem;
  font-weight: 600;
  color: #1e3a5f;
  margin: 0 0 0.2rem;
}

.teaching-role {
  font-size: 0.9rem;
  color: #475569;
  margin: 0 0 0.15rem;
}

.teaching-details {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

/* ===========================
   CV Page
   =========================== */
.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  background: #1e3a5f;
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2rem;
  transition: background 0.2s;
}

.cv-download:hover {
  background: #2563eb;
  color: #fff;
  text-decoration: none;
}

.cv-section {
  margin-bottom: 2rem;
}

.cv-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e3a5f;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.3rem;
  margin: 0 0 1rem;
}

.cv-entry {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.cv-entry-year {
  flex-shrink: 0;
  width: 100px;
  font-size: 0.875rem;
  color: #64748b;
  padding-top: 0.1rem;
}

.cv-entry-content {
  flex: 1;
}

.cv-entry-title {
  font-weight: 600;
  color: #1e3a5f;
  margin: 0 0 0.1rem;
}

.cv-entry-subtitle {
  font-size: 0.9rem;
  color: #475569;
  margin: 0 0 0.1rem;
}

.cv-entry-description {
  font-size: 0.875rem;
  color: #64748b;
  margin: 0;
}

/* ===========================
   Page Layout
   =========================== */
.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 0.5rem;
}

.page-content p,
.page-content ul,
.page-content ol {
  margin-bottom: 1rem;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 1.5rem 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #64748b;
}

.footer-content p {
  margin: 0;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: #64748b;
  font-size: 0.875rem;
}

.social-links a:hover {
  color: #2563eb;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 600px) {
  .profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-links {
    justify-content: center;
  }

  .site-header .container {
    flex-direction: column;
    height: auto;
    padding: 0.75rem 1.5rem;
    gap: 0.5rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .cv-entry {
    flex-direction: column;
    gap: 0.25rem;
  }

  .cv-entry-year {
    width: auto;
    font-weight: 600;
  }
}
