:root {
  --bg: #ffffff;
  --surface: #f5f7fa;
  --text: #16181d;
  --muted: #5f6672;
  --faint: #8a919c;
  --border: #e6e8ec;
  --accent: #2563eb;
  --accent-soft: #eef3fe;
  --logo-bg: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #171a20;
    --text: #e8eaee;
    --muted: #a3aab5;
    --faint: #7c8491;
    --border: #262a32;
    --accent: #7aa7ff;
    --accent-soft: #1a2540;
    --logo-bg: #f4f5f7;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a20;
  --text: #e8eaee;
  --muted: #a3aab5;
  --faint: #7c8491;
  --border: #262a32;
  --accent: #7aa7ff;
  --accent-soft: #1a2540;
  --logo-bg: #f4f5f7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 15.5px;
  line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p { margin: 0 0 12px; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { font-weight: 600; color: var(--text); font-size: 15px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 24px; }
.nav a { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }

.page { max-width: 1000px; margin: 0 auto; padding: 52px 24px 40px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 48px;
  align-items: start;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  margin: 0 0 6px;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.name-ko { font-size: 21px; font-weight: 500; color: var(--faint); margin-left: 6px; letter-spacing: 0; }
.tagline { color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.hero strong { font-weight: 600; }

.hero-photo { margin: 0; }
.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
}
.btn:hover { background: var(--accent-soft); border-color: var(--accent-soft); text-decoration: none; }

svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* Sections */
.section { padding: 36px 0 32px; border-bottom: 1px solid var(--border); }
.section:last-of-type { border-bottom: 0; }
.section h2 { margin: 0 0 20px; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.legend { font-size: 12.5px; color: var(--faint); }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: flex; gap: 18px; padding: 5px 0; }
.news .date { flex: 0 0 74px; color: var(--faint); font-size: 13.5px; font-weight: 500; padding-top: 1px; font-variant-numeric: tabular-nums; }

/* Publications */
.pub {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}
.pub:first-of-type { border-top: 0; padding-top: 4px; }
.pub-thumb img {
  display: block;
  width: 100%;
  height: 148px;
  object-fit: contain;
  background: var(--logo-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.pub-title { margin: 0 0 8px; font-size: 16px; line-height: 1.45; font-weight: 600; }
.pub-authors { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.venue {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
}
.pub-links { display: flex; flex-wrap: wrap; gap: 18px; margin: 14px 0 0; }
.pub-links a { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; }

/* Education */
.entry { display: flex; gap: 16px; margin-bottom: 22px; }
.entry:last-child { margin-bottom: 0; }
.entry-body { flex: 1; min-width: 0; }
.entry-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.logo {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--logo-bg);
  display: grid;
  place-items: center;
  padding: 7px;
}
.logo img { max-width: 100%; max-height: 100%; display: block; }
.entry p { margin: 0; line-height: 1.5; }
.entry-title { font-weight: 600; font-size: 15px; }
.entry-org { color: var(--text); font-size: 14px; }
.entry-meta { color: var(--muted); font-size: 13.5px; }
.entry-date { color: var(--faint); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Honors / Service */
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 14.5px; }
.plain-list strong { font-weight: 600; }
.year { color: var(--faint); font-size: 13.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.footer { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--faint); }

/* Phone */
@media (max-width: 760px) {
  .topbar-inner { padding: 0 16px; }
  .nav { display: none; }
  .page { padding: 32px 16px 32px; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-photo { order: -1; }
  .hero h1 { font-size: 30px; }
  .pub { grid-template-columns: 1fr; gap: 14px; }
  .pub-thumb img { height: auto; max-height: 220px; }
  .entry-row, .plain-list li { flex-direction: column; gap: 0; }
  .hero-photo { width: 140px; }
  .news li { flex-direction: column; gap: 0; }
  .news .date { flex-basis: auto; }
}
