:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #5b6675;
  --line: #e6e9ee;
  --accent: #2f5fdf;
  --accent-soft: #eaf0ff;
  --badge: #eef1f6;
  --badge-text: #4a5568;
  --award-bg: #fff4e0;
  --award-text: #9a5b00;
  --shadow: 0 1px 2px rgba(20,30,50,.04), 0 6px 24px rgba(20,30,50,.05);
  --max: 838px;
}
:root[data-theme="dark"] {
  --bg: #0e1116;
  --bg-soft: #151a21;
  --card: #161b22;
  --text: #e7ecf3;
  --muted: #9aa6b5;
  --line: #232a33;
  --accent: #6b9bff;
  --accent-soft: #1a2540;
  --badge: #232a33;
  --badge-text: #b3c0d0;
  --award-bg: #3a2c12;
  --award-text: #f0c074;
  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 8px 28px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px 72px; }

/* Theme toggle */
.theme-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 10;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .15s ease, background .25s ease;
}
.theme-toggle:hover { transform: translateY(-1px); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* Hero */
.hero {
  display: flex; gap: 36px; align-items: center;
  padding: 64px 0 40px; flex-wrap: wrap;
}
.hero-photo img {
  width: 210px; height: 270px; object-fit: cover; object-position: center top; border-radius: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.hero-body { flex: 1; min-width: 280px; }
.hero-body h1 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 2.5rem; line-height: 1.1; margin: 0 0 10px; letter-spacing: -.01em;
}
.hero-body h1 .hangul { font-size: 1.4rem; color: var(--muted); font-weight: 500; }
.roles { margin: 0 0 8px; color: var(--text); }
.roles strong { color: var(--text); }
.lab { margin: 0 0 6px; color: var(--muted); font-size: .95rem; }
.email { margin: 0 0 16px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .9rem; color: var(--muted); }
.email span { color: var(--accent); }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--text); font-size: .875rem; font-weight: 500; transition: all .15s ease;
}
.links a:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Sections */
.section { padding: 28px 0; border-top: 1px solid var(--line); }
.section h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.6rem; margin: 0 0 18px; letter-spacing: -.01em;
}
.section h3 { font-size: 1rem; margin: 0 0 8px; }
.section p { margin: 0 0 14px; }

/* Research cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; box-shadow: var(--shadow);
}
.card h3 { color: var(--accent); font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.news li:last-child { border-bottom: none; }
.news .date {
  display: inline-block; min-width: 86px; color: var(--accent);
  font-weight: 600; font-size: .82rem; margin-right: 10px;
}

/* Publications */
.pub-note { font-size: .9rem; color: var(--muted); margin-bottom: 18px; }
.pub-note .legend { display: block; margin-bottom: 4px; }
.pubs { margin: 0; padding-left: 0; list-style: none; counter-reset: pub; }
.pubs li {
  position: relative; padding: 14px 0 14px 40px; border-bottom: 1px solid var(--line);
}
.pubs li:last-child { border-bottom: none; }
.pubs li::before {
  counter-increment: pub; content: counter(pub);
  position: absolute; left: 0; top: 15px;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--bg-soft); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: .75rem; color: var(--muted); font-weight: 600;
}
.pubs .title { display: block; font-weight: 600; color: var(--text); }
.pubs .authors { display: block; font-size: .88rem; color: var(--muted); margin: 2px 0; }
.pubs .authors b { color: var(--text); }
.pubs .venue { display: block; font-size: .88rem; }
.pubs .venue em { color: var(--accent); font-style: italic; font-weight: 600; }
.badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 6px;
  background: var(--badge); color: var(--badge-text);
  font-size: .72rem; font-weight: 600; vertical-align: middle;
}
.badge.award { background: var(--award-bg); color: var(--award-text); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 18px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: none; }
.timeline .when { min-width: 130px; color: var(--accent); font-weight: 600; font-size: .85rem; flex-shrink: 0; }
.timeline .what { color: var(--text); font-size: .95rem; }

/* Honors */
.honors { list-style: none; margin: 0; padding: 0; }
.honors li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.honors li:last-child { border-bottom: none; }
.honors .date { display: inline-block; min-width: 56px; color: var(--accent); font-weight: 600; margin-right: 10px; }

/* Services */
.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.svc-grid ul { margin: 0; padding-left: 18px; }
.svc-grid li { font-size: .92rem; color: var(--muted); padding: 3px 0; }
.svc-grid h3 { color: var(--text); }

/* Footer */
.foot { padding-top: 36px; margin-top: 8px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .85rem; }
.foot p { margin: 4px 0; }
.foot .updated { font-size: .78rem; opacity: .8; }

/* Responsive */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .hero { padding: 48px 0 32px; gap: 24px; justify-content: center; text-align: center; }
  .hero-photo img { width: 175px; height: 225px; }
  .hero-body h1 { font-size: 2rem; }
  .links { justify-content: center; }
  .cards { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: 1fr; gap: 20px; }
  .timeline li { flex-direction: column; gap: 2px; }
  .timeline .when { min-width: auto; }
  .news .date { display: block; margin-bottom: 2px; }
}
