/* Redmond Lab — redmondlab.org
   Single stylesheet, no dependencies. */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-alt: #f4f2ee;
  --text: #16181d;
  --muted: #5b6270;
  --border: #e4e1db;
  --accent: #8c1d2a;
  --accent-hover: #6f1621;
  --accent-soft: #f6ebec;
  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --surface: #171a20;
    --surface-alt: #1c2028;
    --text: #e8eaed;
    --muted: #98a0ae;
    --border: #272c35;
    --accent: #e8737f;
    --accent-hover: #f2929c;
    --accent-soft: #241a1d;
  }
}

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

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

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.prose { max-width: 68ch; }

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

h1, h2, h3 { line-height: 1.25; font-weight: 650; letter-spacing: -0.015em; }
h1 { font-size: 2.3rem; margin: 0 0 .5rem; }
h2 { font-size: 1.45rem; margin: 2.75rem 0 .9rem; }
h3 { font-size: 1.08rem; margin: 0 0 .4rem; }
.prose h3 { margin-top: 2rem; }
.prose ul { padding-left: 1.15rem; }
.prose ul li { margin-bottom: .5rem; }

/* ---------- header ---------- */

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  font-weight: 680;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand span { color: var(--accent); }

nav.site { display: flex; gap: 22px; flex-wrap: wrap; }
nav.site a {
  color: var(--muted);
  font-size: .93rem;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
nav.site a:hover { color: var(--text); text-decoration: none; }
nav.site a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ---------- hero ---------- */

.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--border); }
.hero .kicker {
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .74rem;
  font-weight: 650;
  line-height: 1.55;
  color: var(--accent);
  margin: 0 0 14px;
}
.hero p.lead {
  font-size: 1.16rem;
  color: var(--muted);
  max-width: 62ch;
  margin: 1rem 0 0;
}
.hero .affil {
  font-size: 1rem;
  color: var(--muted);
  margin: .35rem 0 0;
}
.hero p.detail {
  font-size: 1rem;
  color: var(--muted);
  max-width: 66ch;
  margin: 1.3rem 0 0;
}

/* ---------- sections & cards ---------- */

section { padding: 52px 0; }
section + section { border-top: 1px solid var(--border); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .74rem;
  font-weight: 650;
  color: var(--muted);
  margin: 0 0 1.4rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Four-across rows (research themes, collaborators) that collapse
   to 2-up then 1-up on narrower screens. */
.grid.themes,
.grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid.themes,
  .grid.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid.themes,
  .grid.four { grid-template-columns: 1fr; }
}

a.card {
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
a.card:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .07);
}
a.card h3 { transition: color .15s ease; }
a.card:hover h3 { color: var(--accent); }
a.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
a.card .more {
  margin-top: auto;
  padding-top: 16px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  a.card, a.card h3 { transition: none; }
  a.card:hover { transform: none; }
}

/* ---------- people ---------- */

/* Person cards hold only a few lines, so they are capped rather than
   stretched across the full width the way the default .grid does. */
.grid.people { grid-template-columns: repeat(auto-fill, minmax(260px, 360px)); }
@media (max-width: 560px) {
  .grid.people { grid-template-columns: 1fr; }
}

/* Name row at the top of a person card. The avatar is either an <img>
   headshot or a <span> of initials; both use the .avatar class so the
   two are interchangeable. */
.person-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.person-head h3 { margin: 0; }

.avatar {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 650;
  letter-spacing: .04em;
  user-select: none;
}

.avatar.lead-avatar {
  flex-basis: 76px;
  width: 76px;
  height: 76px;
  font-size: 1.2rem;
}

/* ---------- theme blocks (research page) ---------- */

.theme {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 32px;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 88px; /* clears the sticky header when jumped to via #anchor */
}
.theme .papers-label {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  font-weight: 650;
  color: var(--muted);
  margin: 1.8rem 0 .2rem;
}
.theme:first-of-type { border-top: none; }
.theme > h2 { margin: 0; font-size: 1.18rem; }
.theme .body p { margin-top: 0; }
.theme .body p:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  .theme { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- publications ---------- */

.pub-year {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--accent);
  margin: 2.2rem 0 .7rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}

ul.pubs { list-style: none; margin: 0; padding: 0; }
ul.pubs li {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
}
ul.pubs li:last-child { border-bottom: none; }
ul.pubs .venue { color: var(--muted); font-style: italic; }

ul.pubs li a, .highlight a {
  color: inherit;
  text-decoration: none;
  transition: color .15s ease;
}
ul.pubs li a:hover, .highlight a:hover {
  color: var(--accent);
  text-decoration: underline;
}
ul.pubs li a:focus-visible, .highlight a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.highlight {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 18px 22px;
  margin: 0 0 12px;
}
.highlight .venue { color: var(--muted); font-style: italic; font-size: .9rem; }

/* ---------- datasets ---------- */

ul.datasets { list-style: none; margin: 0; padding: 0; }
ul.datasets li {
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}
ul.datasets li:last-child { border-bottom: none; }
ul.datasets .ds-title { font-size: .95rem; font-weight: 600; }
ul.datasets .ds-title a { color: inherit; text-decoration: none; }
ul.datasets .ds-title a:hover { color: var(--accent); text-decoration: underline; }
ul.datasets .venue { color: var(--muted); font-style: italic; font-size: .88rem; }

.accs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
a.acc {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}
a.acc:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ---------- misc ---------- */

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 7px;
  font-size: .93rem;
  font-weight: 550;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent); }

@media (prefers-color-scheme: dark) {
  .btn { color: #14161a; }
  .btn:hover { color: #14161a; }
}

dl.meta { margin: 0; }
dl.meta dt {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 650;
  color: var(--muted);
  margin-top: 1.4rem;
}
dl.meta dd { margin: .25rem 0 0; }

footer.site {
  border-top: 1px solid var(--border);
  padding: 34px 0;
  color: var(--muted);
  font-size: .88rem;
  background: var(--surface-alt);
}
footer.site .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
footer.site p { margin: 0; }
