/* Deuel Lab — shared styles */
@import url("https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=Libre+Franklin:wght@400;500;600&display=swap");

:root {
  --paper: #f7f4ef;
  --paper-2: #efe9e1;
  --card: #ffffff;
  --ink: #1d1f22;
  --ink-2: #4a4e54;
  --ink-3: #7a7f86;
  --line: #ddd5ca;
  --accent: #9e1b32;       /* haematology red */
  --accent-soft: #f3e1e3;
  --accent-2: #2f5d62;     /* muted teal, used sparingly */
  --radius: 10px;
  --wrap: 1160px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #7a1426; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: var(--sans); font-size: .78rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  margin-bottom: .9rem; display: block;
}
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 46rem; }
.muted { color: var(--ink-3); }
.section { padding: 88px 0; }
.section.alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.more { font-weight: 500; text-decoration: none; white-space: nowrap; }
.more::after { content: " →"; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 244, 239, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; letter-spacing: -0.01em; }
.brand-name span { color: var(--ink-3); font-weight: 400; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: .95rem; font-weight: 500;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; padding: 12px 16px 20px; gap: 2px;
    background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 8px; font-size: 1.05rem; }
}

/* ---------- Home hero ---------- */
.hero { padding: 56px 0 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: end; }
.hero h1 { max-width: 19ch; margin-bottom: 0; }
.hero-grid .lead { margin-bottom: 24px; font-size: 1.1rem; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 20px; } }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 500; font-size: .98rem;
  text-decoration: none; border: 1px solid var(--ink); color: var(--ink); background: transparent;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #7a1426; border-color: #7a1426; color: #fff; }

.frieze { position: relative; max-width: 1280px; margin: 28px auto 0; aspect-ratio: 10 / 3; }
.frieze img {
  width: 100%; height: 100%; object-fit: cover;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%),
                      linear-gradient(to bottom, transparent 0, #000 10%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%),
                      linear-gradient(to bottom, transparent 0, #000 10%, #000 78%, transparent 100%);
          mask-composite: intersect;
}
.hotspot {
  position: absolute; transform: translate(-8px, -50%);
  display: flex; align-items: center; gap: 8px; text-decoration: none;
}
.hotspot .dot {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--accent);
  animation: pulse 2.6s ease-out infinite;
}
.hotspot .label {
  background: var(--ink); color: #fff; font-size: .8rem; font-weight: 500;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
  opacity: 0; transform: translateX(-4px); transition: .18s ease; pointer-events: none;
}
.hotspot:hover .label, .hotspot:focus-visible .label { opacity: 1; transform: none; }
.hotspot.left { flex-direction: row-reverse; transform: translate(calc(-100% + 8px), -50%); }
.hotspot.left .label { transform: translateX(4px); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 0 rgba(158, 27, 50, .45); }
  70% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 12px rgba(158, 27, 50, 0); }
  100% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 0 rgba(158, 27, 50, 0); }
}
@media (prefers-reduced-motion: reduce) { .hotspot .dot { animation: none; } html { scroll-behavior: auto; } }
@media (max-width: 700px) {
  .frieze { aspect-ratio: 16 / 9; }
  .frieze img { object-position: 45% center; }
  .hotspot { display: none; }
}

/* ---------- Theme cards ---------- */
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.theme {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px 24px; text-decoration: none; color: var(--ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.theme:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 30px -18px rgba(0,0,0,.35); color: var(--ink); }
.theme svg { width: 52px; height: 52px; margin-bottom: 18px; }
.theme h3 { font-size: 1.3rem; margin-bottom: 10px; }
.theme p { color: var(--ink-2); font-size: .95rem; flex: 1; }
.theme .more { color: var(--accent); font-size: .9rem; }
@media (max-width: 800px) { .themes { grid-template-columns: 1fr; } }
.past-note { margin: 24px 0 0; font-size: .92rem; color: var(--ink-3); }
.past-note b { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; margin-right: 8px; }

/* ---------- Mission split ---------- */
.split { display: grid; grid-template-columns: 1fr 1.25fr; gap: 64px; align-items: start; }
.split blockquote {
  margin: 0; font-family: var(--serif); font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.35; color: var(--ink);
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); margin-top: 56px; }
.stat { padding: 28px 24px 0 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat b { display: block; font-family: var(--serif); font-weight: 500; font-size: 2.6rem; line-height: 1; color: var(--accent); margin-bottom: 10px; }
.stat span { font-size: .92rem; color: var(--ink-2); display: block; }
@media (max-width: 860px) {
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .stat { padding-bottom: 24px; }
}

/* ---------- Publications ---------- */
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub { display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding: 22px 0; border-top: 1px solid var(--line); }
.pub:last-child { border-bottom: 1px solid var(--line); }
.pub-year { font-family: var(--serif); font-size: 1.25rem; color: var(--ink-3); }
.pub-title { font-family: var(--serif); font-size: 1.22rem; line-height: 1.3; margin: 0 0 6px; color: var(--ink); }
.pub-title a { color: inherit; text-decoration: none; }
.pub-title a:hover { color: var(--accent); }
.pub-authors { font-size: .9rem; color: var(--ink-2); margin: 0 0 6px; }
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-meta { font-size: .85rem; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pub-meta .journal { font-style: italic; }
.tag {
  display: inline-block; font-size: .75rem; font-weight: 500; padding: 2px 9px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-2); text-decoration: none;
}
a.tag:hover { background: var(--accent-soft); color: var(--accent); }
.tag.star { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 560px) { .pub { grid-template-columns: 1fr; gap: 4px; } }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer;
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.search {
  font: inherit; font-size: .95rem; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); min-width: 240px; flex: 1; max-width: 360px;
}

/* ---------- People ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 28px 24px; }
.person { text-align: left; }
.person .portrait {
  aspect-ratio: 1; width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); margin-bottom: 14px;
}
.person .portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.15); }
.person h3 { font-size: 1.2rem; margin: 0 0 2px; }
.person .title { font-size: .82rem; color: var(--ink-3); margin: 0 0 2px; }
.person .role { font-size: .92rem; color: var(--accent); margin: 0; font-weight: 500; }
.people.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
.people.small h3 { font-size: 1.05rem; }
.people.alumni .portrait img { filter: grayscale(1); opacity: .85; }

.team-strip { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.avatars { display: flex; }
.avatars img {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--card);
  margin-left: -14px; background: var(--paper-2);
}
.avatars img:first-child { margin-left: 0; }

.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 860px) { .cols-3 { grid-template-columns: 1fr; } }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 10px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.plain-list li b { font-weight: 600; display: block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: 64px 0 40px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.page-head h1 { font-size: clamp(2.2rem, 4.4vw, 3.2rem); margin-bottom: 14px; }
.page-head .lead { margin: 0; }

/* ---------- Software ---------- */
.software { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 22px; }
.sw {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: flex; gap: 20px; align-items: flex-start;
}
.sw-logo { width: 76px; height: 76px; flex: none; border-radius: 8px; background: var(--paper); display: grid; place-items: center; overflow: hidden; }
.sw-logo img { max-width: 64px; max-height: 64px; object-fit: contain; }
.sw-logo span { font-family: var(--serif); font-size: 1.7rem; color: var(--ink-3); }
.sw h3 { font-size: 1.2rem; margin-bottom: 6px; }
.sw p { font-size: .93rem; color: var(--ink-2); margin-bottom: 10px; }
.sw .gh { font-size: .88rem; font-weight: 500; text-decoration: none; }

/* ---------- Projects page ---------- */
.toc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.toc a {
  font-size: .9rem; font-weight: 500; text-decoration: none; color: var(--ink-2);
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
}
.toc a:hover { border-color: var(--accent); color: var(--accent); }
.project { padding: 80px 0; border-bottom: 1px solid var(--line); }
.project:nth-of-type(even) { background: var(--card); }
.project-head { display: grid; grid-template-columns: 1fr 300px; gap: 48px; margin-bottom: 40px; }
.project-head h2 { margin-bottom: 16px; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-2); margin-left: 12px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.done { color: var(--ink-3); }
.project.past .past-label { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 14px; margin: -24px 0 40px; border-bottom: 1px solid var(--line); }
.project.past .eyebrow { color: var(--ink-3); }
.toc a.past { color: var(--ink-3); }
.trial-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink-3); }
.facts { border-left: 2px solid var(--accent); padding-left: 20px; font-size: .9rem; color: var(--ink-2); align-self: start; }
.facts dt { font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-top: 12px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 2px 0 0; }
.prose { max-width: 44rem; }
.prose p { color: var(--ink-2); }
.figure-row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 36px 0; }
.figure-row.wide { grid-template-columns: 1.4fr 1fr; }
figure { margin: 0; }
.fig {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; overflow: hidden;
}
.project:nth-of-type(even) .fig { background: #fbf9f6; }
.fig svg { width: 100%; height: auto; display: block; }
figcaption { font-size: .85rem; color: var(--ink-3); margin-top: 12px; line-height: 1.5; }
figcaption b { color: var(--ink-2); font-weight: 600; }
.subproject { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 48px; }
.subproject h3 { margin-bottom: 10px; }
.subproject p { color: var(--ink-2); font-size: .97rem; }
.callouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0 0; }
.callout { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.project:nth-of-type(even) .callout { background: var(--paper); }
.callout b { display: block; font-family: var(--serif); font-size: 2rem; font-weight: 500; color: var(--accent); line-height: 1.05; margin-bottom: 6px; }
.callout span { font-size: .87rem; color: var(--ink-2); }
.people-line { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .9rem; color: var(--ink-2); margin-top: 28px; }
.people-line b { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) {
  .project-head, .figure-row, .figure-row.wide, .subproject { grid-template-columns: 1fr; gap: 28px; }
  .callouts { grid-template-columns: 1fr; }
  .project { padding: 56px 0; }
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
address { font-style: normal; line-height: 1.8; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: #1d1f22; color: #c9ccd1; padding: 64px 0 36px; font-size: .92rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer h4 { font-family: var(--sans); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: #8b9097; margin-bottom: 14px; font-weight: 600; }
.site-footer .brand-name { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; line-height: 2; }
.logos { display: flex; gap: 28px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.logos img { height: 38px; width: auto; filter: brightness(0) invert(1); opacity: .85; }
.footer-bottom { border-top: 1px solid #34373c; margin-top: 48px; padding-top: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: #8b9097; font-size: .82rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .section { padding: 60px 0; }
  .hero { padding-top: 44px; }
}
.fig.scroll { overflow-x: auto; }
@media (max-width: 760px) { .fig.scroll svg { min-width: 760px; } }
.fig .fig-sub { margin: 22px 0 10px; font-size: .8rem; line-height: 1.4; color: var(--ink-3); }
.fig .fig-sub b { display: block; font-size: .85rem; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.fig img { display: block; width: 100%; height: auto; border-radius: 4px; }
.fig .fig-note { margin: 10px 0 0; font-size: .78rem; color: var(--ink-2); }
