/* GitHub-inspired light palette */
:root {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --text: #1f2328;
  --muted: #59636e;
  --line: #d1d9e0;
  --line-soft: #e8ecf0;
  --accent: #0969da;
  --accent-soft: #ddf4ff;
  --highlight: #bc4c00;
  --highlight-soft: #fff1e5;
  --max-width: 820px;
  --header-height: 52px;
  --radius: 6px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

::selection {
  background: var(--accent-soft);
}

.container {
  width: min(var(--max-width), calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: -60px;
  left: 16px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-size: 13px;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 10px;
}

/* Header */
.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-name {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

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

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  padding: 4px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

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

.menu-button {
  display: none;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 1.5px;
  margin: 3.5px auto;
  background: var(--text);
  transition: transform 160ms ease, opacity 160ms ease;
}

.menu-button[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.menu-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-button[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Profile */
.profile {
  display: flex;
  gap: 28px;
  align-items: stretch;
  padding: 36px 0 32px;
}

.avatar {
  position: relative;
  flex: none;
  width: 180px;
  min-height: 200px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.avatar img {
  /* Absolute so the photo never drives the row height; it fills whatever the text column sets */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Keep the subject (right side of the photo) fully in frame */
  object-position: 92% 50%;
}

.profile-body {
  min-width: 0;
}

.profile h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.role {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 14px;
}

.bio {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}

.bio strong {
  font-weight: 600;
}

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

.profile-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.profile-links a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.profile-links svg {
  width: 15px;
  height: 15px;
}

.icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.icon-fill {
  fill: currentColor;
}

/* Sections */
.section {
  padding: 24px 0 28px;
  border-top: 1px solid var(--line-soft);
}

.section h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Publications */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pub {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* Uniform frame for every thumbnail; images are letterboxed inside it */
.pub-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.pub-thumb:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(31, 35, 40, 0.08);
}

.pub-thumb img {
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
}

.pub-body h3 {
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.pub-body h3 a {
  color: var(--text);
}

.pub-body h3 a:hover {
  color: var(--accent);
}

.tag {
  display: inline-block;
  margin-right: 4px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  vertical-align: 1px;
  white-space: nowrap;
}

.tag-highlight {
  background: var(--highlight-soft);
  color: var(--highlight);
}

/* Honor tags placed after the title */
.pub-body h3 a + .tag {
  margin-left: 4px;
}

.pub-authors {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.pub-authors strong {
  color: var(--text);
  font-weight: 600;
}

.pub-links {
  margin: 0;
  font-size: 13.5px;
}

.pub-links > * + *::before {
  content: "·";
  margin: 0 8px;
  color: var(--line);
  display: inline-block;
}

.pub-links a {
  font-weight: 500;
}

.link-pending {
  color: var(--muted);
  cursor: help;
}

/* Honors & service */
.item-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-list li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 4px 0;
  font-size: 14.5px;
}

.item-list time,
.item-label {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.item-list strong {
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}

.footer-wrap {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

.footer-wrap p {
  margin: 0;
  color: var(--muted);
}

.footer-wrap div {
  display: flex;
  gap: 16px;
}

.footer-wrap a {
  color: var(--muted);
}

.footer-wrap a:hover {
  color: var(--accent);
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    width: calc(100% - 32px);
  }

  .menu-button {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-height) 0 auto;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 8px 16px 12px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--bg);
    box-shadow: 0 8px 20px rgba(31, 35, 40, 0.08);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 8px 10px;
  }

  .profile {
    flex-direction: column;
    gap: 16px;
    padding: 28px 0 24px;
  }

  .avatar {
    width: 150px;
    height: 190px;
    min-height: 0;
  }

  .profile h1 {
    font-size: 26px;
  }

  .pub {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pub-thumb {
    aspect-ratio: 2 / 1;
  }

  .pub-list {
    gap: 24px;
  }

  .item-list li {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
  }

  .footer-wrap {
    padding: 16px 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
