:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #666666;
  --line: #e5e5e5;
  --soft: #f7f7f7;
  --accent: #004a99;
  --link: #0066cc;
  --max-width: 930px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--link);
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 58px;
  padding: 0 max(20px, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
}

.site-title {
  flex: 1 0 auto;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 500;
}

.site-title:hover {
  color: var(--text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--muted);
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 52px 20px 36px;
}

.about,
.section {
  scroll-margin-top: 104px;
}

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 40px;
  align-items: start;
  min-height: 360px;
}

.profile {
  width: 260px;
  margin: 0;
}

.profile img {
  display: block;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  margin-top: 12px;
  font-size: 0.88rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: 2.18rem;
  line-height: 1.18;
  font-weight: 500;
}

h2 {
  margin-bottom: 20px;
  font-size: 1.45rem;
  font-weight: 500;
  text-transform: lowercase;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.02rem;
  line-height: 1.3;
}

.subtitle {
  margin-bottom: 8px;
  color: var(--muted);
}

.contact-note {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.93rem;
}

.section {
  clear: both;
  padding-top: 42px;
  margin-top: 42px;
  border-top: 1px solid var(--line);
}

.two-column {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 32px;
}

.two-column h2 {
  margin-bottom: 0;
}

time,
.venue {
  color: var(--muted);
  font-size: 0.9rem;
}

.publication-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.publication {
  min-width: 0;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.publication p {
  margin-bottom: 5px;
}

.links,
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.links a,
.links button {
  font-size: 0.9rem;
  font-weight: 600;
}

.links button {
  border: 0;
  background: transparent;
  color: var(--link);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: inherit;
  padding: 0;
  cursor: pointer;
}

.bibtex-actions button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  line-height: inherit;
  padding: 0;
  cursor: pointer;
}

.links button:hover {
  color: var(--accent);
  text-decoration: underline;
}

.bibtex-actions button:hover {
  color: var(--accent);
  text-decoration: underline;
}

.bibtex-panel {
  max-width: 100%;
  min-width: 0;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.bibtex-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.bibtex-panel pre {
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  color: #333333;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre;
}

.project-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.project-list article {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.project-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 20px 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: flex-start;
  gap: 18px;
  font-size: 0.9rem;
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .site-nav {
    justify-content: flex-start;
    gap: 10px 15px;
  }

  .profile {
    width: 220px;
    margin: 0 0 24px;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .two-column,
  .project-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15.5px;
  }

  .page {
    padding-top: 34px;
  }

  h1 {
    font-size: 1.86rem;
  }

  .footer {
    flex-direction: column;
  }
}
