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

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

body {
  font-family: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
  color: #2c2c2c;
  background: #fafafa;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #1a6aa5;
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: #0d4a78;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Navigation ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid #e8e8e8;
  backdrop-filter: blur(8px);
  transition: box-shadow 0.3s;
}
.navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: #1a1a2e;
  letter-spacing: -0.02em;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}
.nav-links a {
  color: #555;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: #1a6aa5;
  border-bottom-color: #1a6aa5;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #333;
  margin: 5px 0;
  transition: 0.3s;
}

/* ===== Sections ===== */
section {
  padding: 5rem 2rem;
}
.container {
  max-width: 900px;
  margin: 0 auto;
}

/* ===== Hero / Home ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 60px;
  background: linear-gradient(135deg, #f5f7fa 0%, #eef1f5 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: center;
}
.hero-photo {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.hero-text h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.6rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}
.hero-text .subtitle {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 1.2rem;
  font-weight: 400;
}
.hero-text .bio {
  font-size: 1.02rem;
  color: #444;
  margin-bottom: 1.5rem;
}
.hero-text .bio p {
  margin-bottom: 0.8rem;
}
.job-market-badge {
  display: inline-block;
  background: #1a6aa5;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  margin-bottom: 1.2rem;
  letter-spacing: 0.02em;
}
.hero-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #555;
  padding: 0.35rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: all 0.2s;
}
.hero-links a:hover {
  border-color: #1a6aa5;
  color: #1a6aa5;
  background: rgba(26,106,165,0.04);
}
.hero-links a svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ===== Section Headers ===== */
.section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.section-divider {
  width: 50px;
  height: 3px;
  background: #1a6aa5;
  margin-bottom: 2.5rem;
  border: none;
}

/* ===== Research Section ===== */
#research {
  background: #fff;
}
.research-category {
  margin-bottom: 2.5rem;
}
.research-category h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #eee;
}
.paper {
  margin-bottom: 1.2rem;
  padding-left: 1rem;
  border-left: 3px solid #e0e7ef;
  transition: border-color 0.2s;
}
.paper:hover {
  border-left-color: #1a6aa5;
}
.paper-title {
  font-weight: 600;
  color: #1a6aa5;
}
.paper-title a {
  color: inherit;
}
.paper-title a:hover {
  text-decoration: underline;
}
.paper-details {
  font-size: 0.92rem;
  color: #666;
  margin-top: 0.15rem;
}
.paper-details .coauthors {
  font-style: italic;
}
.paper-note {
  font-size: 0.88rem;
  color: #888;
  margin-top: 0.3rem;
}
.paper-abstract {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.5rem;
  padding: 0.8rem 1rem;
  background: #f8f9fb;
  border-radius: 4px;
  display: none;
}
.paper-abstract.open {
  display: block;
}
.abstract-toggle {
  font-size: 0.82rem;
  color: #1a6aa5;
  cursor: pointer;
  margin-top: 0.3rem;
  display: inline-block;
  border: none;
  background: none;
  font-family: inherit;
  padding: 0;
}
.abstract-toggle:hover {
  text-decoration: underline;
}

/* ===== Teaching Section ===== */
#teaching {
  background: #f5f7fa;
}
.teaching-list {
  list-style: none;
}
.teaching-list li {
  padding: 0.8rem 0;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  gap: 1rem;
  align-items: baseline;
}
.teaching-list li:last-child {
  border-bottom: none;
}
.teaching-role {
  font-weight: 600;
  color: #1a1a2e;
  min-width: 0;
}
.teaching-where {
  color: #666;
  font-size: 0.95rem;
}
.teaching-when {
  color: #999;
  font-size: 0.88rem;
  white-space: nowrap;
  margin-left: auto;
}

/* ===== CV Section ===== */
#cv {
  background: #fff;
  text-align: center;
}
.cv-content {
  max-width: 600px;
  margin: 0 auto;
}
.cv-content p {
  font-size: 1.05rem;
  color: #555;
  margin-bottom: 1.5rem;
}
.btn-cv {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1a6aa5;
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: 5px;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.2s, transform 0.2s;
}
.btn-cv:hover {
  background: #155a8f;
  color: #fff;
  transform: translateY(-1px);
}
.btn-cv svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ===== Contact / Footer ===== */
.footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 3rem 2rem;
}
.footer-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.footer h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
}
.footer p,
.footer a {
  font-size: 0.92rem;
  color: #aab;
  line-height: 1.8;
}
.footer a:hover {
  color: #fff;
}
.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #444;
  color: #aab;
  transition: all 0.2s;
}
.footer-social a:hover {
  border-color: #1a6aa5;
  color: #fff;
  background: #1a6aa5;
}
.footer-social a svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #2a2a3e;
  font-size: 0.82rem;
  color: #666;
}

/* ===== Shared Sub-pages (Misc, Blog) ===== */
.page-header {
  padding: 7rem 2rem 2rem;
  background: linear-gradient(135deg, #f5f7fa 0%, #eef1f5 100%);
  text-align: center;
}
.page-subtitle {
  font-size: 1.05rem;
  color: #555;
  margin-top: 0.4rem;
}
.placeholder-text {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 3rem 0;
}

/* -- Miscellaneous / Gallery -- */
.misc-section {
  padding: 3rem 0;
  border-bottom: 1px solid #eee;
}
.gallery-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: #1a1a2e;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}
.gallery-item img {
  width: 100%;
  border-radius: 6px;
  display: block;
}
.gallery-caption {
  font-size: 0.88rem;
  color: #666;
  margin-top: 0.4rem;
}

/* -- Blog -- */
.blog-feed {
  padding: 3rem 0;
}
.blog-post {
  padding: 2rem 0;
  border-bottom: 1px solid #eee;
}
.blog-post:first-child {
  padding-top: 0;
}
.blog-date {
  font-size: 0.85rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.blog-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  margin: 0.3rem 0 0.6rem;
}
.blog-title a {
  color: #1a1a2e;
  text-decoration: none;
}
.blog-title a:hover {
  color: #1a6aa5;
}
.blog-excerpt {
  color: #555;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}
.blog-read-more {
  color: #1a6aa5;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}
.blog-read-more:hover {
  text-decoration: underline;
}

/* ===== JMP Page ===== */
.jmp-header {
  padding: 7rem 2rem 2rem;
  background: linear-gradient(135deg, #f5f7fa 0%, #eef1f5 100%);
  text-align: center;
}
.jmp-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0.6rem 0 0.5rem;
  letter-spacing: -0.02em;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}
.jmp-authors {
  font-size: 1.05rem;
  color: #555;
  margin-bottom: 1.2rem;
}
.jmp-authors a {
  color: #1a6aa5;
}
.jmp-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-appendix {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #1a6aa5;
  border: 2px solid #1a6aa5;
  padding: 0.65rem 1.6rem;
  border-radius: 5px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
}
.btn-appendix:hover {
  background: #1a6aa5;
  color: #fff;
}
.btn-appendix svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.jmp-viewer {
  padding: 0;
  background: #e8e8e8;
}
.pdf-container {
  width: 100%;
  height: calc(100vh - 60px);
}
.pdf-container object {
  width: 100%;
  height: 100%;
  border: none;
}
.pdf-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 1rem;
  color: #555;
  font-size: 1.1rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .hero-photo {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }
  .hero-links {
    justify-content: center;
  }
  .hero-text h1 {
    font-size: 2rem;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: #fff;
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 0;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links li {
    padding: 0.6rem 0;
  }
  .nav-toggle {
    display: block;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .teaching-list li {
    flex-direction: column;
    gap: 0.2rem;
  }
  .teaching-when {
    margin-left: 0;
  }
  section {
    padding: 3.5rem 1.2rem;
  }
}
