/* Erb Laboratory: clear sky palette, light blues with deep blue text and links. */
:root {
  --paper: #ffffff;
  --surface: #f2f8fd;
  --ink: #16283a;
  --muted: #566a7c;
  --hema: #1e6fae;
  --hema-deep: #1a4f80;
  --hema-soft: #e3f2fc;
  --eosin: #2f8fd6;
  --eosin-soft: #d4ebfa;
  --rule: #dbe8f2;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --measure: 66ch;
  --wrap: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--hema); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--eosin); }

:focus-visible { outline: 3px solid var(--eosin); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  font-optical-sizing: auto;
}
h1 { font-size: clamp(2.4rem, 5.4vw, 4.1rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.4rem; line-height: 1.25; }
p { margin: 0 0 1.1em; max-width: var(--measure); }
.lede { font-size: 1.22rem; line-height: 1.55; color: var(--muted); max-width: 58ch; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: flex; align-items: baseline; gap: .65rem; text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; letter-spacing: -0.015em; }
.brand-inst { font-size: .9rem; color: var(--muted); }
.brand:hover { color: var(--ink); }
.brand:hover .brand-name { color: var(--hema); }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.nav a {
  display: block; padding: .5rem .8rem; border-radius: 999px;
  text-decoration: none; color: var(--ink); font-size: .98rem;
}
.nav a:hover { background: var(--hema-soft); color: var(--hema-deep); }
.nav a[aria-current="page"] { background: var(--hema); color: #fff; }

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .brand-inst { display: none; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: .5rem;
    font: inherit; font-size: .95rem; background: none; border: 1px solid var(--rule);
    border-radius: 999px; padding: .45rem .9rem; color: var(--ink); cursor: pointer;
  }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; padding: .5rem var(--gutter) 1rem; }
  .nav a { border-radius: 8px; padding: .75rem .8rem; }
}

/* ---------- Hero (home) ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: 1.25rem; max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.btn {
  display: inline-block; padding: .8rem 1.3rem; border-radius: 999px;
  text-decoration: none; font-weight: 600; font-size: 1rem;
  border: 1.5px solid var(--hema); color: var(--hema); background: transparent;
}
.btn:hover { background: var(--hema-soft); color: var(--hema-deep); }
.btn.solid { background: var(--hema); color: #fff; }
.btn.solid:hover { background: var(--hema-deep); color: #fff; }

.fiber {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%;
}
.fiber .dna { fill: none; stroke: var(--hema); stroke-width: 1.6; opacity: .55; }
.fiber .bead { fill: var(--hema-soft); stroke: var(--hema); stroke-width: 1.2; }
.fiber .bead.hot { fill: var(--eosin-soft); stroke: var(--eosin); stroke-width: 1.6; }
.fiber .wrapline { fill: none; stroke: var(--hema); stroke-width: 1.3; opacity: .7; }
.fiber .ligand { fill: var(--eosin); }

@media (max-width: 860px) {
  .hero { padding-top: 1rem; }
  .fiber { position: relative; inset: auto; display: block; height: auto; aspect-ratio: 3 / 1; margin: 0 auto 1.25rem; max-width: 560px; }
}

@media (prefers-reduced-motion: no-preference) {
  .fiber .dna { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 2.6s cubic-bezier(.4, 0, .2, 1) .2s forwards; }
  .fiber .bead, .fiber .wrapline { opacity: 0; animation: appear .6s ease forwards; animation-delay: var(--d); }
  .fiber .ligand { opacity: 0; animation: dock .7s cubic-bezier(.2, .8, .2, 1.2) forwards; animation-delay: 2.7s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes dock { from { opacity: 0; transform: translate(14px, -14px); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.band { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.page-head { padding: clamp(3rem, 7vw, 5rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.page-head h1 { max-width: 20ch; }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Research themes on home */
.themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 2rem; border-top: 1px solid var(--rule); }
.theme { padding: 1.75rem 1.5rem 0 0; }
.theme + .theme { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
.theme h3 { color: var(--hema-deep); }
.theme p { color: var(--muted); font-size: 1rem; }
@media (max-width: 860px) {
  .themes { grid-template-columns: 1fr; }
  .theme, .theme + .theme { padding: 1.5rem 0 .5rem; border-left: 0; border-top: 1px solid var(--rule); }
  .theme:first-child { border-top: 0; }
}

/* Featured paper covers */
.covers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.covers a { display: block; text-decoration: none; color: var(--ink); }
.covers img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; border: 1px solid var(--rule); background: var(--hema-soft); }
.covers a:hover img { outline: 3px solid var(--eosin); outline-offset: 2px; }
.covers .cap { font-size: .85rem; color: var(--muted); margin-top: .5rem; line-height: 1.35; }
@media (max-width: 960px) { .covers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .covers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.photo { border-radius: 4px; overflow: hidden; border: 1px solid var(--rule); }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Research page ---------- */
.area { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 4vw, 4rem); padding: clamp(2rem, 4vw, 3rem) 0; border-top: 1px solid var(--rule); }
.area:first-of-type { border-top: 0; }
.area h2 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); color: var(--hema-deep); }
.area .keys { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.area .keys li { font-size: .88rem; padding: .3rem .75rem; border-radius: 999px; background: var(--hema-soft); color: var(--hema-deep); }
@media (max-width: 760px) { .area { grid-template-columns: 1fr; } }

.spot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; margin-top: 2rem; }
.spot a { display: block; padding: 1.4rem 1.5rem; background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--eosin); text-decoration: none; color: var(--ink); }
.spot a:hover { border-color: var(--eosin); }
.spot .j { font-size: .9rem; color: var(--muted); }
.spot .t { font-family: var(--serif); font-size: 1.25rem; line-height: 1.3; margin: .35rem 0 .5rem; color: var(--ink); }
.spot .s { font-size: .98rem; color: var(--muted); margin: 0; }
@media (max-width: 760px) { .spot { grid-template-columns: 1fr; } }

/* ---------- Publications ---------- */
.pub-tools { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin: 1.5rem 0 1rem; }
.search { flex: 1 1 280px; max-width: 460px; }
.search input {
  width: 100%; font: inherit; padding: .75rem 1rem; border-radius: 999px;
  border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink);
}
.search input:focus { border-color: var(--hema); outline: none; box-shadow: 0 0 0 3px var(--hema-soft); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font: inherit; font-size: .92rem; padding: .45rem .9rem; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink);
}
.chip:hover { border-color: var(--hema); }
.chip[aria-pressed="true"] { background: var(--hema); border-color: var(--hema); color: #fff; }
.count { color: var(--muted); font-size: .95rem; }

.year { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 1.5rem; padding: 1.75rem 0; border-top: 1px solid var(--rule); }
.year > h2 { font-size: 1.9rem; color: var(--hema); margin: 0; position: sticky; top: 5.5rem; align-self: start; }
.year ol { list-style: none; margin: 0; padding: 0; }
.pub { padding: 0 0 1.5rem; }
.pub:last-child { padding-bottom: 0; }
.pub .title { font-family: var(--serif); font-size: 1.22rem; line-height: 1.35; font-weight: 500; }
.pub .title a { color: var(--ink); text-decoration: none; }
.pub .title a:hover { color: var(--hema); text-decoration: underline; }
.pub .authors { font-size: .95rem; color: var(--muted); margin: .3rem 0 .2rem; max-width: 80ch; }
.pub .authors b { color: var(--ink); font-weight: 600; }
.pub .venue { font-size: .95rem; font-style: italic; }
.pub .tag { font-style: normal; font-size: .78rem; font-weight: 600; padding: .12rem .5rem; border-radius: 4px; background: var(--eosin-soft); color: #0e5c95; margin-left: .4rem; vertical-align: 1px; }
.pub .press { margin: .6rem 0 0; padding: .6rem 0 0 .9rem; border-left: 3px solid var(--eosin); list-style: none; font-size: .92rem; }
.pub .press li + li { margin-top: .25rem; }
.pub .press span { color: var(--muted); }
.era-note { font-size: .95rem; color: var(--muted); margin-top: .5rem; }
.empty { padding: 2rem 0; color: var(--muted); }
mark { background: var(--eosin-soft); color: inherit; padding: 0 .1em; border-radius: 2px; }
@media (max-width: 640px) {
  .year { grid-template-columns: 1fr; gap: .75rem; }
  .year > h2 { position: static; }
}

/* ---------- Team ---------- */
.pi { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.pi .role { color: var(--muted); margin-top: -.25rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; margin-top: 1.5rem; }
.facts h3 { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: var(--hema-deep); margin-bottom: .4rem; }
.facts ul { margin: 0; padding-left: 1.1rem; font-size: .97rem; }
.facts li + li { margin-top: .25rem; }
@media (max-width: 760px) { .pi, .facts { grid-template-columns: 1fr; } }

.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.person img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: 4px; background: var(--hema-soft); }
.person .n { font-family: var(--serif); font-size: 1.2rem; margin-top: .6rem; }
.person .r { font-size: .92rem; color: var(--muted); }

.join { background: var(--hema-deep); color: #fff; }
.join h2 { color: #fff; }
.join p { color: #d2e1f4; }
.join a { color: #fff; }
.join .btn { border-color: #fff; color: #fff; }
.join .btn:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; margin-top: 1rem; }
.contact-grid h2 { font-family: var(--sans); font-size: 1rem; font-weight: 700; color: var(--hema-deep); margin-bottom: .5rem; }
.contact-grid address { font-style: normal; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 3rem; font-size: .95rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; align-items: center; }
.site-footer address { font-style: normal; }
.site-footer img { height: 44px; width: auto; }
/* ---------- Hero artwork ---------- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-art { margin: 0; }
.hero-art svg { display: block; width: 100%; height: auto; max-width: 480px; margin-left: auto; }
@media (max-width: 860px) {
  .hero { padding-top: 2rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art svg { max-width: 260px; margin: 0 auto; }
}

/* ---------- Photo hero (home) ---------- */
.ph { position: relative; min-height: min(82vh, 760px); display: flex; align-items: flex-end; color: #fff; background: #1c1f24; overflow: hidden; padding: 0; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }
.ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 24, 30, .92) 0%, rgba(20, 24, 30, .55) 38%, rgba(20, 24, 30, 0) 70%); }
.ph .wrap { position: relative; z-index: 1; width: 100%; padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.ph h1 { color: #fff; max-width: 18ch; }
.ph .lede { color: #d8e4f4; max-width: 40rem; }
.ph .btn { border-color: #fff; color: #fff; }
.ph .btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ph .btn.solid { background: #fff; color: var(--hema-deep); }
.ph .btn.solid:hover { background: #e3ecf8; color: var(--hema-deep); }

/* ---------- Logo in the banner ---------- */
.brand-logo { display: block; height: 50px; width: auto; }
@media (max-width: 760px) { .brand-logo { height: 42px; } }

/* ---------- Logo in the footer ---------- */
.site-footer .footer-logo { height: 64px; width: auto; }
@media (max-width: 760px) { .site-footer .wrap { justify-content: flex-start; } .site-footer .footer-logo { height: 56px; } }

/* ---------- Footer: both logos on one line ---------- */
.site-footer .wrap { flex-wrap: nowrap; gap: 2rem; }
.site-footer .wrap > div { flex: 1 1 auto; min-width: 0; }
.site-footer .footer-logo { height: 44px; width: auto; flex: none; }
.site-footer a img { height: 62px; width: auto; flex: none; }
.site-footer a { flex: none; }
@media (max-width: 760px) {
  .site-footer .wrap { flex-wrap: wrap; justify-content: flex-start; gap: 1.25rem 1.5rem; }
  .site-footer .wrap > div { flex-basis: 100%; }
  .site-footer .footer-logo { height: 38px; }
  .site-footer a img { height: 54px; }
}

/* Work with us photo: zoomed toward the lower part of the frame */
.photo-zoom img { transform: scale(1.2); transform-origin: 50% 80%; }
/* PI entry: name, title and email sit above the bio */
.pi h2 { margin-bottom: .35rem; }
.pi .role { margin: 0 0 .5rem; line-height: 1.45; }

/* PI entry: larger photo, slightly smaller type */
.pi { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.pi h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); }
.pi .role { font-size: .95rem; }
.pi p { font-size: .98rem; }
.pi .facts ul { font-size: .92rem; }
@media (max-width: 760px) { .pi { grid-template-columns: 1fr; } }

/* ---------- Clear sky overrides ---------- */
.btn.solid { background: #8cc6ef; border-color: #8cc6ef; color: #0e2f4a; }
.btn.solid:hover { background: #74b9ea; border-color: #74b9ea; color: #0e2f4a; }
.nav a[aria-current="page"] { background: #d4ebfa; color: #0e2f4a; }
.nav a:hover { background: #e3f2fc; color: #0e2f4a; }
.join { background: #d4ebfa; color: var(--ink); }
.join h2 { color: var(--ink); }
.join p { color: var(--muted); }
.join a { color: var(--hema); }
.ph .btn.solid:hover { background: #e3f2fc; }

/* ---------- Team roster with headshots ---------- */
.roster { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1.75rem 1.5rem; }
.person img, .person .initials { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.person .initials { display: flex; align-items: center; justify-content: center; background: #e3f2fc; color: #1a4f80; font-family: var(--serif); font-size: 2.4rem; letter-spacing: .02em; }
.person .n { margin-top: .6rem; }

/* PI entry: Education spans the full column so each item fits on one line */
.pi .facts { grid-template-columns: 1fr; }
