/* ---------- Design Tokens ---------- */
:root {
  --navy: #0F2E4C;
  --navy-2: #17416B;
  --ivory: #FAF7F2;
  --ivory-2: #F2ECE0;
  --gold: #B08D57;
  --gold-2: #C9A66B;
  --ink: #1B2430;
  --muted: #5B6674;
  --line: #E4DDD0;
  --card: #FFFFFF;

  --serif: "EB Garamond", "Noto Serif KR", "Source Serif Pro", Georgia, serif;
  --sans: "Inter", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;

  --maxw: 1160px;
  --pad-x: clamp(20px, 4vw, 40px);
  --radius: 4px;
  --shadow-sm: 0 1px 2px rgba(15, 46, 76, .05);
  --shadow-md: 0 8px 30px rgba(15, 46, 76, .08);

  --t-fast: 180ms ease;
  --t: 260ms cubic-bezier(.2,.7,.2,1);
}

/* Dark mode */
html[data-theme="dark"] {
  --navy: #0B1B2C;
  --navy-2: #12283F;
  --ivory: #0E1620;
  --ivory-2: #14202E;
  --gold: #D5B27B;
  --gold-2: #E3C68F;
  --ink: #E8ECF1;
  --muted: #97A1AE;
  --line: #223243;
  --card: #142235;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--serif);
  background: var(--ivory);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--t-fast), color var(--t-fast); }
a:hover { border-color: var(--gold); }
html[data-theme="dark"] a { color: var(--gold-2); }

/* Sans headings & UI */
h1, h2, h3, h4, .sans, nav, button, .btn, .tag, .meta, .kicker {
  font-family: var(--sans);
  letter-spacing: -0.01em;
}
h1, h2, h3 { color: var(--ink); font-weight: 600; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.1; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2; margin: 0 0 .6em; }
h3 { font-size: 1.15rem; margin: 0 0 .4em; }
.kicker {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 14px;
  display: inline-block;
}
.hero .kicker {
  font-size: 14px;
  letter-spacing: .24em;
  margin-bottom: 14px;
}
.hero .hero-name {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 4px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5em;
}
.hero .hero-name .name-given {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.hero .hero-name .name-title {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.hero-rule {
  width: 44px;
  height: 2px;
  background: var(--gold);
  margin: 18px 0 0;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad-x); }
section { padding: clamp(56px, 8vw, 96px) 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--ivory), transparent 8%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--sans); font-weight: 600; font-size: 15px; color: var(--ink); border: none; }
.brand .logo { width: 34px; height: 34px; display: grid; place-items: center; border: 1.5px solid var(--navy); border-radius: 50%; color: var(--navy); font-family: var(--serif); font-weight: 600; font-size: 15px; font-style: italic; }
html[data-theme="dark"] .brand .logo { border-color: var(--gold); color: var(--gold); }
.brand .brand-sub { color: var(--muted); font-weight: 400; font-size: 12px; letter-spacing: .04em; margin-left: 2px; }

nav.primary { display: flex; align-items: center; gap: 6px; }
nav.primary a {
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  color: var(--muted); padding: 8px 12px; border-radius: var(--radius); border: none;
  transition: color var(--t-fast), background var(--t-fast);
}
nav.primary a:hover, nav.primary a.active { color: var(--ink); background: var(--ivory-2); }

.header-tools { display: flex; align-items: center; gap: 8px; }
.lang-toggle, .theme-toggle {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 7px 11px; border-radius: var(--radius); cursor: pointer;
  transition: all var(--t-fast);
}
.lang-toggle:hover, .theme-toggle:hover { border-color: var(--gold); color: var(--ink); }
.theme-toggle { padding: 7px 9px; }

.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 9px; cursor: pointer; color: var(--muted); }

@media (max-width: 860px) {
  nav.primary { display: none; }
  .menu-btn { display: inline-flex; }
  nav.primary.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--ivory); border-bottom: 1px solid var(--line);
    padding: 12px var(--pad-x);
  }
  nav.primary.open a { padding: 12px 0; border-bottom: 1px solid var(--line); border-radius: 0; }
}

/* ---------- Hero ---------- */
.hero { padding-top: clamp(48px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.015em; word-break: keep-all; overflow-wrap: break-word; }
.hero h1 .accent { color: var(--gold); font-style: italic; }
.hero .lede { font-size: 1.05rem; color: var(--ink); max-width: 54ch; margin: 14px 0 0; line-height: 1.8; word-break: keep-all; overflow-wrap: break-word; }
.hero .affil { font-family: var(--sans); font-size: 14px; color: var(--muted); margin: 22px 0 0; }
.hero .affil strong { color: var(--ink); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  padding: 11px 18px; border-radius: var(--radius);
  border: 1px solid var(--navy); background: var(--navy); color: #fff;
  cursor: pointer; transition: all var(--t-fast);
}
.btn:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold); color: var(--ink); background: transparent; }
html[data-theme="dark"] .btn { background: var(--gold); border-color: var(--gold); color: #14202E; }
html[data-theme="dark"] .btn:hover { background: var(--gold-2); border-color: var(--gold-2); }
html[data-theme="dark"] .btn.ghost { background: transparent; color: var(--ink); }

.portrait {
  position: relative; aspect-ratio: 4/5; max-width: 460px; margin-left: auto;
  border-radius: 2px; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 68% center; filter: contrast(1.02) saturate(.95); }
.portrait::after {
  content: ""; position: absolute; inset: 0;
  border: 1px solid rgba(176, 141, 87, .5);
  pointer-events: none;
  transform: translate(10px, 10px);
}

/* ---------- Section utilities ---------- */
.section-head { margin-bottom: 40px; max-width: 720px; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---------- Highlights ---------- */
.highlights-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 720px) { .highlights-grid { grid-template-columns: 1fr; } }
.hl-card {
  background: var(--card); border: 1px solid var(--line);
  padding: 26px 24px; border-radius: var(--radius);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.hl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in oklab, var(--gold), transparent 60%); }
.hl-card .yr { font-family: var(--sans); font-size: 12px; letter-spacing: .12em; color: var(--gold); font-weight: 600; }
.hl-card h3 { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; margin: 8px 0 6px; line-height: 1.35; }
.hl-card p { color: var(--muted); font-size: 14px; margin: 0; font-family: var(--sans); }

/* ---------- Research interests ---------- */
.section-alt { background: var(--ivory-2); }
.interests-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1000px) { .interests-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .interests-grid { grid-template-columns: 1fr; } }
.int-card {
  background: var(--card); border: 1px solid var(--line);
  padding: 26px 22px; border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 14px; align-items: flex-start;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.int-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.int-card .ico {
  width: 42px; height: 42px; flex-shrink: 0; color: var(--gold);
  display: grid; place-items: center;
  border: 1px solid color-mix(in oklab, var(--gold), transparent 60%);
  border-radius: 50%;
}
.int-card .int-body { min-width: 0; }
.int-card h3 {
  font-family: var(--serif); font-size: 1.08rem; font-weight: 500;
  letter-spacing: -0.01em; margin: 0 0 4px; color: var(--ink); line-height: 1.35;
  word-break: keep-all; overflow-wrap: break-word;
}
.int-card .int-subtitle {
  font-family: var(--sans); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.02em; color: var(--gold);
  margin: 0 0 10px; text-transform: none; line-height: 1.4;
}
.int-card p {
  font-family: var(--sans); font-size: 13.5px; color: var(--muted);
  margin: 0; line-height: 1.7; word-break: keep-all; overflow-wrap: break-word;
}

/* ---------- Publications ---------- */
.pub-controls {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 24px;
}
.pub-controls input[type="search"] {
  flex: 1 1 260px; min-width: 200px;
  font-family: var(--sans); font-size: 14px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
}
.pub-controls input[type="search"]:focus { outline: none; border-color: var(--gold); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  cursor: pointer; transition: all var(--t-fast);
}
.chip:hover { color: var(--ink); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
html[data-theme="dark"] .chip.active { background: var(--gold); color: #14202E; border-color: var(--gold); }

.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-item {
  padding: 22px 0; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 88px 1fr; gap: 24px; align-items: baseline;
}
@media (max-width: 640px) { .pub-item { grid-template-columns: 1fr; gap: 6px; } }
.pub-year {
  font-family: var(--sans); font-weight: 600; font-size: 14px;
  color: var(--gold); letter-spacing: .04em;
}
.pub-title {
  font-family: var(--serif); font-size: 1.08rem; line-height: 1.45;
  color: var(--ink); margin: 0 0 6px;
}
.pub-meta {
  font-family: var(--sans); font-size: 13px; color: var(--muted); margin: 0;
}
.pub-meta .authors { color: var(--ink); }
.pub-meta em { font-style: italic; color: var(--muted); }
.pub-tag {
  display: inline-block; margin-left: 8px;
  font-family: var(--sans); font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  padding: 2px 8px; border-radius: 3px; text-transform: uppercase;
}
.pub-tag.ssci   { background: color-mix(in oklab, var(--gold), transparent 82%); color: var(--gold); border: 1px solid color-mix(in oklab, var(--gold), transparent 70%); }
.pub-tag.scopus { background: color-mix(in oklab, #6E4A9E, transparent 86%); color: #6E4A9E; border: 1px solid color-mix(in oklab, #6E4A9E, transparent 65%); }
.pub-tag.kci    { background: color-mix(in oklab, var(--navy), transparent 88%); color: var(--navy); border: 1px solid color-mix(in oklab, var(--navy), transparent 75%); }
.pub-tag.intl   { background: color-mix(in oklab, #4A6B7C, transparent 86%); color: #4A6B7C; border: 1px solid color-mix(in oklab, #4A6B7C, transparent 70%); }
html[data-theme="dark"] .pub-tag.kci    { color: var(--gold-2); background: color-mix(in oklab, var(--gold), transparent 82%); border-color: color-mix(in oklab, var(--gold), transparent 65%); }
html[data-theme="dark"] .pub-tag.scopus { color: #C7A9E8; background: color-mix(in oklab, #C7A9E8, transparent 82%); border-color: color-mix(in oklab, #C7A9E8, transparent 65%); }
html[data-theme="dark"] .pub-tag.intl   { color: #9FB6C4; background: color-mix(in oklab, #9FB6C4, transparent 82%); border-color: color-mix(in oklab, #9FB6C4, transparent 65%); }

/* ---------- Timeline (CV) ---------- */
.cv-grid { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: flex-start; }
@media (max-width: 780px) { .cv-grid { grid-template-columns: 1fr; gap: 12px; } }
.cv-group h3 {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); position: sticky; top: 90px;
}
.cv-list { list-style: none; padding: 0; margin: 0; }
.cv-item { display: grid; grid-template-columns: 68px 1fr; gap: 18px; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.cv-item:last-child { border-bottom: 0; }
.cv-item .yr { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--muted); }
.cv-item .desc { font-family: var(--sans); font-size: 14.5px; color: var(--ink); line-height: 1.55; }
.cv-item .desc small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 780px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-block .row { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: baseline; font-family: var(--sans); font-size: 14.5px; }
.contact-block .row:last-child { border-bottom: 0; }
.contact-block .label { flex: 0 0 96px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.contact-block .val { color: var(--ink); }
.contact-block .val a { color: var(--ink); border-bottom: 1px solid var(--line); }
.contact-block .val a:hover { border-color: var(--gold); }

.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.socials a {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink);
}
.socials a:hover { border-color: var(--gold); color: var(--ink); }

/* ---------- Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 44px;
  font-family: var(--sans); font-size: 13px; color: var(--muted);
}
footer.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer.site-footer a { color: var(--muted); border-bottom: 1px solid transparent; }
footer.site-footer a:hover { color: var(--ink); border-color: var(--gold); }

/* ---------- Reveal animations ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Print ---------- */
@media print {
  .site-header, footer.site-footer, .header-tools, .pub-controls, .hero-cta, .menu-btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  section { padding: 12pt 0; }
}
