/* QCCD Classic design. Colours and fonts are the custom properties on :root. */
:root {
  --paper: #f6f7f9;
  --surface: #ffffff;
  --ink: #0e1a2b;
  --ink-2: #3c4a5e;
  --muted: #5f6b7e;
  --line: #d9dee6;
  --line-soft: #e8ebf0;
  --accent: #0b7285;
  --accent-ink: #075766;
  --accent-wash: #e3f1f3;
  --sig-h: #b7740c; --sig-z: #0b7285; --sig-rx: #6d4fc2; --sig-ry: #2f8a4e; --sig-s: #3d5fc4; --sig-t: #a14f8f; --sig-m: #c2364f; --wire: #c3cad6;
  --navy: #13284a;
  --hero-line: rgba(19, 40, 74, .38);
  --hero-faint: rgba(19, 40, 74, .12);
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --maxw: 1180px;
  --header-bg: rgba(246, 247, 249, .9);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b1220; --surface: #111a2b; --ink: #e7ecf4; --ink-2: #b4bfd0; --muted: #8592a8;
    --line: #243149; --line-soft: #1a2538; --accent: #5cc3d1; --accent-ink: #8ad6e0; --accent-wash: #12303a; --sig-h: #f0b04e; --sig-z: #5cc3d1; --sig-rx: #b49cff; --sig-ry: #6fd08f; --sig-s: #8fa8ff; --sig-t: #e59ad3; --sig-m: #ff8597; --wire: #34425e;
    --navy: #c9d6ec; --hero-line: rgba(178, 205, 236, .42); --hero-faint: rgba(178, 205, 236, .12);
    --header-bg: rgba(11, 18, 32, .88); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b1220; --surface: #111a2b; --ink: #e7ecf4; --ink-2: #b4bfd0; --muted: #8592a8;
  --line: #243149; --line-soft: #1a2538; --accent: #5cc3d1; --accent-ink: #8ad6e0; --accent-wash: #12303a; --sig-h: #f0b04e; --sig-z: #5cc3d1; --sig-rx: #b49cff; --sig-ry: #6fd08f; --sig-s: #8fa8ff; --sig-t: #e59ad3; --sig-m: #ff8597; --wire: #34425e;
  --navy: #c9d6ec; --hero-line: rgba(178, 205, 236, .42); --hero-faint: rgba(178, 205, 236, .12);
  --header-bg: rgba(11, 18, 32, .88); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  /* on a short page the footer still sits at the bottom of the window */
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
/* "Skip to content": hidden above the page until a keyboard user presses Tab, then it drops into the top-left corner */
.skip { position: absolute; left: 16px; top: 0; z-index: 100; transform: translateY(-120%); padding: 10px 16px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 500; text-decoration: none; border-radius: 0 0 4px 4px; }
.skip:focus { transform: none; }
main:focus { outline: none; }
.wrap {
  max-width: calc(var(--maxw) + 64px); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--header-bg); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-family: var(--font-display); font-size: 19px; text-wrap: balance; font-weight: 500; letter-spacing: .01em; }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.nav a {
  text-decoration: none; font-size: 14px; color: var(--ink-2); padding: 6px 10px; border-radius: 4px;
  transition: color .15s, background-color .15s;
}
.nav a:hover { color: var(--ink); background: var(--line-soft); }
.nav a.cta { color: var(--surface); background: var(--navy); margin-left: 8px; }
.nav a.cta:hover { background: var(--accent-ink); color: var(--surface); }
.theme-btn {
  border: 1px solid var(--line); background: transparent; color: var(--ink-2); width: 34px; height: 34px;
  border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none;
}
.theme-btn:hover { color: var(--ink); border-color: var(--muted); }
.menu-btn { display: none; }
@media (max-width: 920px) {
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
  .nav a.cta { margin: 12px 0 0; text-align: center; border-radius: 4px; border: 0; }
  .menu-btn { display: grid; margin-left: auto; }
  .site-header .theme-btn.t { margin-left: 0; }
}

/* Type */
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; text-wrap: balance; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(40px, 6.2vw, 76px); line-height: 1.02; font-weight: 300; letter-spacing: -.02em; }
h1 em { font-style: italic; color: var(--accent-ink); }
h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; }
.sec-head h1 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; font-weight: 400; letter-spacing: -.01em; }   /* page titles: h1 for screen readers and search, sized like a section heading */
h3 { font-size: 23px; line-height: 1.25; }
p { margin: 0; }
/* page intros run the full width, justified from tablet size up (phones keep a ragged edge, where justifying leaves gaps) */
.lede { font-size: 19px; line-height: 1.6; color: var(--ink-2); }
@media (min-width: 720px) { .lede { text-align: justify; hyphens: auto; } }

/* Hero */
.hero { position: relative; border-bottom: 1px solid var(--line-soft); overflow: hidden; }
.hero > .wrap:first-child { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 40px; /* GAP in site.js */ align-items: center; padding-block: 32px 48px; }
.hero-copy { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
/* the title sits on two lines beside the logo: "Quantum Computing" / "& Quantum Chemistry" */
/* university · school · group: wrap between the parts, never inside one */
.hero-eyebrow > span { white-space: nowrap; }
.hero h1 { font-size: clamp(40px, 5.2vw, 68px); }
.hero h1 > span { display: block; white-space: nowrap; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 12px 20px; border-radius: 4px; border: 1px solid var(--navy); transition: background-color .15s, color .15s;
}
.btn.primary { background: var(--navy); color: var(--paper); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ghost { color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
/* the logo is as tall as the eyebrow plus the title; the canvas bleeds 16px above and below
   (BLEED in site.js) so electrons at the top and bottom of the sphere are not clipped */
.orbital { position: relative; width: 100%; align-self: stretch; }
.orbital canvas { position: absolute; left: 0; top: -16px; width: 100%; height: calc(100% + 32px); display: block; }
.orbital figcaption {
  position: absolute; left: 0; bottom: 0; font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .04em;
}
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); margin-top: 8px; }
.fact { padding: 18px 20px 0 0; display: flex; flex-direction: column; gap: 2px; }
.fact + .fact { padding-left: 20px; border-left: 1px solid var(--line-soft); }
.fact b { font-family: var(--font-display); font-weight: 400; font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.fact span { font-size: 13px; color: var(--muted); }

/* Landing page */
.hero-logo { width: 64px; height: 64px; color: var(--navy); }
.group-photo { margin: 0; padding-block: 8px 0; display: flex; flex-direction: column; gap: 10px; }
.photo-ph {
  position: relative; aspect-ratio: 21 / 9; max-width: 100%; border-radius: 4px; display: grid; place-items: center; color: var(--muted);
  background:
    radial-gradient(120% 90% at 20% 30%, var(--accent-wash), transparent 60%),
    linear-gradient(135deg, var(--surface), var(--line-soft));
  border: 1px solid var(--line);
}
.photo-tag { position: absolute; left: 16px; top: 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.group-photo figcaption { font-size: 13px; color: var(--muted); }
.home-intro { padding-top: 40px; }
.funders { display: flex; flex-direction: column; gap: 18px; padding-block: 56px 72px; }
.funder-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.funder-row li {
  height: 64px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 4px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
/* wrap to more rows before the tiles shrink much below their desktop width (about 187px), rather than squeezing six or three into a row */
@media (max-width: 1099px) { .funder-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 599px) { .funder-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .photo-ph { aspect-ratio: 4 / 3; } .hero-logo { width: 52px; height: 52px; } }
.hero { border-bottom: 0; }
.nav-drop { position: relative; }
.drop-trigger { display: inline-flex; align-items: center; gap: 6px; }
.drop-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 280px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 12px 32px rgba(14, 26, 43, .12);
  display: flex; flex-direction: column; gap: 2px; visibility: hidden; opacity: 0; transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.drop-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.nav-drop:hover .drop-menu, .nav-drop:focus-within .drop-menu { visibility: visible; opacity: 1; transform: none; }
.nav .drop-menu a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 4px; }
.drop-menu b { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.drop-menu span { font-size: 12.5px; color: var(--muted); }
.drop-menu a:hover { background: var(--accent-wash); }
.nav .drop-menu a[aria-current="page"] { box-shadow: none; background: var(--accent-wash); }
.choose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.choice {
  display: flex; flex-direction: column; gap: 12px; padding: 32px; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; transition: border-color .15s, transform .15s;
}
.choice:hover { border-color: var(--accent); transform: translateY(-2px); }
.choice p { color: var(--ink-2); font-size: 15.5px; }
.choice .go { color: var(--accent-ink); font-size: 14px; font-weight: 500; margin-top: auto; }
.theme-index { display: flex; flex-direction: column; gap: 14px; margin-bottom: 48px; }
.theme-index ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; border-top: 1px solid var(--line); }
.theme-index a { display: flex; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; font-family: var(--font-display); font-size: 20px; }
.theme-index a:hover { color: var(--accent-ink); }
.theme-index .n { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.theme { scroll-margin-top: 96px; }
.theme:target .theme-head h3 { color: var(--accent-ink); }
@media (max-width: 920px) {
  .nav-drop { display: flex; flex-direction: column; }
  .drop-menu { position: static; visibility: visible; opacity: 1; transform: none; box-shadow: none; border: 0; padding: 0 0 0 14px; min-width: 0; background: none; }
  .nav .drop-menu a { padding: 10px 4px; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
}
@media (max-width: 560px) { .choose, .theme-index ol { grid-template-columns: minmax(0, 1fr); } .choice { padding: 24px; } }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.nav a.cta[aria-current="page"] { box-shadow: none; color: var(--surface); background: var(--accent-ink); border-color: var(--accent-ink); }

/* Sections */
section.block { padding-block: 96px; border-bottom: 1px solid var(--line-soft); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr); margin-bottom: 56px; }
.sec-head > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sec-body { margin-left: 0; }

/* Research */
.themes { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
/* each theme: title beside the image, then the text in two columns across the full width, ending with the Selected publications */
.theme {
  padding-block: 48px; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "head fig" "detail detail"; gap: 32px 40px;
}
/* no image: the title takes the full width */
.theme:not(:has(.theme-fig)) { grid-template-areas: "head head" "detail detail"; }
.theme-head { grid-area: head; display: flex; flex-direction: column; gap: 8px; }
.theme-head h3 { font-size: clamp(26px, 2.6vw, 32px); line-height: 1.15; }   /* below the page title (h1, 44px) */
.theme-short { font-size: 18px; color: var(--accent-ink); max-width: 60ch; }
.theme-fig { grid-area: fig; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.theme-fig figcaption { font-size: 13px; color: var(--muted); }
/* quantum page: the themes hang off one qubit wire; the light passes through each gate as you scroll */
.wired { position: relative; padding-left: 96px; }
.wired .theme { position: relative; }
.wired .rail { position: absolute; left: 38px; top: 0; bottom: 0; width: 2px; }
.rail .clip { position: absolute; inset: 0; overflow: hidden; }
/* site.js paints the wire in each gate's colour from that gate down to the next (--fill) */
.rail .fill { position: absolute; inset: 0; background: var(--fill, var(--sig-h)); }
.rail .cover { position: absolute; inset: 0; background: var(--wire); will-change: transform; }
.rail .photon { position: absolute; left: 1px; top: 0; width: 0; height: 0; z-index: 3; will-change: transform; }
.photon .spin { position: absolute; left: 0; top: 0; width: 0; height: 0; transition: rotate .45s cubic-bezier(.3,1.3,.5,1); }
/* --q is the colour of the last gate passed; site.js sets it with data-gate on the wire */
.photon .q { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--q, var(--sig-h));
  box-shadow: 0 0 0 3px var(--paper), 0 0 14px 3px var(--q, var(--sig-h));
  transition: transform .45s cubic-bezier(.3,1.3,.5,1), scale .45s cubic-bezier(.3,1.3,.5,1), opacity .35s, background .35s, box-shadow .35s, border-radius .35s; }
.photon .q.b { opacity: 0; }
/* each gate's effect on the qubit. Any gate before the measurement splits it into two dots: left hollow, right filled.
   Z swaps them (the dots cross over) and every Z after that swaps them back (data-swapped). Rx sets the pair spinning, Ry tips the
   balance between the two dots, S turns the pair a quarter turn and T an eighth. The measurement collapses it to one square dot */
.wired[data-gate]:not([data-gate="m"]) .photon .q { opacity: 1; }
.wired[data-gate]:not([data-gate="m"]) .photon .q.a { transform: translateX(-9px); background: var(--paper); box-shadow: inset 0 0 0 2px var(--q), 0 0 0 3px var(--paper), 0 0 12px 2px var(--q); }
.wired[data-gate]:not([data-gate="m"]) .photon .q.b { transform: translateX(9px); }
.wired[data-swapped]:not([data-gate="m"]) .photon .q.a { transform: translateX(9px); }
.wired[data-swapped]:not([data-gate="m"]) .photon .q.b { transform: translateX(-9px); }
.wired[data-gate="rx"] .photon .spin { animation: phase 1.8s linear infinite; }
.wired[data-gate="ry"] .photon .q.a { scale: 1.35; }
.wired[data-gate="ry"] .photon .q.b { scale: .7; }
.wired[data-gate="s"] .photon .spin { rotate: 90deg; }
.wired[data-gate="t"] .photon .spin { rotate: 45deg; }
.wired[data-gate="m"] .photon .q { transform: none; }
.wired[data-gate="m"] .photon .q.b { opacity: 0; }
.wired[data-gate="m"] .photon .q.a { border-radius: 2px; }
@keyframes phase { to { transform: rotate(360deg); } }
.tgate { position: absolute; left: -96px; top: 44px; width: 78px; height: 78px; display: grid; place-items: center; z-index: 2;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 4px; font-family: var(--font-mono); font-weight: 500; font-size: 24px; color: var(--muted);
  transition: border-color .35s, color .35s, background .35s; }
.tgate svg { width: 42px; height: 42px; }
.tgate sub { font-size: .55em; }
.tgate::after { content: ""; position: absolute; inset: -1.5px; border-radius: 4px; border: 2px solid currentColor; opacity: 0; pointer-events: none; }
.theme.passed .tgate { color: var(--sig); border-color: var(--sig); }
.theme.fire .tgate { animation: gatehit .6s ease-out; }
.theme.fire .tgate::after { animation: ring .75s ease-out; }
@keyframes gatehit { 0% { transform: scale(1); } 18% { transform: scale(1.1); background: var(--sig); color: var(--surface); } 100% { transform: scale(1); } }
@keyframes ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.8); } }
@media (max-width: 820px) {
  .wired { padding-left: 60px; }
  .wired .rail { left: 22px; }
  .tgate { left: -60px; width: 46px; height: 46px; font-size: 16px; top: 32px; }
  .tgate svg { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .rail .cover, .rail .photon { display: none; }
  .theme.fire .tgate, .theme.fire .tgate::after { animation: none; }
}
/* classical page: a particle in a box on the left doubles as the page's scroll bar */
.cgrid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.cside { position: sticky; top: 96px; }
.cbox { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 14px; }
/* as tall as the window allows: header offset, the card's own chrome and a bottom margin all come off the viewport height */
.cbox-body { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; height: max(240px, calc(100vh - 240px)); max-height: min(900px, var(--fit, 900px)); }
.cbox canvas { display: block; width: 52px; height: 100%; border-radius: 2px; }
/* the row is pinned to the body's height: the canvas's bitmap size feeds an auto row, and at zooms like 110% rounding the
   bitmap up each frame would make it grow without end */
.cbox-body { grid-template-rows: minmax(0, 1fr); }
.cbox-list { position: relative; list-style: none; margin: 0; padding: 0; }
.cbox-list li { position: absolute; left: 0; right: 0; transform: translateY(-2px); }
.cbox-list a { display: flex; gap: 8px; align-items: baseline; text-decoration: none; font-family: var(--font-display); font-size: 15px; line-height: 1.25; color: var(--muted); transition: color .3s; }
.cbox-list a .n { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.cbox-list li.past a { color: var(--ink-2); }
.cbox-list li.on a, .cbox-list a:hover { color: var(--ink); }
.cbox-list li.on a .n { color: var(--accent-ink); }
.cbox-n { font-family: var(--font-mono); font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 10px; }
@media (max-width: 920px) {
  /* the box keeps its own slim column beside the themes, so it never sits over the heading or text */
  .cgrid { grid-template-columns: 42px minmax(0, 1fr); gap: 16px; }
  /* it sticks just under the header and reaches down to near the bottom of the screen. Until it gets there it reaches from
     wherever it is, so it grows as you scroll (--hdr and --grow come from site.js) */
  .cside { top: calc(env(safe-area-inset-top, 0px) + var(--hdr, 66px) + 12px); }
  .cbox { padding: 6px; gap: 0; }
  .cbox .eyebrow, .cbox-list, .cbox-n { display: none; }
  .cbox-body { grid-template-columns: 30px; height: var(--grow, calc(100vh - 120px)); max-height: var(--fit, none); }
  .cbox canvas { width: 30px; }
}
.theme-detail { grid-area: detail; columns: 2; column-gap: 40px; min-width: 0; }
.theme-detail > * { margin-top: 0; margin-bottom: 14px; }
.theme-detail li { break-inside: avoid; }
/* keep "Selected publications" with its list, at the end of the text */
.theme-detail h3 { break-after: avoid; }
.theme p { color: var(--ink-2); font-size: 15.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); background: var(--line-soft);
  padding: 2px 8px; border-radius: 3px; white-space: nowrap;
}

/* People */
.pi {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 40px; padding: 40px; align-items: center;
}
.face.back.pi { grid-template-columns: minmax(0, 1fr); }
/* flip cards: hover (or tap / Enter) turns a card over to show more about the person */
.card { display: block; cursor: pointer; perspective: 1200px; min-width: 0; border-radius: 6px; }
.pi-card { margin-bottom: 64px; }
.pi-card .flip { height: auto; position: relative; }
/* A long bio is cut to fit the card, so the card stays the size of its front; "Read more" lets it grow */
.pi-card .face.back { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; align-items: stretch; }
.pi-card .face.back .pi-body { min-height: 0; flex: 1 1 auto; }
.pi-card .bio { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.flip { display: grid; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.face.back { transform: rotateY(180deg); background: var(--accent-wash); border-color: var(--accent); }
.card.flipped .flip { transform: rotateY(180deg); }
/* Only the card's own (unmoving) box decides hover. Mid-turn, perspective makes the turning faces bulge past
   the card's edges, and if they counted the pointer near an edge would flicker the flip on and off. */
.card .flip { pointer-events: none; }
.card.flipped .face.back a, .card:hover .face.back a { pointer-events: auto; }
@media (hover: hover) { .card:hover .flip { transform: rotateY(180deg); } }
.cue { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--muted); margin-top: auto; padding-top: 10px; }
.avatar {
  --h: 210; aspect-ratio: 1; width: 100%; max-width: 100%; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); color: #f4f7fb; font-weight: 400; letter-spacing: .02em;
  background:
    radial-gradient(circle at 30% 25%, hsl(var(--h) 45% 46%), transparent 60%),
    linear-gradient(145deg, hsl(var(--h) 48% 30%), hsl(calc(var(--h) + 18) 52% 16%));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
/* The group leader's photo is as wide as a member's card: one column of the .people grid below (4, 3 or 2 across) */
.face.front.pi { grid-template-columns: calc((100% + 20px) / 4 - 2px) minmax(0, 1fr); }
.pi .avatar { width: 100%; height: auto; align-self: center; }
/* Headshots: portrait 4:5 photos. The silhouette stands in for a real photo (an <img> with object-fit: cover drops in here) */
.pi .avatar, .person .avatar {
  aspect-ratio: 4 / 5; border-radius: 4px; font-size: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 125'%3E%3Cg fill='%23ffffff' fill-opacity='.26'%3E%3Ccircle cx='50' cy='50' r='20'/%3E%3Cpath d='M10 125c2-30 20-46 40-46s38 16 40 46z'/%3E%3C/g%3E%3C/svg%3E") center bottom / 100% auto no-repeat,
    radial-gradient(circle at 30% 25%, hsl(var(--h) 45% 46%), transparent 60%),
    linear-gradient(145deg, hsl(var(--h) 48% 30%), hsl(calc(var(--h) + 18) 52% 16%));
}
.pi-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pi-body .role { font-size: 14px; color: var(--muted); }
.pi-body p { color: var(--ink-2); max-width: 64ch; }
.pi-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.pi-links a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid var(--accent-wash); }
.pi-links a:hover { border-color: var(--accent); }
.group-label { display: flex; align-items: baseline; gap: 16px; margin-bottom: 24px; }
.group-label h3 { font-size: 22px; }
.group-label .count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line); transform: translateY(-4px); }
.people { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 56px; }
.person .face { display: flex; flex-direction: column; gap: 4px; padding: 20px; }
.person .back .name { font-family: var(--font-display); font-size: 19px; font-weight: 400; }
.person .bio { font-size: 14px; color: var(--ink-2); line-height: 1.55; margin-top: 6px; }
.person .int { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent-ink); margin-top: 2px; }
.person .links { font-size: 12.5px; color: var(--accent-ink); margin-top: auto; padding-top: 10px; }
/* A long bio is cut to fit the card, which keeps every card the size of its front; "Read more" lets the card grow */
.person .flip { position: relative; }
.person .face.back { position: absolute; inset: 0; overflow: hidden; }
.person .bio { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.person .bio.clamped, .pi-card .bio.clamped { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3em), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 3em), transparent); }
.person .more, .pi-card .more { align-self: flex-start; margin-top: 6px; padding: 0; border: 0; background: none; font: inherit; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.card.flipped .face.back .more, .card:hover .face.back .more { pointer-events: auto; }
.card.expanded .face.back { position: static; overflow: visible; }
.card.expanded .bio { overflow: visible; -webkit-mask-image: none; mask-image: none; }
/* People sheet: on narrow screens a tapped card opens in front of the page (built by site.js) */
.sheet-open { overflow: hidden; scrollbar-gutter: stable; }
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); perspective: 1400px; }
.sheet-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--paper) 45%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet { position: relative; width: min(100%, 440px); max-height: 100%; display: flex; transform-style: preserve-3d; }
.sheet .flip { width: 100%; max-height: 100%; height: auto; transform-origin: center; transform-style: preserve-3d; transition: none; }
.sheet .face.back { box-shadow: 0 24px 60px -20px rgba(11, 18, 32, .45); }
.sheet .face.front { position: absolute; left: 50%; top: 50%; inset: 50% auto auto 50%; overflow: hidden; }
.sheet .face.back { position: relative; inset: auto; overflow: auto; max-height: calc(100dvh - 32px); padding: 24px 24px 22px; visibility: visible; }
.sheet .face.back .name { font-size: 24px; padding-right: 40px; }
.sheet .bio { font-size: 15.5px; overflow: visible; flex: none; }
.sheet .links { font-size: 14px; padding-top: 18px; }
.sheet.settled .flip { transform: none !important; }
.sheet.settled .face.front { display: none; }
.sheet.settled .face.back { transform: none; }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); font-size: 28px; line-height: 1; cursor: pointer; }
.sheet-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.person .avatar { width: calc(100% + 40px); max-width: none; margin: -20px -20px 14px; border-radius: 5px 5px 0 0; }
.person .name { font-weight: 600; font-size: 16px; }
.person .role { font-size: 13.5px; color: var(--muted); }
.person .topic { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.collab-label { margin-top: 56px; }
.alumni { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; border-top: 1px solid var(--line); }
.alumni + .group-label { margin-top: 56px; }
.alum { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; min-width: 0; }
.alum span:last-child { color: var(--muted); font-size: 13px; text-align: right; }

/* Publications */
.pub-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  font: 500 13px var(--font-body); color: var(--ink-2); background: transparent; border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--muted); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--navy); color: var(--paper); border-color: var(--navy); }
.pubs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); counter-reset: pub; }
.pub {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line);
  align-items: start;
}
.pub-year { font-family: var(--font-mono); font-size: 14px; color: var(--muted); padding-top: 4px; font-variant-numeric: tabular-nums; }
.pub-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pub-title { font-family: var(--font-display); font-size: 21px; line-height: 1.3; }
.pub-authors { font-size: 14px; color: var(--ink-2); }
.pub-authors b { font-weight: 600; color: var(--ink); }
.pub-authors a.author { text-decoration: none; border-bottom: 1px solid var(--accent-wash); }
.pub-authors a.author:hover { border-color: var(--accent); }
.pub-authors a.author:hover b { color: var(--accent-ink); }
.card { scroll-margin-top: 110px; }
.card.flash .face.front { box-shadow: 0 0 0 2px var(--accent); transition: box-shadow .3s; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.journal { font-family: var(--font-display); font-style: italic; font-size: 15.5px; color: var(--ink); }
.doi {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent-ink); text-decoration: none;
  border: 1px solid var(--line); padding: 2px 8px; border-radius: 3px; word-break: break-all;
}
.doi:hover { border-color: var(--accent); background: var(--accent-wash); }
.pub-foot { margin-top: 28px; font-size: 14.5px; color: var(--muted); }
.pub-foot a { color: var(--accent-ink); }

/* News */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 135px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl { display: grid; grid-template-columns: 120px 32px minmax(0, 1fr); padding-bottom: 44px; align-items: start; }
.tl:last-child { padding-bottom: 0; }
.timeline:not(.expanded) .tl-more { display: none; }
.timeline:not(.expanded) .tl:nth-child(4) { padding-bottom: 0; }
.tl-toggle {
  margin: 36px 0 0 152px; font: 500 14px var(--font-body); color: var(--accent-ink); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 4px; padding: 10px 16px;
}
.tl-toggle:hover { border-color: var(--accent); }
@media (max-width: 560px) { .tl-toggle { margin-left: 24px; } }
.tl time { font-family: var(--font-mono); font-size: 13px; color: var(--muted); padding-top: 3px; text-align: right; padding-right: 8px; font-variant-numeric: tabular-nums; }
.tl .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--accent); margin: 8px 0 0 11px; position: relative; z-index: 1; }
.tl:first-child .dot { background: var(--accent); }
.tl-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 68ch; }
.tl-kind { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.tl-body h3 { font-size: 22px; }
.tl-body p { color: var(--ink-2); font-size: 15.5px; }

/* Join */
.join { --join-bg: var(--paper); --join-ink: var(--ink); background: var(--join-bg); color: var(--join-ink); border-bottom: 0; }
.join .eyebrow { color: var(--accent-wash); opacity: .85; }
.join .lede { color: var(--join-ink); opacity: .82; }
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid color-mix(in srgb, var(--join-ink) 22%, transparent); }
.role-card { padding: 32px 28px 8px 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.role-card + .role-card { padding-left: 28px; border-left: 1px solid color-mix(in srgb, var(--join-ink) 22%, transparent); }
.role-card .k { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.role-card h3 { font-size: 24px; }
.role-card p { font-size: 15px; opacity: .8; }
.role-card .status { font-size: 13px; font-family: var(--font-mono); margin-top: auto; padding-top: 8px; }
.join .btn.primary { background: var(--join-ink); color: var(--join-bg); border-color: var(--join-ink); }
.join .btn.primary:hover { background: var(--accent-wash); }
.join-actions { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 14.5px; }
.join-actions span { opacity: .75; }

/* Footer */
footer { padding-block: 48px 28px; border-top: 1px solid var(--line-soft); font-size: 14px; color: var(--ink-2); }
address { font-style: normal; line-height: 1.7; }
.foot-col address { margin-top: 6px; }
.foot-grid { display: grid; grid-template-columns: repeat(2, auto); justify-content: start; gap: 32px 120px; margin-bottom: 36px; }
.foot-col { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.foot-col .eyebrow { margin-bottom: 4px; }
.foot-col a { text-decoration: none; overflow-wrap: anywhere; }
.foot-col a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 480px) { .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } nav.foot-col { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; } nav.foot-col .eyebrow { flex-basis: 100%; } }
.legal { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; font-size: 13px; color: var(--ink-2); padding-top: 20px; border-top: 1px solid var(--line-soft); }

/* Responsive */
@media (max-width: 1040px) {
  .sec-head { margin-bottom: 40px; }
  .people { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .face.front.pi { grid-template-columns: calc((100% + 40px) / 3 - 2px) minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .hero > .wrap:first-child { grid-template-columns: minmax(0, 1fr); padding-block: 24px 40px; gap: 24px; }
  /* no large logo on phones and narrow tablets: the header mark carries it */
  .orbital { display: none; }
  /* keep the desktop's two lines on phones: "& Quantum Chemistry" is about 8.6 times the font size wide,
     so below about 400px the size shrinks with the screen to fit the width (less the 16px gutters) */
  .hero h1 { font-size: clamp(28px, min(max(40px, 8vw), calc((100vw - 32px) * .112)), 64px); }
  .hero h1 > span { white-space: normal; }
  .orbital figcaption { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { padding-left: 0; border-left: 0; }
  .theme { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "fig" "detail"; padding-block: 32px; }
  .theme-detail { columns: 1; }
  .pi { grid-template-columns: minmax(0, 1fr); padding: 28px 22px; gap: 24px; }
  .people { gap: 14px; }
  .face.front.pi { grid-template-columns: minmax(0, 1fr); }
  .pi .avatar { width: calc((100% + 24px) / 2 - 2px); }
  .people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 20px; }
  .alumni { grid-template-columns: minmax(0, 1fr); }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .roles { grid-template-columns: minmax(0, 1fr); }
  .role-card, .role-card + .role-card { padding: 28px 0; border-left: 0; }
  .role-card + .role-card { border-top: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); }
  section.block { padding-block: 64px; }
}
@media (max-width: 560px) {
  .timeline::before { left: 4px; }
  .tl { grid-template-columns: 24px minmax(0, 1fr); row-gap: 4px; }
  .tl time { grid-column: 2; grid-row: 1; text-align: left; padding: 0; }
  .tl .dot { grid-column: 1; grid-row: 1; margin: 6px 0 0; }
  .tl-body { grid-column: 2; }
  .brand-sub { display: none; }
  .brand-name { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .flip { transform: none !important; transition: none; }
  .face.back { transform: none; visibility: hidden; }
  .card.flipped .face.back, .card:hover .face.back { visibility: visible; }
  .card.flipped .face.front, .card:hover .face.front { visibility: hidden; }
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* Site additions: real images in place of the design's placeholders, and text written in Markdown */
img { max-width: 100%; height: auto; }
/* the build wraps each image in a picture element (WebP plus a fallback); keep it out of the layout */
picture { display: contents; }
.avatar picture { display: block; width: 100%; height: 100%; }
/* the frame sets the shape and clips the photo, so on phones the photo can be enlarged inside it */
.group-photo .photo-frame { display: block; aspect-ratio: 21 / 9; overflow: hidden; border-radius: 4px; border: 1px solid var(--line); }
.group-photo .photo { display: block; width: 100%; height: 100%; object-fit: cover; }
/* phones: a little taller (16:9), and the main photo enlarged about a fifth so the plants at the sides are
   trimmed and the people fill more of it. They stand a little left of centre, hence the left shift.
   The fish photo's people reach both edges, so it is not enlarged */
@media (max-width: 600px) {
  .group-photo .photo-frame { aspect-ratio: 16 / 9; }
  .group-photo .photo-main .photo { width: 119%; max-width: none; margin-left: -7.5%; }
}
.theme-fig .fig { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.avatar.has-photo { background: var(--line-soft); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* logos sit on white tiles so they read the same in dark mode */
.funder-row li { height: 96px; border-style: solid; padding: 10px 14px; background: #fff; }
.funder-row li a { display: grid; place-items: center; width: 100%; height: 100%; }
/* width and height both auto so the two max limits scale a logo down in proportion and never stretch it */
.funder-row img { max-height: 74px; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.prose > * + * { margin-top: 1em; }
.prose a, .theme-detail a, .tl-body a { color: var(--accent-ink); text-underline-offset: 3px; }
.tl-body h3 a { color: inherit; text-decoration: none; }
.tl-body h3 a:hover { color: var(--accent-ink); }
a.pub-title { text-decoration: none; }
a.pub-title:hover { color: var(--accent-ink); }
.person .bio > * + * { margin-top: .6em; }
/* maths drawn by KaTeX: sized to sit with the body serif; a wide equation scrolls sideways on a phone */
.katex { font-size: 1.1em; }
.katex-display { margin: 0; padding: .25em 0; overflow-x: auto; overflow-y: hidden; }
.person .links a, .legal a { color: inherit; }
.post .sec-head > div { max-width: 68ch; }
.post .sec-body { max-width: 68ch; font-size: 17px; color: var(--ink-2); }
.post-img { display: block; margin-bottom: 32px; border-radius: 4px; }
[hidden] { display: none !important; }
.pub-toggle { margin-left: 0; }
.pub-note { font-size: 13.5px; color: var(--ink-2); }
.preprints { margin-bottom: 64px; }
.preprints .pubs { border-top: 0; }
