:root {
  --bg: #ffffff;
  --text: #1c1c1d;
  --muted: #6c757d;
  --accent: #b509ac;
  --hr: #e8e8e8;
  --badge-bg: #b509ac;
  --badge-text: #ffffff;
  --card-hover: #f7f7f9;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --shadow: 0 2px 5px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1c1d;
    --text: #e8e8e8;
    --muted: #a0a4a8;
    --accent: #2698ba;
    --hr: #333336;
    --badge-bg: #2698ba;
    --badge-text: #ffffff;
    --card-hover: #262628;
    --nav-bg: rgba(28, 28, 29, 0.95);
  }
}

:root[data-theme="dark"] {
  --bg: #1c1c1d;
  --text: #e8e8e8;
  --muted: #a0a4a8;
  --accent: #2698ba;
  --hr: #333336;
  --badge-bg: #2698ba;
  --badge-text: #ffffff;
  --card-hover: #262628;
  --nav-bg: rgba(28, 28, 29, 0.95);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
}

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

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hr);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.brand {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 300;
}
.brand-first { font-weight: 500; }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-links a { color: var(--text); font-size: 0.95rem; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}
.theme-toggle:hover { color: var(--accent); }

/* ---------- Header ---------- */
main { padding-top: 88px; padding-bottom: 48px; }

.post-header { margin-bottom: 1.5rem; }
.post-title {
  font-family: "Roboto Slab", serif;
  font-weight: 300;
  font-size: 2.6rem;
  margin: 0;
  line-height: 1.2;
}
.post-title .first { font-weight: 500; }
.desc { color: var(--muted); margin: 0.25rem 0 0; font-size: 1.05rem; }

.profile {
  float: right;
  width: 240px;
  margin: 0 0 1rem 1.75rem;
  text-align: center;
}
.profile img {
  width: 100%;
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.profile .address {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.75rem;
  line-height: 1.5;
}

.tagline { font-style: italic; color: var(--muted); }

.clearfix::after { content: ""; display: table; clear: both; }

/* ---------- Sections ---------- */
h2 {
  font-family: "Roboto Slab", serif;
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--accent);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--hr);
}

ul { padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }

/* Career */
.career li strong { display: inline-block; min-width: 92px; }

/* News */
.news { width: 100%; border-collapse: collapse; }
.news td { padding: 0.45rem 0; vertical-align: top; border-bottom: 1px solid var(--hr); }
.news tr:last-child td { border-bottom: none; }
.news .date { width: 90px; font-weight: 500; white-space: nowrap; padding-right: 1rem; }

/* Publications */
.bibliography { list-style: none; padding: 0; margin: 0; }
.bibliography > li {
  display: flex;
  gap: 1rem;
  padding: 0.85rem 0.5rem;
  margin: 0;
  border-radius: 6px;
  transition: background 0.15s;
}
.bibliography > li:hover { background: var(--card-hover); }
.abbr { flex: 0 0 110px; padding-top: 2px; }
.badge {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.pub-body { flex: 1; min-width: 0; }
.pub-body .title { font-weight: 500; }
.pub-body .author { font-size: 0.93rem; }
.pub-body .author em { font-style: normal; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.pub-body .periodical { font-size: 0.93rem; font-style: italic; color: var(--muted); }
.award { color: var(--accent); font-style: normal; font-weight: 500; }
.links { margin-top: 0.35rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.links a {
  font-size: 0.75rem;
  border: 1px solid var(--text);
  color: var(--text);
  border-radius: 3px;
  padding: 1px 8px;
}
.links a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--hr);
  text-align: center;
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer p { margin: 0.5rem 0 0; }
.social { font-size: 1.6rem; display: flex; justify-content: center; gap: 1.25rem; }
.social a { color: var(--text); }
.social a:hover { color: var(--accent); text-decoration: none; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .nav-links a { display: none; }
  .post-title { font-size: 2rem; }
  .profile { float: none; width: 200px; margin: 0 auto 1.5rem; }
  .bibliography > li { flex-direction: column; gap: 0.4rem; }
  .abbr { flex: none; }
  .badge { width: auto; }
}
