/* ============================================================
   style.css — Chunhui Liu personal site (minimal)
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --bg:         #f9f9f7;
  --bg-alt:     #f2f2f0;
  --text:       #1a1a1a;
  --text-muted: #717171;
  --border:     #e0e0de;
  --card-bg:    #ffffff;
  --nav-bg:     rgba(249, 249, 247, 0.90);
  --shadow:     0 1px 4px rgba(0,0,0,0.07);
}

[data-theme="dark"] {
  --bg:         #141414;
  --bg-alt:     #1c1c1c;
  --text:       #e5e5e5;
  --text-muted: #888888;
  --border:     #2e2e2e;
  --card-bg:    #1c1c1c;
  --nav-bg:     rgba(20, 20, 20, 0.92);
  --shadow:     0 1px 4px rgba(0,0,0,0.3);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  transition: background 0.2s, color 0.2s;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: text-decoration-color 0.15s, opacity 0.15s;
}
a:hover {
  text-decoration-color: var(--text-muted);
  opacity: 0.8;
}

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

/* ---------- Layout ---------- */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.nav-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 28px;
  height: 52px;
  display: flex;
  align-items: center;
}

.nav-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
  letter-spacing: -0.2px;
}
.nav-name:hover { opacity: 0.6; text-decoration: none; }

.nav-links {
  display: flex;
  gap: 24px;
  margin-right: 20px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.1px;
}
.nav-links a:hover {
  color: var(--text);
  opacity: 1;
  text-decoration: none;
}

/* ---------- Theme toggle ---------- */
.theme-btn {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.theme-btn:hover { background: var(--bg-alt); color: var(--text); }
.theme-btn svg { width: 15px; height: 15px; }

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun  { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ---------- Hero ---------- */
.hero {
  padding: 104px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 48px;
  align-items: start;
}

.hero-text h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 18px;
}

.bio {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.7;
}

/* Social links — plain text style */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 20px;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  margin-right: 20px;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.social-btn:hover {
  color: var(--text);
  border-bottom-color: var(--text);
  opacity: 1;
  text-decoration: none;
}
.social-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.hero-photo img {
  width: 148px; height: 148px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  filter: grayscale(8%);
}

/* ---------- Hiring note ---------- */
.hiring-note {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  font-size: 13.5px;
  color: var(--text-muted);
}
.hiring-note a {
  color: var(--text);
  font-weight: 500;
}

/* ---------- Sections ---------- */
.section {
  padding: 64px 0;
}
.section-alt {
  background: var(--bg-alt);
}
.section h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}
.section-desc {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 600px;
  margin-bottom: 36px;
  line-height: 1.65;
}

/* ---------- Publications — flat list ---------- */
.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.15s;
}
.pub-card:first-child { border-top: 1px solid var(--border); }
.pub-card:hover { opacity: 0.85; }

.pub-thumb {
  width: 120px; height: 84px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  margin-top: 2px;
}

.pub-venue {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  display: block;
}

.pub-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
}
.pub-title a {
  text-decoration: none;
  color: inherit;
}
.pub-title a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 1;
}

.pub-authors {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}
.pub-authors strong { color: var(--text); font-weight: 600; }

.pub-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.pub-links a {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}
.pub-links a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
  opacity: 1;
}

.pub-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.55;
}

/* ---------- Blog grid ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.blog-card:hover {
  border-color: var(--text-muted);
  box-shadow: var(--shadow);
  opacity: 1;
  text-decoration: none;
}

.blog-card-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.blog-card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.blog-card-date { font-size: 12px; color: var(--text-muted); }
.blog-card-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 2px;
}

.blog-empty {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}
.btn-text:hover {
  color: var(--text);
  border-bottom-color: var(--text);
  opacity: 1;
  text-decoration: none;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }

/* ---------- Blog post page ---------- */
.post-header {
  padding: 100px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 24px;
}
.post-back:hover { color: var(--text); opacity: 1; text-decoration: none; }

.post-header h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-bottom: 10px;
}
.post-meta { font-size: 13px; color: var(--text-muted); }

.post-body {
  padding-bottom: 80px;
  max-width: 660px;
  font-size: 15px;
  line-height: 1.75;
}
.post-body h2 { font-size: 20px; font-weight: 600; margin: 40px 0 12px; letter-spacing: -0.2px; }
.post-body h3 { font-size: 17px; font-weight: 600; margin: 28px 0 8px; }
.post-body p { margin-bottom: 18px; color: var(--text-muted); }
.post-body p strong { color: var(--text); }
.post-body ul, .post-body ol { padding-left: 24px; margin-bottom: 18px; color: var(--text-muted); }
.post-body li { margin-bottom: 6px; }
.post-body pre {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 7px; padding: 16px; overflow-x: auto;
  margin-bottom: 18px; font-size: 13px;
}
.post-body code {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 5px; font-size: 13px;
}
.post-body pre code { background: none; border: none; padding: 0; }
.post-body blockquote {
  border-left: 2px solid var(--border);
  padding-left: 16px; color: var(--text-muted);
  font-style: italic; margin-bottom: 18px;
}
.post-body img {
  border-radius: 6px; margin: 24px 0;
  border: 1px solid var(--border);
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-photo { order: -1; }
  .hero-photo img { width: 100px; height: 100px; }
  .hero-text h1 { font-size: 26px; }
  .pub-card { grid-template-columns: 1fr; }
  .pub-thumb { width: 100%; height: 140px; }
  .nav-links { display: none; }
  .blog-grid { grid-template-columns: 1fr; }
}
