/* ============================================================
   Academic site — sidebar layout, clean sans
   Persistent left rail (identity + nav) · content on the right
   Palette: white paper, deep ink, oxblood accent
   One file, CSS variables — easy to retheme.
   ============================================================ */

:root {
  --ink:        #1b1b1b;
  --ink-soft:   #3f3f3f;
  --muted:      #6e6c67;
  --line:       #e7e4dd;   /* hairline rules */
  --line-soft:  #f0eee9;
  --bg:         #ffffff;
  --bg-soft:    #f7f6f3;   /* hover / subtle fills */
  --accent:     #7a1f1f;   /* oxblood */
  --accent-tint: rgba(122, 31, 31, 0.08);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --sidebar-w: 250px;
  --content-w: 720px;
}

* { box-sizing: border-box; }

html { font-size: 16.5px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "kern" 1, "liga" 1;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease;
}
a:hover { color: var(--ink); }

/* ============================================================
   Page shell — sidebar + main
   ============================================================ */
.page {
  max-width: calc(var(--sidebar-w) + var(--content-w) + 5rem);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 4rem;
  align-items: start;
}

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 3rem 0 2rem;
}

.photo {
  width: 175px;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  margin-bottom: 1.25rem;
  position: relative;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 20%;   /* favour the face in a landscape shot */
  display: block;
  filter: grayscale(8%);
}
.photo .ph-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.photo.no-photo .ph-fallback { display: flex; }

.name {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.35rem;
  color: var(--ink);
}
.role { font-size: 0.95rem; color: var(--ink-soft); margin: 0; }
.inst { font-size: 0.9rem;  color: var(--muted);    margin: 0.1rem 0 0; }

/* nav */
.site-nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 1.5rem 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.site-nav a {
  color: var(--ink-soft);
  font-size: 0.92rem;
  padding: 0.32rem 0 0.32rem 0.9rem;
  border-left: 2px solid transparent;
  line-height: 1.3;
}
.site-nav a:hover { color: var(--ink); border-left-color: var(--line); }
.site-nav a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }

/* contact links */
.contact {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.contact a {
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
}
.contact a:hover { color: var(--accent); }
.contact svg { width: 15px; height: 15px; flex: none; stroke: currentColor; }

/* ============================================================
   Main content
   ============================================================ */
.main { padding: 3rem 0 2rem; min-width: 0; }

.page-title {
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.3rem;
  line-height: 1.15;
}
.page-sub {
  color: var(--muted);
  margin: 0 0 2.5rem;
  font-size: 1rem;
}

/* section label — small mono eyebrow */
.section { margin-bottom: 2.75rem; }
.section > h2 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

/* intro / about prose */
.lede {
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 1.6rem;
}
.lede em { font-style: italic; color: var(--accent); }
.about p { color: var(--ink-soft); margin: 0 0 0.9rem; }
.about p:last-child { margin-bottom: 0; }
.about strong { color: var(--ink); font-weight: 600; }

/* research interests — tag pills + descriptions */
.interests { list-style: none; padding: 0; margin: 0; }
.interests li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.interests li:last-child { border-bottom: none; }
.interests .topic {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  margin-right: 0.5rem;
}

/* news */
.news { list-style: none; padding: 0; margin: 0; }
.news li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.news li:last-child { border-bottom: none; }
.news-date {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.news-text { color: var(--ink-soft); font-size: 0.97rem; }

/* publications */
.pub-list { list-style: none; padding: 0; margin: 0; counter-reset: pub; }
.pub-list li {
  position: relative;
  padding: 1rem 0 1rem 2.4rem;
  border-bottom: 1px solid var(--line-soft);
}
.pub-list li:last-child { border-bottom: none; }
.pub-list li::before {
  content: attr(value);
  position: absolute;
  left: 0;
  top: 1.15rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
}
.pub-title {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.4;
  margin-bottom: 0.2rem;
}
.pub-title a { color: var(--ink); border-bottom: 1px solid var(--line); }
.pub-title a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.pub-authors, .pub-venue { display: block; font-size: 0.92rem; color: var(--ink-soft); }
.pub-venue em { color: var(--accent); font-style: italic; }
.pub-links {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}
.pub-links a { color: var(--muted); }
.pub-links a:hover { color: var(--accent); }

.see-all {
  margin-top: 1.2rem;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.see-all a { color: var(--accent); }
.see-all a:hover { color: var(--ink); }

/* category sub-heading (used on pubs / talks / teaching) */
.cat-head {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 2.25rem 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}
.cat-head:first-of-type { margin-top: 0; }

/* generic entries (talks, teaching) */
.entry { padding: 0.9rem 0; border-bottom: 1px solid var(--line-soft); }
.entry:last-child { border-bottom: none; }
.entry-title { font-weight: 600; color: var(--ink); margin: 0 0 0.15rem; font-size: 1rem; }
.entry-meta {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin: 0;
}
.entry-desc { color: var(--ink-soft); margin: 0.35rem 0 0; font-size: 0.95rem; }

/* footer */
.site-footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding: 1.5rem 0 2.5rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ============================================================
   Responsive — collapse to a single column
   ============================================================ */
@media (max-width: 820px) {
  .page {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1.5rem;
  }
  .sidebar {
    position: static;
    padding: 2.25rem 0 0;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "photo id"
      "nav   nav"
      "links links";
    gap: 0 1.25rem;
    align-items: center;
  }
  .photo { grid-area: photo; width: 96px; margin-bottom: 0; }
  .sidebar .id { grid-area: id; }
  .site-nav {
    grid-area: nav;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 1.5rem 0 0.75rem;
    padding: 1rem 0 0;
    border-bottom: none;
  }
  .site-nav a { padding: 0.2rem 0; border-left: none; }
  .site-nav a:hover { border-left: none; }
  .site-nav a.active { border-left: none; border-bottom: 2px solid var(--accent); }
  .contact { grid-area: links; flex-direction: row; flex-wrap: wrap; gap: 0.4rem 1.1rem; padding-top: 0.5rem; }
  .main { padding: 1rem 0 2rem; }
  .news li { grid-template-columns: 100px 1fr; }
}

@media (max-width: 460px) {
  .sidebar {
    grid-template-columns: 1fr;
    grid-template-areas: "photo" "id" "nav" "links";
    justify-items: start;
  }
  .photo { width: 110px; margin-bottom: 1rem; }
  .news li { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* accessibility: honour reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
