/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Jiawei Yang — Personal Site
   Modern / Inter / sticky sidebar
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

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

/* ── Tokens ────────────────────────────────────── */
:root {
  --bg:       #f7f8fa;
  --fg:       #111111;
  --body:     #444444;
  --muted:    #777777;
  --subtle:   #aaaaaa;
  --border:   #e2e5ea;
  --surface:  #edf0f4;
  --link:     #0066cc;
  --link-h:   #004499;
  --nav-bg:       rgba(247,248,250,0.9);
  --highlight-bg: rgba(240, 180, 0, 0.22);
  --font:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --topbar-h: 44px;
  --sidebar-w: 160px;
  --gap:       36px;
  --max-w:     920px;
}

[data-theme="dark"] {
  --bg:       #111111;
  --fg:       #eeeeee;
  --body:     #bbbbbb;
  --muted:    #888888;
  --subtle:   #555555;
  --border:   #282828;
  --surface:  #1a1a1a;
  --link:     #6699dd;
  --link-h:   #88bbff;
  --nav-bg:       rgba(17,17,17,0.9);
  --highlight-bg: rgba(100, 150, 230, 0.22);
}

/* ── Base ──────────────────────────────────────── */
html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

ol, ul { list-style: none; }

strong { color: var(--fg); font-weight: 600; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-h); text-decoration: underline; }

/* ── Top bar — theme toggle only ──────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 28px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

/* Theme toggle */
.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}

.theme-btn:hover { color: var(--fg); background: var(--surface); }

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

/* ── Page layout — sidebar + main ─────────────── */
.layout {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--topbar-h) + 48px) 32px 80px;
}

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--topbar-h) + 28px);
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar {
  width: var(--sidebar-w);
  height: var(--sidebar-w);
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-bottom: 13px;
}

.sidebar-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 3px;
}

.sidebar-role {
  font-size: 12px;
  color: var(--muted);
}

/* Icon links row */
.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  width: 100%;
  justify-content: center;
}

.social-icons a {
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color 0.15s;
  text-decoration: none;
}

.social-icons a:hover {
  color: var(--fg);
  text-decoration: none;
}

.social-icons svg {
  width: 17px;
  height: 17px;
  display: block;
}

/* ── Main content ──────────────────────────────── */
.main {
  flex: 1;
  min-width: 0;
}

/* ── Intro / Bio ───────────────────────────────── */
.intro {
  margin-bottom: 52px;
}

.bio {
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--body);
  margin-bottom: 12px;
}

.bio a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.bio a:hover {
  color: var(--link-h);
  border-color: var(--link-h);
  text-decoration: none;
}

/* Einstein quote */
.quote {
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}

/* Humble summary line */
.summary {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.summary a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.summary a:hover {
  color: var(--body);
  border-color: var(--body);
  text-decoration: none;
}

/* ── Section header ────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0;
}

.section-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: none;
}

.section-link:hover {
  color: var(--fg);
  text-decoration: none;
}

/* ── Papers ────────────────────────────────────── */
.papers {
  display: flex;
  flex-direction: column;
}

/* Every paper row — same two-column grid so all titles align */
.paper {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 18px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.paper:first-child { border-top: none; padding-top: 0; }

/* Paper image — always column 2 */
.paper-img {
  grid-column: 2;
  width: 140px;
  height: 92px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface);
  display: block;
  transition: opacity 0.2s;
}

.paper:hover .paper-img { opacity: 0.85; }

/* Paper body — always column 1 */
.paper-body {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Footer row — venue badge(s) + links on one line */
.paper-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.paper-venue {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Venue / oral badges — always accent colored ── */
.badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--link);
  border: 1px solid var(--link);
  border-radius: 100px;
  padding: 1px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Oral badge — filled accent to distinguish from venue */
.badge.oral {
  background: var(--link);
  color: var(--bg);
}

/* All titles full dark */
.paper-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 7px;
}

/* Highlighted papers — tinted title background, hugs text only */
.title-hl {
  background: var(--highlight-bg);
  border-radius: 4px;
  padding: 2px 6px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Insight — italic, only on highlighted */
.insight {
  font-size: 13.5px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.65;
  margin-bottom: 8px;
}

.authors {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 9px;
}

.authors strong {
  color: var(--body);
}

.paper-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.paper-links a {
  font-size: 13px;
  color: var(--link);
  text-decoration: none;
}

.paper-links a:hover {
  color: var(--link-h);
  text-decoration: underline;
}

/* ── Footer ────────────────────────────────────── */
footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 12px;
  color: var(--subtle);
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 640px) {
  .layout {
    flex-direction: column;
    gap: 40px;
    padding: 40px 20px 60px;
  }

  .sidebar {
    position: static;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
  }

  .avatar { width: 72px; height: 72px; margin-bottom: 0; }

  .sidebar-name { font-size: 18px; }

  .sidebar-role { margin-bottom: 0; }

  .social { flex-direction: row; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 0; }

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

  .paper-img {
    grid-column: 1;
    width: 100%;
    height: 140px;
  }
}
