:root {
  --bg: #FDFCFA;
  --text: #37352F;
  --muted: #787570;
  --accent: #C4704B;
  --accent-hover: #A85A38;
  --heading: #1D1B16;
  --border: #E6E1D9;
  --surface: #F5F1EB;
  --content-width: 710px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Crimson Text", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.78;
  background-color: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 180ms ease;
}

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

/* Subtle underlines for inline content links (not nav/action links) */
.bio a,
.section-note a,
.news-list a {
  text-decoration-line: underline;
  text-decoration-color: rgba(196, 112, 75, 0.35);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 180ms ease, color 180ms ease;
}
.bio a:hover,
.section-note a:hover,
.news-list a:hover {
  text-decoration-color: var(--accent-hover);
}

h1, h2, h3 {
  color: var(--heading);
  margin: 0;
}

h1 {
  font-size: 2.5rem;
  font-weight: 400;
  margin: 0 0 0.45rem;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.7rem;
  font-weight: 400;
  margin: 0 0 0.5rem;
  letter-spacing: -0.005em;
}

h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}

p {
  margin: 0 0 0.95rem;
}

.container {
  width: min(var(--content-width), 90vw);
  margin: 0 auto;
}

/* ── Header ──────────────────────────────────── */

.site-header {
  padding: 4rem 0 2rem;
  text-align: left;
}

.affiliation {
  margin: 0 0 0.2rem;
  color: var(--muted);
  line-height: 1.6;
}

.header-links {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0;
}

.header-links a {
  font-weight: 600;
  transition: color 180ms ease;
}

.header-links .separator {
  color: var(--border);
  margin: 0 0.55rem;
  user-select: none;
}

/* ── Bio ─────────────────────────────────────── */

.bio {
  padding: 0.8rem 0 0.5rem;
  max-width: 68ch;
}

.bio p {
  margin-bottom: 0.95rem;
  line-height: 1.78;
}

/* ── Sections ────────────────────────────────── */

.section {
  padding: 1.6rem 0 0.4rem;
  border-top: 1px solid var(--border);
}

.section-note {
  color: var(--muted);
  margin-bottom: 0.6rem;
}

/* ── News ────────────────────────────────────── */

.news-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.news-list li {
  margin-bottom: 0.55rem;
  padding-left: 1rem;
  position: relative;
}

.news-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
}

.news-date {
  font-weight: 700;
  color: var(--heading);
}

/* ── Publications ────────────────────────────── */

.pub-entry {
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(230, 225, 217, 0.5);
}

.pub-entry:first-child {
  padding-top: 0;
}

.pub-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pub-title {
  font-weight: 700;
  margin-bottom: 0.15rem;
  line-height: 1.38;
  color: var(--heading);
}

.pub-authors {
  margin-bottom: 0.1rem;
  color: var(--muted);
  line-height: 1.55;
}

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

.pub-venue {
  margin-bottom: 0.2rem;
}

.pub-venue strong {
  color: var(--heading);
}

.pub-venue .venue-note {
  color: var(--heading);
  font-style: normal;
  font-weight: 600;
  background: linear-gradient(to top, transparent 35%, rgba(196, 112, 75, 0.18) 35%, rgba(196, 112, 75, 0.18) 65%, transparent 65%);
  padding: 0 0.1rem;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 0;
}

.pub-links a,
.pub-links button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: var(--accent);
  font-weight: 600;
  transition: color 180ms ease;
}

.pub-links button:hover,
.pub-links a:hover {
  color: var(--accent-hover);
}

.pub-links .separator {
  color: var(--border);
  margin: 0 0.35rem;
  user-select: none;
}

/* Collapsible TL;DR & citation */
.pub-collapsible {
  display: none;
  margin-top: 0.4rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border-left: 2px solid var(--border);
  border-radius: 0 6px 6px 0;
  color: var(--text);
  line-height: 1.7;
}

.pub-collapsible.open {
  display: block;
}

.pub-collapsible pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.78rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--muted);
  line-height: 1.55;
}

/* ── Teaching ────────────────────────────────── */

.teaching-list {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.teaching-item {
  margin-bottom: 0.55rem;
  padding-left: 1rem;
  position: relative;
}

.teaching-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
}

.teaching-course {
  font-weight: 700;
  color: var(--heading);
}

.teaching-meta {
  color: var(--muted);
}

/* ── Footer ──────────────────────────────────── */

.site-footer {
  padding: 2rem 0 3.5rem;
}

.site-footer hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.footer-text {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.88em;
  letter-spacing: 0.01em;
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 640px) {
  body {
    font-size: 16px;
    line-height: 1.72;
  }

  .site-header {
    padding: 2.5rem 0 1.4rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.35rem;
  }

  .section {
    padding: 1.3rem 0 0.3rem;
  }
}

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

  a,
  .pub-links a,
  .pub-links button,
  .header-links a {
    transition: none;
  }
}
