@font-face {
  font-family: Roboto;
  font-style: normal;
  font-weight: 400;
  src: url("../assets/fonts/roboto-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: Roboto;
  font-style: normal;
  font-weight: 500;
  src: url("../assets/fonts/roboto-latin-500.woff2") format("woff2");
}

@font-face {
  font-family: Roboto;
  font-style: normal;
  font-weight: 700;
  src: url("../assets/fonts/roboto-latin-700.woff2") format("woff2");
}

:root {
  --crimson: #980000;
  --ink: #1c1c1c;
  --muted: #5f6368;
  --page-bg: #f9f9f9;
  --border: #e0e0e0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: Verdana, Arial, sans-serif;
  font-size: 16px;
  line-height: 24px;
}

a { color: var(--crimson); }

/* ---------- Top bar with inline navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  min-height: 56px;
  padding: 8px 24px;
  background: var(--crimson);
}

.site-title {
  color: #fff;
  font-family: Verdana, Arial, sans-serif;
  font-size: 24px;
  font-weight: 400;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin-left: auto;
}

.site-nav a {
  color: #fff;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  text-decoration: none;
  padding: 4px 2px;
}

.site-nav a:hover { text-decoration: underline; }

.site-nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
}

/* ---------- Content ---------- */

.content {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 28px 72px;
}

.content-home { max-width: 1176px; }

.nowrap { white-space: nowrap; }

.page-body p { margin: 0 0 16px; }

p.center { text-align: center; }

.photo {
  display: block;
  width: 320px;
  max-width: 100%;
  margin: 0 auto;
}

/* Home: photo left, bio right */

.home-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.home-left .photo {
  width: 100%;
  margin: 0;
}

.home-left p {
  margin: 14px 0 0;
  text-align: center;
}

.home-links {
  margin: 10px 0 0 !important;
}

.home-links a {
  display: inline-block;
  color: var(--ink);
}

.home-links a:hover { color: var(--crimson); }

.home-right p { margin: 0 0 16px; }

.updated {
  margin: 56px 0 0;
  color: #5f6368;
  text-align: right;
}

/* Floating, collapsible table of contents (right edge, vertically centered) */

.toc-widget {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
}

.toc-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border: 0;
  border-radius: 8px 0 0 8px;
  background: var(--crimson);
  color: #fff;
  cursor: pointer;
}

.toc-fab:hover { background: #7a0000; }

.toc-panel {
  display: none;
  max-width: 300px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-right: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.toc-widget.open .toc-panel { display: block; }

.toc-panel a {
  display: block;
  margin: 7px 0;
  color: var(--ink);
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
  text-decoration: none;
}

.toc-panel a:hover {
  color: var(--crimson);
  text-decoration: underline;
}

/* ---------- Typography ---------- */

h2 {
  margin: 48px 0 14px;
  color: var(--ink);
  font-size: 18.67px;
  font-weight: 400;
  line-height: 28px;
  text-decoration: underline;
}

h2:first-child { margin-top: 0; }

h3 {
  margin: 28px 0 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
}

.note { font-size: 10.67px; }

.tldr {
  font-size: 13.33px;
  line-height: 20px;
}

.sm { font-size: 13.33px; line-height: 20px; }

/* ---------- Publications / lists ---------- */

ol.papers {
  margin: 0 0 10px;
  padding-left: 22px;
}

ol.papers > li { margin: 0 0 16px; }

ol.papers p { margin: 0 0 6px; }

ol.papers.bracket {
  list-style: none;
  padding-left: 0;
  counter-reset: paper;
}

ol.papers.bracket > li {
  position: relative;
  padding-left: 36px;
}

ol.papers.bracket > li::before {
  position: absolute;
  left: 0;
  content: "[" counter(paper) "]";
  counter-increment: paper;
}

ul.details {
  margin: 0 0 6px;
  padding-left: 20px;
  list-style: square;
  font-size: 13.33px;
  line-height: 20px;
}

ul.details li { margin: 0 0 6px; }

ul.details p { margin: 0; }

ul.details.flat {
  margin: 0 0 16px;
  padding-left: 22px;
}

a.ptitle {
  color: #000;
  font-weight: 700;
  text-decoration: none;
}

a.ptitle:hover { text-decoration: underline; }

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

a.plain:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .home-grid { grid-template-columns: 1fr; }
  .content { padding: 32px 20px 56px; }
  .site-header { padding: 8px 16px; }
}
