:root {
  --fg: #1a1d21;
  --muted: #6a737d;
  --bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --border: #e5e7eb;
  --accent: #2050a0;
  --accent-hover: #16336b;
  --accent-tint: #eef3fc;
  --badge-bg: #fdf6e3;
  --badge-fg: #8a6100;
  --badge-border: #e8cf8f;
  --code-bg: #f6f8fa;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4rem; }

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

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

.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.topnav-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topnav .brand {
  color: var(--fg);
  font-weight: 600;
}

.topnav-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.topnav-links a {
  color: var(--muted);
  font-size: 0.95rem;
}

.topnav-links a:hover { color: var(--fg); text-decoration: none; }

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
}

section { padding-top: 3rem; }
section:first-child { padding-top: 1rem; }

h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
  position: relative;
}

/* Accent tick anchoring each section rule. */
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

p { margin: 0.5rem 0; }

.hero {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.hero-text { flex: 1; min-width: 0; }

.hero-photo {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.contact {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.social {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.pub {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.25rem;
  align-items: flex-start;
}

/* Thumbnail links to the entry's project site (or PDF as fallback). */
.thumb {
  flex-shrink: 0;
  display: block;
  border-radius: 6px;
  outline-offset: 3px;
}

.thumb img {
  width: 170px;
  height: 116px;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 6px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.thumb:hover img,
.thumb:focus-visible img {
  transform: translateY(-2px) scale(1.02);
  filter: saturate(1.08);
}

.pub-body { flex: 1; min-width: 0; }

.authors {
  color: #4a5157;
  font-size: 0.92rem;
  margin: 0.15rem 0;
}

/* Co-author links read as text, not as actions. */
.authors a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.authors a:hover {
  color: var(--accent);
  border-bottom-color: currentColor;
  text-decoration: none;
}

.venue {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.15rem 0;
}

.venue a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.venue a:hover {
  color: var(--accent);
  border-bottom-color: currentColor;
  text-decoration: none;
}

/* Award pills: "Best Systems Paper", "Oral", "Highlight". */
.venue strong,
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--badge-fg);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 100px;
  padding: 0.1rem 0.5rem;
  margin-right: 0.15rem;
  vertical-align: 0.05em;
  white-space: nowrap;
}


.links {
  margin: 0.45rem 0 0.5rem;
  font-size: 0.92rem;
  line-height: 1.9;
}

.links > * { margin-right: 0.55rem; }

.links a,
.links summary {
  color: var(--accent);
  font-weight: 500;
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  margin-left: -0.3rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.links a:hover,
.links summary:hover {
  background: var(--accent-tint);
  color: var(--accent-hover);
  text-decoration: none;
}

details.bib {
  display: contents;
}

details.bib > summary {
  display: inline;
  cursor: pointer;
  list-style: none;
}
details.bib > summary::-webkit-details-marker { display: none; }
details.bib[open] > summary { color: var(--accent); }

details.bib > pre {
  display: none;
}
details.bib[open] > pre {
  display: block;
  margin: 0.5rem 0 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--code-bg);
  border-radius: 4px;
  font-size: 0.82rem;
  line-height: 1.4;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--fg);
}

.job, .edu { margin-bottom: 1.75rem; }

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Company/school mark, cropped to a compact icon and framed in a
   uniform chip so the differing logo shapes still line up. */
.job-title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.job-title h3 { margin: 0; }

.job-logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;
  padding: 3px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.date {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.org {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.15rem 0 0.5rem;
}

ul { margin: 0.4rem 0 0; padding-left: 1.25rem; }
li { margin: 0.15rem 0; }

@media (max-width: 640px) {
  main { padding: 4.5rem 1rem 3rem; }
  .topnav-inner { padding: 0.6rem 1rem; }
  .topnav .brand { display: none; }
  .topnav-links { width: 100%; justify-content: space-between; gap: 0.4rem; }
  .topnav-links a { font-size: 0.82rem; }
  .hero { flex-direction: column-reverse; gap: 1.25rem; align-items: flex-start; }
  .hero-photo { width: 120px; height: 120px; }
  /* Stack title and date consistently: whether they fit side by side
     otherwise depends on title length, which reads as a layout bug. */
  .job-head { flex-direction: column; align-items: flex-start; gap: 0.1rem; }
  .pub { flex-direction: column; gap: 0.75rem; }
  .thumb, .thumb img { width: 100%; }
  .thumb img { height: 180px; }
  h1 { font-size: 1.9rem; }
}
