/* ─── Colour tokens ─────────────────────────────────────────── */
:root {
  --bg: #fafaf8;
  --text: #222;
  --text-strong: #111;
  --text-2: #333;
  --text-3: #555;
  --text-4: #666;
  --muted: #888;
  --faint: #999;
  --fainter: #aaa;
  --faintest: #bbb;
  --border: #e0ddd6;
  --border-2: #e8e5de;
  --accent: #3a5a8c;
  --accent-2: #7a9bbf;
  --badge-bg: #eef2f8;
  --badge-border: #c9d5e6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191c;
    --text: #d9d7d2;
    --text-strong: #f1efea;
    --text-2: #cfccc6;
    --text-3: #b3b0aa;
    --text-4: #a3a09a;
    --muted: #8e8b85;
    --faint: #7f7c76;
    --fainter: #74716b;
    --faintest: #5c5a55;
    --border: #2f3236;
    --border-2: #2a2d31;
    --accent: #8fb0dd;
    --accent-2: #5b7aa6;
    --badge-bg: #1e2938;
    --badge-border: #35496a;
  }
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Serif 4', 'Noto Serif KR', Georgia, serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}

/* ─── Accent Bar ────────────────────────────────────────────── */
.accent-bar {
  height: 3px;
  background: linear-gradient(to right, var(--accent), var(--accent-2));
  width: 100%;
}

/* ─── Navigation ────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 0.75rem 0;
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav ul li a {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-3);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

nav ul li a:hover {
  color: var(--text-strong);
}

nav ul li a.active {
  color: var(--text-strong);
  font-weight: 500;
}

/* ─── Main Layout ───────────────────────────────────────────── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 2rem 3rem;
}

section {
  margin-bottom: 3rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

/* ─── Profile Block ─────────────────────────────────────────── */
.profile-block {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  margin-top: 0.4rem;
}

/* ─── About Section ─────────────────────────────────────────── */
h1 {
  font-size: 2.1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-bottom: 0.3rem;
  color: var(--text-strong);
}

.korean {
  font-size: 1.4rem;
  color: var(--text-4);
}

.position {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-4);
  letter-spacing: 0.03em;
  margin-bottom: 1.4rem;
}

.bio {
  margin-bottom: 1.4rem;
  color: var(--text-2);
  font-size: 1.1rem;
}

/* Research fields: plain, small, dot-separated text */
.research-fields {
  margin-bottom: 1.1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  line-height: 1.9;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.research-fields span {
  white-space: nowrap;
}

/* separator sits at the end of the line when wrapping, never at the start */
.research-fields span:not(:last-child)::after {
  content: "·";
  margin: 0 0.25rem 0 0.55rem;
  color: var(--faintest);
}

.contact-links {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: var(--text-3);
}

.contact-links a {
  color: var(--accent);
  text-decoration: none;
}

.contact-links a:hover {
  text-decoration: underline;
}

.email {
  white-space: nowrap;
}

.email .at {
  font-style: italic;
  color: var(--faint);
  padding: 0 0.1rem;
}

.sep {
  margin: 0 0.4rem;
  color: var(--faintest);
}

/* ─── Section Headings ──────────────────────────────────────── */
h2 {
  font-size: 1.625rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-strong);
  margin-bottom: 1.6rem;
}

h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-2);
  padding-bottom: 0.4rem;
}

/* ─── Papers ────────────────────────────────────────────────── */
.paper {
  margin-bottom: 1.6rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  transition: border-left-color 0.2s ease;
}

.paper:hover {
  border-left-color: var(--accent);
}

.paper-title {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-strong);
  margin-bottom: 0.2rem;
}

.paper-title-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--accent);
  text-decoration: none;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.paper-title-link:hover {
  text-decoration: underline;
}

.paper-title-ko {
  font-family: 'Noto Serif KR', serif;
  font-size: 1.0rem;
  font-weight: 700;
}

.paper-title-en {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--text-3);
}

.paper-authors {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text-4);
  margin-bottom: 0.2rem;
}

.paper-meta {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.paper-links {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.paper-links a {
  color: var(--accent);
  text-decoration: none;
  margin-right: 0.6rem;
}

.paper-links a:hover {
  text-decoration: underline;
}

.paper-abstract {
  font-size: 0.95rem;
  color: var(--text-3);
  margin-top: 0.3rem;
}

.toggle-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  margin-right: 0.4rem;
}

.toggle-label:hover {
  text-decoration: underline;
}

.abstract-text {
  display: none;
}

/* ─── Paper status badge ────────────────────────────────────── */
.paper-status {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text-3);
  margin: 0.15rem 0 0.25rem;
}

.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 3px;
  padding: 0.12rem 0.45rem;
  margin-right: 0.35rem;
  vertical-align: 0.08em;
}

/* ─── CV Section ────────────────────────────────────────────── */
.cv-block {
  margin-bottom: 1.5rem;
}

.cv-entry {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 0.6rem;
  align-items: baseline;
}

.cv-year {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  color: var(--muted);
  min-width: 90px;
  flex-shrink: 0;
}

.cv-detail {
  font-size: 1.05rem;
  color: var(--text-2);
}

.cv-indent {
  color: var(--text-3);
  font-size: 1rem;
}

.cv-download {
  margin-top: 1.2rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
}

.cv-download a {
  color: var(--accent);
  text-decoration: none;
}

.cv-download a:hover {
  text-decoration: underline;
}

/* ─── Footer ────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--fainter);
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--text-2);
}

.footer-updated {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--faintest);
}

/* ─── Fade-in ───────────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.paper.fade-in {
  transition: opacity 0.5s ease, transform 0.5s ease, border-left-color 0.2s ease;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  body { font-size: 16px; }
  main { padding: 2.5rem 1.2rem 2rem; }
  .nav-inner { padding: 0 1.2rem; }
  h1 { font-size: 1.7rem; }
  .cv-entry { flex-direction: column; gap: 0.1rem; }
  .cv-year { min-width: unset; }
  .profile-block { flex-direction: column; align-items: center; text-align: center; }
  .research-fields { justify-content: center; }
}
