:root {
  --bg: #ffffff;
  --text: #3a3838;
  --ink: #161515;
  --muted: #76706f;
  --line: #ece8e7;
  --hover: #f8f6f5;
  --accent: #1f5fbf;
  --accent-soft: #eef4fd;
  --tint: #f4f8fe;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 16.5px/1.72 var(--font);
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, var(--tint) 0, var(--bg) 620px) no-repeat, var(--bg);
}
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.shell { width: min(860px, calc(100% - 40px)); margin: 0 auto; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); background: rgba(255, 255, 255, .92); }
.topbar .shell { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 1.05rem; font-weight: 750; letter-spacing: -.035em; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.brand:hover { text-decoration: none; }
.topnav { display: flex; flex-wrap: wrap; gap: 2px; }
.topnav a { position: relative; padding: 6px 11px; color: var(--muted); font-size: .9rem; transition: color .15s; }
.topnav a::after {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 1px; height: 2px;
  border-radius: 1px; background: var(--accent); transform: scaleX(0); transition: transform .2s;
}
.topnav a:hover { color: var(--ink); text-decoration: none; }
.topnav a.on { color: var(--ink); }
.topnav a.on::after { transform: scaleX(1); }

/* About */
.about { padding: 64px 0 0; }
.about::after { content: ""; display: table; clear: both; }
.side { float: right; width: 196px; margin: 6px 4px 20px 44px; text-align: center; }
.frame { position: relative; isolation: isolate; width: 172px; margin: 0 auto; }
.frame::before {
  content: ""; position: absolute; inset: 10px -10px -10px 10px; z-index: -1;
  border-radius: 16px; border: 1.5px solid color-mix(in srgb, var(--accent) 38%, transparent);
}
.portrait {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 40%; border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 16px 32px -18px rgba(20, 30, 60, .45);
}
.icons { display: flex; justify-content: center; gap: 5px; margin: 24px 0 4px; }
.icons a {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: .95rem;
  transition: color .15s, border-color .15s, transform .15s;
}
.icons a:hover {
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-2px); text-decoration: none;
}
.icons .cv-btn { font: 700 .72rem var(--font); letter-spacing: .02em; }
.email { font-size: .82rem; color: var(--muted); }

h1 { margin: 0; font-size: 3.2rem; font-weight: 750; letter-spacing: -.035em; line-height: 1.08; color: var(--ink); }
.subtitle { margin: 10px 0 28px; font-size: .95rem; color: var(--muted); }
.prose p { margin: 0 0 14px; }
.prose b { font-weight: 650; color: var(--ink); }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose h3 { display: flex; align-items: center; gap: 10px; margin: 26px 0 6px; font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.prose h3::before { content: ""; width: 4px; height: 1.05em; border-radius: 2px; background: var(--accent); }
.notice {
  clear: both; display: flex; align-items: center; gap: 12px; margin: 28px 0 0;
  padding: 13px 18px; border-radius: 12px; background: var(--accent-soft); color: var(--ink);
}
.notice i { color: var(--accent); }

/* Sections */
.section { padding-top: 72px; }
.section > h2 { margin: 0; font-size: 1.7rem; font-weight: 750; letter-spacing: -.035em; line-height: 1.2; color: var(--ink); }
.section > h2::after { content: ""; display: block; width: 30px; height: 3px; margin-top: 12px; border-radius: 2px; background: var(--accent); }
.note { margin: 14px 0 0; font-size: .9rem; color: var(--muted); }

/* Publications */
h3.group {
  display: flex; align-items: baseline; gap: 10px; margin: 34px 0 6px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line); font-size: 1.08rem; font-weight: 700; color: var(--ink);
}
h3.group small { padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .74rem; font-weight: 700; line-height: 1.7; }
ol.pubs { list-style: none; margin: 0; padding: 0; }
ol.pubs li {
  display: grid; grid-template-columns: 158px 1fr; column-gap: 18px;
  margin: 0 -14px; padding: 14px; border-radius: 12px; transition: background .2s;
}
ol.pubs li:hover { background: var(--hover); }
ol.pubs li > :not(.venue) { grid-column: 2; }
.title { display: block; margin-bottom: 3px; color: var(--ink); font-weight: 700; line-height: 1.45; transition: color .15s; }
.title:hover { color: var(--accent); text-decoration: none; }
.authors { margin: 0 0 8px; font-size: .92rem; line-height: 1.55; color: var(--muted); }
.authors b { font-weight: 700; color: var(--ink); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.venue {
  grid-column: 1; grid-row: 1 / span 3; justify-self: start; align-self: start; margin-top: 2px; padding: 1px 10px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-size: .78rem; font-weight: 700; line-height: 1.8; white-space: nowrap;
}
.venue.pre { background: var(--hover); color: var(--muted); font-weight: 600; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 6px;
  font-size: .76rem; font-weight: 700; line-height: 1.7; transition: background .15s, transform .15s;
}
.tag:hover { text-decoration: none; transform: translateY(-1px); }
.tag.pdf { background: #fce8e6; color: #b3261e; }
.tag.pdf:hover { background: #f9d2ce; }
.tag.code { background: #e3edfd; color: #1a56c9; }
.tag.code:hover { background: #cfe0fb; }

/* Label | content rows (education, awards, service, experience) */
.rows { margin-top: 18px; }
.row { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.k { padding-top: 1px; font-size: .9rem; line-height: 1.6; color: var(--muted); font-variant-numeric: tabular-nums; }
.k small { display: block; font-size: .8rem; }
.v strong { font-weight: 700; color: var(--ink); }
.v span { display: block; font-size: .93rem; color: var(--muted); }
.v.logo { display: flex; align-items: center; gap: 14px; }
.v.logo img { flex: none; width: 44px; height: 44px; padding: 4px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.v.logo img.cover { object-fit: cover; padding: 0; }
.v.logo img.contain { object-fit: contain; }

footer { margin-top: 88px; padding: 26px 0 72px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }

@media (max-width: 720px) {
  .topnav { display: none; }
  .about { padding-top: 40px; }
  .side { float: none; width: 196px; margin: 0 auto 28px; }
  h1 { font-size: 2.4rem; }
  ol.pubs li { display: block; }
  .venue { display: inline-block; margin: 0 0 6px; }
  .row { grid-template-columns: 1fr; gap: 2px; }
}
