:root {
  --bg: #ffffff;
  --surface: #f7f7f8;
  --text: #171717;
  --muted: #66646a;
  --line: #e4e2e5;
  --accent: #aa4a9f;
  --accent-soft: #f6eaf4;
  --shadow: 0 4px 14px rgba(24, 18, 24, 0.13);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #151316;
  --surface: #1e1b20;
  --text: #eee9ee;
  --muted: #b8b1b8;
  --line: #353036;
  --accent: #df82d2;
  --accent-soft: #352532;
  --shadow: 0 5px 18px rgba(0, 0, 0, 0.32);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.52;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
}
.nav-wrap {
  width: min(790px, calc(100% - 36px));
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.site-name {
  color: var(--text);
  font-size: 19px;
  white-space: nowrap;
}
.site-name:hover { text-decoration: none; }
.site-name span { margin-left: 5px; }
.socials { display: flex; align-items: center; gap: 7px; }
.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  transition: color 140ms ease, transform 140ms ease;
}
.socials a .ai { font-size: 21px; }
.socials .email-link { font-size: 1.7rem; }
.socials a:hover { color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.page-nav { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.page-nav a { color: var(--text); font-size: 14px; }
.page-nav a[aria-current="page"] { color: var(--accent); }
.theme-toggle {
  border: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.container { width: min(790px, calc(100% - 36px)); margin: 0 auto; padding: 46px 0 70px; }
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 42px;
  align-items: center;
  padding: 0 0 34px;
}
.eyebrow {
  margin: 0 0 12px;
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .02em;
}
.intro-line { margin: 11px 0; font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.contact-line { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.contact-line a { overflow-wrap: anywhere; }
.portrait {
  width: 130px;
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.section { padding: 12px 0 20px; border-top: 1px solid var(--line); scroll-margin-top: 76px; }
.section h1,
.section h2 {
  margin: 0 0 7px;
  font-size: 31px;
  line-height: 1.25;
  font-weight: 300;
  letter-spacing: -.02em;
}
.section h3 {
  margin: 22px 0 10px;
  font-size: 21px;
  line-height: 1.3;
  font-weight: 400;
}
.section p { margin: 8px 0; }
.section ul { margin: 8px 0; padding-left: 24px; }
.section li { margin: 4px 0; }
.accent { color: var(--accent); }
.note { color: var(--muted); font-size: 14px; }

.paper-group { margin-top: 24px; }
.paper-group-title {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 400;
}
.paper-list { display: grid; gap: 18px; }
.paper {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 17px;
  align-items: start;
}
.paper-visual {
  position: relative;
  width: 150px;
  height: 102px;
  overflow: hidden;
  display: block;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}
.paper-visual:hover { text-decoration: none; }
.paper-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transition: transform .18s ease;
}
.paper-visual:hover img { transform: scale(1.025); }
.venue {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  padding: 3px 7px;
  background: var(--accent);
  color: white;
  font-family: Roboto, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.paper h4 { margin: 0 0 3px; font-size: 16px; line-height: 1.34; font-weight: 500; }
.authors, .publication { margin: 1px 0; color: var(--muted); font-size: 14px; line-height: 1.42; }
.publication { color: var(--text); }
.paper-links { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 9px; font-size: 13px; }
.paper-links a { color: var(--accent); }
.equal-note { font-size: 13px; color: var(--muted); }

.project-list, .plain-list { padding-left: 21px; }
.project-list li, .plain-list li { margin: 8px 0; }
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 3px;
  color: var(--accent);
  font-size: 11px;
  vertical-align: 1px;
}
.edu-item, .experience-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 20px;
  margin: 12px 0;
}
.edu-item strong, .experience-item strong { font-weight: 500; }
.edu-item .date, .experience-item .date { color: var(--muted); white-space: nowrap; }
.edu-item p, .experience-item p { grid-column: 1 / -1; margin: -4px 0 0; color: var(--muted); font-size: 14px; }

.pub-page-title { margin-bottom: 8px !important; }
.pub-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 25px; }
.filter-button {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 10px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.filter-button.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.paper[hidden] { display: none; }
.abstract {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

footer {
  width: min(790px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 720px) {
  .nav-wrap { min-height: 64px; flex-wrap: wrap; gap: 7px 12px; padding: 9px 0; }
  .identity { width: 100%; justify-content: space-between; }
  .page-nav { margin-left: 0; width: 100%; justify-content: flex-end; gap: 13px; }
  .container { padding-top: 30px; }
  .intro { grid-template-columns: 1fr; gap: 24px; }
  .portrait { width: min(100%, 150px); height: auto; justify-self: start; }
  .paper { grid-template-columns: 1fr; gap: 10px; }
  .paper-visual { width: 100%; height: 150px; }
  .edu-item, .experience-item { grid-template-columns: 1fr; gap: 2px; }
  .edu-item .date, .experience-item .date { white-space: normal; }
  .section h1, .section h2 { font-size: 28px; }
}

@media print {
  .site-header, .theme-toggle, .pub-controls { display: none; }
  .container { width: 100%; padding-top: 0; }
  .section { break-inside: avoid; }
}
