/* ==========================================================================
   Academic personal website — Peicheng Wu
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --text: #1f2328;
  --text-muted: #57606a;
  --accent: #ba0c2f;          /* OSU scarlet */
  --accent-dark: #8f0a24;
  --link: #0a5dc2;
  --border: #d8dee4;
  --max-width: 860px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-alt: #161b22;
    --text: #e6edf3;
    --text-muted: #9da7b1;
    --accent: #ff5470;
    --accent-dark: #ff7a90;
    --link: #58a6ff;
    --border: #30363d;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  border-top: 4px solid var(--accent);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.portrait {
  width: 150px;
  height: 150px;
  margin-top: 1.1rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 15%;
  border: 3px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.header-text h1 {
  margin: 0 0 0.25rem;
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.chinese-name {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 1.4rem;
  margin-left: 0.4rem;
}

.header-text .tagline {
  margin: 0.15rem 0;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.header-links {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  font-size: 0.92rem;
}

.header-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
}

.header-links a:hover { color: var(--accent); text-decoration: none; }

.header-links svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

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

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  gap: 1.6rem;
  overflow-x: auto;
}

.nav-inner a {
  padding: 0.7rem 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav-inner a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Main content
   -------------------------------------------------------------------------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}

section { padding-top: 2.2rem; scroll-margin-top: 3.5rem; }

h2 {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* About */
.about p { margin: 0.6rem 0; }

.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding: 0;
  list-style: none;
}

.interests li {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* News */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-list li {
  display: flex;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border);
}

.news-list time {
  flex-shrink: 0;
  width: 6.2rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.1rem;
}

/* Publications */
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: pub;
}

.pub-item {
  position: relative;
  margin: 0 0 1.1rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}

.pub-title {
  font-weight: 600;
  font-size: 1.02rem;
  margin: 0 0 0.2rem;
}

.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--accent); text-decoration: none; }

.pub-authors {
  margin: 0 0 0.15rem;
  font-size: 0.93rem;
  color: var(--text-muted);
}

.pub-authors .me { font-weight: 700; color: var(--text); }

.pub-venue {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pub-venue em { color: var(--accent-dark); font-style: italic; }

.pub-links {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pub-links a {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
  color: var(--link);
  background: var(--bg);
}

.pub-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.pub-year-group {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 1.4rem 0 0.7rem;
}

/* CV / education timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: flex;
  gap: 1.2rem;
  padding: 0.55rem 0;
}

.timeline .period {
  flex-shrink: 0;
  width: 8.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  padding-top: 0.1rem;
}

.timeline .what strong { display: block; }
.timeline .what span { color: var(--text-muted); font-size: 0.92rem; }

/* Contact */
.contact-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  margin-top: 0.5rem;
}

.contact-card p { margin: 0.3rem 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.3rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.2rem 1.5rem;
  }
  .header-links { justify-content: center; }
  .timeline li { flex-direction: column; gap: 0.1rem; }
  .timeline .period { width: auto; }
  .news-list li { flex-direction: column; gap: 0.1rem; }
}
