/* al-folio inspired theme. Change --accent to recolor the site. */
:root {
  --accent: #b509ac;
  --bg: #ffffff;
  --text: #000000;
  --muted: #6c757d;
  --border: #dee2e6;
  --surface: #f5f5f7;
  --nav-bg: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #2698ba;
    --bg: #1c1c1d;
    --text: #e8e8e8;
    --muted: #9aa0a6;
    --border: #3a3a3c;
    --surface: #2a2a2c;
    --nav-bg: #1c1c1d;
  }
}
:root[data-theme="dark"] {
  --accent: #2698ba;
  --bg: #1c1c1d;
  --text: #e8e8e8;
  --muted: #9aa0a6;
  --border: #3a3a3c;
  --surface: #2a2a2c;
  --nav-bg: #1c1c1d;
}

* { box-sizing: border-box; }

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

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

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

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

main.container { padding-top: 88px; padding-bottom: 48px; min-height: calc(100vh - 60px); }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  background: var(--nav-bg);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 12px;
}
.navbar-brand { color: var(--text); font-weight: 300; font-size: 1.2rem; white-space: nowrap; }
.navbar-brand:hover { color: var(--accent); text-decoration: none; }
.first-name { font-weight: 700; }
.nav-links { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a { color: var(--text); font-size: .98rem; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); text-decoration: none; }
.theme-toggle {
  background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--text); font-size: 1rem;
}
.theme-toggle:hover { color: var(--accent); }
.icon-light { display: none; }
:root[data-theme="dark"] .icon-dark { display: none; }
:root[data-theme="dark"] .icon-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-dark { display: none; }
  :root:not([data-theme="light"]) .icon-light { display: inline; }
}

/* ---------- Headers ---------- */
.post-header { margin-bottom: 24px; }
.post-title { font-size: 2.6rem; font-weight: 300; margin: 0 0 4px; line-height: 1.2; }
.post-description { color: var(--muted); margin: 0; font-size: 1rem; }
.profile-header { margin-bottom: 24px; }

.section-title {
  font-size: 1.5rem; font-weight: 400; margin: 48px 0 16px;
}
.section-title a { color: var(--accent); }
.section-title a:hover { text-decoration: none; }

h2.year {
  text-align: right; font-size: 2rem; font-weight: 300; color: var(--border);
  border-top: 1px solid var(--border); margin: 32px 0 8px; padding-top: 8px;
}

/* ---------- About ---------- */
.about::after { content: ""; display: block; clear: both; }
.profile-img {
  float: right; width: 30%; max-width: 260px;
  margin: 0 0 16px 24px; border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
main > p { margin: 0 0 14px; text-align: justify; }
.social { clear: both; text-align: center; font-size: 2rem; padding-top: 16px; }
.social a { color: var(--text); margin: 0 10px; }
.social a:hover { color: var(--accent); text-decoration: none; }

/* ---------- News ---------- */
.news { width: 100%; border-collapse: collapse; }
.news th {
  width: 130px; text-align: left; vertical-align: top;
  font-weight: 500; padding: 6px 12px 6px 0; white-space: nowrap;
}
.news td { padding: 6px 0; }
.news tr + tr th, .news tr + tr td { border-top: 1px solid var(--border); }

/* ---------- Publications ---------- */
.publications { list-style: none; padding: 0; margin: 0; }
.pub {
  display: flex; gap: 20px; padding: 16px 0;
}
.pub + .pub { border-top: 1px solid var(--border); }
.pub-media { flex: 0 0 200px; }
.pub-media img { width: 100%; border-radius: 4px; display: block; }
.pub-placeholder {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 4px;
  background: var(--surface); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: .9rem; text-align: center; padding: 8px;
}
.pub-body { flex: 1; min-width: 0; }
.badge {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 3px;
  margin-bottom: 4px;
}
.pub-title { font-weight: 600; }
.pub-authors { font-size: .95rem; }
.pub-authors .me { font-style: normal; font-weight: 700; text-decoration: underline; }
.pub-venue { font-size: .95rem; color: var(--muted); }
.pub-links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.btn {
  display: inline-block; font: inherit; font-size: .75rem; text-transform: uppercase;
  color: var(--text); background: transparent; cursor: pointer;
  border: 1px solid var(--text); border-radius: 3px; padding: 1px 10px;
}
.btn:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.abstract {
  margin-top: 10px; padding: 10px 14px; font-size: .92rem;
  border: 1px solid var(--border); border-radius: 4px; text-align: justify;
}

/* ---------- Projects ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.project-card {
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
  background: var(--bg); transition: box-shadow .2s, transform .2s;
}
.project-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); }
.project-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.project-placeholder {
  aspect-ratio: 16 / 10; background: var(--surface); color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: .85rem;
}
.project-placeholder i { font-size: 1.8rem; }
.project-body { padding: 14px 16px 18px; }
.project-body h3 { margin: 0 0 2px; font-size: 1.1rem; font-weight: 500; }
.project-period { color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.project-body p { margin: 0 0 8px; font-size: .95rem; }

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

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .post-title { font-size: 2rem; }
  .navbar-inner { height: auto; padding-top: 10px; padding-bottom: 10px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .nav-links { gap: 14px; justify-content: flex-start; }
  main.container { padding-top: 110px; }
  .profile-img { float: none; display: block; width: 60%; max-width: 220px; margin: 0 auto 16px; }
  .pub { flex-direction: column; gap: 10px; }
  .pub-media { flex-basis: auto; max-width: 260px; }
  .news th { width: 100px; white-space: normal; }
  .social { font-size: 1.6rem; }
}
