:root {
  --theme: #004488;
  --text: #000;
  --muted: #828282;
  --bg: #fff;
  --border: #dbdbdb;
  --nav-bg: #fff;
}
html[data-theme="dark"] {
  --theme: #6fa8dc;
  --text: #e8e8e8;
  --muted: #a0a0a0;
  --bg: #1c1c1d;
  --border: #3a3a3c;
  --nav-bg: #1c1c1d;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding-top: 70px;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background .2s, color .2s;
}
a { color: var(--theme); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 500; }
h1, h2, h3 { font-weight: 300; }
hr { border: 0; border-top: 1px solid var(--border); }

/* Navbar */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.nav-inner {
  max-width: 930px; margin: 0 auto; padding: 0 15px;
  display: flex; align-items: center; justify-content: space-between; height: 56px;
}
.brand { color: var(--text); font-size: 1.25rem; }
.brand:hover { color: var(--theme); text-decoration: none; }
.brand b { font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--text); font-weight: 400; }
.nav-links a:hover, .nav-links a.active { color: var(--theme); text-decoration: none; }
.theme-toggle, .menu-toggle {
  background: none; border: 0; cursor: pointer; color: var(--text); font-size: 1rem; padding: 4px;
}
.theme-toggle:hover, .menu-toggle:hover { color: var(--theme); }
.menu-toggle { display: none; font-size: 1.3rem; }

/* Layout */
.container { max-width: 930px; margin: 0 auto; padding: 1.5rem 15px 4rem; }
.post-title { font-size: 2.6rem; margin: 0 0 .25rem; }
.post-title b { font-weight: 700; }
.desc { color: var(--text); margin: 0 0 1.5rem; }
.section-title { font-size: 1.6rem; margin: 2.5rem 0 .75rem; }
.section-title a { color: var(--theme); }

/* Profile */
.profile { float: right; width: 30%; margin: 0 0 1rem 1.75rem; text-align: center; }
.profile img { width: 100%; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.15); display: block; }
.more-info { font-size: .9rem; color: var(--muted); margin-top: .6rem; line-height: 1.4; }
.more-info p { margin: 0; }
.clearfix::after { content: ""; display: table; clear: both; }

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

/* Publications */
.year { font-size: 2.6rem; color: var(--muted); text-align: right; margin: 2rem 0 0; opacity: .5; font-weight: 300; }
.pub-group { font-size: 1.25rem; margin: 2rem 0 .5rem; color: var(--text); font-weight: 400; border-bottom: 1px solid var(--border); padding-bottom: .3rem; }
ol.bibliography { list-style: none; padding: 0; margin: 0; }
ol.bibliography li { display: flex; gap: 1rem; padding: .9rem 0; }
.abbr { flex: 0 0 105px; }
.badge {
  display: block; text-align: center; background: var(--theme); color: #fff;
  font-size: .75rem; font-weight: 500; padding: .25rem .3rem; border-radius: 3px; letter-spacing: .02em;
}
.badge.alt { background: var(--muted); }
.pub-body { flex: 1; }
.pub-title { font-weight: 500; }
.author, .periodical { font-size: .95rem; }
.author em { font-style: normal; text-decoration: underline; font-weight: 500; }
.periodical { font-style: italic; }
.award { display: inline-block; font-size: .85rem; font-weight: 500; color: #c27c0e; margin-top: .15rem; }
html[data-theme="dark"] .award { color: #e6b34a; }
.links { margin-top: .35rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.btn {
  font-size: .72rem; font-weight: 400;
  border: 1px solid var(--text); color: var(--text); border-radius: 3px; padding: .1rem .55rem;
}
.btn:hover { border-color: var(--theme); color: var(--theme); text-decoration: none; }

/* Projects */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; margin-top: 1rem; }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.1); transform: translateY(-2px); }
.card-img { display: block; margin: -1.1rem -1.2rem 1rem; }
.card-img img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px 8px 0 0; }
.card { overflow: hidden; }
.card h3 { font-size: 1.1rem; font-weight: 500; margin: 0 0 .2rem; }
.card .when { color: var(--muted); font-size: .85rem; margin-bottom: .6rem; }
.card p { margin: 0 0 .9rem; font-size: .95rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .9rem; }
.tag { font-size: .75rem; border-radius: 10px; padding: .05rem .55rem; background: var(--border); }

/* Social + footer */
.social { text-align: center; margin-top: 3rem; }
.contact-icons { font-size: 2rem; display: flex; justify-content: center; gap: 1.1rem; }
.contact-icons a { color: var(--text); }
.contact-icons a:hover { color: var(--theme); text-decoration: none; }
.contact-note { margin-top: .75rem; }
footer { border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem 15px; }

/* Mobile */
@media (max-width: 640px) {
  .menu-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column;
    align-items: flex-end; gap: .6rem; padding: .8rem 15px; background: var(--nav-bg); border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .profile { float: none; width: 60%; margin: 0 auto 1.25rem; }
  .post-title { font-size: 2.1rem; }
  ol.bibliography li { flex-direction: column; gap: .4rem; }
  .abbr { flex: none; width: 105px; }
  .news .date { width: 30%; }
}
