/* ============================================================
   Pengcheng Zhang — Personal site
   Simple, readable academic design with system fonts
   ============================================================ */

:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-soft: #4a4a4a;
  --text-muted: #888;
  --border: #e2e2e2;
  --border-soft: #ededed;
  --link: #1e3a5f;
  --link-hover: #0c2340;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
          Ubuntu, Cantarell, "Helvetica Neue", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --max-w: 1280px;
  --max-w-wide: 1440px;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

/* ===== Nav ===== */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  gap: 28px;
}

.nav-inner a {
  font-size: 16px;
  color: var(--text-soft);
  text-decoration: none;
  transition: color 120ms ease;
}

.nav-inner a:hover { color: var(--link); }

.nav-inner a.current {
  color: var(--text);
  font-weight: 600;
}

/* ===== Main / shared ===== */

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 40px 32px;
}

main.wide { max-width: var(--max-w-wide); }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 120ms ease;
}

a:hover { color: var(--link-hover); }

p { margin-bottom: 16px; }
p:last-child { margin-bottom: 0; }

section { margin-bottom: 40px; }

h2 {
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}

/* ===== Profile (home header) ===== */

.profile {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 48px;
  align-items: start;
  margin-bottom: 48px;
}

.profile-main h1 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.profile-main h1 .cn-name {
  font-size: 28px;
  font-weight: 400;
  color: var(--text);
  margin-left: 10px;
  letter-spacing: 0;
}

.profile-main .contact-links {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 26px;
  line-height: 1.8;
}

.profile-main .contact-links a {
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 120ms ease, border-color 120ms ease;
}

.profile-main .contact-links a:hover {
  color: var(--link);
  border-bottom-color: var(--link);
}

.profile-main .bio p {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 16px;
}

.profile-main .bio p:last-child { margin-bottom: 0; }

.profile-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
  margin-top: 48px;
}

/* ===== CV lists (Education, Appointments) ===== */

ul.cv-list {
  list-style: none;
}

ul.cv-list li {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  padding: 8px 0;
  font-size: 16px;
  color: var(--text);
  align-items: baseline;
}

ul.cv-list .date {
  color: var(--text-muted);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ===== Page title (Publications / Gallery / Calendar) ===== */

.page-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}

.page-sub {
  color: var(--text-muted);
  font-size: 16px;
  margin-top: -24px;
  margin-bottom: 36px;
}

/* ===== Publications ===== */

.pub-group { margin-bottom: 36px; }

.pub-list {
  list-style: none;
}

.pub-list li {
  padding: 8px 0 8px 1.8em;
  text-indent: -1.8em;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 6px;
}

.pub-list li strong {
  color: var(--text);
  font-weight: 600;
}

.pub-list li em {
  font-style: italic;
}

.pub-list li sup {
  font-size: 0.75em;
}

.pub-list li a.meta {
  font-size: 14.5px;
  color: var(--link);
  text-decoration: none;
  margin-left: 6px;
  white-space: nowrap;
}

.pub-list li a.meta:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.footnote {
  margin-top: 24px;
  font-size: 14.5px;
  color: var(--text-muted);
}

/* ===== Gallery ===== */

.video-card {
  margin: 0 0 32px 0;
}

.video-card video {
  width: 100%;
  display: block;
  border-radius: 4px;
  background: #000;
  border: 1px solid var(--border);
}

.video-card figcaption {
  padding-top: 10px;
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.5;
}

.video-card figcaption .loc {
  display: block;
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 3px;
}

/* ===== Calendar ===== */

.calendar-frame {
  width: 100%;
  height: 760px;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: #fafafa;
}

.calendar-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ===== Footer ===== */

footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ===== Responsive ===== */

@media (max-width: 760px) {
  body { font-size: 16px; }

  .nav-inner { padding: 14px 20px; gap: 20px; }
  .nav-inner a { font-size: 15px; }

  main { padding: 40px 20px 24px; }

  .profile {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 36px;
  }
  .profile-photo {
    width: 180px;
    height: 180px;
    max-width: none;
    margin-top: 0;
    order: -1;
  }
  .profile-main h1 { font-size: 24px; }
  .profile-main h1 .cn-name {
    display: block;
    margin-left: 0;
    margin-top: 4px;
    font-size: 24px;
  }

  ul.cv-list li {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px 0;
  }

  .page-title { font-size: 24px; margin-bottom: 28px; }
  .page-sub { margin-top: -20px; margin-bottom: 28px; }

  .calendar-frame { height: 600px; }

  footer {
    flex-direction: column;
    gap: 6px;
  }
}

/* ===== Print ===== */

@media print {
  .nav, footer { display: none; }
  main { max-width: 100%; padding: 0; }
  a { color: var(--text); text-decoration: none; }
}
