:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #5f6d80;
  --line: #dce3ec;
  --accent: #175f78;
  --accent-strong: #0f4355;
  --accent-soft: #e6f2f5;
  --shadow: 0 18px 45px rgb(22 38 60 / 10%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11161f;
  --panel: #182130;
  --text: #edf2f7;
  --muted: #a9b6c7;
  --line: #2a3547;
  --accent: #7ccce0;
  --accent-strong: #a5e4f1;
  --accent-soft: #1e3540;
  --shadow: 0 18px 45px rgb(0 0 0 / 28%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  justify-self: start;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.main-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.main-nav a,
.theme-toggle {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-decoration: none;
}

.theme-toggle {
  justify-self: end;
  cursor: pointer;
}

.main-nav a[aria-current="page"],
.main-nav a:hover,
.theme-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

section {
  margin: clamp(2.5rem, 6vw, 5rem) 0;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.35rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

.profile-card {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.75rem, 5vw, 4rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.portrait {
  width: min(100%, 320px);
  height: auto;
  border: 8px solid var(--bg);
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.profile-content {
  min-width: 0;
}

.profile-kicker {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-subtitle {
  margin: 0.65rem 0 2rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.profile-card h1 {
  max-width: 100%;
  text-wrap: balance;
}

.name-last {
  display: inline-block;
  white-space: nowrap;
}

.about-copy {
  max-width: 780px;
}

.about-copy h2 {
  margin-bottom: 1rem;
}

.about-copy p,
.pub-authors {
  color: var(--muted);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.5rem 0 0;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.social-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.social-mark {
  display: inline-grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.logo-mark svg {
  width: 1.08rem;
  height: 1.08rem;
  fill: currentColor;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.35rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.62rem 1rem;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.research-section {
  max-width: 960px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  background: var(--panel);
  color: var(--muted);
}

.page-title {
  margin-bottom: 1.4rem;
}

.page-title h1 {
  max-width: none;
}

.publication-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: end;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.publication-tools label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.publication-tools select {
  min-width: 12rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.publication-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 0;
}

.publication {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: var(--panel);
}

.publication[hidden] {
  display: none;
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pub-meta span + span::before {
  content: "/";
  margin-right: 0.45rem;
  color: var(--muted);
}

.publication h2 {
  max-width: 980px;
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.3;
}

.publication h2 a {
  color: var(--text);
  text-decoration: none;
}

.publication h2 a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.pub-authors {
  margin: 0.45rem 0 0;
  font-size: 0.94rem;
  line-height: 1.45;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .brand,
  .main-nav,
  .theme-toggle {
    justify-self: center;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .portrait {
    width: min(72vw, 260px);
    justify-self: center;
  }

  h1 {
    font-size: 2.75rem;
  }

  .profile-card h1 {
    white-space: normal;
  }

  .publication-tools {
    align-items: stretch;
  }

  .publication-tools label,
  .publication-tools select {
    width: 100%;
  }
}
