:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --border: #e8eaed;
  --accent: #1a73e8;
  --accent-hover: #174ea6;
  --radius: 4px;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --shadow: none;
  --max-prose: 42rem;
  --max-narrow: 44rem;
  --max-wide: 64rem;
  --header-height: 3.5rem;
}

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

html {
  font-size: 106%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--bg);
  z-index: 100;
  border-radius: 4px;
}

.skip-link:focus {
  left: 0.75rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

.site-main {
  padding-bottom: 4rem;
}

.container {
  width: 100%;
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 0 1.25rem;
  min-width: 0;
}

.container--wide {
  max-width: var(--max-wide);
}

/* Header / nav — clean top directory bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-height);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.site-logo {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-logo:hover {
  color: var(--accent);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
}

.site-nav a:hover {
  color: var(--text);
  background: #f1f3f4;
}

.site-nav a.is-active {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: 0;
  background: transparent;
}

.site-nav a.is-active:hover {
  background: transparent;
  color: var(--accent-hover);
}

/* Home hero */
.container--narrow {
  max-width: var(--max-narrow);
}

.hero {
  padding: 2.75rem 0 1.75rem;
  margin-bottom: 0.5rem;
}

.hero__name {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hero__tagline {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.hero__bio {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 36rem;
  margin: 0 0 0.5rem;
}

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

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social a {
  font-weight: 500;
  font-size: 0.95rem;
}

/* Home */
.home {
  min-width: 0;
}

/* Sections */
.section {
  margin-bottom: 2.5rem;
  min-width: 0;
  max-width: 100%;
}

.section__title {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section__head h2 {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.section__link {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

/* News / CV lists (home) */
.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Child combinator: nested .resume-bullets items must not inherit the grid row styling */
.cv-list > li {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr);
  column-gap: 1.25rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.98rem;
  align-items: baseline;
}

.cv-list > li:last-child {
  border-bottom: 0;
}

.cv-list__when {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.cv-list__what {
  color: var(--text);
  min-width: 0;
}

.contact p {
  margin: 0 0 0.35rem;
  color: var(--muted);
}

.contact__name {
  color: var(--text) !important;
  font-weight: 600;
}

.contact .social {
  margin-top: 0.85rem;
}

.contact__resume {
  margin-top: 0.85rem !important;
}

.resume-download {
  font-weight: 600;
  font-size: 1.05rem;
}

.resume-bullets {
  list-style: disc;
  margin: 0.45rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.resume-bullets li {
  display: list-item;
  padding: 0;
  border: 0;
}

.resume-bullets li + li {
  margin-top: 0.25rem;
}

/* Clean item lists (Research / Presentations / Publications) */
.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-list__entry {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border);
}

.item-list__entry:first-child {
  padding-top: 0.25rem;
}

.item-list__title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.35rem;
}

.item-list__title a {
  color: var(--text);
  text-decoration: none;
}

.item-list__title a:hover {
  color: var(--accent);
}

.item-list__meta,
.item-list__desc {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.item-list__links {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.item-list .pub-item__links {
  margin-top: 0.45rem;
}

/* Cards */
.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  height: 100%;
  box-shadow: var(--shadow);
}

.card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  line-height: 1.35;
}

.card__title--sm {
  font-size: 1.05rem;
}

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

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

.card__meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.card .pub-item__links {
  margin-top: 0.65rem;
}

/* Project cards */
.project-card.card {
  height: auto;
}

.project-card .card__inner {
  padding: 1.15rem 1.25rem 1.25rem;
}

/* One column layout for project grid */
.card-grid.card-grid--projects {
  grid-template-columns: minmax(0, 1fr);
}

.project-card .card__title,
.project-card .card__title a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Publications — citation list (reference-site style) */
.pub-section {
  margin-bottom: 2.25rem;
}

.pub-section__title {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
  color: var(--text);
}

.pub-cite-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.pub-cite-list > li {
  margin: 0 0 1.75rem;
  padding: 0;
}

.pub-entry {
  margin: 0;
}

.pub-cite {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
}

.pub-cite__title {
  color: var(--text);
  text-decoration: none;
}

/* Linked titles (to project pages) get the accent color + a faint underline so they read as clickable */
.pub-cite a.pub-cite__title {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(26, 115, 232, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.pub-cite a.pub-cite__title:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

.pub-note {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 1.75rem;
  padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--border);
  max-width: 40rem;
}

.pub-cite__title em,
.pub-cite em.pub-cite__title {
  font-style: italic;
}

.pub-cite__links {
  display: inline;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.pub-cite__links a {
  text-decoration: none;
}

.pub-abstract {
  margin: 0.65rem 0 0;
  padding: 0.85rem 0 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text);
}

.pub-abstract > *:first-child {
  margin-top: 0;
}

.pub-abstract > *:last-child {
  margin-bottom: 0;
}

.pub-abstract p {
  margin: 0 0 0.65rem;
}

.pub-abstract strong {
  font-weight: 600;
}

/* Legacy pub / card styles (project cards, etc.) */
.pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
}

.pub-list--compact .pub-item {
  padding: 0.85rem 1rem;
}

.pub-item__title {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.pub-item__authors,
.pub-item__venue {
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
}

.pub-item__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Page */
.page-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

.page-header__title {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}

.page-header__subtitle {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.lead {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
  max-width: 40rem;
}

.lead code {
  font-size: 0.9em;
}

/* Prose (markdown) */
.prose {
  font-size: 1.02rem;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.25;
  margin-top: 1.75rem;
  margin-bottom: 0.65rem;
}

.prose h2 {
  font-size: 1.2rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.home .prose p {
  color: var(--text);
  font-size: 1.02rem;
}

.prose h3 {
  font-size: 1.12rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.35rem;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* Article (blog / single) */
.article {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.article__title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.article__meta {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* Archive list */
.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive-list li {
  margin-bottom: 0.65rem;
}

.archive-list a {
  font-weight: 500;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 2rem;
  background: var(--surface);
}

.site-footer__inner {
  text-align: center;
}

.site-footer__copy {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding-top: 0.85rem;
    padding-bottom: 0.5rem;
  }

  .site-nav__list {
    justify-content: flex-start;
    margin-left: -0.7rem;
  }

  .cv-list > li {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 0.15rem;
  }

  .section__head {
    flex-direction: column;
    align-items: flex-start;
  }
}
