:root {
  --text: #222;
  --muted: #666;
  --light: #f5f5f5;
  --border: #e5e5e5;
  --link: #1772d0;
  --max-width: 980px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.55;
  font-size: 16px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 15px;
}
.nav a { color: #111; }
.nav a.active { color: var(--link); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 0.9fr;
  gap: 70px;
  align-items: center;
  margin-bottom: 54px;
}

h1 {
  font-size: 42px;
  font-weight: 300;
  letter-spacing: 0.2px;
  margin: 0 0 22px;
}
h1 strong { font-weight: 750; }

.bio p { margin: 0 0 13px; }
.contact-line { margin-top: 18px; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.profile-card { text-align: center; }
.profile-photo {
  width: 245px;
  height: 245px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 22px rgba(0,0,0,0.16);
  background: var(--light);
}
.profile-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  font-size: 15px;
}

.section { margin-top: 42px; }
section[id], #service, #skills { scroll-margin-top: 80px; }
h2 {
  font-size: 32px;
  font-weight: 400;
  margin: 0 0 12px;
  text-transform: lowercase;
}
.note { color: var(--muted); margin-top: -2px; }

.news-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  border-top: 1px solid var(--border);
}
.news-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.news-list span {
  display: inline-block;
  width: 58px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.publications { margin-top: 58px; }
.publication {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 95px;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
}
.publication:last-child { border-bottom: 1px solid var(--border); }
.publication h3 {
  font-size: 18px;
  margin: 0 0 5px;
  line-height: 1.35;
}
.publication p { margin: 3px 0; }
.pub-year {
  text-align: right;
  font-size: 32px;
  color: #d2d2d2;
  font-weight: 300;
  line-height: 1;
}
.pub-links {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pub-links a {
  display: inline-block;
  color: #111;
  border: 1px solid #222;
  padding: 3px 13px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pub-links a:hover {
  background: #111;
  color: #fff;
  text-decoration: none;
}

.bib-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #111;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.bib-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bib-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 200;
}
.bib-modal.visible {
  opacity: 1;
  pointer-events: auto;
}
.bib-modal-content {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.bib-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bib-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}
.bib-modal-close {
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #666;
}
.bib-modal-text {
  margin: 0;
  padding: 14px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.bib-modal-copy {
  margin-top: 14px;
  border: 1px solid #222;
  background: #111;
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.project-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
}
.project-card h3 { margin: 0 0 8px; font-size: 18px; }
.project-card p { margin: 0; color: #444; }

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}
.two-column ul { margin-top: 8px; padding-left: 21px; }

.footer {
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  padding: 22px 20px;
  font-size: 14px;
}

@media (max-width: 760px) {
  .container { padding-top: 32px; }
  .hero { grid-template-columns: 1fr; gap: 28px; text-align: left; }
  .profile-card { order: -1; }
  .profile-photo { width: 190px; height: 190px; }
  h1 { font-size: 36px; }
  .publication { grid-template-columns: 1fr; gap: 8px; }
  .pub-year { text-align: left; font-size: 22px; }
  .project-grid, .two-column { grid-template-columns: 1fr; }
  .nav { justify-content: center; }
}
