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

:root {
  --text: #0f172a;
  --muted: #475569;
  --subtle: #94a3b8;
  --accent: #0c4a6e;
  --accent-mid: #0369a1;
  --accent-light: #e0f2fe;
  --border: #edf1f6;
  --bg: #ffffff;
  --bg2: #f8fafc;
  --gold: #b45309;
  --green: #15803d;
  --r: 5px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-mid);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(3, 105, 161, 0.35);
}

a:hover { text-decoration-color: var(--accent-mid); }
img { display: block; }

.wrap {
  width: min(920px, 100% - 3rem);
  margin: 0 auto;
}

/* ─── Nav ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 99;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 52px;
}

.nav-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-name { text-decoration: none; }
.nav-name:hover { color: var(--accent-mid); text-decoration: none; }

.nav-links {
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.3rem 0.55rem;
  border-radius: var(--r);
}

.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--text); background: var(--bg2); text-decoration: none; }

.nav-toggle {
  display: none;
  flex-shrink: 0;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.28rem 0.6rem;
  font-size: 1rem;
  font-weight: 900;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: 0.05em;
  line-height: 1;
  width: auto;
}

.nav-toggle:hover { background: var(--bg2); color: var(--text); }

/* ─── Hero ─── */
.hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 3rem;
  align-items: start;
}

.hero-text h1 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-dept {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.3rem;
  line-height: 1.5;
}

.hero-dept span { display: block; }

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

.hero-contact a { color: var(--muted); }
.hero-contact a:hover { color: var(--accent-mid); text-decoration: none; }

.hero-bio {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.3rem;
  max-width: 540px;
}

.hero-git {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--subtle);
  margin-bottom: 0.45rem;
}

.chip-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hlink {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  transition: border-color 0.12s, color 0.12s;
}

.hlink { text-decoration: none; }
.hlink:hover { border-color: var(--accent-mid); color: var(--accent-mid); text-decoration: none; }

.hero-photo {
  width: 190px;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: center 10%;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── Sections ─── */
section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 60px;
}

.sec-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-mid);
  margin-bottom: 0.35rem;
}

section h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  padding-left: 0.75rem;
  margin-bottom: 1.6rem;
  border-left: 3px solid var(--accent-mid);
}

/* ─── Research ─── */
.ri-panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.ri-panel {
  display: flex;
  flex-direction: column;
}

.ri-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r);
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
  background: var(--bg2);
}

.ri-panel h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.ri-panel p {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ─── Publications ─── */
.pub-list {
  display: flex;
  flex-direction: column;
}

.pub {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0 1.4rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.pub:last-child { border-bottom: none; }

.pub-year {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--subtle);
  padding-top: 3px;
  line-height: 1.4;
}

.pub-venue-tag {
  display: inline-block;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 3px;
  padding: 0.12rem 0.45rem;
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.pub-if {
  font-size: 0.73rem;
  color: var(--subtle);
  margin-left: 0.4rem;
}

.pub-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0.25rem;
}

.pub-authors {
  font-size: 0.84rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

.pub-authors strong { color: var(--text); font-weight: 700; }
.pub-note { font-size: 0.8rem; color: var(--gold); font-weight: 600; }

.pub-row-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pl {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-mid);
  border: 1px solid #bae6fd;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  background: var(--accent-light);
}

.pl { text-decoration: none; }
.pl:hover { background: #bae6fd; text-decoration: none; }

/* ─── Entry logo ─── */
.entry-logo-cell {
  width: 60px;
  padding-top: 3px;
}

.entry-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 5px;
  display: block;
}

/* ─── Experience ─── */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.exp-group-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-mid);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.35rem 0.75rem;
  margin: 2rem 0 0;
  display: inline-block;
  align-self: flex-start;
}

.exp-group-title:first-child { margin-top: 0; }

.exp {
  display: grid;
  grid-template-columns: 64px 100px 1fr;
  gap: 0 1.25rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
}

.exp:last-child { padding-bottom: 0; }

.exp-period {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--subtle);
  line-height: 1.5;
  padding-top: 2px;
}

.exp-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.exp-org {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.exp-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.65;
}

.exp-desc ul { padding-left: 1.1rem; }
.exp-desc li { margin-bottom: 0.18rem; }
.exp-desc a { font-weight: 600; }

/* ─── Education ─── */
.edu-list {
  display: flex;
  flex-direction: column;
}

.edu {
  display: grid;
  grid-template-columns: 64px 100px 1fr;
  gap: 0 1.25rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
}

.edu:last-child { padding-bottom: 0; }

.edu-period {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--subtle);
  padding-top: 2px;
}

.edu-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.edu-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.edu-detail {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.6;
}

.edu-detail ul { padding-left: 1.1rem; }
.edu-detail li { margin-bottom: 0.15rem; }

/* ─── Activities ─── */
.act-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 3rem;
}

.act-col h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-mid);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.35rem 0.75rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.act-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}

.act-item:last-child { border-bottom: none; }

.act-year {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--subtle);
  padding-top: 2px;
  line-height: 1.4;
}

.act-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.1rem;
  line-height: 1.4;
}

.act-sub {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.act-sub a { font-weight: 600; font-size: 0.8rem; }

/* ─── Projects ─── */
.proj-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.6rem;
}

.proj {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.85rem 1rem;
  transition: border-color 0.12s;
  text-decoration: none;
  color: inherit;
}

.proj:hover { border-color: var(--accent-mid); text-decoration: none; }

.proj-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.proj-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.proj-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-mid);
  word-break: break-all;
  overflow-wrap: break-word;
}

/* ─── Contact ─── */
.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
}

.ct {
  padding: 0.7rem 0.9rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.ct-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--subtle);
  margin-bottom: 0.1rem;
}

.ct-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.ct-val a { color: var(--accent-mid); }


/* ─── Footer ─── */
.footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer p { font-size: 0.82rem; color: var(--subtle); }

.footer-counter img { display: block; }

/* ─── Responsive ─── */
@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr 160px;
    gap: 2rem;
  }
  .hero-photo { width: 160px; }

  .ri-panels {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .ri-img { aspect-ratio: 16 / 9; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 2rem); }

  .nav .wrap {
    height: 52px;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem 1rem 0.75rem;
    gap: 0.1rem;
    z-index: 98;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    font-size: 0.9rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--r);
  }

  .hero { padding: 36px 0 32px; }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hero-photo {
    width: 100px;
    aspect-ratio: 1/1;
    order: -1;
    border-radius: 50%;
  }

  .hero-text h1 { font-size: 1.85rem; }

  section { padding: 40px 0; }

  section h2 { font-size: 1.2rem; margin-bottom: 1.25rem; }

  /* pub: collapse to single column */
  .pub {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .pub-year {
    font-size: 0.75rem;
    margin-bottom: 0.3rem;
  }

  /* exp / edu: collapse */
  .exp, .edu {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .entry-logo-cell { display: none; }

  .exp-period, .edu-period {
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
    color: var(--subtle);
  }

  /* activities: single column */
  .act-cols { grid-template-columns: 1fr; gap: 2rem; }

  /* act-item: tighter date column */
  .act-item { grid-template-columns: 72px 1fr; gap: 0 0.75rem; }
  .act-year { font-size: 0.74rem; }

  .ri-img { aspect-ratio: 16 / 9; max-height: 150px; }

  /* proj: compact title-only tiles */
  .proj-list { grid-template-columns: repeat(2, 1fr); gap: 0.45rem; }
  .proj { padding: 0.6rem 0.75rem; }
  .proj-desc, .proj-link { display: none; }
  .proj-name { font-size: 0.85rem; }

  /* contact: single col */
  .contact-list { grid-template-columns: 1fr; }

  .hero-links { gap: 0.35rem; }
  .hlink { font-size: 0.77rem; padding: 0.25rem 0.55rem; }
}
