/* ---------- Design tokens ---------- */
:root {
  --accent: #1e40af;        /* links on hover, "Published" badges, status dot */
  --warn: #7a4b00;          /* "Under review" badge */
  --bg: #fcfbf8;
  --ink: #14171a;           /* main text */
  --ink-soft: #2a2f35;      /* body paragraphs */
  --ink-muted: #4b525a;     /* metadata, captions */
  --rule: #dcd8cf;          /* hairlines between rows */
  --rule-strong: #b9b4a8;   /* filter button outline */
  --placeholder: #ece8de;   /* GIF placeholder box */

  --serif: 'Source Serif 4', Georgia, serif;
  --mono: 'IBM Plex Mono', monospace;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
}

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

h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
}

/* ---------- Page layout: sidebar + main ---------- */
.page {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  max-width: 1440px;
  min-height: 100vh;
  margin: 0 auto;
}

.sidebar {
  padding: 56px 40px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.main {
  padding: 56px 80px 56px 64px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* ---------- Sidebar ---------- */
.identity {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.name {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.affiliation {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.tagline {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.availability {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
}

.availability-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.nav {
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}

.nav a:last-child { border-bottom: 1px solid var(--rule); }

.contact {
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  font-size: 13px;
}

.contact a { padding: 10px 0; }

/* ---------- Publications ---------- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.filters {
  display: flex;
  gap: 8px;
}

.filter {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
}

.filter.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.pub {
  display: grid;
  grid-template-columns: 72px 260px minmax(0, 1fr);
  column-gap: 24px;
  align-items: start;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}

.pub[hidden] { display: none; }
.pub.is-last { border-bottom: 1px solid var(--rule); }

.pub-year {
  padding-top: 3px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-muted);
}

.pub-media {
  height: 160px;
  padding: 0 20px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--placeholder);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-muted);
}

.pub-media-label { letter-spacing: 0.12em; }

.pub-media:has(img) {
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.pub-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pub-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pub-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
}

.pub-authors {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
}

.pub-authors strong { color: var(--ink); }

.pub-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}

.pub-links {
  font-family: var(--mono);
  font-size: 13px;
}

/* Status badges: pick one modifier per publication */
.badge {
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
}

.badge--published { color: var(--accent); }
.badge--review    { color: var(--warn); }
.badge--workshop  { color: var(--ink-muted); }

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
}

.project {
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-tags {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.project-title {
  font-size: 21px;
  font-weight: 600;
}

.project-desc {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---------- Background ---------- */
.background {
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.background h2 { margin-bottom: 12px; }

.background p {
  margin: 0;
  max-width: 780px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 32px;
  bottom: 32px;
  width: 48px;
  height: 48px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  z-index: 10;
}

.back-to-top:hover { background: var(--accent); border-color: var(--accent); }
.back-to-top[hidden] { display: none; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1000px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--rule); padding: 40px 24px; }
  .main { padding: 40px 24px; }
  .pub { grid-template-columns: 1fr; row-gap: 12px; }
  .projects-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 16px; }
}
