*, *::before, *::after { box-sizing: border-box; }

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  background: #fafafa;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { margin: 0; min-width: 320px; background: #fafafa; }

a { color: #6c8ebf; text-decoration: none; transition: color .15s ease; }
a:hover, a:focus { color: #5a7aa8; }
p { margin: .6em 0; }
strong { color: #1a1a1a; font-weight: 600; }
a strong { color: inherit; }
p { overflow-wrap: anywhere; }
em { color: #555; }
::selection { color: #0a0a0a; background: #e8e8e8; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 3px; }

/* Layout */
.page-shell { width: min(100%, 840px); margin: 0 auto; padding: 32px 20px 48px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 32px;
  align-items: center;
  padding: 8px 0 24px;
}
.hero-copy { min-width: 0; }

h1, h2 { font-weight: 650; letter-spacing: 0; color: #0a0a0a; }
h1 {
  margin: 0 0 16px;
  font-size: clamp(2.35rem, 7vw, 2.75rem);
  line-height: 1.08;
  text-align: center;
}
h2 {
  display: inline-block;
  margin: 0 0 12px;
  padding-bottom: 4px;
  border-bottom: 1.5px solid #e0e0e0;
  font-size: 1.5rem;
  line-height: 1.2;
}
h3 { margin: 0; font-size: 1rem; line-height: 1.5; font-weight: 600; }

.profile-links { margin-top: 16px; font-size: .9rem; text-align: center; }
.profile-links a { font-weight: 500; }
.sep { color: #777; }

.section { padding: 18px 0; }
.is-hidden { display: none !important; }

/* Toggle buttons */
.toggle {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #555;
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, .2);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color .15s ease, text-decoration-color .15s ease;
}
.toggle:hover, .toggle:focus { color: #000; text-decoration-color: rgba(0, 0, 0, .8); }

/* Publications */
.publications { display: grid; gap: 18px; }
.publication { padding: 0 0 16px; border-bottom: 1px solid #ececec; }
.publication p { margin: .35em 0; }
.authors, .venue, .paper-links { font-size: .9rem; line-height: 1.55; color: #333; }
.note { font-size: .9rem; color: #555; }

/* Profile photo */
.profile-figure { margin: 0; width: 100%; }
.image-wrapper {
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, .06);
}
.profile-image { display: block; width: 100%; height: auto; object-fit: cover; }

/* Hover notes: <span class="hover-note">text<span class="hover-msg">note</span></span> */
.hover-note {
  position: relative;
  display: inline-block;
  text-decoration: underline dotted rgba(0, 0, 0, .25);
  text-underline-offset: 3px;
  cursor: help;
}
.hover-msg {
  position: absolute;
  z-index: 100;
  bottom: 100%;
  left: 50%;
  margin-bottom: 5px;
  padding: 6px 14px;
  border-radius: 8px;
  color: #f5f5f5;
  background: #1a1a1a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
}
.hover-msg::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: #1a1a1a;
}
.hover-note:hover .hover-msg,
.hover-note:focus .hover-msg { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

@media (max-width: 700px) {
  .page-shell { padding-inline: 18px; }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .profile-figure { width: min(56vw, 200px); margin: 0 auto; grid-row: 1; }
  .hover-msg { white-space: normal; min-width: 200px; }
}

/* Publications: Selected / All by date switch */
.publication-switch { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 16px; font-size: .9rem; }
.publication-switch button {
  padding: 0;
  border: 0;
  background: none;
  color: #777;
  font: inherit;
  cursor: pointer;
  transition: color .15s ease;
}
.publication-switch button:hover { color: #5a7aa8; }
.publication-switch button[aria-pressed="true"] { color: #6c8ebf; font-weight: 600; }
.authors span[title] { cursor: help; }

/* Experience */
.exp { padding: 2px 0 4px; }
.exp + .exp { margin-top: 14px; }
.exp-head, .exp-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.exp-date { font-size: .9rem; color: #555; font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-meta { margin: .2em 0; font-size: .9rem; line-height: 1.55; color: #333; }
.exp-place { font-size: .9rem; color: #777; white-space: nowrap; }
