/* Layout: compact, document-like academic site. 1120px column, hairline-bordered panels, restrained type scale (15px base), one accent. */
@font-face { font-family: "Geist"; src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --fg: #0c1220;
  --fg-2: #333b4c;
  --muted: #626b7d;
  --line: #e5e8ee;
  --line-2: #d5dae3;
  --accent: #2f54eb;
  --accent-2: #5a3ff0;
  --accent-ink: #ffffff;
  --accent-soft: #eef1fe;
  --teal: #0a8578; --teal-soft: #e5f4f2;
  --amber: #b06604; --amber-soft: #fcf2e2;
  --violet: #6b45d4; --violet-soft: #f2ecfd;
  --rose: #be3657; --rose-soft: #fcecf0;
  --grid-line: rgba(12, 18, 32, 0.035);
  --spot: rgba(47, 84, 235, 0.06);
  --shadow-sm: 0 1px 2px rgba(12, 18, 32, 0.04);
  --shadow-md: 0 1px 2px rgba(12, 18, 32, 0.04), 0 6px 20px -6px rgba(12, 18, 32, 0.10);
  --shadow-lg: 0 18px 48px -12px rgba(12, 18, 32, 0.22);
  --sans: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 14px;
  --r-sm: 10px;
  --nav-h: 56px;
  /* type scale */
  --t-xs: 12px; --t-sm: 13.5px; --t-base: 15px; --t-md: 16px; --t-lg: 18px; --t-xl: 22px; --t-2xl: 28px; --t-3xl: clamp(28px, 3.4vw, 40px);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0e15; --surface: #11151f; --surface-2: #171c28; --fg: #ecf0f7; --fg-2: #c6cddb; --muted: #919bb0;
  --line: #1f2634; --line-2: #2a3344;
  --accent: #7d94ff; --accent-2: #a28dff; --accent-ink: #0b0e15; --accent-soft: #171f3c;
  --teal: #40c9b9; --teal-soft: #0d2725; --amber: #f0b451; --amber-soft: #29200f;
  --violet: #ac90ff; --violet-soft: #201938; --rose: #f17f9a; --rose-soft: #2e141e;
  --grid-line: rgba(255, 255, 255, 0.03); --spot: rgba(125, 148, 255, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-md: 0 6px 20px -6px rgba(0, 0, 0, 0.55); --shadow-lg: 0 18px 48px -12px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--fg); font: 400 var(--t-base)/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; text-wrap: balance; line-height: 1.2; font-weight: 600; }
p { margin: 0; text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--accent) 20%, transparent); }
svg.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
kbd { font: 500 10.5px/1 var(--mono); padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 10px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

@view-transition { navigation: auto; }
.nav { view-transition-name: nav; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 160ms; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(1.8) blur(14px); backdrop-filter: saturate(1.8) blur(14px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 14px; height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--fg); font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line-2); }
.nav-links { display: flex; align-items: center; gap: 0; margin-left: auto; }
.nav-links a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 500; font-size: 13.5px; padding: 6px 10px; border-radius: 8px; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--fg); background: var(--surface-2); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--fg); background: var(--surface-2); }
.nav-links a.nav-hl { color: var(--accent); }
.nav-links a.nav-hl svg.i { width: 13px; height: 13px; }
.nav-links .nav-mobile { display: none; }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--fg-2); cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-2); color: var(--fg); text-decoration: none; }
.icon-btn svg.i { width: 15px; height: 15px; }
.search-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 6px 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 400 13px/1 var(--sans); cursor: pointer; min-width: 150px; }
.search-btn:hover { border-color: var(--line-2); color: var(--fg); }
.search-btn span { margin-right: auto; }
.search-btn svg.i { width: 14px; height: 14px; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.menu-btn { display: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: 500 14px/1 var(--sans); padding: 9px 14px; border-radius: 9px; border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn svg.i { width: 15px; height: 15px; }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { background: color-mix(in srgb, var(--fg) 86%, var(--accent)); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--fg); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-sm svg.i { width: 13px; height: 13px; }

/* ---------- small pieces ---------- */
.pill { display: inline-flex; align-items: center; gap: 7px; font: 500 12.5px/1 var(--sans); color: var(--fg-2); background: var(--surface); border: 1px solid var(--line); padding: 6px 10px 6px 8px; border-radius: 999px; }
.pill svg.i { width: 13px; height: 13px; color: var(--accent); }
.dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--teal); flex: none; display: inline-block; }
.dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: var(--teal); opacity: .3; animation: ping 2.4s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
.tag { display: inline-flex; align-items: center; gap: 5px; font: 500 11.5px/1 var(--sans); padding: 4px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.tag.teal { background: var(--teal-soft); color: var(--teal); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.violet { background: var(--violet-soft); color: var(--violet); }
.tag.rose { background: var(--rose-soft); color: var(--rose); }
.tag.grey { background: var(--surface-2); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ib { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); flex: none; }
.ib svg.i { width: 16px; height: 16px; }
.c-teal .ib, .ib.c-teal { background: var(--teal-soft); color: var(--teal); }
.c-amber .ib, .ib.c-amber { background: var(--amber-soft); color: var(--amber); }
.c-violet .ib, .ib.c-violet { background: var(--violet-soft); color: var(--violet); }
.c-rose .ib, .ib.c-rose { background: var(--rose-soft); color: var(--rose); }
.grad { color: var(--accent); }
.link-arrow { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; font-size: var(--t-sm); color: var(--fg-2); }
.link-arrow svg.i { width: 14px; height: 14px; transition: transform .15s ease; }
.link-arrow:hover { text-decoration: none; color: var(--accent); }
.link-arrow:hover svg.i { transform: translateX(2px); }

/* faint grid behind page heads */
.backdrop { position: relative; isolation: isolate; overflow: hidden; overflow: clip; }
.backdrop::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%); }

/* ---------- cards & panels ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.card.hover:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
.card.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s; background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 60%); }
.card.spot:hover::before { opacity: 1; }
.card > * { position: relative; }
.card h3 { font-size: var(--t-md); margin-top: 12px; }
.card h3:first-child { margin-top: 0; }
.card p { color: var(--muted); margin-top: 6px; font-size: 14px; }
.card .foot { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13.5px; }
.card .refs { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font: 400 11.5px/1.6 var(--mono); color: var(--muted); }
.row { display: flex; gap: 12px; align-items: flex-start; }
.row h3 { margin-top: 0; }
.card a.stretch::after { content: ""; position: absolute; inset: 0; border-radius: var(--r); }
.glow { border-color: var(--line-2); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-bio { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }

/* ---------- sections ---------- */
.section { padding-block: 56px; }
.section.tight { padding-block: 32px; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section.alt .card, .section.alt .panel { background: var(--bg); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.eyebrow { display: block; font: 500 11.5px/1 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
.section-head h2 { font-size: var(--t-xl); font-weight: 600; letter-spacing: -0.025em; margin-top: 8px; }
.section-head p { color: var(--muted); margin-top: 6px; max-width: 64ch; font-size: 14.5px; }

/* ---------- home ---------- */
.home-hero { padding-block: 52px 40px; }
.home-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
.home-hero h1 { margin-top: 16px; font-size: clamp(30px, 3.6vw, 42px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.12; max-width: 20ch; }
.home-hero .lead { margin-top: 16px; font-size: var(--t-md); color: var(--fg-2); max-width: 60ch; line-height: 1.65; }
.home-hero .lead strong { font-weight: 600; color: var(--fg); }
.cta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; align-items: center; }
.icon-links { display: flex; gap: 6px; margin-left: 6px; }
.profile { padding: 0; overflow: hidden; }
.profile .top { display: flex; gap: 14px; align-items: center; padding: 16px; }
.profile .top img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; object-position: 50% 20%; box-shadow: 0 0 0 1px var(--line); }
.profile .top b { display: block; font-size: 15px; font-weight: 600; }
.profile .top span { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.kpis > div { padding: 12px 16px; }
.kpis > div:nth-child(odd) { border-right: 1px solid var(--line); }
.kpis > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.kpis .n { font: 600 20px/1 var(--sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.kpis .l { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.35; }
.profile .status { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-2); background: var(--surface-2); }
.profile .status a { margin-left: auto; font-weight: 500; }

.updates { list-style: none; margin: 0; padding: 0; }
.updates li > a, .updates li > div { display: grid; grid-template-columns: 92px 88px minmax(0, 1fr) 16px; gap: 14px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--fg); font-size: 14px; }
.updates li:last-child > a, .updates li:last-child > div { border-bottom: 0; }
.updates li a:hover { background: var(--surface-2); text-decoration: none; }
.updates time { font: 400 12.5px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.updates .tag { justify-self: start; }
.updates .ttl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.updates svg.i { color: var(--muted); width: 14px; height: 14px; }

.research-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 12px; align-items: stretch; }
.fl-mini { display: flex; flex-direction: column; padding: 14px; }
.fl-mini canvas { width: 100%; flex: 1 1 auto; height: 0; min-height: 280px; display: block; background: var(--surface-2); border-radius: 10px; }
.fl-mini .cap { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font: 400 11.5px/1.4 var(--mono); color: var(--muted); }
.fl-mini .cap i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.theme-list { list-style: none; margin: 0; padding: 0; }
.theme-list li a { display: grid; grid-template-columns: 32px minmax(0, 1fr) 16px; gap: 14px; align-items: start; padding: 15px 16px; border-bottom: 1px solid var(--line); color: var(--fg); }
.theme-list li:last-child a { border-bottom: 0; }
.theme-list li a:hover { background: var(--surface-2); text-decoration: none; }
.theme-list b { display: block; font-weight: 600; font-size: 14.5px; }
.theme-list span.d { display: block; color: var(--muted); font-size: 13.5px; margin-top: 3px; line-height: 1.5; }
.theme-list span.r { display: block; font: 400 11.5px/1.5 var(--mono); color: var(--muted); margin-top: 6px; }
.theme-list > li > a > svg.i { color: var(--muted); margin-top: 8px; }

.mini-cards .card { display: flex; flex-direction: column; }
.mini-cards .card .foot { margin-top: auto; padding-top: 14px; }

/* ---------- FL explainer (research page) ---------- */
.fl-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 18px; }
.fl-card canvas { width: 100%; aspect-ratio: 1 / 0.78; display: block; background: var(--surface-2); border-radius: 10px; }
.fl-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font: 400 11.5px/1.4 var(--mono); color: var(--muted); }
.fl-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
ol.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; counter-reset: s; }
ol.steps li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; counter-increment: s; }
ol.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font: 500 12px/1 var(--mono); background: var(--surface-2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
ol.steps b { display: block; font-size: 14.5px; font-weight: 600; }
ol.steps span { color: var(--muted); font-size: 13.5px; }

/* ---------- media cards ---------- */
.media-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.media-card .media { position: relative; aspect-ratio: 2 / 1; background: #fff; border-bottom: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.media-card .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.media-card .media.cover { background: linear-gradient(135deg, var(--accent-soft), var(--violet-soft)); }
.media-card .media.cover svg.i { width: 40px; height: 40px; color: var(--accent); stroke-width: 1.5; }
.media-card .media .status { position: absolute; top: 10px; left: 10px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.media-card .media .status.teal { color: var(--teal); }
.media-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.media-card .body h3 { margin-top: 0; font-size: var(--t-md); }
.media-card .body p { margin-top: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.facts span { display: inline-flex; align-items: center; gap: 5px; }
.facts svg.i { width: 13px; height: 13px; }
.media-card .actions { margin-top: auto; padding-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- publications: one bordered list, rows divided by hairlines ---------- */
.pub-list { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.section.alt .pub-list { background: var(--bg); }
.pub { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent !important; }
.pub:last-child { border-bottom: 0; }
.pub[hidden] { display: none; }
.pub.spot::before { border-radius: 0; }
.pub .top { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.pub .yr { font: 500 12px/1 var(--mono); color: var(--muted); margin-right: 3px; }
.pub .t { font-size: 14.5px; font-weight: 600; color: var(--fg); line-height: 1.45; letter-spacing: -0.005em; }
.pub a.t:hover { color: var(--accent); text-decoration: none; }
.pub .a { margin-top: 3px; color: var(--muted); font-size: 13px; }
.pub .a b { color: var(--fg-2); font-weight: 600; }
.pub .v { margin-top: 1px; font-size: 13px; color: var(--muted); font-style: italic; }
.pub .acts { display: flex; gap: 5px; }
.year-label { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; font: 600 13px/1 var(--mono); color: var(--fg); }
.year-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.year-label small { font: 400 12px/1 var(--sans); color: var(--muted); }
.toolbar { position: sticky; top: calc(var(--nav-h) + 8px); z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px; margin-bottom: 4px; background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); }
.search { flex: 1 1 220px; display: flex; align-items: center; gap: 7px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; color: var(--muted); min-width: 0; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); font: 400 14px/1 var(--sans); padding: 8px 0; outline: none; }
.seg { display: flex; flex-wrap: wrap; gap: 2px; }
.seg button { font: 500 12.5px/1 var(--sans); padding: 7px 9px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg button:hover { background: var(--surface-2); color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.count { font: 400 12px/1 var(--mono); color: var(--muted); margin-left: auto; padding-right: 6px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.chart { display: flex; align-items: flex-end; gap: 5px; height: 62px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.chart .bar i { display: block; width: 100%; max-width: 26px; border-radius: 4px 4px 2px 2px; background: var(--accent); opacity: .85; }
.chart .bar span { font: 400 10px/1 var(--mono); color: var(--muted); }
.chart .bar b { font: 500 10.5px/1 var(--mono); color: var(--fg-2); }

/* stat tiles (inner pages) */
.b-stat { display: flex; align-items: center; gap: 12px; }
.b-stat .n { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.b-stat .l { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.b-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 10px; }
.pubstats { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.5fr); margin-top: 24px; }
.pubstats > .card { padding: 14px 16px; }

/* dialogs */
dialog { color: var(--fg); }
dialog::backdrop { background: rgba(8, 11, 20, 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.cite { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(620px, calc(100vw - 32px)); background: var(--surface); box-shadow: var(--shadow-lg); }
dialog.cite .hd { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
dialog.cite pre { margin: 0; padding: 14px 16px; font: 400 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow: auto; background: var(--surface-2); }
dialog.cite .ft { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 14px; }
dialog.cmdk { border: 0; padding: 0; background: transparent; width: min(600px, calc(100vw - 24px)); margin-top: 12vh; max-height: 76vh; }
.cmdk-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.cmdk-input input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--fg); font: 400 16px/1.2 var(--sans); }
.cmdk-list { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; }
.cmdk-list li a { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; color: var(--fg); }
.cmdk-list li a:hover, .cmdk-list li a[aria-selected="true"] { background: var(--surface-2); text-decoration: none; }
.cmdk-list .k { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.cmdk-list .k svg.i { width: 14px; height: 14px; }
.cmdk-list .tt { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-list .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-list .ty { font: 400 10.5px/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cmdk-list .none { padding: 24px; text-align: center; color: var(--muted); }
.cmdk-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font: 400 11.5px/1 var(--mono); color: var(--muted); }
.cmdk-foot svg.i { width: 12px; height: 12px; }

/* news cards */
.news-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.news-card .date { display: inline-flex; align-items: center; gap: 5px; font: 400 12px/1 var(--mono); color: var(--muted); }
.news-card .date svg.i { width: 13px; height: 13px; }
.news-card h3 { margin-top: 12px; font-size: var(--t-md); }
.news-card h3 a { color: var(--fg); }

/* timeline */
.timeline { position: relative; display: grid; gap: 8px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.tl-item { position: relative; padding: 14px 16px; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 20px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.tl-item.now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-item .when { font: 400 12px/1 var(--mono); color: var(--accent); }
.tl-item h3 { margin-top: 7px; font-size: 15px; }
.tl-item .org { color: var(--fg-2); font-size: 13.5px; margin-top: 2px; font-weight: 500; }
.tl-item p { margin-top: 5px; font-size: 13.5px; }

/* people */
.avatar { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 600; font-size: 13.5px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; flex: none; }
.avatar.teal { background: linear-gradient(135deg, var(--teal), var(--accent)); }
.avatar.amber { background: linear-gradient(135deg, var(--amber), var(--rose)); }
.person h3 { font-size: 15px; }
.person .org { font: 400 12px/1.5 var(--mono); color: var(--muted); margin-top: 2px; }

/* page hero */
.page-hero { border-bottom: 1px solid var(--line); }
.page-hero .wrap { padding-block: 44px 32px; }
.page-hero h1 { font-size: var(--t-3xl); font-weight: 600; letter-spacing: -0.035em; margin-top: 14px; max-width: 26ch; line-height: 1.12; }
.page-hero .lead { margin-top: 10px; font-size: var(--t-md); color: var(--muted); max-width: 66ch; }
.page-hero .cta-row { margin-top: 18px; }
.hero-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.hero-split .photo { width: 132px; border-radius: 16px; border: 1px solid var(--line); padding: 4px; background: var(--surface); }
.hero-split .photo img { border-radius: 12px; aspect-ratio: 4 / 4.6; object-fit: cover; }

/* prose & lists */
.prose { display: grid; gap: 12px; max-width: 72ch; }
.prose p { color: var(--fg-2); font-size: 15px; line-height: 1.7; }
.prose-card { padding: 24px; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-cloud span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-weight: 500; font-size: 13.5px; }
.chip-cloud span i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip-cloud span:nth-child(4n+2) i { background: var(--teal); }
.chip-cloud span:nth-child(4n+3) i { background: var(--violet); }
.chip-cloud span:nth-child(4n+4) i { background: var(--amber); }
.list-clean { list-style: none; margin: 0; padding: 0; }
.list-clean li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-clean li:last-child { border-bottom: 0; }
.list-clean li > span:last-child { color: var(--muted); font-size: 12.5px; text-align: right; }
.list-clean li > span:last-child.mono { font-family: var(--mono); }
.list-clean a { color: var(--fg); display: inline-flex; gap: 6px; align-items: center; }
.list-clean a:hover { color: var(--accent); }
.list-clean a svg.i { width: 12px; height: 12px; color: var(--muted); }
.code { margin: 0; background: #0b1020; color: #d6deff; border-radius: 10px; padding: 14px 16px; font: 400 12.5px/1.7 var(--mono); overflow-x: auto; white-space: pre; border: 1px solid #1d2540; }
.code .k { color: #9db0ff; } .code .s { color: #7fe0cc; } .code .c { color: #6e7891; }
.install { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 6px 6px 6px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font: 400 13px/1 var(--mono); }
.checks { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 9px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.checks li svg.i { color: var(--teal); margin-top: 3px; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 10px; background: var(--accent-soft); color: var(--fg); font-size: 13.5px; }
.note svg.i { color: var(--accent); margin-top: 2px; }

/* CTA band */
.cta-band { position: relative; overflow: hidden; border-radius: var(--r); padding: 26px 28px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); }
.cta-band::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.cta-band h2 { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.02em; }
.cta-band p { margin-top: 4px; color: var(--muted); max-width: 64ch; font-size: 14px; }
.cta-band .cta-row { margin-top: 0; }
.btn-light { background: var(--fg); color: var(--bg); }
.btn-outline { border-color: var(--line-2); color: var(--fg); background: var(--surface); }
.btn-outline:hover { background: var(--surface-2); }

/* footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer .wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 28px; padding-block: 36px 20px; }
.footer h4 { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13.5px; color: var(--fg-2); }
.footer ul a { color: var(--fg-2); }
.footer ul a:hover { color: var(--accent); }
.f-about p { color: var(--muted); font-size: 13.5px; margin-top: 10px; max-width: 40ch; }
.f-social { display: flex; gap: 6px; margin-top: 14px; }
.f-bottom { grid-column: 1 / -1; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); font: 400 11.5px/1.4 var(--mono); color: var(--muted); }

/* post */
.post-body { max-width: 70ch; }
.post-body p { font-size: 15.5px; line-height: 1.75; color: var(--fg-2); margin-top: 12px; }

/* subtle scroll reveal; content is visible without it */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 30%; }
    @keyframes rise { from { opacity: .5; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  }
}

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .search-btn { min-width: 0; width: 32px; padding: 0; justify-content: center; }
  .search-btn span, .search-btn kbd { display: none; }
}
@media (max-width: 960px) {
  .nav-links { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px max(20px, env(safe-area-inset-left, 0px)) 14px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 12px; font-size: 15px; }
  .nav-links .nav-mobile { display: inline-flex; }
  .nav-actions { margin-left: auto; }
  .menu-btn { display: inline-grid; }
  .join-btn { display: none; }
  .home-hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .home-hero .profile { max-width: 460px; }
  .research-split { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pubstats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pubstats > .card:last-child { grid-column: 1 / -1; }
  .footer .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .g3, .g2, .g-bio { grid-template-columns: minmax(0, 1fr); }
  .fl-card { grid-template-columns: minmax(0, 1fr); }
  .cta-band { grid-template-columns: minmax(0, 1fr); }
  .hero-split { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hero-split .photo { width: 96px; order: -1; }
  .section { padding-block: 40px; }
  .page-hero .wrap { padding-block: 32px 24px; }
  .home-hero { padding-block: 32px 28px; }
  .updates li > a, .updates li > div { grid-template-columns: 86px minmax(0, 1fr) 14px; gap: 10px; padding: 11px 14px; }
  .updates .ttl { white-space: normal; }
  .updates time { font-size: 11.5px; }
  .updates .tag { display: none; }
}
@media (max-width: 520px) {
  .g4, .footer .wrap { grid-template-columns: minmax(0, 1fr); }
  .pubstats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .pubstats .b-stat .ib { display: none; }
  .pubstats > .card { padding: 12px; }
  .pub { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .brand span { display: none; }
  .count { margin-left: 0; }
  .list-clean li { flex-direction: column; gap: 1px; }
  .list-clean li > span:last-child { text-align: left; }
  .toolbar { position: static; }
  .icon-links { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .nav, .footer, .toolbar, .acts, dialog { display: none !important; }
  body { background: #fff; }
  .card, .panel { break-inside: avoid; }
}

/* long text in a full-width card flows into two columns on wide screens */
@media (min-width: 900px) {
  .prose-card .prose { display: block; max-width: none; columns: 2 380px; column-gap: 40px; }
  .prose-card .prose p { break-inside: avoid; margin-bottom: 12px; }
}

.updates li > div .ttl { white-space: normal; }

/* home: identity card */
.idcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.idcard .ph { aspect-ratio: 4 / 2.9; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.idcard .ph img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.id-body { padding: 16px 18px 14px; }
.id-body h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.id-body .role { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.id-rows { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.id-rows li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; color: var(--fg-2); }
.id-rows li > svg.i { color: var(--muted); width: 15px; height: 15px; }
.id-rows li a { color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.id-rows li a:hover { color: var(--accent); }
.icon-btn.mini { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn.mini svg.i { width: 13px; height: 13px; }
.id-links { display: flex; gap: 6px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.id-links .btn { margin-left: auto; }
.id-foot { display: flex; align-items: center; gap: 8px; padding: 11px 18px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 13px; color: var(--fg-2); }
.id-foot span:last-child { margin-left: auto; color: var(--accent); font-weight: 500; white-space: nowrap; }
.id-foot:hover { text-decoration: none; background: var(--accent-soft); }

/* utilities used by inner pages */
.inset { padding: 2px 16px; }
.meta { font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 3px; }
.panel-foot { display: flex; gap: 8px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 13px; color: var(--fg-2); }
a.card, a.card:hover { color: inherit; text-decoration: none; }
@media (max-width: 960px) { .home-hero .idcard { max-width: 420px; } }
@media (max-width: 1180px) { .search-btn { min-width: 0; width: 32px; padding: 0; justify-content: center; } .search-btn span, .search-btn kbd { display: none; } }
.interests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); max-width: 640px; }
.interests .label { width: 100%; font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 4px; }
.interests span:not(.label) { font-size: 13px; padding: 5px 10px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); color: var(--fg-2); }
.grid.top { align-items: start; }
.list-clean li > span:only-child { color: var(--fg); font-size: 14px; text-align: left; }

/* compact project cards, three per row */
.small-cards .media-card .media { aspect-ratio: 16 / 7; }
.small-cards .media-card .body { padding: 14px 16px 16px; gap: 6px; }
.small-cards .media-card .body h3 { font-size: 15px; }
.small-cards .media-card .body p { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.small-cards .media-card .facts { font-size: 12px; }
.small-cards .media-card .btn-sm { padding: 5px 9px; font-size: 12.5px; }
@media (max-width: 960px) { .small-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .small-cards { grid-template-columns: minmax(0, 1fr); } }

/* compact cards for dense grids */
.compact .card { padding: 14px 16px; }
.compact .card h3 { font-size: 14.5px; }
.compact .card p { font-size: 13px; }
.compact .card .refs { font-size: 11px; margin-top: 10px; padding-top: 8px; }
.compact .card .foot { margin-top: 10px; }
.compact .card .btn-sm { padding: 5px 8px; font-size: 12.5px; }
.compact .row { flex-direction: column; gap: 10px; }
.compact .list-clean li { padding: 6px 0; font-size: 13px; }
.compact .list-clean li > span:only-child { font-size: 13px; }
@media (max-width: 960px) { .compact.g4, .compact.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .compact.g4, .compact.g3 { grid-template-columns: minmax(0, 1fr); } }

/* about: header with identity card */
.about-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: center; }
@media (max-width: 960px) { .about-hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; } .about-hero .idcard { max-width: 420px; } }
.about-hero .wrap { align-items: start; }
.about-bio { margin-top: 16px; }
.about-bio p { font-size: 15px; }
