:root {
  --mint-900: #1e5c50;
  --mint-700: #2d7b6b;
  --mint-500: #50b9ad;
  --mint-300: #a8e1d4;
  --mint-100: #e6f5f2;
  --mint-50:  #f2faf8;
  --ink:      #2c2825;
  --charcoal: #3d3832;
  --stone-700:#5c554d;
  --stone-500:#8a8279;
  --stone-400:#a89f95;
  --sand:     #e0d8ce;
  --parchment:#f0ebe4;
  --cream:    #f6f1eb;
  --paper:    #fdfaf7;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono:  "IBM Plex Mono", Menlo, Consolas, monospace;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--charcoal);
}

body {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 32px 96px;
}

/* Header */
.page-header {
  margin-bottom: 12px;
}

.page-header h1 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 2.2em;
  line-height: 1.15;
  margin: 0;
}

.page-header .portrait {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--sand);
  vertical-align: middle;
  margin-right: 16px;
  margin-bottom: 6px;
}

.credentials {
  font-family: var(--serif);
  color: var(--stone-500);
  font-size: 0.95em;
  line-height: 1.5;
  margin: 0 0 8px 0;
}

.intro-current {
  font-family: var(--serif);
  color: var(--charcoal);
  font-size: 0.95em;
  line-height: 1.55;
  margin: 0 0 28px 0;
}

.intro-lead {
  font-family: var(--serif);
  color: var(--charcoal);
  font-size: 1.05em;
  line-height: 1.7;
  margin: 0 0 56px 0;
}

.page-nav {
  font-family: var(--serif);
  color: var(--stone-700);
  font-size: 0.95em;
  margin-bottom: 56px;
}

.page-nav a {
  color: var(--stone-700);
  text-decoration: none;
  border-bottom: 1px solid var(--sand);
}

.page-nav a:hover {
  color: var(--mint-700);
  border-bottom-color: var(--mint-500);
}

.page-nav .sep {
  color: var(--stone-400);
  margin: 0 10px;
}

/* Sections */
section {
  margin: 0 0 64px 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72em;
  color: var(--mint-700);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 12px;
  display: block;
}

h2 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  font-size: 1.6em;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 28px 0;
}

h3 {
  font-family: var(--serif);
  color: var(--stone-700);
  font-weight: 500;
  font-size: 1.15em;
  line-height: 1.3;
  letter-spacing: 0;
  margin: 44px 0 16px 0;
}

p {
  margin: 0 0 22px 0;
}

p .em-mint {
  color: var(--mint-700);
  font-weight: 600;
}

a {
  color: var(--mint-700);
  text-decoration: none;
  border-bottom: 1px solid var(--mint-300);
  transition: border-color 0.15s;
}

a:hover {
  border-bottom-color: var(--mint-700);
}

/* Quiet divider */
hr {
  border: none;
  border-top: 1px solid var(--sand);
  margin: 40px auto;
  width: 32%;
}

/* Italic kicker inline */
.kicker {
  font-style: italic;
  color: var(--stone-700);
}

/* Inline section number (sits inside the h2) */
.section-num {
  font-family: var(--mono);
  font-size: 0.46em;
  color: var(--mint-700);
  letter-spacing: 0.14em;
  font-weight: 600;
  margin-right: 16px;
  position: relative;
  top: -0.55em;
  white-space: nowrap;
}

/* Doc-type bullet list (NICE-register dash bullets) */
.doc-types {
  list-style: none;
  padding-left: 0;
  margin: 14px 0 22px 0;
}

.doc-types li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 6px;
  font-size: 0.96em;
  line-height: 1.55;
}

.doc-types li::before {
  content: "—";
  color: var(--mint-500);
  position: absolute;
  left: 0;
  top: 0;
}

/* Pullout quote */
.pullout {
  font-family: var(--serif);
  font-style: italic;
  color: var(--stone-700);
  border-left: 3px solid var(--mint-700);
  padding: 6px 0 6px 22px;
  margin: 36px 0;
  font-size: 1.04em;
  line-height: 1.7;
}

/* Inline section break — subsection headings */
section h3 {
  margin: 48px 0 18px 0;
}

/* Curiosity list */
.curiosity {
  font-family: var(--serif);
  font-style: italic;
  color: var(--stone-700);
  font-size: 0.98em;
}

/* Publication list (compact paragraphs under h3) */
.pub-list p {
  font-size: 0.94em;
  line-height: 1.55;
  margin: 0 0 16px 0;
  color: var(--charcoal);
}

.pub-list p a {
  border-bottom-color: var(--mint-300);
}

/* Lab images */
.lab-images {
  display: block;
}

.lab-images img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 24px 0;
  border-radius: 4px;
  border: 1px solid var(--sand);
}

/* Footer */
.page-footer {
  font-family: var(--serif);
  font-size: 0.92em;
  color: var(--stone-500);
  line-height: 1.7;
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--sand);
}

.page-footer a {
  color: var(--stone-700);
  border-bottom: 1px solid var(--sand);
}

.page-footer a:hover {
  color: var(--mint-700);
  border-bottom-color: var(--mint-500);
}

.page-footer .row {
  margin-bottom: 10px;
}

.page-footer .funding {
  font-family: var(--mono);
  font-size: 0.78em;
  color: var(--stone-400);
  margin-top: 18px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 40, 37, 0.42);
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 50;
}

.modal-backdrop.open {
  opacity: 1;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 48px);
  max-width: 720px;
  max-height: 86vh;
  background: var(--parchment);
  border: 1px solid var(--sand);
  border-radius: 12px;
  padding: 40px 44px 36px;
  overflow-y: auto;
  z-index: 60;
  opacity: 0;
  transition: opacity 120ms ease;
  box-shadow: 0 8px 32px rgba(44, 40, 37, 0.18);
}

.modal.open {
  opacity: 1;
}

.modal[hidden],
.modal-backdrop[hidden] {
  display: none;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: transparent;
  border: none;
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--stone-500);
  cursor: pointer;
  padding: 6px 8px;
  letter-spacing: 0.04em;
}

.modal-close:hover {
  color: var(--mint-700);
}

.modal h3 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  font-size: 1.3em;
  line-height: 1.3;
  margin: 0 0 14px 0;
}

.modal .citation {
  font-family: var(--mono);
  font-size: 0.78em;
  color: var(--stone-500);
  line-height: 1.6;
  margin: 0 0 24px 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--sand);
}

.modal .body {
  font-family: var(--serif);
  color: var(--charcoal);
  font-size: 0.96em;
  line-height: 1.75;
}

.modal .body p {
  margin: 0 0 18px 0;
}

.modal .body p:last-of-type {
  margin-bottom: 0;
}

.modal .modal-footer {
  font-family: var(--sans);
  font-size: 0.78em;
  color: var(--stone-500);
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--sand);
}

/* Mobile */
@media (max-width: 768px) {
  body {
    font-size: 17px;
  }
  .page {
    padding: 40px 22px 72px;
  }
  .page-header h1 {
    font-size: 1.9em;
  }
  h2 {
    font-size: 1.4em;
  }
  .modal {
    padding: 32px 24px 28px;
    max-height: 88vh;
  }
  .page-nav {
    margin-bottom: 40px;
  }
}
