/* =========================================================
   Dong Ju Mun — academic homepage
   al-folio-inspired layout · indigo accent · serif display
   ========================================================= */

:root {
  --accent:      #4f46e5;
  --accent-soft: #eef0fe;
  --accent-2:    #0891b2;
  --bg:          #ffffff;
  --bg-soft:     #f7f8fb;
  --surface:     #ffffff;
  --text:        #1a1a22;
  --text-soft:   #5b6070;
  --muted:       #8a8fa0;
  --rule:        #e6e8f0;
  --rule-soft:   #eef0f5;
  --tag-bg:      #f0f1f6;
  --code-bg:     #f6f7fb;
  --shadow:      0 1px 2px rgba(20,22,40,.04), 0 8px 24px rgba(20,22,40,.06);
  --shadow-lg:   0 12px 40px rgba(20,22,40,.12);
  --maxw:        920px;
  --serif:  "Spectral", Georgia, "Times New Roman", serif;
  --sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:   "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
}

[data-theme="dark"] {
  --accent:      #8b91f7;
  --accent-soft: #23263a;
  --accent-2:    #38bdf8;
  --bg:          #14161c;
  --bg-soft:     #1a1d25;
  --surface:     #1c1f28;
  --text:        #e8e9ef;
  --text-soft:   #a9adbd;
  --muted:       #7d8295;
  --rule:        #2a2e3a;
  --rule-soft:   #23262f;
  --tag-bg:      #23262f;
  --code-bg:     #1f222b;
  --shadow:      0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

a { color: var(--accent); text-decoration: none; transition: color .15s, opacity .15s; }
a:hover { opacity: .78; }

::selection { background: var(--accent-soft); color: var(--accent); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule-soft);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 62px; display: flex; align-items: center; justify-content: space-between;
}
.brand {
  font-family: var(--serif); font-weight: 600; font-size: 1.18rem;
  color: var(--text); letter-spacing: -.01em;
}
.brand:hover { opacity: 1; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--text-soft); font-size: .92rem; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; position: relative;
}
.nav-links a:hover { color: var(--text); background: var(--bg-soft); opacity: 1; }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 1px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.theme-btn {
  margin-left: 6px; width: 36px; height: 36px; border: 1px solid var(--rule);
  background: var(--surface); border-radius: 9px; cursor: pointer;
  display: grid; place-items: center; color: var(--text-soft);
  transition: all .15s;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg { width: 17px; height: 17px; }
.theme-btn .moon { display: none; }
[data-theme="dark"] .theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .moon { display: block; }

.burger { display: none; width: 38px; height: 38px; border: 1px solid var(--rule);
  background: var(--surface); border-radius: 9px; cursor: pointer; color: var(--text); }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
main { padding: 40px 0 20px; }

.page-title {
  font-family: var(--serif); font-weight: 700; font-size: clamp(2.3rem, 6vw, 3.2rem);
  letter-spacing: -.02em; line-height: 1.05; margin: 8px 0 26px; color: var(--text);
}
.page-title .dot { color: var(--accent); }

/* ---------- hero / about ---------- */
.hero { display: grid; grid-template-columns: 1fr 270px; gap: 44px; align-items: start; }
.bio p { margin: 0 0 16px; color: var(--text); }
.bio .lede { font-size: 1.06rem; }
.bio .ri {
  margin-top: 18px; padding: 16px 18px; background: var(--bg-soft);
  border: 1px solid var(--rule-soft); border-left: 3px solid var(--accent);
  border-radius: 10px; font-size: .97rem; color: var(--text-soft);
}
.bio .ri b { color: var(--text); font-weight: 600; }
.jump {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 22px;
  font-weight: 600; font-size: .95rem; color: var(--accent);
}
.jump svg { width: 15px; height: 15px; }

/* profile card */
.card {
  position: sticky; top: 86px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 16px; padding: 18px; box-shadow: var(--shadow); text-align: center;
}
.card .avatar {
  width: 100%; aspect-ratio: 1; border-radius: 13px; object-fit: cover;
  display: block; background: var(--accent-soft);
}
.card .pname { font-family: var(--serif); font-weight: 600; font-size: 1.18rem;
  margin: 14px 0 2px; color: var(--text); }
.card .prole { font-size: .86rem; color: var(--text-soft); line-height: 1.45; }
.card .prole a { font-weight: 500; }
.card .ploc { font-size: .82rem; color: var(--muted); margin-top: 7px; }
.socials { display: flex; justify-content: center; gap: 6px; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--rule-soft); }
.socials a {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; color: var(--text-soft); background: var(--bg-soft);
  transition: all .16s;
}
.socials a:hover { color: #fff; background: var(--accent); opacity: 1; transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; }

/* ---------- section heading ---------- */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 54px 0 22px; padding-bottom: 12px; border-bottom: 1px solid var(--rule);
}
.sec-head h2 {
  font-family: var(--serif); font-weight: 700; font-size: 1.7rem;
  letter-spacing: -.01em; margin: 0; color: var(--text);
}
.sec-head .eyebrow {
  display: block; font-family: var(--mono); font-size: .72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .16em; color: var(--accent);
  margin-bottom: 4px;
}
.sec-head .see-all { font-size: .9rem; font-weight: 500; color: var(--text-soft); white-space: nowrap; }
.sec-head .see-all:hover { color: var(--accent); }

/* ---------- publications ---------- */
.pub { display: grid; grid-template-columns: 220px 1fr; gap: 26px;
  padding: 24px 0; border-bottom: 1px solid var(--rule-soft); }
.pub:last-child { border-bottom: none; }

.thumb {
  position: relative; width: 100%; aspect-ratio: 4/3; border-radius: 12px;
  overflow: hidden; background: var(--bg-soft); border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .9s ease;
}
.thumb img.show { opacity: 1; }
.thumb .dots {
  position: absolute; bottom: 8px; left: 0; right: 0; display: flex;
  justify-content: center; gap: 5px; z-index: 3;
}
.thumb .dots i {
  width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.55);
  transition: all .3s;
}
.thumb .dots i.on { background: #fff; width: 16px; border-radius: 3px; }

.pub-body { min-width: 0; }
.venue-tag {
  display: inline-block; font-family: var(--mono); font-size: .7rem; font-weight: 600;
  letter-spacing: .04em; color: var(--accent); background: var(--accent-soft);
  padding: 3px 9px; border-radius: 6px; margin-bottom: 9px;
}
.venue-tag.award { color: #b45309; background: #fef3c7; }
[data-theme="dark"] .venue-tag.award { color: #fbbf24; background: #3a2e10; }
.pub-title {
  font-family: var(--serif); font-weight: 600; font-size: 1.16rem; line-height: 1.3;
  margin: 0 0 7px; color: var(--text); letter-spacing: -.005em;
}
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--accent); }
.pub-authors { font-size: .92rem; color: var(--text-soft); margin: 0 0 3px; }
.pub-authors .me { color: var(--text); font-weight: 700; }
.pub-authors .eq { color: var(--accent); font-weight: 700; }
.pub-meta { font-size: .9rem; color: var(--muted); font-style: italic; margin: 0 0 12px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 7px; }
.pub-links a, .pub-links button {
  font-family: var(--sans); font-size: .8rem; font-weight: 500;
  color: var(--text-soft); background: var(--surface); border: 1px solid var(--rule);
  padding: 4px 11px; border-radius: 7px; cursor: pointer; transition: all .15s;
}
.pub-links a:hover, .pub-links button:hover {
  color: var(--accent); border-color: var(--accent); background: var(--accent-soft); opacity: 1;
}
.bibtex {
  display: none; margin-top: 12px; background: var(--code-bg);
  border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px;
  font-family: var(--mono); font-size: .78rem; line-height: 1.6; color: var(--text-soft);
  white-space: pre; overflow-x: auto;
}
.bibtex.open { display: block; }

/* ---------- news (optional list) ---------- */
.news { list-style: none; padding: 0; margin: 0; }
.news li { display: grid; grid-template-columns: 96px 1fr; gap: 18px;
  padding: 12px 0; border-bottom: 1px solid var(--rule-soft); font-size: .94rem; }
.news li:last-child { border-bottom: none; }
.news .date { font-family: var(--mono); font-size: .8rem; color: var(--muted); padding-top: 2px; }

/* ---------- cv page ---------- */
.cv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 22px;
}
.cv-bar p { margin: 0; color: var(--text-soft); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem;
  color: #fff; background: var(--accent); padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--accent); transition: all .15s;
}
.btn:hover { opacity: 1; box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.pdf-frame {
  width: 100%; height: 1180px; border: 1px solid var(--rule); border-radius: 14px;
  box-shadow: var(--shadow); background: var(--bg-soft);
}

/* ---------- publications page ---------- */
.year-head {
  font-family: var(--serif); font-weight: 700; font-size: 1.5rem; color: var(--accent);
  margin: 40px 0 6px; padding-bottom: 6px;
}
.subhead {
  font-family: var(--mono); font-size: .76rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-soft); margin: 26px 0 6px;
}

/* ---------- footer ---------- */
footer {
  margin-top: 60px; border-top: 1px solid var(--rule-soft); background: var(--bg-soft);
}
.foot-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 26px 24px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: .85rem; color: var(--muted);
}
.foot-inner a { color: var(--text-soft); }
.foot-inner a:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .card { position: static; max-width: 320px; margin: 0 auto; }
  .pub { grid-template-columns: 1fr; gap: 14px; }
  .thumb { max-width: 280px; }
  .nav-links { position: fixed; inset: 62px 0 auto 0; flex-direction: column;
    align-items: stretch; gap: 0; background: var(--bg); border-bottom: 1px solid var(--rule);
    padding: 8px 16px 16px; transform: translateY(-130%); transition: transform .28s ease;
    box-shadow: var(--shadow-lg); }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 12px 10px; border-radius: 8px; }
  .nav-links a.active::after { display: none; }
  .nav-links .theme-btn { margin: 8px 0 0; width: 100%; height: 42px; }
  .burger { display: grid; place-items: center; }
  .news li { grid-template-columns: 1fr; gap: 2px; }
  .pdf-frame { height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto; }
  .thumb img { transition: none; }
}

/* ---------- publications list (full list page) ---------- */
.pli {
  display: grid; grid-template-columns: 30px 1fr; gap: 14px;
  padding: 18px 0; border-bottom: 1px solid var(--rule-soft);
}
.pli:last-child { border-bottom: none; }
.pli .idx {
  font-family: var(--mono); font-size: .82rem; font-weight: 600;
  color: var(--accent); padding-top: 3px;
}
.pli .pli-body { min-width: 0; }
.pli .pub-title { font-size: 1.02rem; margin: 0 0 4px; }
.pli .pub-meta { margin: 0 0 10px; }
.cv-link-row { margin: 4px 0 30px; }
