/* ============================================================
   Zongzhe Xu - academic homepage
   Palette: "Sage & Linen" — muted sage green on soft linen
   ============================================================ */

:root {
  /* Palette: "Sage & Linen" */
  --bg:         #f5f2ea;  /* soft linen, very lightly warmed */
  --bg-panel:   #e4e4d6;  /* pale sage stone (cards) */
  --bg-accent:  #cfd2c0;  /* deeper sage for badges */
  --rule:       #b3b7a3;  /* soft sage-grey rule */

  --text:       #1d2521;  /* deep pine for headings/strong */
  --text-soft:  #2e3732;  /* body copy */
  --muted:      #6b6e62;  /* warm grey-green for meta */

  --link:       #3f6659;  /* muted sage green */
  --link-hover: #a8742a;  /* warm antique gold */
  --accent:     #3f6659;  /* sage for rules, badges, borders */
  --news-text:  #4f5f5a;  /* subdued sage-ink for news copy */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino,
               "Noto Serif", serif;
  font-size: 16px;
  line-height: 1.62;
}

.container {
  width: min(1180px, calc(100vw - 96px));
  margin: 0 auto;
  padding: 56px 0 76px;
  transform: translateX(-40px);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--link-hover); }

h1, h2, h3 {
  color: var(--text);
  font-family: "Iowan Old Style", Georgia, "Palatino Linotype", Palatino, serif;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

h1 {
  font-size: 2rem;
  margin: 0 0 4px;
  color: var(--text);
}

h2 {
  font-size: 1.3rem;
  margin: 40px 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
  color: var(--text);
}

p { margin: 0 0 12px; }

em { color: var(--text-soft); }
strong { color: #173d34; }

/* ---------- Profile header ---------- */
.profile {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 24px 34px;
  background:
    radial-gradient(circle at 14% 22%, rgba(63, 102, 89, 0.055) 0 1px, transparent 1.5px),
    radial-gradient(circle at 82% 68%, rgba(168, 116, 42, 0.045) 0 1px, transparent 1.5px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 42%),
    var(--bg-panel);
  background-size: 18px 18px, 22px 22px, 100% 100%, auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 2px 0 var(--bg-accent);
}
.profile::before,
.profile::after {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  pointer-events: none;
}
.profile::before {
  top: 12px;
  left: 12px;
  border-top: 2px solid rgba(63, 102, 89, 0.58);
  border-left: 2px solid rgba(63, 102, 89, 0.58);
  border-top-left-radius: 5px;
}
.profile::after {
  right: 12px;
  bottom: 12px;
  border-right: 2px solid rgba(63, 102, 89, 0.58);
  border-bottom: 2px solid rgba(63, 102, 89, 0.58);
  border-bottom-right-radius: 5px;
}

.avatar { flex: 0 0 210px; }

.avatar img {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  background: var(--bg-accent);
  box-shadow: 0 3px 12px rgba(29, 37, 33, 0.14);
}

.profile-info {
  flex: 0 1 520px;
  min-width: 260px;
}

.profile-info .tagline {
  color: var(--muted);
  margin: 2px 0 6px;
  font-size: 1.05rem;
  font-style: italic;
}

.profile-info p { margin: 2px 0; }
.profile-info .links { margin-top: 12px; }
.profile-info .links a { font-weight: 600; }

/* ---------- Lists ---------- */
ul { padding-left: 22px; }
ul li { margin-bottom: 6px; }

.interests { list-style: square; }
.interests li::marker { color: var(--accent); }

.news {
  list-style: none;
  padding: 0;
  margin: 0;
}
.news li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  column-gap: 18px;
  align-items: baseline;
  padding: 4px 2px;
  border-bottom: 1px dashed var(--rule);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 0.84rem;
  line-height: 1.32;
}
.news li:last-child { border-bottom: none; }
.news .date {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.news .news-text {
  min-width: 0;
  color: var(--news-text);
}
.news .news-text em {
  color: #173d34;
  font-weight: 700;
}

/* ---------- Experience / Education ---------- */
.exp { list-style: none; padding-left: 0; }
.exp li {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--rule);
}
.exp li:last-child { border-bottom: none; }
.exp .when {
  flex: 0 0 245px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.exp .what { flex: 1 1 380px; }

/* ---------- Publications ---------- */
.note { color: var(--muted); margin-bottom: 16px; }
.note .sub { font-size: 0.92em; }

.pub {
  display: flex;
  gap: 22px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
  align-items: flex-start;
}
.pub:last-child { border-bottom: none; }

.pub-fig { flex: 0 0 240px; }
.pub-fig a {
  display: block;
  width: 240px;
  height: 160px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg-panel);
  box-shadow: 0 1px 4px rgba(29, 37, 33, 0.10);
}
.pub-fig img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pub-fig a:hover {
  box-shadow: 0 4px 10px rgba(29, 37, 33, 0.18);
}
.pub-fig a:hover img {
  transform: translateY(-1px);
}

.pub-info { flex: 1 1 auto; min-width: 0; }

.pub .venue {
  display: inline-block;
  background: var(--accent);
  color: #f6f4ec;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 8px;
}

.pub .title {
  font-weight: 700;
  font-size: 1.08rem;
  margin-bottom: 4px;
  line-height: 1.35;
}
.pub .title a { color: var(--text); }
.pub .title a:hover { color: var(--link-hover); }

.pub .authors { margin-bottom: 2px; color: var(--text-soft); }
.pub .authors strong { color: var(--text); }

.pub .meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 6px; font-style: italic; }

.pub .pub-links a {
  font-size: 0.9rem;
  margin-right: 12px;
  font-weight: 600;
}

.pub .desc {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.97rem;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 52px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .container {
    width: calc(100vw - 36px);
    padding: 28px 0 48px;
    transform: none;
  }
  .profile { padding: 16px; gap: 20px; }
  .avatar { flex-basis: 100%; display: flex; justify-content: center; }
  .avatar img { width: 170px; height: 170px; }
  .profile-info { text-align: center; }
  .pub { flex-direction: column; }
  .pub-fig {
    flex-basis: auto;
    width: min(100%, 300px);
  }
  .pub-fig a {
    width: min(100%, 300px);
    height: min(66.67vw, 200px);
  }
  .exp .when { flex-basis: 100%; }
}
