/* ============ Theme tokens ============ */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --text: #1f2328;
  --muted: #5f6670;
  --line: #e5e7eb;
  --accent: #0b5cad;       /* 메인 포인트 색 — 바꾸면 전체 톤이 바뀝니다 */
  --accent-soft: #e8f1fb;
  --badge: #b4232a;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121417;
  --bg-soft: #1b1e23;
  --text: #e6e8eb;
  --muted: #9aa3ad;
  --line: #2c3138;
  --accent: #6cb2ff;
  --accent-soft: #1c2b3d;
  --badge: #ff7b72;
  color-scheme: dark;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.container { max-width: 920px; margin: 0 auto; padding: 32px 20px 48px; }

h1, h2, h3 { font-family: var(--font-ui); line-height: 1.25; }
h2 {
  font-size: 1.45rem;
  margin: 48px 0 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

/* ============ Nav ============ */
.topnav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-ui);
}
.nav-inner {
  max-width: 920px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap;
}
.brand { font-weight: 700; color: var(--text); margin-right: auto; }
.topnav ul { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; font-size: 0.92rem; }
.topnav ul a { color: var(--muted); font-weight: 500; }
.topnav ul a:hover { color: var(--accent); text-decoration: none; }
.theme-toggle {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); }

/* ============ About ============ */
/* 이름·직함은 위에 전체 폭, 그 아래에서 소개글과 사진의 윗선이 맞춰짐 */
.about {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 36px;
  grid-template-areas: "head head" "text photo";
  align-items: start;
}
.about-head { grid-area: head; }
.about-text { grid-area: text; min-width: 0; }
.about-text > p:first-child { margin-top: 0; }
.portrait {
  grid-area: photo;
  width: 190px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.about h1 { font-size: 2.1rem; margin: 0 0 4px; }
.name-ko { font-size: 1.1rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.tagline { margin: 0 0 16px; font-family: var(--font-ui); color: var(--muted); font-size: 0.98rem; }

.social { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 20px 0 8px; }
.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-soft); color: var(--muted); font-size: 1.15rem;
  transition: background .2s, color .2s;
}
.social a:hover { background: var(--accent); color: #fff; text-decoration: none; }
.social .icon { width: 1.25rem; height: 1.25rem; display: block; }
.social .ai-google-scholar { font-size: 1.3rem; }
.social .cv-text { font: 800 1rem/1 var(--font-ui); letter-spacing: -0.02em; }
.meta { font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted); }
.meta i { margin-right: 4px; }

/* ============ Lists ============ */
.news, .plain { list-style: none; padding: 0; margin: 0; }
.news li, .plain li { padding: 5px 0; display: flex; gap: 14px; }
.date {
  flex-shrink: 0; min-width: 64px;
  font-family: var(--font-ui); font-size: 0.85rem; font-weight: 600; color: var(--accent);
  padding-top: 3px;
}
.is-hidden { display: none !important; }
.link-btn {
  margin-top: 8px; border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--accent); font: 600 0.9rem var(--font-ui);
}
.link-btn:hover { text-decoration: underline; }
.note { font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted); margin-top: -6px; }

/* ============ Publications ============ */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.filter {
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  padding: 5px 14px; border-radius: 999px; cursor: pointer;
  font: 500 0.88rem var(--font-ui);
}
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .filter.active { color: #0b1420; }

.year { font-size: 1rem; color: var(--muted); margin: 26px 0 6px; }
.paper {
  display: flex; gap: 20px; padding: 16px 0;
  border-bottom: 1px dashed var(--line);
}
.paper:last-child { border-bottom: 0; }
.thumb {
  width: 200px; flex-shrink: 0; aspect-ratio: 16 / 10;
  border-radius: 8px; overflow: hidden; background: var(--bg-soft);
  border: 1px solid var(--line);
}
.thumb:not(.empty) { background: #fff; }   /* 논문 그림은 보통 흰 배경 */
/* 비율이 달라도 잘리지 않고 그림 전체가 보이도록 (남는 부분은 흰 여백) */
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 4px; box-sizing: border-box; }
.thumb.empty { background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft)); }
.paper-body { flex: 1; min-width: 0; }
.paper-title { font-family: var(--font-ui); font-weight: 600; font-size: 1.02rem; line-height: 1.4; }
.paper-authors { font-size: 0.95rem; color: var(--muted); margin-top: 3px; }
.paper-authors .me { color: var(--text); }
.paper-venue { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.venue {
  display: inline-block;
  font: 600 0.8rem var(--font-ui); color: var(--text);
  background: var(--bg-soft);
  padding: 2px 8px; border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
:root[data-theme="dark"] .venue { box-shadow: 0 0 0 1px var(--line); }
.badge {
  font: 700 0.72rem var(--font-ui); letter-spacing: .02em; text-transform: uppercase;
  color: var(--badge); border: 1px solid currentColor; border-radius: 4px; padding: 1px 6px;
}
.sub { font-size: 0.9rem; color: var(--muted); }
.paper-tldr { font-size: 0.92rem; margin-top: 6px; }
.paper-links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  font: 500 0.78rem var(--font-ui);
  padding: 2px 10px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
}
.pill:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* ============ Timeline (Education / Experience) ============ */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 16px; align-items: flex-start; padding: 10px 0; }
.timeline > li > div { flex: 1; }
.logo { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; border-radius: 6px; }
.row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.when { font-family: var(--font-ui); font-size: 0.85rem; color: var(--muted); }

/* ============ Footer ============ */
footer {
  text-align: center; padding: 28px 16px 40px;
  font: 0.82rem var(--font-ui); color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ============ Blog ============ */
.post-list { list-style: none; padding: 0; }
.post-list li { padding: 10px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 14px; }
.post h1 { font-size: 2rem; margin-bottom: 4px; }
.post .post-date { font-family: var(--font-ui); color: var(--muted); font-size: 0.9rem; margin-bottom: 28px; }
.post pre { background: var(--bg-soft); padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 0.88rem; }
.post code { font-size: 0.9em; }
.post blockquote { border-left: 3px solid var(--accent); margin: 0; padding-left: 16px; color: var(--muted); }

/* ============ Responsive ============ */
@media (max-width: 680px) {
  body { font-size: 16px; }
  .about { grid-template-columns: minmax(0, 1fr); grid-template-areas: "photo" "head" "text"; row-gap: 16px; }
  .portrait { width: 150px; justify-self: center; }
  .paper { flex-direction: column; gap: 10px; }
  .thumb { width: 100%; max-width: 360px; }
  .topnav ul { font-size: 0.85rem; gap: 2px 12px; }
}

/* 증빙 문서 버튼 (아이콘만, 마우스를 올리면 설명 표시). 논문의 Paper/Code 버튼과 같은 톤 */
.doc-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin: 2px 0 2px 5px; border-radius: 6px;
  font-size: 0.85rem; vertical-align: -6px;
  background: var(--accent-soft); color: var(--accent);
  transition: background .15s, color .15s;
}
.doc-link:hover { background: var(--accent); color: #fff; text-decoration: none; }
:root[data-theme="dark"] .doc-link:hover { color: #0b1420; }
