/* ============================================================
   Huihuo Zheng — Personal Academic Website
   Design: clean, minimal, professional
   ============================================================ */

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

:root {
  --navy:   #1b3a2d;
  --blue:   #2a9d8f;
  --sky:    #8ecfc9;
  --white:  #ffffff;
  --off:    #f4f9f6;
  --muted:  #5a6e65;
  --text:   #1e2d26;
  --border: #d4e6de;
  --accent: #e63946;
  --radius: 8px;
  --shadow: 0 2px 16px rgba(27,58,45,0.08);
  --font:   'Inter', 'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

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

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

img { max-width: 100%; display: block; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; color: var(--navy); }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { margin-bottom: 1rem; }

/* ---------- Navigation ---------- */
nav.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

nav.topnav .brand {
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

nav.topnav ul {
  display: flex;
  gap: 1.6rem;
  list-style: none;
}

nav.topnav ul a {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

nav.topnav ul a:hover { color: var(--white); text-decoration: none; }

/* ---------- Layout Container ---------- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ---------- Section ---------- */
section {
  padding: 5rem 0;
}

.section-title {
  font-size: 1.6rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--blue);
  display: inline-block;
}

/* ---------- Hero ---------- */
#hero {
  background:
    radial-gradient(circle, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(135deg, #122518 0%, #1b3a2d 45%, #254d3a 100%);
  background-size: 28px 28px, 100% 100%;
  color: var(--white);
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 75% 50%, rgba(42,157,143,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero-photo img {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,0.25);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 0 0 8px rgba(42,157,143,0.15);
}

.hero-text h1 {
  color: var(--white);
  font-size: 2.6rem;
  margin-bottom: 0.25rem;
}

.hero-text .title {
  color: var(--sky);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.1rem;
}

.title-group {
  font-weight: 400;
  opacity: 0.85;
}

.hero-text .inst {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  margin-bottom: 0.9rem;
}

.inst-link {
  color: rgba(255,255,255,0.85);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.3);
}

.inst-link:hover {
  color: var(--white);
  text-decoration-color: var(--sky);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.hero-tag {
  background: rgba(42,157,143,0.22);
  border: 1px solid rgba(142,207,201,0.35);
  color: var(--sky);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: 99px;
  letter-spacing: 0.02em;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.5);
  color: var(--white);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--white);
  color: var(--white);
  text-decoration: none;
}

.btn-solid {
  background: var(--blue);
  color: var(--white);
  border: 1.5px solid var(--blue);
}

.btn-solid:hover {
  background: #238c7e;
  color: var(--white);
  text-decoration: none;
}

.btn-cv {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.7);
  color: var(--white);
  font-weight: 700;
}

.btn-cv:hover {
  background: rgba(255,255,255,0.25);
  color: var(--white);
  text-decoration: none;
}

.btn-outline-dark {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--navy);
}

.btn-outline-dark:hover {
  background: var(--off);
  color: var(--navy);
  text-decoration: none;
}

/* ---------- Stats row ---------- */
.stats-row {
  display: flex;
  gap: 2rem;
}

.stat { text-align: center; }
.stat .num { font-size: 1.6rem; font-weight: 700; color: var(--white); }
.stat .lbl { font-size: 0.78rem; color: rgba(255,255,255,0.65); letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- News Section ---------- */
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.news-list li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.news-list li:last-child { border-bottom: none; }

.news-date {
  flex-shrink: 0;
  width: 5.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.news-text { flex: 1; color: var(--text); line-height: 1.6; }

/* ---------- Research Areas ---------- */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.research-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.research-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(29,53,87,0.12);
}

.research-card .thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}

.research-card .icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.research-card h3 {
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.research-card p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* ---------- Publications (full list) ---------- */
.pub-list { margin-top: 2rem; }

.pub-year-group { margin-bottom: 2.5rem; }

.pub-year {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  border-left: 4px solid var(--blue);
  padding-left: 0.75rem;
  margin-bottom: 1rem;
}

.pub-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.pub-item:last-child { border-bottom: none; }

.pub-num {
  flex-shrink: 0;
  width: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  padding-top: 0.2rem;
  text-align: right;
}

.pub-body { flex: 1; }

.pub-title {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.97rem;
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

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

.pub-authors {
  font-size: 0.87rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

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

.pub-venue {
  font-size: 0.87rem;
  color: var(--text);
  font-style: italic;
  margin-bottom: 0.35rem;
}

/* One-sentence summary */
.pub-summary {
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 0.3rem;
  margin-bottom: 0.4rem;
  font-style: italic;
}

/* Link taxonomy row */
.pub-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.pub-links a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  transition: all 0.15s;
  text-decoration: none;
}

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

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.badge-cite      { background: #dbeafe; color: #1d4ed8; }
.badge-highlight { background: #fee2e2; color: #b91c1c; }
.badge-new       { background: #d1fae5; color: #065f46; }

/* Selected pubs on homepage - card style */
.sel-pub-grid {
  display: grid;
  gap: 1.25rem;
}

.sel-pub-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  transition: box-shadow 0.2s;
}

.sel-pub-card:hover {
  box-shadow: 0 4px 20px rgba(29,53,87,0.12);
}

.sel-pub-thumb {
  flex-shrink: 0;
  width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.sel-pub-thumb img {
  width: 130px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
}

.sel-pub-thumb .year-tag {
  background: var(--navy);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  width: 100%;
  text-align: center;
}

@media (max-width: 700px) {
  .sel-pub-thumb { display: none; }
}

/* ---------- Projects ---------- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.proj-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.proj-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(29,53,87,0.12);
}

.proj-card h3 {
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.proj-card h3 a { color: var(--navy); }
.proj-card h3 a:hover { color: var(--blue); text-decoration: none; }

.proj-card p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.75rem 0;
  line-height: 1.6;
}

.proj-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
  background: var(--off);
  color: var(--navy);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  font-weight: 500;
}

/* ---------- Talks (brief, on homepage) ---------- */
.talk-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.talk-list li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.talk-list li:last-child { border-bottom: none; }

.talk-date {
  flex-shrink: 0;
  width: 5.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.talk-body { flex: 1; line-height: 1.55; }

/* ---------- Talks (full, on About page) ---------- */
.talk-full-list { display: flex; flex-direction: column; gap: 1.5rem; }

.talk-year-group { margin-bottom: 0.5rem; }

.talk-entry {
  padding: 0.75rem 0 0.75rem 1rem;
  border-left: 3px solid var(--border);
  margin-top: 0.75rem;
}

.talk-meta {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.talk-title-full {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 0.15rem;
}

.talk-venue-full {
  font-size: 0.87rem;
  color: var(--muted);
}

/* ---------- About Page ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  align-items: start;
}

.about-photo img {
  width: 200px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.about-quick-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.about-content h3 {
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.edu-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.95rem;
}

/* Teaching list */
.teach-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.teach-list li {
  font-size: 0.95rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.55;
}

.teach-list li:last-child { border-bottom: none; }

.subsection-h {
  font-size: 1.05rem;
  color: var(--navy);
  font-weight: 700;
}

/* Prospective collaborators box */
.collab-box {
  background: var(--off);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  font-size: 0.95rem;
}

.collab-box p:last-child { margin-bottom: 0; }

/* Collab note on main page */
.collab-note {
  background: var(--off);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  font-size: 0.93rem;
  color: var(--text);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.contact-card .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.contact-card h3 { font-size: 0.9rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.contact-card p { margin: 0; font-size: 0.95rem; }

/* ---------- Footer ---------- */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.65);
  text-align: center;
  padding: 2rem;
  font-size: 0.88rem;
}

footer a { color: var(--sky); }

/* ---------- Utilities ---------- */
.mt1 { margin-top: 1rem; }
.mt2 { margin-top: 2rem; }
.text-muted { color: var(--muted); font-size: 0.9rem; }
.view-all { display: inline-block; margin-top: 1.5rem; }
.talks-more { display: inline-block; margin-top: 1.5rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ---------- Responsive / Mobile-first ---------- */

/* Tablet */
@media (max-width: 800px) {
  nav.topnav ul { gap: 1rem; }
  nav.topnav ul a { font-size: 0.84rem; }
  .research-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Large phone (≤ 700px) */
@media (max-width: 700px) {
  nav.topnav { padding: 0 1rem; height: auto; flex-wrap: wrap; gap: 0; }
  nav.topnav .brand { padding: 0.75rem 0; }
  nav.topnav ul { gap: 0.6rem; flex-wrap: wrap; padding: 0.4rem 0 0.6rem; }
  nav.topnav ul a { font-size: 0.82rem; }

  section { padding: 3rem 0; }
  .section-slim { padding: 2rem 0; }
  .container { padding: 0 1rem; }

  .hero-inner { flex-direction: column; text-align: center; gap: 1.5rem; padding: 0 1rem; }
  .hero-photo img { width: 140px; height: 140px; }
  .hero-text h1 { font-size: 1.9rem; }
  .hero-links { justify-content: center; gap: 0.5rem; }
  .hero-links .btn { font-size: 0.82rem; padding: 0.45rem 0.9rem; }
  .stats-row { justify-content: center; gap: 1.25rem; }
  .stat .num { font-size: 1.3rem; }

  .research-grid { grid-template-columns: 1fr; }
  .research-card .thumb { height: 140px; }

  .sel-pub-thumb { display: none; }
  .sel-pub-card { padding: 0.9rem 1rem; }

  .proj-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr 1fr; }

  .about-grid { grid-template-columns: 1fr; }
  .about-photo { display: flex; flex-direction: column; align-items: center; }
  .about-photo img { width: 140px; margin: 0 auto; }
  .about-quick-links { flex-direction: row; flex-wrap: wrap; justify-content: center; }

  .news-date { width: 4.5rem; font-size: 0.75rem; }
  .talk-date { width: 4.5rem; font-size: 0.75rem; }
  .talk-entry { padding-left: 0.75rem; }

  .collab-box { padding: 1rem 1.25rem; }
}

/* Small phone (≤ 480px) */
@media (max-width: 480px) {
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.4rem; }
  .section-title { font-size: 1.3rem; }

  nav.topnav ul { gap: 0.5rem; }
  nav.topnav ul a { font-size: 0.76rem; }

  .hero-text h1 { font-size: 1.7rem; }
  .hero-links { flex-direction: column; align-items: center; }
  .hero-links .btn { width: 100%; max-width: 220px; justify-content: center; }
  .stats-row { gap: 1rem; }

  .news-list li { flex-direction: column; gap: 0.1rem; }
  .news-date { width: auto; }
  .talk-list li { flex-direction: column; gap: 0.1rem; }
  .talk-date { width: auto; }

  .contact-grid { grid-template-columns: 1fr; }

  .pub-links { gap: 0.5rem; }
  .badge { font-size: 0.68rem; }

  .sel-pub-card { padding: 0.75rem; }
  .pub-title { font-size: 0.92rem; }
  .pub-summary { font-size: 0.82rem; }
}

/* ---------- Section background variants ---------- */
.section-white { background: var(--white); }
.section-off   { background: var(--off); }
.section-slim  { padding: 3rem 0; }

/* ---------- Intro paragraph ---------- */
.intro-text {
  font-size: 1.05rem;
  max-width: 780px;
  line-height: 1.8;
  color: var(--text);
}

.edu-text {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* ---------- Stat bar (publications page) ---------- */
.stat-bar-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-big {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}
