:root {
  --bg: #fbfaf7;
  --text: #1c1c1a;
  --muted: #5f5e59;
  --faint: #8c8a83;
  --rule: #e4e1d9;
  --accent: #003c8c;          /* same blue as the CV's links */
  --accent-soft: #e8eef7;
  --media-bg: #efede7;
  --font: "Charis SIL", Charter, "Bitstream Charter", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161614;
    --text: #e9e7e1;
    --muted: #aeaba3;
    --faint: #85827a;
    --rule: #2e2d29;
    --accent: #8fb4ff;
    --accent-soft: #1f2a3d;
    --media-bg: #23221f;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}

.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 64px 24px 48px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 { font-weight: 700; line-height: 1.25; margin: 0; }

/* ---------- Intro ---------- */
.intro {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 40px;
  align-items: start;
}
.intro h1 { font-size: 2.1rem; letter-spacing: -0.01em; }
.intro .role { color: var(--muted); margin: 4px 0 18px; }
.intro p { margin: 0 0 12px; }

.links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 18px; }
.links a { font-weight: 700; }

.portrait {
  width: 180px;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  background: var(--media-bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait span { color: var(--faint); font-size: 1.5rem; letter-spacing: 0.08em; }

/* ---------- Sections ---------- */
section { margin-top: 56px; }

h2 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 20px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 8px;
}
.section-head h2 { border: 0; margin: 0; }

.toggle { display: flex; gap: 4px; padding-bottom: 6px; }
.toggle button {
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 10px;
  cursor: pointer;
}
.toggle button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--rule);
  background: var(--accent-soft);
}

.legend { color: var(--faint); font-size: 0.85rem; margin: 0 0 20px; }

/* ---------- News ---------- */
.news { list-style: none; margin: 0; padding: 0; }
.news li {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  padding: 3px 0;
}
.news time { color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- Publications ---------- */
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs[data-view="selected"] .pub:not([data-selected]) { display: none; }

.pub {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
  padding: 18px 0;
}
.pub + .pub { border-top: 1px solid var(--rule); }
.pub.no-media { grid-template-columns: 1fr; }

.media {
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: var(--media-bg);
}
.media video, .media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pub h3 { font-size: 1.02rem; margin-bottom: 4px; }
.pub h3 a { color: var(--text); }
.pub h3 a:hover { color: var(--accent); }
.pub p { margin: 0; }
.authors { color: var(--muted); font-size: 0.93rem; }
.authors b { color: var(--text); }
.venue { margin-top: 4px !important; font-size: 0.93rem; }
.note { color: var(--faint); font-style: italic; }
.note::before { content: "\00b7\00a0"; font-style: normal; }
.plinks { margin-top: 6px !important; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.9rem; }

sup { font-size: 0.7em; line-height: 0; }

/* ---------- Experience ---------- */
.job { display: grid; grid-template-columns: 64px 1fr; gap: 20px; align-items: start; }
.job-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #ffcd00;         /* Kakao yellow; same in both color schemes */
  display: grid;
  place-items: center;
}
.job-logo img { width: 80%; filter: brightness(0); }   /* official wordmark, rendered black on yellow */
.job-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.job-head h3 { font-size: 1.05rem; }
.when { color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.job-role { color: var(--muted); margin: 2px 0 10px; }
.projects { margin: 0; padding-left: 1.1em; }
.projects li { margin-bottom: 10px; color: var(--muted); }
.projects li::marker { color: var(--faint); }
.ptitle { display: block; color: var(--text); font-style: italic; }

/* ---------- Footer ---------- */
footer { margin-top: 64px; padding-top: 16px; border-top: 1px solid var(--rule); color: var(--faint); font-size: 0.85rem; }
footer p { margin: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .page { padding: 40px 16px 32px; }
  .intro { grid-template-columns: 1fr; gap: 24px; }
  .portrait { order: -1; width: 120px; }
  .pub { grid-template-columns: 1fr; gap: 12px; }
  .news li { grid-template-columns: 1fr; gap: 0; padding: 6px 0; }
  .job { grid-template-columns: 48px 1fr; gap: 14px; }
  .job-logo { width: 48px; height: 48px; border-radius: 11px; }
  .job-head { flex-wrap: wrap; gap: 0 12px; }
}
