@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');
@font-face {
  font-family: 'et-book';
  src: url('https://cdnjs.cloudflare.com/ajax/libs/tufte-css/1.8.0/et-book/et-book-roman-line-figures/et-book-roman-line-figures.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'et-book';
  src: url('https://cdnjs.cloudflare.com/ajax/libs/tufte-css/1.8.0/et-book/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff') format('woff');
  font-weight: normal;
  font-style: italic;
}
@font-face {
  font-family: 'et-book';
  src: url('https://cdnjs.cloudflare.com/ajax/libs/tufte-css/1.8.0/et-book/et-book-bold-line-figures/et-book-bold-line-figures.woff') format('woff');
  font-weight: bold;
  font-style: normal;
}

/* ── Reset & base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:      #1a1a18;
  --muted:    #5a5a52;
  --faint:    #c8c8be;
  --rule:     #e0e0d6;
  --bg:       #faf9f6;
  --bg-tint:  #f3f1ec;
  --accent:   #8b3a2a;   /* deep terracotta — restrained, academic */
  --max:      680px;
  --mono:     'JetBrains Mono', monospace;
  --serif:    'et-book', Palatino, 'Palatino Linotype', 'Palatino LT STD', Georgia, serif;
}

html { font-size: 20px; scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  padding: 0 1.5rem;
}

/* ── Layout ────────────────────────────────────────────────────── */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 0 6rem;
}

/* ── Typography helpers ─────────────────────────────────────────── */
h1, h2, h3 {
  font-weight: 500;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 0.72rem;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1.4rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-size: 1rem;
  font-weight: 500;
}

p { margin-bottom: 0.9rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity 0.15s;
}
a:hover { opacity: 0.65; }

/* ── Header ─────────────────────────────────────────────────────── */
header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

header .name-block h1 { margin-bottom: 0.15rem; }

header .name-block p {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
  font-style: italic;
}

header nav {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
}

header nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
}
header nav a:hover { color: var(--accent); opacity: 1; }

.profile-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.profile-links a {
  font-family: var(--serif);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.profile-links a:hover { color: var(--accent); border-color: var(--accent); opacity: 1; }

/* ── Sections ───────────────────────────────────────────────────── */
section {
  margin-top: 3.5rem;
}

/* ── About ──────────────────────────────────────────────────────── */
#about p {
  font-size: 1rem;
}

/* ── Teaching ───────────────────────────────────────────────────── */
.course-list {
  list-style: none;
}

.course-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0 1.2rem;
  align-items: start;
}

.course-list li:first-child { border-top: 1px solid var(--rule); }

.course-year {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  padding-top: 0.25rem;
}

.course-title {
  font-weight: 500;
  display: block;
  margin-bottom: 0.1rem;
}

.course-programme {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  display: block;
  margin-bottom: 0.2rem;
}

.course-desc {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

/* ── Books / Publications ───────────────────────────────────────── */
.pub-list {
  list-style: none;
}

.pub-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}
.pub-list li:first-child { border-top: 1px solid var(--rule); }

.pub-title {
  font-weight: 500;
  display: block;
  margin-bottom: 0.25rem;
}

.pub-authors {
  color: var(--muted);
  font-style: italic;
  font-size: 0.88rem;
  display: block;
  margin-bottom: 0.25rem;
}

.pub-link {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Projects ───────────────────────────────────────────────────── */
.project-list {
  list-style: none;
}

.project-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 1.5rem;
  align-items: start;
}
.project-list li:first-child { border-top: 1px solid var(--rule); }

.project-name {
  font-weight: 500;
  display: block;
}

.project-full {
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
  display: block;
  grid-column: 1;
}

.project-desc {
  font-size: 0.88rem;
  color: var(--muted);
  grid-column: 1;
  margin-top: 0.2rem;
}

.project-years {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  text-align: right;
  grid-row: 1;
  grid-column: 2;
  padding-top: 0.25rem;
}

/* ── Students ───────────────────────────────────────────────────── */
#students h3 {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 1.6rem 0 0.6rem;
}
.student-list {
  list-style: none;
  columns: 2;
  column-gap: 2rem;
}

.student-list li {
  break-inside: avoid;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
}

.student-list li:first-child { border-top: 1px solid var(--rule); }

.student-name {
  font-weight: 500;
  display: block;
}

.student-now {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
}

/* ── Contact ────────────────────────────────────────────────────── */
#contact p {
  font-size: 0.95rem;
}

/* ── Footer ─────────────────────────────────────────────────────── */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  html { font-size: 19px; }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  header nav { gap: 1rem; flex-wrap: wrap; }

  .student-list { columns: 1; }

  .project-list li {
    grid-template-columns: 1fr;
  }
  .project-years { grid-column: 1; grid-row: auto; text-align: left; }

  .recent-work-grid { grid-template-columns: 1fr !important; }
}
