/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
  padding: 0;
}
img {
  max-width: 100%;
  display: block;
}
ul {
  list-style: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --subtle: #f5f5f7;
  --rule: #e5e5e7;
  --accent: #1772d0;
  --accent-hover: #f09228;
  --card: #fafafa;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1000px;
  --radius: 10px;
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --fg: #e8e8ea;
  --muted: #9a9aa2;
  --subtle: #171a20;
  --rule: #24272e;
  --accent: #6ea8ff;
  --accent-hover: #ffb066;
  --card: #171a20;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-hover);
}
h1,
h2,
h3,
h4 {
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
}
h3 {
  font-size: 1rem;
}
p {
  margin-bottom: 0.85rem;
}
strong,
b {
  font-weight: 600;
}
u {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* ---------- Layout ---------- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}
main.container {
  padding-top: 2rem;
  padding-bottom: 1rem;
}
.section {
  padding: 2.25rem 0;
  border-top: 1px solid var(--rule);
}
.section:first-of-type {
  border-top: 0;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-brand {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.nav-brand:hover {
  color: var(--accent);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--fg);
  font-weight: 500;
  font-size: 0.925rem;
}
.nav-links a:hover {
  color: var(--accent);
}
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  transition: background-color 0.15s ease;
}
.theme-toggle:hover {
  background: var(--subtle);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}
:root[data-theme="dark"] .icon-sun {
  display: block;
}
:root[data-theme="dark"] .icon-moon {
  display: none;
}
:root:not([data-theme="dark"]) .icon-sun {
  display: none;
}
:root:not([data-theme="dark"]) .icon-moon {
  display: block;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  align-items: center;
  padding-top: 1.25rem;
}
.hero-side {
  text-align: center;
}
.hero-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  margin: 0 auto 1rem;
}
.hero-side .social {
  justify-content: center;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-name {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}
.hero-subtitle {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 1rem;
}
.hero-main {
  padding-top: 0.15rem;
}
.hero-main p {
  text-align: left;
}

/* ---------- Social row ---------- */
.social {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.social.compact {
  gap: 0.35rem;
}
.social.compact a {
  padding: 0.55rem;
  gap: 0;
}
.social.compact .label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.social.compact svg {
  width: 20px;
  height: 20px;
}
.social a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--subtle);
}
.social svg {
  width: 15px;
  height: 15px;
}

/* ---------- News ---------- */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.news-list li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  align-items: baseline;
}
.news-date {
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.news-item {
  font-size: 0.95rem;
}
.news-item i a {
  color: var(--accent);
  transition: color 0.15s ease;
}
.news-item i a:hover {
  color: var(--accent-hover);
}

/* ---------- Publications ---------- */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.pub {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.pub-thumb {
  width: 128px;
  height: 128px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: #ffffff;
  text-align: center;
  padding: 0.5rem;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, #475569, #64748b);
}
.pub-thumb .venue-abbr {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.pub-thumb .venue-year {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.9;
}
.pub-thumb-link {
  display: block;
  width: 128px;
  height: 128px;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pub-thumb-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.pub-thumb--img {
  padding: 0;
  background: #ffffff;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--rule);
  width: 100%;
  height: 100%;
}
:root[data-theme="dark"] .pub-thumb--img {
  background: #e8e8ea;
}
.pub-thumb--tmlr    { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.pub-thumb--iclr    { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.pub-thumb--aistats { background: linear-gradient(135deg, #15803d, #22c55e); }
.pub-thumb--icml    { background: linear-gradient(135deg, #ea580c, #f97316); }
.pub-thumb--neurips { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.pub-thumb--acml    { background: linear-gradient(135deg, #be185d, #ec4899); }
.pub-thumb--arxiv   { background: linear-gradient(135deg, #b91c1c, #f97316); }

.pub-body {
  min-width: 0;
}
.pub-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.15rem;
  line-height: 1.35;
}
.pub-title a {
  color: var(--accent);
}
.pub-title a:hover {
  color: var(--accent-hover);
}
.pub-authors {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.pub-venue {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--fg);
  margin-bottom: 0.45rem;
}
.pub-venue .badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.5rem;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  vertical-align: 2px;
}
.pub-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.pub-links a {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--fg);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.pub-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--subtle);
}
.pub-more {
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- Theses & service ---------- */
.thesis {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.service-list li {
  padding: 0.25rem 0;
  font-size: 0.95rem;
}
.service-list li::before {
  content: "·";
  color: var(--muted);
  margin-right: 0.6rem;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 1.25rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  margin-top: 1.5rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .hero-photo {
    width: 130px;
    height: 130px;
  }
  .nav-links {
    gap: 0.9rem;
    font-size: 0.9rem;
  }
  .news-list li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  h1 {
    font-size: 1.75rem;
  }
  .pub {
    grid-template-columns: 96px 1fr;
    gap: 1rem;
  }
  .pub-thumb,
  .pub-thumb-link {
    width: 96px;
    height: 96px;
  }
  .pub-thumb .venue-abbr {
    font-size: 1.05rem;
  }
  .pub-thumb .venue-year {
    font-size: 0.8rem;
  }
}
