/* ============================================================
   solab.org — stylesheet
   "Alignment / residue-grid" identity: warm paper + residue palette
   sampled from the lab's MSA colouring, fully monospace (JetBrains
   Mono). Signature: live multiple-sequence-alignment graphics
   generated in assets/js/msa.js. Dark mode aware.
   ============================================================ */

/* ---------- Self-hosted fonts ---------- */
@font-face {
  font-family: 'JetBrains Mono';
  src: url(../fonts/jetbrainsmono.woff2) format('woff2');
  font-weight: 400 800; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light dark;

  /* residue palette — sampled from the lab's own MSA colouring */
  --res-green: #6e9e4f;
  --res-blue:  #4e7fc4;
  --res-gold:  #e0a32e;
  --res-coral: #d75a45;
  --res-plum:  #8e5b9f;

  --brand:        #c0452c;   /* deep residue-coral — links / interactive */
  --brand-dark:   #9d3520;
  --brand-light:  #f2e2d9;

  --accent:       #4e7fc4;   /* residue-blue, secondary highlight */

  --ink:          #241f18;   /* warm near-black */
  --ink-soft:     #565049;
  --muted:        #8d8576;
  --line:         #e5ddca;   /* warm hairline */
  --bg:           #faf7f0;   /* paper */
  --bg-soft:      #f1ebdc;
  --card:         #fffdf7;
  --panel:        #f0ebdf;   /* fixed light panel behind logos (theme-independent) */

  --header:       rgba(36, 31, 24, .93);   /* warm ink bar */
  --header-fg:    #f6f1e6;

  --shadow-sm: 0 1px 2px rgba(60,48,24,.05);
  --shadow-md: 0 6px 22px rgba(60,48,24,.10);

  --maxw:   1180px;
  --radius: 4px;
  --font-display: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand:       #e58a70;
    --brand-dark:  #eda58e;
    --brand-light: #33241d;
    --accent:      #7ba2dc;
    --ink:         #f0e9dc;
    --ink-soft:    #c1b8a6;
    --muted:       #8b8272;
    --line:        #332d23;
    --bg:          #191510;
    --bg-soft:     #211c15;
    --card:        #211c15;
    --header:      rgba(16, 13, 9, .86);
    --header-fg:   #f0e9dc;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 10px 28px rgba(0,0,0,.55);
  }
}

* { box-sizing: border-box; }

html { scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

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

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--header);
  -webkit-backdrop-filter: saturate(1.5) blur(10px);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.10);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  min-height: 64px;
}
.brand {
  color: var(--header-fg);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; opacity: .92; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.nav-links a {
  position: relative;
  color: var(--header-fg);
  font-family: var(--font-display);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  display: inline-block;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 7px;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .2s ease;
}
.nav-links a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { font-weight: 700; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--header-fg);
  font-size: 26px;
  cursor: pointer;
  padding: 4px 8px;
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-bottom: 8px;
  }
  .nav-links.open { display: flex; }
  .nav { flex-wrap: wrap; }
  .nav-links a { padding: 10px 14px; }
  .nav-links a::after { display: none; }
  .nav-links a.active { border-left: 3px solid currentColor; }
}

/* ---------- Layout ---------- */
main { flex: 1 0 auto; }
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px 24px 72px;
}
/* the MSA mark spells the page name and serves as the visible heading;
   keep the real <h1> for screen readers / SEO but hide it visually */
.page-title {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* signature: live multiple-sequence-alignment graphics (generated in msa.js) */
.msa-mark { display: block; height: 62px; margin-bottom: 26px; }
.msa-mark svg { display: block; height: 100%; width: auto; }
.msa-band {
  overflow: hidden;
  height: 108px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.msa-band[data-rows="8"] { height: 72px; }
.msa-row {
  display: inline-flex;
  height: 100%;
  will-change: transform;
  animation: msa-scroll 80s linear infinite;
}
.msa-row svg { display: block; height: 100%; width: auto; }
@keyframes msa-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--tile, 1200px))); }
}
@media (max-width: 700px) {
  .msa-band { height: 76px; }
  .msa-band[data-rows="8"] { height: 54px; }
}
.page-intro {
  color: var(--ink-soft);
  font-size: 18px;
  max-width: 820px;
  margin: 0 0 28px;
}
section { margin-bottom: 46px; }
h2.section-title {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.01em; }

/* ---------- Home hero ---------- */
.hero-band {
  background: var(--bg);
  position: relative;
}
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 24px 64px;
}
.hero-img { position: relative; text-align: center; }
.hero-img::before {
  content: "";
  position: absolute;
  inset: 6% 6% 6% 6%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--res-gold) 16%, transparent), transparent 68%);
  filter: blur(38px);
  z-index: 0;
}
.hero-img img { position: relative; z-index: 1; }
.hero-svg { position: relative; z-index: 1; display: block; width: 100%; height: auto; }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--ink-soft);
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.hero-eyebrow::before {
  content: "";
  width: 10px; height: 10px;
  background: var(--res-coral);
  border-radius: 2px;
  flex: none;
}
.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.16;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: -.025em;
  margin: 0;
}
/* each concept coloured as a residue — the site's through-line */
.hero-tagline b { font-weight: 700; }
.hero-tagline b:nth-of-type(1) { color: var(--res-green); }
.hero-tagline b:nth-of-type(2) { color: var(--res-blue); }
.hero-tagline b:nth-of-type(3) { color: var(--res-gold); }
.hero-tagline b:nth-of-type(4) { color: var(--res-coral); }
.hero-tagline b:nth-of-type(5) { color: var(--res-plum); }
.hero-tagline b:nth-of-type(6) { color: var(--res-green); }
.hero-tagline b:nth-of-type(7) { color: var(--res-coral); }

.news h2 {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .02em;
  color: var(--ink-soft);
  margin: 34px 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.news h2::before {
  content: "";
  width: 10px; height: 10px;
  background: var(--res-blue);
  border-radius: 2px;
}
.news .date { font-family: var(--font-mono); }
.news ul { list-style: none; margin: 0; padding: 0; }
.news li {
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--accent);
  margin-bottom: 6px;
}
.news .date { font-family: var(--font-mono); font-size: 13px; font-weight: 400; color: var(--ink); display: block; margin-bottom: 2px; }
.news li.feature { display: flex; gap: 18px; align-items: flex-start; }
.news .thumb {
  width: 104px; height: 104px; flex: none;
  object-fit: contain; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px;
}
.news .blurb { color: var(--ink-soft); font-size: 14px; margin-top: 6px; line-height: 1.55; }

/* ---------- Home portal ---------- */
.portal { padding: 56px 0 8px; }
.portal-lead {
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.5;
  letter-spacing: -.015em;
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 34px;
}
.portal-lead b { color: var(--ink); font-weight: 600; }
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.portal-card {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 24px 24px;
  background: var(--bg-soft);
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.portal-card:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-2px); }
.portal-card .pc-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-card .pc-arrow { color: var(--brand); transition: transform .18s ease; font-family: var(--font-mono); }
.portal-card:hover .pc-arrow { transform: translateX(4px); }
.portal-card .pc-desc { color: var(--ink-soft); font-size: 14px; line-height: 1.55; margin-top: 8px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; gap: 24px; }
  .hero-tagline { font-size: 22px; }
}

/* ---------- People grid ---------- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 10px;
}
.person {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 22px 16px 20px;
  text-align: center;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.person:hover {
  background: color-mix(in srgb, var(--brand-light) 55%, transparent);
  border-color: var(--line);
  transform: translateY(-2px);
}
.person .avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 32px; font-weight: 600;
  margin: 0 auto 15px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow .18s ease;
}
.person:hover .avatar { box-shadow: 0 0 0 2px var(--accent); }
.person img.avatar { object-fit: cover; object-position: center top; }
.person .name { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; color: var(--ink); letter-spacing: -.01em; }
.person .role { font-family: var(--font-mono); color: var(--muted); font-size: 11.5px; letter-spacing: .3px; margin-top: 4px; line-height: 1.45; }
.person .links { margin-top: 12px; display: flex; gap: 11px; justify-content: center; align-items: center; }
.person .links a { margin: 0; display: inline-flex; align-items: center; color: var(--brand); transition: color .15s ease, transform .15s ease; }
.person .links a:hover { color: var(--accent); transform: translateY(-1px); }
.person .links a svg { width: 16px; height: 16px; }

/* ---------- Generic card lists (tools, resources) ---------- */
.card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 640px) { .card-list { grid-template-columns: 1fr; } }
.card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px 22px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: transparent; }
.card-img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: var(--panel);
  border-radius: 8px;
  padding: 12px;
  margin: -2px 0 14px;
}
.card h3 {
  margin: 0 0 5px;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--ink);
}
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--brand); text-decoration: none; }
.card p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.card p a { color: var(--brand); }
.card .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ---------- Research themes (numbered feature blocks) ---------- */
.theme {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}
.theme:last-of-type { padding-bottom: 8px; }
/* research area marker: a residue cell, not a number */
.theme-num {
  display: block;
  font-size: 0;
  margin-bottom: 14px;
}
.theme-num::before {
  content: "";
  display: inline-block;
  width: 15px; height: 15px;
  border-radius: 3px;
  background: var(--res-green);
}
.theme:nth-of-type(2) .theme-num::before { background: var(--res-coral); }
.theme:nth-of-type(3) .theme-num::before { background: var(--res-plum); }
.theme-content { min-width: 0; }
.theme-statement {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 22px;
  line-height: 1.35;
  letter-spacing: -.015em;
  max-width: 56ch;
}
.theme-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.theme-fig {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
.theme-fig + .theme-fig { margin-top: 18px; }
.fig-credit { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.recent-pubs h3 {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 400; letter-spacing: .02em;
  color: var(--ink-soft); margin: 0 0 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.recent-pubs h3::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--res-green); }
.recent-pubs .rp {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-bottom: 9px;
  margin-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.recent-pubs .rp:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.recent-pubs .rp .rtitle {
  order: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--ink);
}
.recent-pubs .rp .rtitle:hover { color: var(--brand); text-decoration: none; }
.recent-pubs .rp .meta { order: 1; color: var(--muted); font-size: 12.5px; }
.recent-pubs .rp .pill {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; background: var(--brand-light);
  color: var(--brand-dark); padding: 1px 8px; border-radius: 999px; margin-left: 4px;
  vertical-align: middle;
}
.recent-pubs .rp .pill:hover { text-decoration: none; background: var(--accent); color: #fff; }
@media (max-width: 820px) {
  .theme { padding: 28px 0; }
  .theme-row { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- Publications ---------- */
.is-hidden { display: none !important; }
.pub-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 20px;
}
.pub-search {
  flex: 1 1 260px;
  min-width: 0;
  font-family: var(--font);
  font-size: 14.5px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.pub-search::placeholder { color: var(--muted); }
.pub-search:focus { outline: none; border-color: var(--brand); background: var(--bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.pub-scholar {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.pub-scholar:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.pub-count, .pub-empty { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin: 0 0 24px; }
.pub-cat { margin-bottom: 54px; scroll-margin-top: 84px; }
.pub-cat > h2.section-title { margin-bottom: 6px; }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid;
  grid-template-columns: 58px 1fr;
  column-gap: 22px;
  padding: 18px 0 18px 14px;
  border-top: 1px solid var(--line);
  position: relative;
  transition: background .15s ease;
}
.pub:last-child { border-bottom: 1px solid var(--line); }
/* rail dot on the year gutter */
.pub::before {
  content: "";
  position: absolute;
  left: 0; top: 26px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line);
  transition: background .15s ease, transform .15s ease;
}
.pub:hover { background: color-mix(in srgb, var(--brand-light) 45%, transparent); }
.pub:hover::before { background: var(--accent); transform: scale(1.35); }
.pub-year {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .5px;
  padding-top: 3px;
}
.pub:hover .pub-year { color: var(--brand); }
a.pub-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.32;
  letter-spacing: -.012em;
  color: var(--ink);
  display: inline;
}
a.pub-title:hover { color: var(--brand); text-decoration: none; }
.pub-meta { margin-top: 6px; font-size: 14px; line-height: 1.5; }
.pub-auth { color: var(--ink-soft); }
.pub-venue { color: var(--muted); font-style: italic; }
.pub-venue a:not(.pill) { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.pub-meta .pill {
  display: inline-block;
  margin: 3px 6px 0 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-style: normal;
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 1px 9px;
  border-radius: 999px;
  vertical-align: middle;
}
.pub-meta .pill:hover { text-decoration: none; background: var(--accent); color: #fff; }
@media (max-width: 560px) {
  .pub { grid-template-columns: 1fr; row-gap: 2px; }
  .pub-year { padding-top: 0; }
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.contact-block h3 { color: var(--ink-soft); font-family: var(--font-mono); font-size: 12px; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 8px; }
.contact-block h3::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--res-blue); }
.contact-block p { margin: 4px 0; color: var(--ink-soft); }

/* ---------- Definition-style resource blocks ---------- */
.res-group { margin-bottom: 36px; }
.res-group ul { margin: 6px 0 0; padding-left: 22px; }
.res-group li { margin-bottom: 8px; color: var(--ink-soft); }

/* ---------- Resources: category cards ---------- */
.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 22px;
  margin-top: 10px;
}
.res-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px 26px 26px;
  background: var(--bg-soft);
}
.res-card .cat {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0;
}
.res-card ul { list-style: none; margin: 14px 0 0; padding: 0; }
.res-card li {
  padding: 13px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.55;
}
.res-card li:first-child { border-top: 0; padding-top: 2px; }
.res-card li > a:first-child {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}
.res-card li > a:first-child:hover { color: var(--brand); text-decoration: none; }
.res-card a { color: var(--brand); }

/* ---------- Join: route cards ---------- */
.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  margin-top: 10px;
}
.route-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 26px 28px;
  background: var(--bg-soft);
}
.route-card .who {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--ink-soft);
  margin: 0 0 8px;
  display: inline-flex; align-items: center; gap: 8px;
}
.route-card .who::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--res-green); }
.route-card:nth-of-type(2) .who::before { background: var(--res-blue); }
.route-card:nth-of-type(3) .who::before { background: var(--res-gold); }
.route-card:nth-of-type(4) .who::before { background: var(--res-coral); }
.route-card h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0 0 10px;
}
.route-card p { color: var(--ink-soft); font-size: 14.5px; line-height: 1.62; margin: 0 0 10px; }
.route-card p:last-child { margin-bottom: 0; }
.route-card .flabel { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.route-card ul { margin: 4px 0 12px; padding-left: 20px; }
.route-card li { color: var(--ink-soft); font-size: 14px; line-height: 1.5; margin-bottom: 5px; }
.route-card a { color: var(--brand); }

/* ---------- Contact: the generated protein leads; info flows after the MSA mark ---------- */
.contact-head { display: flex; align-items: flex-start; gap: 14px 20px; flex-wrap: wrap; }
.info-boxes { display: flex; gap: 12px; flex-wrap: wrap; flex: 1 1 auto; }
.addr-box {
  flex: 1 1 180px; min-width: 170px; text-align: left;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg-soft);
  padding: 12px 16px;
  font-size: 13px; color: var(--ink-soft); line-height: 1.65;
}
.addr-label {
  display: flex; align-items: center; gap: 7px; margin-bottom: 7px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink);
}
.addr-label::before { content: ""; width: 9px; height: 9px; border-radius: 2px; }
.addr-label.loc::before { background: var(--res-blue); }
.addr-label.mail::before { background: var(--res-coral); }
.id-box .who { display: block; font-size: 14px; color: var(--ink); margin-bottom: 9px; }
.id-box .contact-email {
  display: inline-block; font-family: var(--font-mono); font-size: 12.5px; color: var(--brand);
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--brand-light);
}
.id-box .contact-email:hover { text-decoration: none; border-color: var(--brand); }

.viz-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 26px auto 0; max-width: 860px; align-items: start; }
.viz-pair figure { margin: 0; }
.struct-3d canvas { width: 100%; aspect-ratio: 1 / 1; height: auto; display: block; cursor: grab; }
.contact-map svg { width: 100%; height: auto; display: block; }
.struct-3d::after, .contact-map::after {
  display: block; margin-top: 10px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em;
  color: var(--muted); text-align: center;
}
.struct-3d::after { content: "predicted structure · drag to rotate"; }
.contact-map::after { content: "contact map"; }
.viz-actions { text-align: center; margin-top: 18px; }
.regen-btn {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px; cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.regen-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-light); }
@media (max-width: 760px) {
  .viz-pair { grid-template-columns: 1fr; gap: 22px; }
}

/* ---------- Coevolution: rail timeline ---------- */
.timeline { list-style: none; margin: 12px 0 0; padding: 0 0 0 5px; }
.tl-node {
  position: relative;
  padding: 0 0 34px 36px;
  border-left: 2px solid var(--line);
}
.tl-node:last-child { border-left-color: transparent; padding-bottom: 4px; }
.tl-node::before {
  content: "";
  position: absolute;
  left: -8px; top: 3px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--brand);
}
.tl-title {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.32;
  color: var(--ink);
  margin: 0 0 12px;
}
.tl-entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tl-entries > li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.tl-year { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 1px; line-height: 1.4; }
.tl-entries .pill {
  display: inline-block;
  margin: 2px 5px 0 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 1px 9px;
  border-radius: 999px;
}
.tl-entries .pill:hover { text-decoration: none; background: var(--accent); color: #fff; }
@media (max-width: 560px) {
  .tl-entries > li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Research: numbered themes ---------- */
.theme-index {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 13.5px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}
.footer-inner a { color: var(--brand); }

/* ---------- Utility: subnav / jump pills ---------- */
.subnav {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 26px;
}
.subnav a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.subnav a:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
