/* Moor Lab — plain CSS, no build step. Works as-is on GitHub Pages.
   Palette borrows from Goldner's trichrome: mineralized bone stains green, osteoid stains red. */

:root {
  --bg: #f4f6f5;
  --surface: #e8edeb;
  --ink: #17222b;
  --muted: #52616b;
  --rule: #cfd8d5;
  --green: #1d7356;
  --red: #b3343f;
  --dot: #9eabb3;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 66ch;
  --header: 3.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101715;
    --surface: #18211f;
    --ink: #e4ebe8;
    --muted: #9cada8;
    --rule: #2b3734;
    --green: #5ec29b;
    --red: #f07b85;
    --dot: #4d5d59;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
}

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--green); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--bg); padding: 0.5rem 0.8rem; z-index: 20;
}
.skip:focus { top: 0.5rem; }

/* Header and section navigation */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.top-inner {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: var(--header);
}
.brand {
  font-family: var(--serif); font-size: 1.15rem;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.top nav { margin-left: auto; min-width: 0; }
.top nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.1rem; }
.top nav a { color: var(--muted); text-decoration: none; white-space: nowrap; font-size: 0.95rem; }
.top nav a:hover { color: var(--ink); }

/* Phones: brand on its own row, sections scroll sideways underneath */
@media (max-width: 52rem) {
  :root { --header: 5.6rem; }
  .top-inner { flex-direction: column; align-items: stretch; gap: 0.3rem; padding-top: 0.6rem; padding-bottom: 0.2rem; }
  .top nav { margin-left: -1.25rem; margin-right: -1.25rem; overflow-x: auto; scrollbar-width: none; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav ul { padding: 0.35rem 1.25rem 0.55rem; gap: 1.1rem; }
}

/* Hero */
.hero { padding: 3.5rem 0 3rem; }
.affil { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; max-width: var(--measure); }
.hero h1 {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: clamp(3.4rem, 18vw, 8rem); line-height: 0.92; letter-spacing: -0.02em;
}
.lede {
  margin: 1.5rem 0 0; max-width: 38ch;
  font-family: var(--serif); font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.4;
}

/* QTL mapping figure */
.qtl-fig { margin-top: 2.75rem; margin-bottom: 0; }
.qtl-fig img {
  display: block;
  width: 100%;
  max-width: 460px;   /* half size on desktop; phones use the full width */
  height: auto;
  background: #fff;          /* the plot has a white background; keep it framed in dark mode */
  padding: 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.qtl-fig figcaption { margin-top: 0.75rem; max-width: var(--measure); font-size: 0.9rem; color: var(--muted); }

.pi {
  margin-top: 2.5rem; padding: 0.25rem 1.5rem 0.75rem;
  background: var(--surface); max-width: calc(var(--measure) + 3rem);
}

/* Home, lower half: PI and News side by side on wide screens */
.home-lower { display: grid; gap: 0 3rem; }
@media (min-width: 60rem) {
  .home-lower { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
  .home-lower .pi { max-width: none; }
}
.news { margin-top: 2.5rem; }
.news .h3 { margin-top: 0; }
.news-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.news-list li {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--rule);
}
.news-list .when { color: var(--green); font-variant-numeric: tabular-nums; font-size: 0.95rem; padding-top: 0.1rem; }
.news-list p { margin: 0; }
@media (max-width: 30rem) {
  .news-list li { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* Sections */
.block { padding: 3.5rem 0; border-top: 1px solid var(--rule); }
.block p, .block ul, .block dl { max-width: var(--measure); }
/* Wider layouts that need to escape the text measure */
.block .dated { max-width: 52rem; }
.block .people, .block .link-grid .links { max-width: none; }

h2, h3, .h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; }
h2 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); margin: 0 0 1.25rem; }
h3, .h3 { font-size: 1.35rem; margin: 2.25rem 0 0.9rem; }
h2 + h3 { margin-top: 0.5rem; }
.pi .h3 { margin-top: 1.25rem; }
.pi-head { display: flex; align-items: flex-end; gap: 1.1rem; margin-top: 1.25rem; }
.pi-head .h3 { margin: 0 0 0.25rem; }
.headshot {
  flex: none;
  width: 112px;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--rule);
}

.questions { margin: 0; padding: 0; }
.questions div { padding: 0.9rem 0 0.9rem 1rem; border-left: 3px solid var(--green); margin-bottom: 0.75rem; }
.questions dt { font-weight: 600; }
.questions dd { margin: 0.2rem 0 0; color: var(--muted); }

.pubs { padding-left: 1.1rem; }
.pubs li { margin-bottom: 0.85rem; }
.pubs li::marker { color: var(--green); }
.pubs cite { font-style: italic; }
.pubs .title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.pubs a { overflow-wrap: anywhere; }
.note { font-size: 0.95rem; color: var(--muted); }
.more { margin-top: 1.25rem; }

.plain { padding-left: 1.1rem; }
.plain li { margin-bottom: 0.5rem; }
.plain li::marker { color: var(--green); }

/* Dated rows: CV and courses */
.dated { list-style: none; padding: 0; margin: 0; max-width: 52rem; }
.dated li {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--rule);
}
.dated .when { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 30rem) {
  .dated li { grid-template-columns: 1fr; gap: 0.1rem; }
  .dated .when { font-size: 0.9rem; }
}

/* People */
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 0 2rem; }
@media (min-width: 46rem) { .block .people { grid-template-columns: 1fr 1fr; max-width: 60rem; } }
.people li { padding: 0.65rem 0; border-bottom: 1px solid var(--rule); }
.people strong { display: block; font-weight: 600; }
.people span { color: var(--muted); font-size: 0.95rem; }

/* Links */
.link-grid { display: grid; gap: 0 2.5rem; }
@media (min-width: 46rem) { .link-grid { grid-template-columns: 1fr 1fr; max-width: 56rem; } }
.links { list-style: none; margin: 0; padding: 0; }
.links li { padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }

/* Footer with address */
.foot { padding: 2.5rem 0 3rem; border-top: 1px solid var(--rule); background: var(--surface); }
.foot-grid { display: grid; gap: 1.25rem; }
@media (min-width: 46rem) { .foot-grid { grid-template-columns: 1fr auto; align-items: end; } }
address { font-style: normal; line-height: 1.7; }
.copy { margin: 0; color: var(--muted); font-size: 0.875rem; }

@media (max-width: 30rem) {
  body { font-size: 1rem; }
  .hero { padding-top: 2.25rem; }
}
