/* ---------------------------------------------------------------
   Zihao Su — personal site
   Single stylesheet, no build step.
   --------------------------------------------------------------- */

:root {
  --bg:        #fbfaf8;
  --surface:   #ffffff;
  --text:      #1a1c1e;
  --text-soft: #52585f;
  --text-mute: #7b828a;
  --line:      #e4e2dd;
  --accent:    #0f6b64;
  --accent-soft:#e6f2f0;
  --gold:      #8a6d1f;
  --gold-soft: #f7f0dc;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --measure: 43rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #101214;
    --surface:   #16191c;
    --text:      #e9e7e3;
    --text-soft: #b3b8bd;
    --text-mute: #868d94;
    --line:      #2a2e33;
    --accent:    #5ec8bd;
    --accent-soft:#12312e;
    --gold:      #d8b95f;
    --gold-soft: #2e2716;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- header / nav ---------- */

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-head .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-top: 1.25rem; padding-bottom: 1.25rem;
}
.brand {
  font-family: var(--serif);
  font-size: 1.1rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--accent); }
.nav { display: flex; gap: 1.4rem; font-size: 0.92rem; }
.nav a { color: var(--text-soft); }
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- typography ---------- */

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--text); }

h1 { font-size: 2.5rem; letter-spacing: -0.015em; margin: 0 0 0.4rem; }
h2 {
  font-size: 1.05rem; font-family: var(--sans); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-mute);
  margin: 3.25rem 0 1.1rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--line);
}
h3 { font-size: 1.15rem; margin: 0 0 0.3rem; }

p { margin: 0 0 1.1rem; color: var(--text-soft); }
main p strong, main li strong { color: var(--text); font-weight: 600; }

.lede { font-size: 1.12rem; color: var(--text-soft); }

/* main also carries .wrap, whose padding shorthand would zero these out —
   the more specific selector keeps the vertical rhythm. */
main.wrap { padding-top: 3rem; padding-bottom: 4rem; }

/* ---------- hero ---------- */

.hero { margin-bottom: 0.5rem; }
.hero .role {
  font-size: 1.05rem; color: var(--text-soft); margin: 0 0 1.25rem;
}
.hero .role em { color: var(--text); font-style: normal; font-weight: 600; }

.status {
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 0.35rem 0.9rem;
  font-size: 0.85rem; font-weight: 600; margin-bottom: 1.75rem;
}
.status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex: none;
}

.links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.5rem; padding: 0; list-style: none; }
.links a {
  display: inline-block; border: 1px solid var(--line); background: var(--surface);
  border-radius: 7px; padding: 0.4rem 0.85rem; font-size: 0.9rem; color: var(--text-soft);
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- research threads ---------- */

.thread {
  border-left: 2px solid var(--line);
  padding: 0 0 0 1.25rem; margin: 0 0 2.25rem;
}
.thread:hover { border-left-color: var(--accent); }
.thread h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; }
.thread p { margin-bottom: 0.5rem; }
.thread .refs { font-size: 0.88rem; color: var(--text-mute); margin: 0; }

/* ---------- publications ---------- */

.pub { margin: 0 0 1.9rem; }
.pub-title { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; line-height: 1.4; margin: 0 0 0.3rem; color: var(--text); }
.pub-authors { font-size: 0.92rem; color: var(--text-soft); margin: 0 0 0.4rem; }
.pub-authors .me { color: var(--text); font-weight: 600; }
.pub-meta { font-size: 0.88rem; color: var(--text-mute); margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.tag {
  display: inline-block; border-radius: 5px; padding: 0.12rem 0.5rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  background: var(--accent-soft); color: var(--accent);
}
.tag.award { background: var(--gold-soft); color: var(--gold); }
.tag.quiet { background: transparent; color: var(--text-mute); border: 1px solid var(--line); font-weight: 500; }

.note {
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  padding: 1rem 1.15rem; font-size: 0.93rem; color: var(--text-soft); margin: 0 0 2rem;
}
.note p:last-child { margin-bottom: 0; }

/* ---------- CV ---------- */

.entry { margin: 0 0 1.6rem; }
.entry-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.entry-head h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; margin: 0; }
.entry .when { font-size: 0.87rem; color: var(--text-mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry p, .entry ul { margin: 0.3rem 0 0; font-size: 0.95rem; }
.entry ul { padding-left: 1.15rem; }
.entry li { margin-bottom: 0.25rem; }

.metrics { display: flex; gap: 2rem; flex-wrap: wrap; margin: 1.75rem 0 1rem; padding: 0; list-style: none; }
.metrics div { }
.metrics .n { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; display: block; line-height: 1.1; }
.metrics .k { font-size: 0.82rem; color: var(--text-mute); letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line); margin-top: 2rem;
  padding: 1.75rem 0 2.5rem; font-size: 0.87rem; color: var(--text-mute);
}
.site-foot .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-foot a { color: var(--text-mute); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  h1 { font-size: 2rem; }
  .site-head .wrap { flex-direction: column; gap: 0.6rem; align-items: flex-start; }
  .nav { gap: 1.1rem; }
}
