:root {
  --bg: #ffffff;
  --bg-2: #fafafa;
  --fg: #0a0a0a;
  --fg-2: #4a4a4a;
  --fg-3: #858585;
  --fg-4: #c9c9c9;
  --line: #ececec;
  --line-2: #e2e2e2;
  --hover: #f4f4f4;
  --chip: #f5f5f5;
  --accent: #800000;
  --focus: #0a72ef;
  --live: #16a34a;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --fg: #ededed;
  --fg-2: #a1a1a1;
  --fg-3: #737373;
  --fg-4: #3d3d3d;
  --line: #1e1e1e;
  --line-2: #2a2a2a;
  --hover: #151515;
  --chip: #161616;
  --accent: #f2777a;
  --focus: #3b8eff;
  --live: #22c55e;
  color-scheme: dark;
}

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

html {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  scroll-padding-top: 24px;
  scroll-behavior: smooth;
}

body { margin: 0; min-height: 100vh; background: var(--bg); }

::selection { background: var(--fg); color: var(--bg); }

a { color: inherit; text-decoration: none; }

p, li { text-wrap: pretty; }

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

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

kbd {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  color: var(--fg-3);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--line-2), 0 1px 0 var(--line-2);
}

.wrap { max-width: 800px; margin: 0 auto; padding: 0 24px; }

.inline-link {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--fg-4);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s;
}
.inline-link:hover { text-decoration-color: var(--fg); }

/* ---------- top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 12px;
  background: linear-gradient(var(--bg) 70%, color-mix(in srgb, var(--bg) 0%, transparent));
}

.jump { display: flex; gap: 18px; font-size: 13.5px; }
.jump a { color: var(--fg-3); transition: color 0.2s; }
.jump a:hover, .jump a.on { color: var(--fg); }

.btn {
  appearance: none;
  font: inherit;
  color: var(--fg-2);
  background: var(--bg);
  border: 1px solid var(--line-2);
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--hover); color: var(--fg); }
.btn svg { width: 15px; height: 15px; }
.btn.icon { width: 32px; padding: 0; justify-content: center; }

.theme .sun, [data-theme='dark'] .theme .moon { display: none; }
[data-theme='dark'] .theme .sun { display: block; }

/* ---------- intro ---------- */

.intro { padding-top: 44px; margin-top: 0; }

.id { display: flex; align-items: center; gap: 22px; }

.avatar {
  width: 124px;
  height: 155px;
  border-radius: 12px;
  object-fit: cover;
  object-position: 50% 25%;
  flex: none;
  background: var(--chip);
  box-shadow: 0 0 0 1px var(--line-2);
}

.id-text { min-width: 0; }

.id h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin: 0; line-height: 1.25; }

.role {
  margin: 5px 0 0;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-2);
}

.social { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.social a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--fg-2);
  transition: background-color 0.15s, color 0.15s;
}
.social a:hover { background: var(--hover); color: var(--fg); }
.social svg { width: 13px; height: 13px; }

/* ---------- focus card ---------- */

.focus {
  margin-top: 36px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--bg), var(--bg-2));
}

.focus-row {
  margin: 0;
  padding: 14px 24px;
  font-size: 13.5px;
  color: var(--fg-2);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}
.focus-row + .focus-row { border-top: 1px dashed var(--line-2); }
.focus-row > :last-child { flex: 1 1 260px; }

.eyebrow {
  flex: none;
  width: 64px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.eyebrow .dot {
  align-self: center;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

/* ---------- sections ---------- */

section { margin-top: 64px; }

.sec-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  min-height: 42px;
}
.sec-h h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-h h2 .n { font-family: var(--mono); font-size: 11.5px; color: var(--fg-4); }

.sec-h .aside { font-size: 12.5px; color: var(--fg-4); }

.list.news { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.list.news.more { mask-image: linear-gradient(#000 calc(100% - 10px), transparent); }
.list.news.more.end { mask-image: none; }

.pub-detail p a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--fg-4); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.pub-detail p a:hover { text-decoration-color: var(--fg); }

.about { font-size: 15px; color: var(--fg-2); padding-top: 4px; }
.about p { margin: 0 0 0.9em; }

.list { list-style: none; margin: 0 -12px; padding: 0; position: relative; }
.list > li { position: relative; }

.glide {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  background: var(--hover);
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.24s var(--ease), height 0.24s var(--ease), opacity 0.2s ease;
}

.row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 16px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14.5px;
}
.row .k { font-family: var(--mono); font-size: 12px; color: var(--fg-3); white-space: nowrap; }
.row .t { color: var(--fg-2); min-width: 0; }
.row .x { white-space: nowrap; text-align: right; }

.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fg-3);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 6px;
}
.tag.hl { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

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

.tools { display: flex; align-items: center; gap: 8px; }

.seg {
  position: relative;
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--chip);
  border: 1px solid var(--line);
}
.seg-ind {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 0;
  border-radius: 7px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line-2), 0 1px 2px rgb(0 0 0 / 0.06);
  transition: transform 0.3s var(--ease), width 0.3s var(--ease);
}
.seg button {
  position: relative;
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--fg-3);
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seg button span { font-family: var(--mono); font-size: 11px; color: var(--fg-4); }
.seg button[aria-selected='true'] { color: var(--fg); }
.seg button[aria-selected='true'] span { color: var(--fg-3); }
:root:not(.js) .seg button[aria-selected='true'] { background: var(--bg); }

.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 9px; width: 14px; height: 14px; color: var(--fg-3); pointer-events: none; }
.search input {
  font: inherit;
  font-size: 13px;
  height: 32px;
  width: 140px;
  padding: 0 30px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--fg);
  transition: width 0.3s var(--ease), border-color 0.2s;
}
.search input::placeholder { color: var(--fg-3); }
.search input:focus { outline: none; border-color: var(--fg-3); width: 190px; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { position: absolute; right: 7px; }

.pub-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 12px;
  border-radius: 10px;
}
.pub-thumb-link { display: block; margin-top: 2px; }
.pub-main { min-width: 0; }

.pub-thumb {
  width: 84px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line-2);
  display: block;
  transition: transform 0.3s var(--ease);
}
.pub-thumb.soon {
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
  background: repeating-linear-gradient(135deg, var(--bg), var(--bg) 5px, var(--chip) 5px, var(--chip) 10px);
}
.row .t .sub { color: var(--fg-3); }
.row .t a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--fg-4); }
.row .x { font-size: 13px; color: var(--fg-3); }
.pub-thumb.fit { object-fit: contain; padding: 3px; }
.pub-thumb.pix, figure.pix img { image-rendering: pixelated; }
.pub-row:hover .pub-thumb { transform: scale(1.04); }

.pub-title { display: block; color: var(--fg); font-weight: 500; font-size: 14.5px; line-height: 1.42; }
a.pub-title:hover { text-decoration: underline; text-decoration-color: var(--fg-4); text-underline-offset: 3px; }

.pub-authors {
  display: block;
  color: var(--fg-3);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 2px;
}
.pub-authors a { transition: color 0.15s; }
.pub-authors a:hover { color: var(--fg); text-decoration: underline; text-decoration-color: var(--fg-4); text-underline-offset: 3px; }

.me { color: var(--fg); font-weight: 500; }
.vjep-avatar { color: #0080fa; font-weight: 700; font-style: italic; }

.pub-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-3);
  text-align: right;
  white-space: nowrap;
  line-height: 1.55;
}
.pub-meta .award { color: var(--accent); font-weight: 600; }

.chev {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 1.4px solid var(--fg-3);
  border-bottom: 1.4px solid var(--fg-3);
  transform: rotate(45deg) translate(-2px, -2px);
  margin-left: 10px;
  transition: transform 0.3s var(--ease);
  vertical-align: middle;
}
.pub.open .chev { transform: rotate(225deg) translate(-1px, -1px); }

.pub-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.38s var(--ease); }
.pub.open .pub-detail { grid-template-rows: 1fr; }
.pub-detail > div { overflow: hidden; min-height: 0; }
.pub-detail-inner {
  padding: 0 12px 20px 114px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.38s var(--ease);
}
.pub.open .pub-detail-inner { opacity: 1; transform: none; }
.pub-detail figure {
  margin: 4px 0 14px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line-2);
  padding: 10px;
}
.pub-detail figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
}
figure[data-zoom] { position: relative; }
figure[data-zoom] .lens {
  position: absolute;
  inset: 10px;
  background-repeat: no-repeat;
  background-color: #fff;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
figure[data-zoom].zooming { cursor: zoom-in; }
figure[data-zoom].zooming .lens { opacity: 1; }
figure[data-zoom]::after {
  content: 'Hover to zoom';
  position: absolute;
  right: 18px;
  bottom: 16px;
  font: 11px var(--mono);
  color: #555;
  background: rgb(255 255 255 / 0.85);
  border-radius: 5px;
  padding: 2px 7px;
  pointer-events: none;
  transition: opacity 0.15s;
}
figure[data-zoom].zooming::after { opacity: 0; }
@media (hover: none) { figure[data-zoom]::after { content: none; } }
.pub-detail figure.poster img { width: auto; max-width: 100%; height: auto; max-height: 480px; margin: 0 auto; }
.pub-detail figure.pix img { width: auto; height: 220px; margin: 0 auto; }
.pub-detail p { margin: 0 0 6px; font-size: 13.5px; color: var(--fg-2); }

.pub-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font-size: 12px;
  color: var(--fg-2);
  background: var(--bg);
  transition: background-color 0.15s, color 0.15s;
}
.soon-tag { font-family: var(--mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.03em; text-transform: uppercase; }

/* poster viewer */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 4vh 4vw;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.viewer[hidden] { display: none; }
.viewer figure { position: relative; margin: 0; padding: 10px; background: #fff; border-radius: 12px; box-shadow: 0 0 0 1px var(--line-2), 0 24px 64px -16px rgb(0 0 0 / 0.35); }
.viewer figure img { display: block; max-width: 88vw; max-height: 86vh; width: auto; height: auto; border-radius: 6px; }
.viewer .close { position: absolute; top: 14px; right: 14px; }
.pub-links a:hover { background: var(--hover); color: var(--fg); }
.pub-links svg { width: 11px; height: 11px; }

.pub[hidden] { display: none; }

.empty { padding: 28px 12px; color: var(--fg-3); font-size: 14px; text-align: center; }
.fine { margin: 14px 0 0; font-size: 12.5px; color: var(--fg-3); }

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

.foot {
  margin-top: 96px;
  padding: 26px 0 56px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  font-size: 13px;
  color: var(--fg-3);
}
.foot a:hover { color: var(--fg); }
.foot .links { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  html { font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  .intro { padding-top: 28px; }
  .id { gap: 16px; align-items: flex-start; }
  .avatar { width: 92px; height: 115px; border-radius: 10px; }
  .id h1 { font-size: 18px; }
  .role { font-size: 13.5px; }
  .focus-row { padding: 13px 18px; }
  .sec-h { flex-wrap: wrap; }
  .tools { width: 100%; }
  .search { flex: 1; }
  .search input, .search input:focus { width: 100%; }
  .search kbd { display: none; }
  .row { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 2px 10px; }
  #experience .row .x:not(:empty), #education .row .x { grid-column: 2; text-align: left; white-space: normal; }
  .pub-row { grid-template-columns: 64px minmax(0, 1fr); gap: 4px 12px; }
  .pub-thumb { width: 64px; height: 46px; margin-top: 3px; }
  .pub-authors { white-space: normal; }
  .pub-meta { grid-column: 2; text-align: left; }
  .pub-detail-inner { padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
