:root {
  --ink: #1a1a1a;
  --muted: #555;
  --faint: #888;
  --line: #e5e5e5;
  --accent: #2563eb;
  --max: 680px;
}
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
html { color-scheme:light; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 60px 0 80px; }

header { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; margin-bottom: 44px; }

.photo {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line);
}

.header-text { flex: 1; min-width: 0; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.tagline { color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.tagline .me { color: var(--accent); font-weight: 600; cursor: help; position: relative; }
.tagline .me::after {
  content: "Right — my English name";
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 500; line-height: 1.4;
  padding: 5px 9px; border-radius: 6px; white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.tagline .me::before {
  content: ""; position: absolute; left: 50%; bottom: calc(100% + 3px);
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink);
  opacity: 0; visibility: hidden; transition: opacity .15s ease;
  pointer-events: none;
}
.tagline .me:hover::after, .tagline .me:hover::before,
.tagline .me:focus::after, .tagline .me:focus::before { opacity: 1; visibility: visible; }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; font-weight: 500; }
.links a { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.links svg { width: 16px; height: 16px; flex-shrink: 0; }

section { margin-bottom: 44px; }
h2 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint);
  margin-bottom: 14px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.section-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 14px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.section-heading h2 { margin: 0; padding: 0; border: 0; }
.section-link {
  color: var(--faint); font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; white-space: nowrap;
}
.section-link:hover { color: var(--accent); text-decoration: none; }

.bio p { color: #333; margin-bottom: 10px; }
.bio p:last-child { margin-bottom: 0; }

.job { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: baseline; }
.job:first-of-type { padding-top: 0; }
.job:last-of-type { border-bottom: 0; padding-bottom: 0; }
.job h3 { font-size: 15px; font-weight: 600; }
.job .org { font-weight: 600; }
.job .role { color: var(--muted); font-weight: 400; }
.when { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.job p { grid-column: 1 / -1; margin-top: 2px; color: var(--muted); font-size: 14.5px; }

.paper-group { margin-top: 20px; }
.paper-group-title { font-size: 13px; font-weight: 600; color: var(--muted); }
.papers { display: flex; flex-direction: column; gap: 10px; }
.paper { padding: 10px 0; border-bottom: 1px solid var(--line); }
.paper:last-child { border-bottom: 0; }
.paper-title { font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--ink); }
a.paper-title:hover { color: var(--accent); text-decoration: none; }
.paper-meta { margin-top: 3px; font-size: 13px; color: var(--muted); }
.paper-link { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 500; }
.paper-note { margin-top: 6px; font-size: 13px; color: var(--muted); }
.venue { display: inline-block; font-size: 11px; font-weight: 600; color: var(--accent); background: #eff6ff; border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; letter-spacing: 0.01em; }

.edu-item { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: baseline; }
.edu-item:last-child { border-bottom: 0; }
.edu-item h3 { font-size: 15px; font-weight: 600; }
.edu-item p { grid-column: 1 / -1; color: var(--muted); font-size: 14.5px; margin-top: 1px; }

footer { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }

@media (max-width: 520px) {
  header { flex-direction: column; align-items: center; text-align: center; gap: 16px; }
  .header-text { text-align: center; }
  .links { justify-content: center; }
  .job, .edu-item { grid-template-columns: 1fr; }
  .when { margin-top: 0; }
  .wrap { padding: 40px 0 60px; }
}
