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

/* ===== Base ===== */
body {
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: 17px;
  line-height: 1.7;
  color: #2c2c2c;
  background-color: #fdfdfd;
}

/* ===== Layout wrapper ===== */
.site-wrapper {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ===== Header / Nav ===== */
header {
  border-bottom: 2px solid #1a3a1a;
  padding: 20px 0 0;
  margin-bottom: 32px;
}

header .site-title {
  font-size: 1.6em;
  font-weight: 700;
  color: #1a3a1a;
  margin-bottom: 2px;
}

header .site-subtitle {
  font-size: 0.95em;
  color: #666;
  margin-bottom: 14px;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  margin: 0;
}

nav li {
  margin: 0;
}

nav li a {
  display: block;
  padding: 10px 18px;
  text-decoration: none;
  color: #444;
  font-size: 0.92em;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

nav li a:hover {
  color: #1a3a1a;
  border-bottom-color: #1a3a1a;
}

nav li.active a {
  color: #1a3a1a;
  border-bottom-color: #1a3a1a;
}

/* ===== Links ===== */
a {
  color: #2a5e2a;
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: #1a3a1a;
  text-decoration: underline;
}

/* ===== Homepage layout ===== */
.homepage {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}

.homepage-sidebar {
  flex-shrink: 0;
  width: 200px;
  text-align: center;
}

.homepage-sidebar img {
  width: 180px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.homepage-sidebar .name {
  font-size: 1.2em;
  font-weight: 700;
  color: #1a3a1a;
  margin-bottom: 4px;
}

.homepage-main {
  flex: 1;
  min-width: 0;
}

/* ===== Contact block ===== */
.contact-info {
  font-size: 0.92em;
  color: #555;
  line-height: 1.8;
  margin-bottom: 24px;
}

.contact-info strong {
  color: #333;
}

/* ===== Section headings ===== */
h2 {
  font-size: 1.25em;
  color: #1a3a1a;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
  margin: 30px 0 14px;
}

h2:first-child,
.homepage-main h2:first-of-type {
  margin-top: 0;
}

/* ===== Quick links ===== */
.quick-links {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.quick-links li {
  margin-bottom: 6px;
}

.quick-links li a {
  font-weight: 600;
}

/* ===== Content sections ===== */
p {
  margin-bottom: 10px;
}

section {
  margin-bottom: 36px;
}

/* ===== Paper list ===== */
.paper-list {
  list-style: none;
  padding: 0;
  counter-reset: paper;
}

.paper-list > li {
  margin-bottom: 18px;
  padding-left: 0;
}

.paper-title {
  font-weight: 700;
}

.paper-meta {
  font-size: 0.9em;
  color: #666;
}

.paper-links {
  font-size: 0.88em;
  margin-top: 2px;
}

.paper-links a {
  margin-right: 10px;
  font-weight: 600;
}

/* ===== Talks list ===== */
.talks-list {
  list-style: none;
  padding: 0;
}

.talks-list > li {
  margin-bottom: 14px;
  padding-left: 0;
  line-height: 1.6;
}

.talk-date {
  font-weight: 700;
  color: #555;
  font-size: 0.9em;
}

.talk-type {
  display: inline-block;
  font-size: 0.78em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background-color: #3a6e3a;
  padding: 1px 7px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 4px;
}

.talk-type.conference { background-color: #2a5e8a; }
.talk-type.internal { background-color: #888; }
.talk-type.working-group { background-color: #8a6a2a; }

/* ===== Teaching list ===== */
h3 {
  font-size: 1.05em;
  color: #333;
  margin: 22px 0 8px;
}

.teaching-list {
  padding-left: 22px;
}

.teaching-list li {
  margin-bottom: 8px;
}

/* ===== Misc page boxes ===== */
.misc-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.misc-section {
  flex: 1 1 340px;
  min-width: 0;
}

.misc-section ul {
  padding-left: 20px;
}

.misc-section li {
  margin-bottom: 8px;
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid #ddd;
  margin-top: 50px;
  padding: 16px 0;
  font-size: 0.82em;
  color: #999;
  text-align: center;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .site-wrapper {
    padding: 0 16px;
  }

  header {
    margin-bottom: 24px;
  }

  header .site-title {
    font-size: 1.3em;
  }

  nav li a {
    padding: 8px 12px;
    font-size: 0.85em;
  }

  .homepage {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .homepage-sidebar {
    width: auto;
  }

  .homepage-sidebar img {
    width: 150px;
  }

  h2 {
    font-size: 1.15em;
    margin-top: 24px;
  }

  .misc-grid {
    flex-direction: column;
  }

  .talks-list > li {
    margin-bottom: 16px;
  }
}
