:root {
  color-scheme: dark;
  --bg: #070b1a;
  --surface: #0c1227;
  --surface-2: #131b36;
  --text: #e9ecf7;
  --text-2: #c9cfe3;
  --muted: #9ba5c4;
  --dim: #7f8bb5;
  --line: #1f2a4a;
  --line-2: #34416a;
  --accent: #e98ad6;
  --accent-ink: #f0a6e2;
  --on-accent: #070b1a;
  --phys: #7988ed;
  --neuro: #00ae75;
  --ai: #d8732b;
  --glow: #121b44;
  --card-top: rgba(23, 32, 66, .55);
  --card-bottom: rgba(12, 18, 39, .55);
  --card-line: #222e52;
  --nav-bg: rgba(7, 11, 26, .84);
  --card-shadow: none;
  --solid-from: #f4d6ee;
  --solid-to: #e9ecf7;
  --on-solid: #070b1a;
  --orb-core: #111a3d;
  --orb-mid: #0a1027;
  --mesh-a: #5b74f0;
  --mesh-b: #e98ad6;
  --mesh-rim: #b9c4ff;
  --mesh-glow: .85;
  --cv-bg: #050816;
  --cv-ink: #e9ecf7;
  --cv-dim: #6e7aa3;
  --cv-grid: #1c2645;
  --cv-inhib: #9ba5c4;
  --cv-class0: #b9c4e6;
  --cv-mid: #121933;
  --cv-label-bg: rgba(5, 8, 22, .8);
  --fig-bg: #000;
  --fig-filter: invert(1) hue-rotate(180deg) saturate(1.2);
  --fig-blend: screen;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans", sans-serif;
  --font-display: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --display-weight: 500;
  --display-tracking: -0.015em;
  --display-case: none;
  --size: 16.5px;
  --leading: 1.62;
  --w: 1200px;
  --w-text: 46rem;
  --radius: 18px;
  --section-space: 6rem;
}
/* The bright style: the style switch in the header sets data-theme="bright" on <html> (site.js; the
   first visit follows the visitor's system setting). Only the colours differ from the dark :root above. */
:root[data-theme="bright"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #eef0f7;
  --surface-2: #e5e8f2;
  --text: #0e1433;
  --text-2: #2e3555;
  --muted: #4d5577;
  --dim: #596180;
  --line: #dde1ee;
  --line-2: #c3c9de;
  --accent: #c2489f;
  --accent-ink: #a8327f;
  --on-accent: #ffffff;
  --phys: #5069c8;
  --neuro: #007a5f;
  --ai: #c9690c;
  --glow: #e3e7fb;
  --card-top: rgba(255, 255, 255, .92);
  --card-bottom: rgba(255, 255, 255, .7);
  --card-line: #e1e5f0;
  --nav-bg: rgba(246, 247, 251, .86);
  --card-shadow: 0 1px 2px rgba(14, 20, 51, .04), 0 10px 30px rgba(14, 20, 51, .06);
  --solid-from: #1a2150;
  --solid-to: #3a2a6e;
  --on-solid: #ffffff;
  --orb-core: #ffffff;
  --orb-mid: #eef1fa;
  --mesh-a: #2f3fa8;
  --mesh-b: #b03c8c;
  --mesh-rim: #ffffff;
  --mesh-glow: .45;
  --cv-bg: #fbfcfe;
  --cv-ink: #0e1433;
  --cv-dim: #8a92ad;
  --cv-grid: #e1e5ef;
  --cv-inhib: #596180;
  --cv-class0: #4e5f86;
  --cv-mid: #fbfcfe;
  --cv-label-bg: rgba(251, 252, 254, .9);
  --fig-bg: #ffffff;
  --fig-filter: none;
  --fig-blend: multiply;
}
/* The shared base of designs made in /web_design: type, layout, buttons, section tones. Every colour,
   font and size above is a Theme token; blocks (blocks/*.css) use only these tokens. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: var(--size); line-height: var(--leading); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; text-decoration-thickness: 1px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
h1, h2, h3, .display { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); text-transform: var(--display-case); line-height: 1.08; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.32rem; line-height: 1.25; }
p { margin: 0 0 1em; text-wrap: pretty; }
.prose > :last-child, .lead > :last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin: .25em 0; }
.prose blockquote { margin: 1.2em 0; padding: .2em 0 .2em 1.1em; border-left: 3px solid var(--accent); color: var(--muted); }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--surface); padding: .12em .35em; border-radius: 5px; }
.prose pre { background: var(--surface); padding: 1rem 1.2rem; border-radius: calc(var(--radius) * .6); overflow-x: auto; font-size: .88rem; }
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: calc(var(--radius) * .6); margin: 1.4em 0; }
.prose h2 { font-size: 1.7rem; margin-top: 1.6em; } .prose h3 { margin-top: 1.4em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.lead { font-size: clamp(1.08rem, 1.7vw, 1.28rem); line-height: 1.55; color: color-mix(in srgb, var(--text) 82%, var(--bg)); }
.muted { color: var(--muted); }
.eyebrow { display: inline-block; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.wrap { width: min(100% - 3rem, var(--w)); margin-inline: auto; }
.wrap.narrow { width: min(100% - 3rem, var(--w-text)); }

/* buttons: {label, url, style: "" | "ghost" | "link"} */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .72rem 1.25rem; border-radius: 999px; background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); font: 500 .95rem/1.2 var(--font-body); text-decoration: none; transition: transform .15s, background .15s, color .15s, border-color .15s; }
.btn:hover { color: var(--on-accent); transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn.ghost { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 30%, transparent); }
.btn.ghost:hover { border-color: currentColor; color: inherit; background: color-mix(in srgb, currentColor 6%, transparent); }
.btn.link { background: none; border: 0; padding: .72rem 0; color: inherit; text-decoration: underline; text-underline-offset: .25em; }
.btns { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.8rem; }
.btns:empty { display: none; }

/* sections: every block is a .blk; its tone sets the background */
.blk { padding: var(--section-space) 0; position: relative; }
.blk.tight { padding: calc(var(--section-space) * .5) 0; }
.tone-surface { background: var(--surface); }
.tone-accent { background: var(--accent); color: var(--on-accent); --muted: color-mix(in srgb, var(--on-accent) 75%, var(--accent)); --line: color-mix(in srgb, var(--on-accent) 25%, var(--accent)); }
.tone-accent .lead { color: color-mix(in srgb, var(--on-accent) 88%, var(--accent)); }
.tone-accent a:not(.btn):hover { color: inherit; }
.tone-accent .btn { background: var(--on-accent); color: var(--accent); border-color: var(--on-accent); }
.tone-accent .btn.ghost { background: transparent; color: var(--on-accent); }
.tone-invert { background: var(--text); color: var(--bg); --muted: color-mix(in srgb, var(--bg) 66%, var(--text)); --line: color-mix(in srgb, var(--bg) 16%, var(--text)); --surface: color-mix(in srgb, var(--bg) 7%, var(--text)); }
.tone-invert .btn:not(.ghost):not(.link) { background: var(--bg); color: var(--text); border-color: var(--bg); }
.tone-invert .lead { color: color-mix(in srgb, var(--bg) 85%, var(--text)); }
.tone-plain + .tone-plain, .tone-surface + .tone-surface { padding-top: 0; }
.sec-head { margin-bottom: 2.6rem; max-width: var(--w-text); }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head h2 { margin-bottom: .35em; }
.sec-head .lead { margin: 0; }
.empty-note { padding: 1.4rem; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: .92rem; }
@media (max-width: 700px) {
  body { font-size: calc(var(--size) - 1px); }
  :root { --section-space: 4rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }

/* ── Manifold: the lab's look — deep navy, Cormorant display type, soft glass cards, a pink accent and
   one colour per research programme (--phys --neuro --ai, checked for contrast on the dark page).
   Shared pieces live here; each section type has its own stylesheet (blocks/mf_*.css). ── */
html { background: radial-gradient(ellipse 80% 55% at 75% 8%, var(--glow) 0%, transparent 60%), var(--bg); background-repeat: no-repeat; background-color: var(--bg); }
body { background: transparent; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
a { text-decoration: none; }
.prose a, .lead a, .mf-intro a, .mf-prose a { color: var(--text); border-bottom: 1px solid var(--line-2); transition: border-color .15s, color .15s; }
.prose a:hover, .lead a:hover, .mf-intro a:hover, .mf-prose a:hover { color: var(--accent-ink); border-color: var(--accent); }
.prose strong, .mf-intro strong { color: var(--text); font-weight: 600; }
.wrap { width: min(100% - 3rem, var(--w)); }

/* the Chinese pages: modern, light sans display type — Noto Sans SC 300 (self-hosted slices), Inter for Latin
   letters in the same headings; the system's Chinese sans where a character is not in the slices */
:root:lang(zh-CN) { --font-display: "Inter", "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Source Han Sans SC", sans-serif; --display-weight: 300; --display-tracking: .02em;
  --font-body: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", monospace; }
:lang(zh-CN) .mf-head h2, :lang(zh-CN) .prog h3, :lang(zh-CN) .mf-interests li { letter-spacing: .03em; }
:lang(zh-CN) .mono { letter-spacing: .02em; }
:lang(zh-CN) .mf-hero h1 { font-size: clamp(2.8rem, 5.8vw, 5.2rem); line-height: 1.08; letter-spacing: .08em; }
:lang(zh-CN) .mf-pagehead h1 { letter-spacing: .08em; }

/* small labels, field keys */
.mono { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.key { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-mono); font-size: .7rem; color: var(--muted); letter-spacing: .02em; }
.key::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--c, var(--dim)); flex: none; }
.c-phys { --c: var(--phys); } .c-neuro { --c: var(--neuro); } .c-ai { --c: var(--ai); }

/* buttons: glass pills; the first one solid */
.btn { padding: .62rem 1.05rem; font: 500 .9rem/1.2 var(--font-body); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); backdrop-filter: blur(6px); }
.btn:hover { border-color: var(--line-2); background: var(--surface-2); color: var(--text); transform: none; }
.btn.primary, .btn.solid { background: linear-gradient(90deg, var(--solid-from), var(--solid-to)); color: var(--on-solid); border-color: transparent; }
.btn.primary:hover, .btn.solid:hover { opacity: .9; background: linear-gradient(90deg, var(--solid-from), var(--solid-to)); color: var(--on-solid); }
.btn.ghost { background: transparent; }
.mf-btns { display: flex; flex-wrap: wrap; gap: .6rem; }
.mf-more { display: flex; justify-content: flex-end; margin-top: 1.4rem; }

/* a section: numbered label on the left, display heading, optional introduction */
.mf { padding: var(--section-space) 0 0; }
.mf:last-child { padding-bottom: 1rem; }
.mf-head { display: grid; grid-template-columns: 12rem 1fr; gap: 2rem; align-items: baseline; margin-bottom: 2.3rem; }
.mf-head .mono { padding-top: .4rem; }
.mf-head h2 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(2.4rem, 4.8vw, 3.7rem); line-height: .98; letter-spacing: var(--display-tracking); margin: 0; }
.mf-intro { max-width: var(--w-text); font-size: 1.06rem; color: var(--text-2); margin: -1rem 0 2.3rem 14rem; }
.mf-intro > :last-child { margin-bottom: 0; }
.mf-empty { padding: 1.2rem 1.4rem; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); font-size: .9rem; }

/* glass card */
.mf-card { background: linear-gradient(180deg, var(--card-top), var(--card-bottom)); border: 1px solid var(--card-line); border-radius: var(--radius); backdrop-filter: blur(4px); box-shadow: var(--card-shadow); }

/* a paper, wherever it is listed */
.authors { color: var(--muted); font-size: .92rem; margin: 0 0 .6rem; }
.authors .me { color: var(--text); font-weight: 600; }
.venue-chip { font-family: var(--font-mono); font-size: .7rem; padding: .2rem .5rem; border: 1px solid var(--line); border-radius: 6px; color: var(--text); max-width: 100%; overflow-wrap: anywhere; }
.venue-chip.pre { color: var(--muted); border-style: dashed; }
.award { font-family: var(--font-mono); font-size: .66rem; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .04em; }
.p-row { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.p-links a { color: var(--muted); font-family: var(--font-mono); font-size: .74rem; margin-right: .7rem; }
.p-links a::after { content: " ↗"; }
.p-links a:hover { color: var(--accent-ink); }
.p-title a:hover { color: var(--accent-ink); }
.figs { display: flex; gap: .7rem; margin-top: 1.1rem; flex-wrap: wrap; }
.figs .f { background: var(--fig-bg); border-radius: calc(var(--radius) * .7); overflow: hidden; border: 1px solid var(--line); }
.figs video { display: block; height: clamp(130px, 16vw, 200px); width: auto; max-width: 100%; filter: var(--fig-filter); mix-blend-mode: var(--fig-blend); }
.fn { font-family: var(--font-mono); font-size: .72rem; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; margin-top: 1rem; }

/* the “Pause motion” switch (hero, live figure): pauses every animation and video on the site, remembered */
.motion { font: 500 .66rem/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); border-radius: 999px; padding: .38rem .65rem; cursor: pointer; }
.motion:hover { color: var(--text); border-color: var(--line-2); }
.motion[aria-pressed="true"] { color: var(--bg); background: var(--text); border-color: var(--text); }
video[data-fig] { cursor: pointer; }
video[data-fig]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* live figures: HUD numbers */
.hud { font-family: var(--font-mono); font-size: .7rem; color: var(--dim); white-space: nowrap; line-height: 1.6; }
.hud span { color: var(--muted); display: inline-block; min-width: 2.6em; }

/* hover tips (charts) */
.tip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; font-size: .8rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); color: var(--text); }
.tip b { font-weight: 600; font-size: .95rem; display: block; }
.tip span { color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.tip span::before { content: ""; width: 12px; height: 2px; background: var(--c, var(--muted)); }
[hidden] { display: none !important; }

@media (max-width: 960px) {
  .mf-head { grid-template-columns: 1fr; gap: .9rem; }
  .mf-intro { margin-left: 0; margin-top: 0; }
  :root { --section-space: 4.6rem; }
}
@media (max-width: 560px) { body { font-size: 16px; } }
