/* =========================================================================
   Theme for Young-Jun Lee — inspired by the al-folio academic layout.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --accent: #b509ac;            /* al-folio default theme color */
  --accent-soft: rgba(181, 9, 172, 0.08);
  --text: #1c1d1f;
  --text-muted: #828282;
  --bg: #ffffff;
  --border: #ececec;
  --hover-bg: #fafafa;
  --max-width: 960px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-display: "Space Grotesk", var(--font-sans);
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e8e8;
    --text-muted: #9a9a9a;
    --bg: #1a1a1d;
    --border: #2c2c30;
    --hover-bg: #232327;
    --accent-soft: rgba(225, 95, 218, 0.14);
    --accent: #e15fda;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--text); text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Navbar ---------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.navbar-brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.navbar-brand:hover { color: var(--accent); text-decoration: none; }
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 6px 11px;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--hover-bg); text-decoration: none; }
.nav-links a.active { color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 1.1rem;
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 16px;
    left: 16px;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  }
  .nav-links.open { display: flex; }
}

/* ---------------- Page layout ---------------- */
main { padding: 40px 0 60px; min-height: 60vh; }

.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.page-subtitle { color: var(--text-muted); margin: 0 0 28px; }

h2.section-heading {
  font-family: var(--font-display);
  font-variant: normal;
  font-size: 1.55rem;
  font-weight: 600;
  margin: 42px 0 14px;
  letter-spacing: -0.01em;
  position: relative;
  padding-bottom: 8px;
}
h2.section-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}

/* ---------------- About / hero ---------------- */
.hero { display: block; }
.hero::after { content: ""; display: block; clear: both; }
.hero-text { min-width: 0; }
.hero-name {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}
.hero-roles { color: var(--text-muted); font-size: 1.05rem; margin: 0 0 6px; line-height: 1.5; }
.hero-roles span { display: block; }

.profile {
  float: right;
  width: 240px;
  margin: 4px 0 18px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.profile img {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 14px 34px rgba(0, 0, 0, 0.18),
    0 24px 60px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}
.profile img:hover {
  transform: translateY(-6px);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.10),
    0 22px 48px rgba(0, 0, 0, 0.22),
    0 36px 80px rgba(0, 0, 0, 0.16);
}
@media (max-width: 720px) {
  .profile { float: none; width: auto; margin: 0 auto 20px; }
  .profile img { width: 180px; height: 180px; }
  .hero-name, .hero-roles { text-align: center; }
}

.bio p { margin: 0 0 14px; }

/* ---------------- Social icons ---------------- */
.socials { display: flex; gap: 16px; font-size: 1.35rem; margin-top: 4px; }
.socials a { color: var(--text-muted); }
.socials a:hover { color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.contact-loc { color: var(--text-muted); font-size: 0.9rem; }

/* ---------------- News / two-column tables ---------------- */
.news-table, .talk-list { width: 100%; border-collapse: collapse; }
.news-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.news-row:last-child { border-bottom: none; }
.news-date { color: var(--accent); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.news-body { margin: 0; }
@media (max-width: 560px) {
  .news-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------------- Publications ---------------- */
.pub-note { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 18px; }
.pub-cat {
  font-family: var(--font-display);
  font-variant: normal;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 34px 0 10px;
  color: var(--text);
}
.pub-list { list-style: none; margin: 0; padding: 0; counter-reset: pub; }
.pub-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:last-child { border-bottom: none; }
.pub-list.no-num .pub-item { grid-template-columns: 1fr; gap: 0; }
.pub-num {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
  padding-top: 2px;
}
.pub-title { font-weight: 600; margin: 0 0 3px; line-height: 1.4; }
.pub-authors { font-size: 0.92rem; margin: 0 0 3px; }
.pub-authors b { color: var(--text); }
.pub-venue { font-style: italic; color: var(--text-muted); font-size: 0.92rem; }
.pub-badge {
  display: inline-block;
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 1px 8px;
  margin-left: 6px;
}
.pub-note-inline { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

/* ---------------- Publication resource links ---------------- */
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.pub-link svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}
.pub-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}
.pub-link-project:hover {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.pub-link-paper:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.pub-link-code:hover {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}
.pub-link-hf:hover {
  border-color: #ffd21e;
  background: #ffd21e;
  color: #23221e;
}

/* ---------------- Talks / experience cards ---------------- */
.entry {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.entry:last-child { border-bottom: none; }
.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.entry-title { font-weight: 700; margin: 0; }
.entry-meta { color: var(--text-muted); font-size: 0.9rem; white-space: nowrap; }
.entry-sub { color: var(--text-muted); margin: 2px 0 0; font-style: italic; }
.entry ul { margin: 8px 0 0; padding-left: 18px; }
.entry ul li { margin: 3px 0; }
.entry-talk-title { margin: 6px 0 0; font-style: italic; }

/* ---------------- Interactive timeline (CV) ---------------- */
.timeline {
  position: relative;
  margin: 22px 0 8px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), color-mix(in srgb, var(--accent) 20%, var(--border)) 70%, var(--border));
}
.timeline-item {
  position: relative;
  padding: 0 0 22px 52px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.timeline-item.in-view { opacity: 1; transform: none; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: 4px;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: var(--accent);
  z-index: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.timeline-item:hover .timeline-marker {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px var(--accent-soft);
  background: var(--accent);
  color: #fff;
}
.timeline-marker.is-current {
  background: var(--accent);
  color: #fff;
}
.timeline-marker.is-current::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: tl-pulse 1.9s ease-out infinite;
}
@keyframes tl-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.3); opacity: 0; }
}

.timeline-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.timeline-item:hover .timeline-card {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.13);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.timeline-date {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 11px;
  border-radius: 999px;
  margin-bottom: 7px;
}
.timeline-org {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2px 0 2px;
}
.timeline-role { color: var(--text); margin: 0 0 4px; font-size: 0.94rem; }
.timeline-loc { display: block; color: var(--text-muted); font-size: 0.82rem; }
.timeline-card ul { margin: 9px 0 0; padding-left: 18px; }
.timeline-card ul li { margin: 3px 0; font-size: 0.92rem; color: var(--text-muted); }
@media (prefers-reduced-motion: reduce) {
  .timeline-item { opacity: 1; transform: none; transition: none; }
  .timeline-marker.is-current::after { animation: none; }
}

/* ---------------- Simple lists ---------------- */
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.simple-list li:last-child { border-bottom: none; }

.skill-row { display: grid; grid-template-columns: 160px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.skill-row:last-child { border-bottom: none; }
.skill-label { font-weight: 600; }
@media (max-width: 560px) { .skill-row { grid-template-columns: 1fr; gap: 2px; } }

/* ---------------- CV embed ---------------- */
.cv-frame {
  width: 100%;
  height: 1100px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}
.btn:hover { color: #fff; text-decoration: none; opacity: 0.9; }

/* ---------------- Footer ---------------- */
footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.muted-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--hover-bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 10px;
}
