@import url('https://cdn.jsdelivr.net/gh/dreampulse/computer-modern-web-font@master/font.css');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Computer Modern Serif', Georgia, serif;
  background-color: #f9f8f6;
  color: #1e1e1e;
  font-size: 17px;
  line-height: 1.75;
}

a {
  color: #3a5f8a;
  text-underline-offset: 3px;
}

a:hover {
  color: #2a4a70;
}

/* ── Navigation ── */

header {
  padding: 1.75rem 0;
  border-bottom: 1px solid #dedad4;
}

.nav-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.site-name {
  font-size: 1.25rem;
  font-weight: normal;
  text-decoration: none;
  color: #1e1e1e;
  letter-spacing: 0.01em;
}

nav {
  display: flex;
  gap: 0.25rem;
}

nav a {
  font-size: 0.9rem;
  text-decoration: none;
  color: #666;
  padding: 0.1rem 0.6rem;
  letter-spacing: 0.03em;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

nav a:hover,
nav a.active {
  color: #3a5f8a;
  border-bottom-color: #3a5f8a;
}

/* ── Page wrapper ── */

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
}

/* ── Home layout ── */

.home-layout {
  display: flex;
  gap: 3.5rem;
  align-items: flex-start;
}

.home-text {
  flex: 1;
  min-width: 0;
}

.home-text h1 {
  font-size: 1.5rem;
  font-weight: normal;
  margin-bottom: 1.25rem;
  letter-spacing: 0.01em;
}

.home-text p {
  margin-bottom: 1rem;
  color: #333;
}

.home-image {
  flex: 0 0 320px;
}

.home-image img {
  width: 100%;
  display: block;
}

/* ── Page image (teaching, research) ── */

.page-image-wrap {
  float: right;
  width: 260px;
  margin: 0 0 2rem 2.5rem;
}

.page-image-wrap img {
  width: 100%;
  display: block;
}

.page-image-wrap figcaption {
  font-size: 0.85rem;
  color: #999;
  margin-top: 0.5rem;
  font-style: italic;
}

.page-content-clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* ── Section headings ── */

h2 {
  font-size: 1.5rem;
  font-weight: normal;
  letter-spacing: 0.01em;
  color: #3a5f8a;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #3a5f8a;
  margin-bottom: 0.35rem;
  padding-bottom: 0.5rem;
}

/* ── Course list ── */

.course-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.course-list li {}

.course-title {
  font-size: 1rem;
  font-style: italic;
}

.course-title a {
  color: #3a5f8a;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #c2d4e8;
  transition: text-decoration-color 0.15s;
}

.course-title a:hover {
  text-decoration-color: #3a5f8a;
}

.course-meta {
  font-size: 0.875rem;
  color: #888;
  margin-top: 0.2rem;
}

/* ── Paper list ── */

.paper-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.paper-title {
  font-style: italic;
  font-size: 1rem;
}

.paper-title a {
  color: #3a5f8a;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #c2d4e8;
  transition: text-decoration-color 0.15s;
}

.paper-title a:hover {
  text-decoration-color: #3a5f8a;
}

.paper-venue {
  font-size: 0.875rem;
  color: #888;
  margin-top: 0.2rem;
}

.paper-abstract {
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.5rem;
}

/* ── Research page extras ── */

.committee {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.75rem;
}

.paper-note {
  font-size: 0.875rem;
  color: #999;
  font-style: italic;
}

.paper-ms {
  font-style: normal;
  font-size: 0.85rem;
  color: #aaa;
}

/* ── CV embed ── */

.cv-embed {
  width: 100%;
  height: 82vh;
  border: 1px solid #dedad4;
  display: block;
}

/* ── Footer ── */

footer {
  border-top: 1px solid #dedad4;
  text-align: center;
  padding: 2rem;
  font-size: 0.8rem;
  color: #bbb;
  margin-top: 4rem;
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .home-layout {
    flex-direction: column-reverse;
    gap: 1rem;
  }

  .home-image {
    flex: unset;
    width: 100%;
  }

  .page-image-wrap {
    float: none;
    width: 100%;
    margin: 0 0 2rem 0;
  }

  nav a {
    padding: 0.1rem 0.35rem;
  }
}
