/* ============================================================
   Personal homepage — plain CSS, no build step.
   Layout follows the previous Google Sites page:
   dark top bar / left profile sidebar / right content column.
   Colors are defined once here; dark mode follows the OS setting.
   ============================================================ */

:root {
  --bg: #ffffff;
  --text: #212121;
  --muted: #6b7078;
  --border: #e6e8eb;
  --heading: #3c78d8;   /* section headings (Google Sites blue) */
  --link: #1f6f8b;      /* paper titles & links */
  --topbar-bg: #111111;
  --topbar-text: #f2f2f2;
  --font: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
          "Malgun Gothic", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1080px;
  --sidebar: 220px;
  --topbar-h: 3.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181b;
    --text: #e4e6e9;
    --muted: #9aa1aa;
    --border: #2b2f35;
    --heading: #7ea6ef;
    --link: #6cc0dc;
    --topbar-bg: #0b0c0e;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 1rem); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.6;
  word-break: keep-all;        /* 한글 단어 중간에서 줄바꿈 방지 */
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
p { margin: 0; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--topbar-bg);
  color: var(--topbar-text);
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand { color: inherit; text-decoration: none; font-size: 1.05rem; white-space: nowrap; }
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
}
.nav-links a {
  color: #b9bec5;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; border-bottom-color: var(--heading); }

/* ---------- Two-column layout ---------- */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  gap: 3.5rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 2rem);
  text-align: center;
}
.profile-photo {
  display: block;
  width: 100%;
  max-width: var(--sidebar);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--border);
}
.profile-name { margin-top: 1rem; font-size: 0.98rem; }
.profile-name .ko { white-space: nowrap; }
.profile-affil { margin-top: 0.2rem; color: var(--muted); font-size: 0.88rem; }

.icon-links {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.icon-links a {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: #5f6368;
  color: #fff;
  transition: background 0.15s;
}
.icon-links a:hover { background: var(--heading); }
.icon-links svg { width: 1.05rem; height: 1.05rem; fill: currentColor; }

/* ---------- Sections ---------- */
main { min-width: 0; }
section { margin-bottom: 3.25rem; }

h2 {
  margin: 0 0 1.25rem;
  color: var(--heading);
  font-size: 1.55rem;
  font-weight: 700;
}
h3.year {
  margin: 1.75rem 0 0.9rem;
  color: var(--heading);
  font-size: 0.95rem;
  font-weight: 700;
}
.note { color: var(--muted); font-size: 0.88rem; }

/* Generic entry (education / experience / project / teaching) */
.entry { margin-bottom: 1rem; }
.entry-title { font-weight: 700; }
.entry-meta { color: var(--muted); font-size: 0.9rem; }
.period { font-weight: 400; color: var(--muted); }

/* Publications */
.pubs { margin: 0; padding: 0; list-style: none; }
.pubs li { margin-bottom: 1.15rem; }
.pub-title { font-weight: 700; color: var(--text); }
a.pub-title { color: var(--link); text-underline-offset: 2px; }
.pub-title-ko { font-size: 0.95rem; }
.pub-authors { font-size: 0.92rem; color: var(--muted); }
.pub-venue { font-size: 0.9rem; color: var(--muted); font-style: italic; }
.pub-links { font-size: 0.9rem; }

/* Shown when a sections/*.html file fails to load */
.load-error {
  padding: 0.75rem 1rem;
  border: 1px solid #e0a3a3;
  border-radius: 6px;
  background: #fdf2f2;
  color: #8a1f1f;
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--maxw);
  margin: 1rem auto 0;
  padding: 1.5rem 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

/* ---------- Tablet / mobile ---------- */
@media (max-width: 760px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; padding: 0.55rem 1.25rem; gap: 0.2rem; }
  .nav-links { font-size: 0.85rem; gap: 0.1rem 0.9rem; }
  html { scroll-padding-top: 6rem; }

  .layout { grid-template-columns: 1fr; gap: 2rem; padding: 2rem 1.25rem 0; }
  .sidebar { position: static; }
  .profile-photo { margin: 0 auto; max-width: 160px; }
}
