:root {
  --bg: #ffffff;
  --ink: #1c1b1a;
  --muted: #6b6660;
  --rail: #f6f5f3;
  --border: #e7e4e0;
  --green: #146c43;
  --green-strong: #0e512f;
  --green-soft: #e8f2ec;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-strong); text-decoration: underline; }

/* --- Layout --- */
.rail {
  background: var(--rail);
  border-right: 1px solid var(--border);
  padding: 2.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.content {
  max-width: 47rem;
  padding: 3rem 2.5rem 4rem;
}

@media (min-width: 880px) {
  body { display: grid; grid-template-columns: 17rem 1fr; }
  .rail {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
  .content { margin: 0 auto; }
}

/* --- Author block --- */
.name {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 1.65rem;
  line-height: 1.2;
  margin: 0 0 0.6rem;
}
.name a { color: var(--ink); text-decoration: none; }
.name a:hover { color: var(--green-strong); }

.role {
  margin: 0 0 0.4rem;
  font-weight: 600;
  color: var(--ink);
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* --- Nav --- */
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav li { margin: 0 0 0.4rem; }
.nav a {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  padding: 0.15rem 0;
}
.nav a:hover { color: var(--green-strong); text-decoration: none; }

.links { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.9rem; }

/* --- Content --- */
section { margin: 0 0 3.25rem; }

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  margin: 0 0 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

h3.title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.35;
  margin: 0.15rem 0 0.4rem;
}

h3.subhead {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 1.05rem;
  margin: 2rem 0 0.6rem;
}

.lede { font-size: 1.12rem; line-height: 1.55; }

p { margin: 0 0 0.85rem; }
section > p:last-child { margin-bottom: 0; }

/* --- Entries --- */
.entry { margin: 0 0 1.6rem; }

.tag {
  display: inline-block;
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green-strong);
  background: var(--green-soft);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.4rem;
}
.tag.muted { color: var(--muted); }

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

.detail { color: var(--ink); margin: 0 0 0.35rem; }
.note { color: var(--muted); font-size: 0.92rem; margin: 0 0 0.35rem; }

.pub-link { font-size: 0.92rem; }

/* --- Standalone post --- */
body.post { display: block; }
body.post .content { max-width: 47rem; margin: 0 auto; }
.backlink a { color: var(--muted); font-size: 0.9rem; }
.backlink a:hover { color: var(--green-strong); }

.post-header { margin: 0 0 2.25rem; }
.post-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0.5rem 0 0.5rem;
}

.table-wrap { overflow-x: auto; margin: 1rem 0 1.25rem; }
table.results {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
table.results th, table.results td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
}
table.results thead th {
  background: var(--rail);
  font-weight: 600;
}
table.results tbody th { font-weight: 500; }
table.results td {
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

/* --- Inline math / formulas --- */
.formula {
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  margin: 1.1rem 0;
  background: var(--rail);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.02rem;
  line-height: 1.6;
  overflow-x: auto;
}
.formula var { font-style: italic; }
.formula sub, .formula sup { font-size: 0.7em; }
.formula .op { color: var(--muted); font-style: normal; }

/* --- Research highlight callout --- */
.highlight {
  background: var(--green-soft);
  border: 1px solid #cfe3d8;
  border-radius: 8px;
  padding: 1.25rem 1.4rem;
  margin: 1.5rem 0 1.75rem;
}
.highlight .detail { margin-bottom: 0; }

/* --- Themes & lists --- */
.themes { padding-left: 1.2rem; margin: 0; }
.themes li { margin: 0 0 0.35rem; }

.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin: 0 0 0.5rem; }
.plain.contact li { display: inline; margin-right: 1.4rem; }

/* --- Timeline --- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.4rem 1.25rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.timeline li:last-child { border-bottom: none; }
.timeline .when {
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--muted);
  align-self: start;
}
.timeline .role { font-weight: 600; }
.timeline .org { color: var(--muted); }

/* --- Footer --- */
footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
footer p { margin: 0; }

@media (max-width: 879px) {
  .rail {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 1.25rem;
    gap: 1.25rem;
  }
  .nav ul { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
  .nav li { margin: 0; }
  .content { padding: 2rem 1.25rem 3rem; }
  .timeline li { grid-template-columns: 7rem 1fr; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .timeline li { grid-template-columns: 1fr; gap: 0.1rem; }
}