/* Weishu Deng — personal site.
   Fixed dark navbar, single column of content cards.
   Every card shares one left edge (--pad) and one item rhythm. */

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --card-head: #fbfbfc;
  --nav: #343a40;
  --nav-ink: #ced4da;
  --nav-ink-on: #ffffff;
  --ink: #1f2328;
  --ink-soft: #4b5259;
  --ink-faint: #6c757d;
  --rule: #edf0f2;
  --rule-strong: #e1e5e9;
  --link: #0069d9;
  --link-hover: #003d80;
  --accent: #138a9c;
  --accent-wash: #e6f5f7;
  --chip-bg: #f3f5f7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --sans: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --head: "Fira Sans", "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
  --mono: "Source Code Pro", SFMono-Regular, Menlo, Consolas, monospace;
  --shell: 880px;
  --navh: 56px;
  --pad: 28px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a; --card: #1d2025; --card-head: #21252a; --nav: #0e1013;
    --nav-ink: #adb5bd; --ink: #e7eaed; --ink-soft: #b3bac1; --ink-faint: #868e96;
    --rule: #2a2f35; --rule-strong: #343a41; --link: #61aaf2; --link-hover: #8ec5ff;
    --accent: #3bc9db; --accent-wash: #12343a; --chip-bg: #262a30;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  --bg: #15171a; --card: #1d2025; --card-head: #21252a; --nav: #0e1013;
  --nav-ink: #adb5bd; --ink: #e7eaed; --ink-soft: #b3bac1; --ink-faint: #868e96;
  --rule: #2a2f35; --rule-strong: #343a41; --link: #61aaf2; --link-hover: #8ec5ff;
  --accent: #3bc9db; --accent-wash: #12343a; --chip-bg: #262a30;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--navh) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
strong, b { font-weight: 700; }
p { margin: 0; }

/* ---------- navbar ---------- */
.topnav { position: fixed; inset: 0 0 auto 0; height: var(--navh); background: var(--nav); z-index: 50; }
.topnav-inner {
  max-width: var(--shell); height: 100%; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 8px;
}
.brand { font-family: var(--head); font-weight: 700; font-size: 17px; color: var(--nav-ink-on); margin-right: auto; white-space: nowrap; }
.brand:hover { color: var(--nav-ink-on); text-decoration: none; }
.navlinks { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a { color: var(--nav-ink); font-size: 14px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.navlinks a:hover { color: var(--nav-ink-on); text-decoration: none; background: rgba(255,255,255,.07); }
.theme-toggle {
  background: none; border: 0; color: var(--nav-ink); cursor: pointer;
  width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; flex: none;
}
.theme-toggle:hover { color: var(--nav-ink-on); background: rgba(255,255,255,.07); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------- layout ---------- */
.shell { max-width: var(--shell); margin: 0 auto; padding: calc(var(--navh) + 28px) 20px 36px; }
.content { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.card {
  background: var(--card); border: 1px solid var(--rule-strong);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-head {
  font-family: var(--head); font-weight: 600; font-size: 15px; letter-spacing: .01em;
  padding: 13px var(--pad); background: var(--card-head); border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; gap: 10px;
}
.hicon { color: var(--accent); font-size: 9px; }
.head-link { margin-left: auto; font-family: var(--sans); font-weight: 400; font-size: 13px; color: var(--ink-faint); }
.head-link:hover { color: var(--link); text-decoration: none; }
.card-body { padding: 22px var(--pad) 24px; }

/* ---------- about / profile ---------- */
.hero { display: flex; align-items: center; gap: 24px; padding-bottom: 20px; margin-bottom: 18px; border-bottom: 1px solid var(--rule); }
.avatar {
  width: 112px; height: 112px; flex: none; border-radius: 50%; overflow: hidden;
  position: relative; background: linear-gradient(135deg, var(--accent), var(--link));
  display: grid; place-items: center; box-shadow: 0 0 0 4px var(--accent-wash);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.initials { font-family: var(--head); font-size: 40px; font-weight: 700; color: #fff; }
.hero-info { min-width: 0; }
.name { font-family: var(--head); font-size: 26px; font-weight: 700; line-height: 1.2; margin: 0 0 4px; }
.affil { font-size: 15px; color: var(--ink-soft); }
.email { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-top: 2px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.social {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.social svg { flex: none; }
.social:hover { text-decoration: none; color: var(--link); border-color: var(--link); background: var(--accent-wash); }
.about-text { display: flex; flex-direction: column; gap: 10px; }

/* ---------- shared item rhythm (pubs, open source, experience) ---------- */
.item, .entry { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.item:first-child, .entry:first-child, .label + .entry { padding-top: 0; }
.item:last-child, .entry:last-child, .entry:has(+ .label) { border-bottom: 0; padding-bottom: 0; }

.item-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.item-title, .pub-title, .entry-title { font-family: var(--head); font-weight: 600; font-size: 16px; line-height: 1.4; color: var(--ink); }
a.item-title { color: var(--link); }
.item-desc { margin-top: 4px; font-size: 15px; color: var(--ink-soft); }
.item-desc strong { color: var(--ink); }

/* venue / role pill — same style everywhere */
.venue {
  display: inline-block; vertical-align: 2px; margin-left: 6px; white-space: nowrap;
  font-family: var(--mono); font-size: 12px; font-weight: 600; line-height: 1.5;
  padding: 1px 8px; border-radius: 6px; background: var(--accent-wash); color: var(--accent);
}
.item-top .venue { margin-left: 0; vertical-align: 0; }

/* ---------- publications ---------- */
.authors { margin-top: 3px; font-size: 14px; color: var(--ink-soft); }
.authors b { color: var(--ink); }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-size: 12px; font-weight: 700; line-height: 1; padding: 6px 10px;
  border-radius: 6px; background: var(--chip-bg); color: var(--ink-soft);
}
.chip:hover { text-decoration: none; background: var(--accent-wash); color: var(--link); }

/* ---------- experience ---------- */
.label {
  font-family: var(--head); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 12px;
}
.entry + .label, .entry ~ .label { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--rule-strong); }
.entry-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; }
.entry-sub { color: var(--ink-soft); font-size: 15px; }
.entry-sub::before { content: "·"; margin: 0 6px 0 2px; color: var(--ink-faint); }
.entry-meta { font-size: 13px; color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry p { margin-top: 4px; font-size: 15px; color: var(--ink-soft); }
.entry ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: 15px; color: var(--ink-soft); }
.entry li { position: relative; padding-left: 16px; margin: 3px 0; }
.entry li::before {
  content: ""; position: absolute; left: 2px; top: .68em; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent);
}

/* ---------- blog ---------- */
.post-date { margin-left: auto; font-size: 13px; color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { font-size: 15px; color: var(--ink-faint); font-style: italic; }

.footer { text-align: center; font-size: 13px; color: var(--ink-faint); padding: 4px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .navlinks { display: none; }
}
@media (max-width: 560px) {
  :root { --pad: 18px; }
  .shell { padding-left: 14px; padding-right: 14px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .avatar { width: 96px; height: 96px; }
  .name { font-size: 23px; }
}
