/* ===========================================================
   Aojie (Justin) Yuan — personal site
   Palette: warm paper, ink, one indigo accent, cardinal detail
   =========================================================== */

:root {
  --paper:      #fbfaf7;
  --paper-2:    #f4f1ea;
  --card:       #ffffff;
  --ink:        #1a1a1a;
  --ink-soft:   #454545;
  --ink-faint:  #7a746b;
  --line:       #e7e2d8;
  --accent:     #2f4a7a;   /* indigo */
  --accent-2:   #8f2d2d;   /* cardinal */
  --tag-bg:     #eef1f6;
  --tag-ink:    #35507e;
  --radius:     14px;
  --maxw:       1080px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: start;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 40px;
  padding-top: 64px;
}

.avatar {
  width: 200px;
  height: 200px;
  border-radius: 18px;
  object-fit: cover;
  filter: grayscale(8%) contrast(1.02);
  box-shadow: 0 10px 34px rgba(30,25,15,.16);
}

.name {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 560;
  letter-spacing: -.01em;
  margin: 22px 0 2px;
  line-height: 1.12;
}
.name .zh { display:block; font-size: 17px; color: var(--ink-faint); font-weight: 400; margin-top: 4px; letter-spacing: .06em; }

.role {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 10px 0 2px;
}
.role strong { color: var(--ink); font-weight: 600; }

.pitch {
  color: var(--ink-faint);
  font-size: 13.5px;
  margin: 14px 0 20px;
  line-height: 1.55;
}

.links { list-style: none; padding: 0; margin: 0; font-size: 14.5px; }
.links li { margin: 7px 0; display: flex; gap: 10px; align-items: center; }
.links svg { width: 16px; height: 16px; flex: none; color: var(--ink-faint); }
.links a { color: var(--ink-soft); }
.links a:hover { color: var(--accent); }

.cv-btn {
  display: inline-flex; align-items:center; gap:8px;
  margin-top: 18px;
  background: var(--ink);
  color: #fff !important;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  transition: transform .12s ease, background .2s ease;
}
.cv-btn:hover { text-decoration: none; background: var(--accent); transform: translateY(-1px); }

/* ---------- Main ---------- */
.main { padding-top: 64px; padding-bottom: 96px; min-width: 0; }

section { margin-bottom: 62px; scroll-margin-top: 40px; }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 18px;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::after { content:""; height:1px; flex:1; background: var(--line); }

.lede {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
  font-weight: 380;
  margin: 0 0 16px;
  letter-spacing: -.005em;
}
.about p { color: var(--ink-soft); margin: 0 0 14px; }
.about .now { font-size: 14.5px; }
.about .now b { color: var(--ink); }

/* ---------- Education ---------- */
.edu-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.edu-item:last-child { border-bottom: none; }
.edu-logo {
  width: 66px; height: 66px;
  object-fit: contain;
  background: transparent;
  border: none;
  padding: 2px;
}
.edu-body h3 { margin: 0; font-size: 16.5px; font-weight: 600; font-family: var(--serif); letter-spacing:-.01em;}
.edu-body .deg { color: var(--ink-soft); font-size: 14px; margin-top: 2px; }
.edu-body .deg em { color: var(--accent-2); font-style: normal; font-weight:500;}
.edu-when { color: var(--ink-faint); font-size: 13.5px; white-space: nowrap; text-align:right; font-variant-numeric: tabular-nums;}
.edu-where { display:block; color: var(--ink-faint); font-size:12px; font-weight:400;}

/* ---------- Projects (starred) ---------- */
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.proj {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  background: var(--card);
  display: flex; flex-direction: column;
  transition: transform .14s ease, box-shadow .2s ease, border-color .2s ease;
}
.proj:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(30,25,15,.08); border-color: #d8d2c6; }
.proj .top { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.proj .top img { width: 26px; height: 26px; border-radius:6px; object-fit:contain;}
.proj h3 { margin:0; font-size: 17px; font-family: var(--serif); font-weight:600;}
.proj .tagline { color: var(--ink-soft); font-size: 13.8px; flex:1; margin: 4px 0 14px;}
.proj .meta { display:flex; align-items:center; gap:16px; font-size:13px; color: var(--ink-faint); }
.proj .meta .lang::before{ content:""; display:inline-block; width:9px;height:9px;border-radius:50%; background:var(--dot,#888); margin-right:6px; vertical-align:-1px;}
.proj .meta a { margin-left:auto; font-weight:500; }
.pill { font-size:11px; font-weight:600; letter-spacing:.02em; color:#fff; background:var(--accent-2); padding:2px 8px; border-radius:999px;}

/* ---------- Publications ---------- */
.venue-note { color: var(--ink-faint); font-size:13.5px; margin:-6px 0 22px; }
.pub {
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.pub:last-child { border-bottom:none; }
.pub .fig {
  width: 236px; height: auto;      /* natural aspect — no letterbox whitespace */
  display: block;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px;
  transition: transform .14s ease, box-shadow .2s ease;
}
.pub a:hover .fig { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30,25,15,.10); }
.pub .num {
  width:236px;height:150px;border-radius:9px;border:1px solid var(--line);
  background:linear-gradient(135deg,#f4f1ea,#eae4d6);
  display:flex;align-items:center;justify-content:center;
  font-family:var(--serif); font-size:40px; color:var(--ink-faint); font-weight:500;
}
.pub h3 { margin:0 0 4px; font-size:16.5px; font-family:var(--serif); font-weight:600; line-height:1.32; letter-spacing:-.01em;}
.pub h3 a { color: var(--ink); }
.pub h3 a:hover { color: var(--accent); }
.pub .authors { font-size:13.5px; color: var(--ink-soft); margin:0 0 8px; }
.pub .authors b { color: var(--ink); }
.pub .authors .me { color: var(--accent-2); font-weight:600; }
.pub .row { display:flex; flex-wrap:wrap; gap:7px; align-items:center; }
.tag { font-size:11.5px; font-weight:500; color: var(--tag-ink); background: var(--tag-bg); padding: 3px 9px; border-radius: 6px; }
.tag.arxiv { background:#f7ecec; color: var(--accent-2); }
.tag.star  { background:#1a1a1a; color:#fff; }
.tag.cite  { background:transparent; color: var(--ink-faint); border:1px solid var(--line);}
.tag.emnlp { background:#e7f1ea; color:#2c6e49; font-weight:650; }
.pub .plinks { margin-left:auto; font-size:12.5px; display:flex; gap:12px;}

/* featured publication (flagship) — full-width teaser banner */
.pub.feat { grid-template-columns: 1fr; gap: 10px; padding-bottom: 26px; }
.pub.feat .banner {
  width: 100%; height: auto; display:block;
  background: #fff; padding: 14px;
  border-radius: 12px; border: 1px solid var(--line);
  box-shadow: 0 8px 26px rgba(30,25,15,.08);
}
.pub.feat .figcap { margin: 2px 2px 6px; font-size: 12.5px; color: var(--ink-faint); line-height: 1.5; }
.pub.feat .figcap code { font-size: 11.5px; background: var(--paper-2); padding: 0 4px; border-radius: 4px; }

/* ---------- Experience ---------- */
.exp-item {
  display:grid; grid-template-columns: 72px 1fr; gap:20px;
  padding: 22px 0; border-bottom:1px solid var(--line);
}
.exp-item:last-child{border-bottom:none;}
.exp-logo{ width:66px;height:66px;object-fit:contain;background:transparent;border:none;padding:4px;}
.exp-logo.dark{ background:transparent; border:none; padding:4px; }
.exp-logo.jd{ filter: drop-shadow(0 1px 2px rgba(0,0,0,.30)); }
.exp-head{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; flex-wrap:wrap;}
.exp-head h3{ margin:0; font-size:16.5px; font-family:var(--serif); font-weight:600;}
.exp-head h3 .co{color:var(--ink);}
.exp-role{ color: var(--accent); font-weight:500; font-size:14px;}
.exp-when{ color:var(--ink-faint); font-size:13px; white-space:nowrap; font-variant-numeric:tabular-nums;}
.exp-loc{ color: var(--ink-faint); font-weight:400; font-size:13px;}
.exp ul{ margin:8px 0 0; padding-left:18px; color:var(--ink-soft); font-size:14px;}
.exp ul li{ margin:4px 0;}
.exp ul li b{ color:var(--ink);}
.exp .stack{ margin-top:9px; display:flex; flex-wrap:wrap; gap:6px;}
.exp .stack span{ font-size:11.5px; color:var(--ink-faint); background:var(--paper-2); border:1px solid var(--line); padding:2px 8px; border-radius:6px;}

/* ---------- Footer ---------- */
footer{ border-top:1px solid var(--line); padding:26px 0 60px; color:var(--ink-faint); font-size:13px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .wrap{ grid-template-columns: 1fr; gap: 0; }
  .sidebar{ position: static; padding-top: 44px; text-align:center; }
  .avatar{ width:150px; height:150px; }
  .links{ display:inline-block; text-align:left; }
  .main{ padding-top: 20px; }
  .proj-grid{ grid-template-columns: 1fr; }
  .pub{ grid-template-columns: 1fr; }
  .pub .fig,.pub .num{ width:100%; height:130px; }
}
