:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #b8860b;
  --link: #2a6f97;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(1060px, 92%);
  margin: 0 auto;
}

a {
  color: var(--link);
}

/* Header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.6rem 0 1.4rem;
  flex-wrap: wrap;
}

.brand {
  text-decoration: none;
  color: inherit;
}

.brand-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-role {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.header-logos {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.header-logos img {
  height: 38px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.header-logos a:hover img {
  opacity: 1;
}

/* Navigation */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.site-nav ul {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
}

.site-nav a {
  display: block;
  padding: 0.85rem 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Layout */

main {
  padding: 2.5rem 0 3rem;
}

.page-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.page-title .subtitle {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.card + .card {
  margin-top: 1.25rem;
}

.card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.card h3 {
  margin: 1.6rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 650;
}

.card h3:first-child {
  margin-top: 0;
}

/* Home */

.profile-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.portrait {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.75rem;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.identity h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
}

.identity {
  align-self: center;
}

.identity p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.identity .affiliation {
  color: var(--text);
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
}

.link-list a {
  display: block;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfcfd;
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.link-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fffdf6;
}

/* Generic content lists */

.content-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.content-list > li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.content-list > li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.content-list > li:first-child {
  padding-top: 0;
}

.steps {
  margin: 0;
  padding-left: 1.3rem;
}

.steps li {
  margin: 0.35rem 0;
}

.note {
  margin: 0 0 0.9rem;
  font-weight: 600;
}

.emphasis {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: #fffdf6;
  border-radius: 0 8px 8px 0;
  font-weight: 600;
}

/* Small link chips (papers, DOI, downloads) */

.chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-left: 0.15rem;
  vertical-align: middle;
}

.chip {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fcfcfd;
  color: var(--link);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chip:hover {
  border-color: var(--link);
  background: #f2f7fb;
}

.topic-title {
  display: block;
  margin-bottom: 0.35rem;
}

/* Research */

.areas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.6rem;
}

.areas li {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: #fcfcfd;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.lab-line {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-list > li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.project-list > li:first-child {
  padding-top: 0;
}

.project-list > li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.project-title {
  margin: 0 0 0.45rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.82rem;
}

.tag {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f9fafb;
  color: var(--muted);
}

.tag-role {
  color: var(--text);
}

.tag-lead {
  border-color: #e6d6a8;
  background: #fffdf6;
  color: #8a6508;
  font-weight: 600;
}

.tag-ongoing {
  border-color: #b7e0c8;
  background: #f3fbf6;
  color: #216c43;
  font-weight: 600;
}

/* Publications */

.pub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.pub-search {
  flex: 1 1 260px;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
}

.pub-search:focus {
  outline: 2px solid #e6d6a8;
  outline-offset: 1px;
  border-color: var(--accent);
}

.pub-count {
  font-size: 0.85rem;
  color: var(--muted);
}

.year-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.year-index a {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.year-index a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.year-block {
  margin-bottom: 1.25rem;
  scroll-margin-top: 4.5rem;
}

.year-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.year-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.pub {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.65;
}

.citation-text {
  display: block;
  padding-left: 1.5rem;
  
}

.citation-text a {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  white-space: normal;
}

.citation-text a:hover {
  background: transparent;
}

.publication-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.45rem 0 0 1.5rem;
}

.pub:first-child {
  padding-top: 0;
}

.pub:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.pub em strong,
.pub strong em {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #e6d6a8;
  background: #fffdf6;
  color: #8a6508;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.pub a {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fcfcfd;
  color: var(--link);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.pub a:hover {
  border-color: var(--link);
  background: #f2f7fb;
}

.no-results {
  padding: 1rem 0;
  color: var(--muted);
}

.no-results[hidden] {
  display: none;
}

.load-error {
  margin: 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid #d92d20;
  border-radius: 0 8px 8px 0;
  background: #fef3f2;
  color: #912018;
}

code {
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fafb;
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 0.88em;
}

/* Contact */

.contact-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.contact-block + .contact-block {
  margin-top: 1.5rem;
}

.contact-block p {
  margin: 0.15rem 0;
}

.contact-block a {
  color: var(--link);
}

.map-card {
  padding: 0.5rem;
  overflow: hidden;
}

.map-frame {
  position: relative;
  width: 100%;
  min-height: 420px;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e3df;
}

.map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 1.5rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: var(--muted);
}

/* Responsive */

@media (max-width: 900px) {
  .profile-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .portrait {
    max-width: 420px;
  }

  .map-frame {
    min-height: 320px;
  }
}

@media (max-width: 600px) {
  .header-inner {
    padding: 1.25rem 0 1rem;
  }

  .header-logos img {
    height: 30px;
  }

  .card {
    padding: 1.15rem;
  }

  .site-nav ul {
    gap: 1.25rem;
  }
}
