:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #5c6b7a;
  --accent: #0b4f8a;
  --border: #d9e2ec;
}

* {
  box-sizing: border-box;
}

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

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

a:focus,
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: min(980px, 92vw);
  margin: 0 auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  gap: 1rem;
}

.site-title {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.nav-list {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  text-decoration: none;
  color: var(--text);
  padding: 0.2rem 0.1rem;
}

.nav-list a[aria-current="page"] {
  border-bottom: 2px solid var(--accent);
}

main {
  padding: 2rem 0;
}

section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

h1,
h2,
h3 {
  line-height: 1.3;
  margin-top: 0;
}

.lead {
  font-size: 1.1rem;
  margin: 0.25rem 0;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 1rem;
  align-items: start;
}

.profile-photo {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.meta {
  color: var(--muted);
}

.two-col {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.icon-links,
.research-list {
  padding-left: 1.2rem;
}

.paper-list {
  display: grid;
  gap: 1rem;
}

.paper-card {
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
}

.paper-card.compact {
  padding-top: 0.4rem;
}

.paper-title {
  margin-bottom: 0.2rem;
}

.compact-line {
  margin: 0.15rem 0;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  text-decoration: none;
}

.search-box {
  margin-bottom: 1rem;
}

.search-box input {
  margin-top: 0.4rem;
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
}

.button {
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  text-decoration: none;
}

.cv-frame {
  width: 100%;
  height: 78vh;
  min-height: 620px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.cv-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-links {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

#page {
  transition: filter 0.2s ease;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open #page {
  filter: blur(5px);
}

.abstract-button {
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent);
  padding: 0.32rem 0.72rem;
  border-radius: 999px;
  font-size: 0.9rem;
  line-height: 1.2;
  cursor: pointer;
}

.abstract-button:hover,
.abstract-button:focus {
  background: #f1f7ff;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 820px);
  max-height: 80vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem 1.1rem;
  z-index: 1000;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

.modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
  color: var(--text);
}

#abstract-body {
  white-space: pre-line;
  margin-bottom: 0.8rem;
}

.modal-actions {
  margin: 0.2rem 0 0;
}

@media (max-width: 760px) {
  .nav-wrap {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.7rem 0;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    grid-template-columns: 1fr;
  }

  .cv-frame {
    min-height: 500px;
    height: 68vh;
  }

  .modal {
    width: min(94vw, 820px);
    max-height: 82vh;
    padding: 0.9rem 0.95rem 1rem;
  }
}
