:root {
  --surface: #FDFCFA;
  --sidebar: #F3F0EA;
  --ink: #1F1B17;
  --body: #4A433C;
  --muted: #6B6259;
  --faint: #9A9086;
  --accent: #8C3B2E;
  --rule: #E4DFD5;
  --rule-soft: #EDE8DF;
  --rule-sidebar: #E0DAD0;
  --chip-border: #DCD5C9;
  --serif: 'Lora', 'Times New Roman', Times, serif;
  --sans: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --sidebar-w: 360px;
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--surface);
  color: #2E2A26;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 16px;
  z-index: 10;
}
.skip-link:focus { left: 0; }

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--rule);
  padding: 56px 44px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar__portrait {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.sidebar__name {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 6px;
  color: var(--ink);
}
.sidebar__name a { color: inherit; text-decoration: none; }

.sidebar__affiliation {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}

.rule { height: 1px; background: var(--rule-sidebar); border: 0; margin: 0; }

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
}
.sidebar__nav a { color: var(--body); text-decoration: none; }
.sidebar__nav a:hover { color: var(--accent); }
.sidebar__nav a[aria-current="page"] { color: var(--accent); }

.sidebar__contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--sans);
  font-size: 15px;
}
.sidebar__contact a {
  color: #2E2A26;
  text-decoration: none;
  display: flex;
  gap: 12px;
  align-items: center;
  overflow-wrap: anywhere;
}
.sidebar__contact a:hover { color: var(--accent); }
.sidebar__contact .fa, .sidebar__contact .fab { width: 16px; color: var(--accent); flex: none; }

/* ---------- Main column ---------- */

.content {
  margin-left: var(--sidebar-w);
  padding: 72px 80px 96px;
  max-width: 1000px;
}

.content a { color: var(--accent); }
.content a:hover { color: #6E2C22; }

.page-title {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--ink);
}
.page-title--home { font-size: 46px; line-height: 1.1; margin-bottom: 10px; }
.page-title--sub { font-size: 32px; margin-bottom: 8px; }

.lede {
  line-height: 1.7;
  margin: 0 0 36px;
  color: var(--body);
  max-width: 60ch;
  text-wrap: pretty;
}

.prose p { margin: 0 0 22px; color: var(--body); max-width: 62ch; text-wrap: pretty; }
.prose p:last-child { margin-bottom: 0; }

.section { margin-top: 52px; padding-top: 36px; border-top: 1px solid var(--rule); }
.section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.section__label {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  margin: 0 0 24px;
}

.more-link {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-top: 26px;
}
.more-link:hover { text-decoration: underline; }

/* ---------- Timeline ---------- */

.timeline { display: grid; grid-template-columns: auto 1fr; gap: 0 24px; }

.timeline__marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 9px;
}
.timeline__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.timeline__line { flex: 1; width: 1px; background: var(--rule-sidebar); }

.timeline__entry { padding-bottom: 34px; }
.timeline__entry:last-child { padding-bottom: 0; }

.timeline__date {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--faint);
  font-style: italic;
  margin: 0 0 8px;
}
.timeline__title {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
  text-wrap: pretty;
}
.timeline__summary {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--body);
  max-width: 60ch;
  text-wrap: pretty;
}
.timeline__summary ul { margin: 0; padding-left: 20px; }
.timeline__summary li + li { margin-top: 6px; }
.timeline__meta { margin: 0; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.timeline__meta a { color: var(--accent); }

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

.pub-note { font-family: var(--sans); font-size: 14px; color: var(--faint); margin: 0 0 36px; }

.pub-year {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 36px 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}
.pub-year:first-of-type { margin-top: 0; }

.pub { display: grid; grid-template-columns: 150px 1fr; gap: 24px 28px; margin-bottom: 36px; }
.pub:last-child { margin-bottom: 0; }

.pub__venue {
  border: 1px solid var(--chip-border);
  background: var(--sidebar);
  border-radius: 4px;
  padding: 14px 12px;
  text-align: center;
  align-self: start;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--muted);
}
.pub__title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--ink);
  text-wrap: pretty;
}
.pub__authors {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 6px;
  color: var(--body);
}
.pub__authors em.self { font-weight: 700; font-style: italic; }
.pub__ref { font-family: var(--sans); font-size: 14px; margin: 0 0 12px; color: var(--muted); }

.pub__links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}
.pub__links a, .pub__abs > summary {
  border: 1px solid var(--chip-border);
  color: var(--body);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 3px;
  display: inline-block;
}
.pub__links a:hover, .pub__abs > summary:hover { border-color: var(--accent); color: var(--accent); }

.pub__abs { display: inline-block; }
.pub__abs > summary {
  border-color: var(--accent);
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}
.pub__abs > summary::-webkit-details-marker { display: none; }
.pub__abs[open] > summary { background: var(--accent); color: #fff; }
.pub__abstract {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--body);
  background: var(--sidebar);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 16px 18px;
  margin: 12px 0 0;
  max-width: 62ch;
}

/* ---------- Writing list ---------- */

.tag-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 40px;
}
.tag-filter a {
  border: 1px solid var(--chip-border);
  color: var(--body);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 999px;
}
.tag-filter a:hover { border-color: var(--accent); color: var(--accent); }
.tag-filter a[aria-current="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.entry-list { display: flex; flex-direction: column; }

.entry {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 28px;
  align-items: start;
  text-decoration: none;
  color: inherit;
  padding: 30px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.entry:first-child, .entry.is-first { padding-top: 0; }
.entry:last-child, .entry.is-last { border-bottom: 0; }
.entry:hover .entry__title { color: var(--accent); }

.entry__thumb { width: 180px; height: 130px; object-fit: cover; display: block; }
.entry__thumb--placeholder {
  width: 180px;
  height: 130px;
  background: #F1EFEA;
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #B5AA9E;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.entry__meta {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 10px;
}
.entry__title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--ink);
  text-wrap: pretty;
}
.entry__excerpt {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--body);
  max-width: 56ch;
  text-wrap: pretty;
}

/* compact variant used on the home page */
.entry--compact { grid-template-columns: 120px 1fr; gap: 24px; align-items: center; padding: 0 0 24px; border-bottom: 0; }
.entry--compact:last-of-type { padding-bottom: 0; }
.entry--compact .entry__thumb, .entry--compact .entry__thumb--placeholder { width: 120px; height: 88px; }
.entry--compact .entry__title { font-size: 22px; margin-bottom: 6px; }
.entry--compact .entry__meta {
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  font-weight: 400;
  margin: 0;
}
.entry--compact > div { display: flex; flex-direction: column; }

.empty-note { font-family: var(--sans); font-size: 15px; color: var(--faint); }

/* ---------- Outside the lab rows ---------- */

.rows { display: flex; flex-direction: column; }
.row-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  padding-bottom: 30px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--rule-soft);
}
.row-item:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.row-item__label {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}
.row-item__title {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
  text-wrap: pretty;
}
.row-item__body { margin: 0; font-size: 17px; line-height: 1.6; color: var(--body); max-width: 56ch; }

/* ---------- Post ---------- */

.post-header { margin-bottom: 36px; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.post-header .entry__meta { margin-bottom: 12px; }
.post-subtitle { font-family: var(--sans); font-size: 18px; color: var(--muted); margin: 10px 0 0; }

.post-body { color: var(--body); }
.post-body > *:first-child { margin-top: 0; }
.post-body p, .post-body li { max-width: 68ch; text-wrap: pretty; }
.post-body h2 { font-family: var(--serif); font-size: 28px; color: var(--ink); margin: 44px 0 14px; }
.post-body h3 { font-family: var(--serif); font-size: 22px; color: var(--ink); margin: 36px 0 12px; }
.post-body img { display: block; height: auto; margin: 28px 0 10px; }
.post-body em { color: var(--muted); }
.post-body blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
.post-body pre, .post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
}
.post-body pre {
  background: var(--sidebar);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 16px 18px;
  overflow-x: auto;
}
.post-body table { border-collapse: collapse; margin: 28px 0; max-width: 100%; }
.post-body table img { margin: 0; }
.post-body hr { border: 0; height: 1px; background: var(--rule); margin: 40px 0; }
/* markdown helpers carried over from the old Bootstrap-based theme */
.post-body .mx-auto { margin-left: auto; margin-right: auto; }
.post-body .d-block { display: block; }

.post-footer { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--rule); }
.post-tags { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 28px; }
.post-tags__label {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
}
.post-tags a {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--chip-border);
  color: var(--body);
  text-decoration: none;
  padding: 5px 14px;
  border-radius: 999px;
}
.post-tags a:hover { border-color: var(--accent); color: var(--accent); }

.post-nav { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.post-nav a {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}
.post-nav a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  /* the fixed rail becomes a compact header once there is no room beside the content */
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 24px 22px;
    padding: 36px 32px;
  }
  .sidebar__portrait { width: 116px; height: 116px; }
  .sidebar__name { font-size: 28px; }
  .sidebar__name br { display: none; }
  .rule, .sidebar__nav, .sidebar__contact { grid-column: 1 / -1; }
  .sidebar__nav, .sidebar__contact { flex-direction: row; flex-wrap: wrap; gap: 12px 24px; }
  .content { margin-left: 0; padding: 48px 32px 72px; max-width: 820px; }
}

@media (max-width: 620px) {
  body { font-size: 17px; }
  .sidebar { gap: 20px 18px; padding: 28px 24px; }
  .sidebar__portrait { width: 96px; height: 96px; }
  .sidebar__name { font-size: 26px; }
  .sidebar__nav, .sidebar__contact { gap: 10px 20px; }
  .content { padding: 36px 24px 64px; }
  .page-title, .page-title--home { font-size: 32px; }
  .page-title--sub { font-size: 26px; }
  .pub { grid-template-columns: 1fr; gap: 14px; }
  .pub__venue { justify-self: start; padding: 8px 14px; }
  .entry, .entry--compact { grid-template-columns: 1fr; gap: 14px; }
  .entry__thumb, .entry__thumb--placeholder,
  .entry--compact .entry__thumb, .entry--compact .entry__thumb--placeholder { width: 100%; height: 180px; }
  .row-item { grid-template-columns: 1fr; gap: 10px; }
  .timeline { gap: 0 16px; }
}

@media print {
  .sidebar { position: static; border: 0; }
  .content { margin-left: 0; }
}
