/* ---------- Tokens ---------- */
:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --ink: #14161a;
  --muted: #5a606b;
  --line: #e7e4de;
  --chip: #f1efea;
  --accent: #2646d6;
  --accent-soft: #e8ecff;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 24px rgba(20, 22, 26, .06);
  --radius: 16px;
  --maxw: 1080px;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0e1013;
  --surface: #151820;
  --ink: #eceef2;
  --muted: #9ba2ae;
  --line: #262b33;
  --chip: #1b1f27;
  --accent: #93a8ff;
  --accent-soft: #1d2440;
  --accent-ink: #0e1013;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }
.mono { font-family: var(--mono); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }
.brand { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; color: var(--ink); text-decoration: none; font-size: 1.05rem; display: inline-flex; align-items: center; gap: 10px; }
.brand .mark { display: block; width: auto; height: 36px; flex: none; }
[data-theme="dark"] .brand .mark { filter: invert(1) hue-rotate(180deg) brightness(.95); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: 7px 12px; border-radius: 999px; }
.nav-links a:hover { color: var(--ink); background: var(--chip); }
.nav-links a[aria-current="true"] { color: var(--ink); background: var(--chip); }
.icon-btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--muted); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.nav-right { display: flex; align-items: center; gap: 8px; }

@media (max-width: 1120px) {
  .menu-btn { display: grid; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 62px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 10px 20px 16px; gap: 2px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 1.02rem; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 9vw, 104px) 0 clamp(40px, 6vw, 72px); }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 620px; height: 620px; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%);
  filter: blur(10px);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -2; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 70% at 70% 20%, #000, transparent);
          mask-image: radial-gradient(70% 70% at 70% 20%, #000, transparent);
}
.hero-grid { display: grid; grid-template-columns: 1.5fr .75fr; gap: clamp(28px, 6vw, 72px); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #1f9d63; box-shadow: 0 0 0 4px color-mix(in srgb, #1f9d63 22%, transparent); }
h1 { font-family: var(--display); font-weight: 750; font-size: clamp(2.7rem, 7.4vw, 5.2rem); line-height: .98; letter-spacing: -.035em; margin: 18px 0 18px; }
h1 span { color: var(--accent); }
.role { font-size: clamp(1.1rem, 2.2vw, 1.35rem); line-height: 1.45; color: var(--ink); max-width: 36ch; margin: 0 0 14px; font-weight: 500; }
.lede { color: var(--muted); max-width: 58ch; margin: 0 0 28px; font-size: 1.06rem; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: .97rem; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn svg { width: 17px; height: 17px; }
.hero-side { justify-self: end; width: min(100%, 340px); display: flex; flex-direction: column; align-items: center; gap: 30px; }
.portrait { position: relative; width: 100%; }
.social { display: flex; gap: 12px; }
.icon-link { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; transition: background .2s, border-color .2s, color .2s, transform .2s; }
.icon-link:hover, .icon-link:focus-visible { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); text-decoration: none; }
.icon-link svg { width: 20px; height: 20px; }
.portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 28px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.portrait::before { content: ""; position: absolute; inset: 14px -14px -14px 14px; border-radius: 28px; border: 1.5px solid var(--accent); opacity: .55; z-index: -1; }

@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { justify-self: start; width: auto; order: -1; align-items: flex-start; gap: 18px; }
  .hero-side .portrait { width: 180px; }
  .icon-link { width: 42px; height: 42px; }
  .portrait img { border-radius: 22px; }
}

/* ---------- Stats ---------- */
/* 1px gaps over a line-coloured background draw the dividers, so any number of columns/rows stays tidy */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: clamp(36px, 6vw, 64px); box-shadow: var(--shadow); }
.stat { padding: 18px 20px; background: var(--surface); }
.stat b { display: block; font-family: var(--display); font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .86rem; line-height: 1.3; display: block; margin-top: 2px; }
.stat.hero-stat b { color: var(--accent); }
@media (max-width: 960px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat { padding: 16px 18px; } }

/* ---------- Skill tags under the stats ---------- */
.skills { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.skills li { font-size: .88rem; font-weight: 500; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color .2s, background .2s, color .2s; }
.skills li:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- Sections ---------- */
section { padding: clamp(52px, 8vw, 96px) 0; }
section + section { border-top: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: 250px 1fr; gap: 24px; margin-bottom: 36px; align-items: baseline; }
.kicker { font-family: var(--mono); font-size: clamp(1.05rem, 2.2vw, 1.35rem); font-weight: 600; letter-spacing: .06em; line-height: 1.25; text-transform: uppercase; color: var(--accent); }
h2 { font-family: var(--display); font-size: clamp(1.7rem, 3.6vw, 2.5rem); letter-spacing: -.025em; line-height: 1.12; margin: 0; max-width: 24ch; }
h3 { font-family: var(--display); font-size: 1.15rem; letter-spacing: -.01em; margin: 0 0 6px; line-height: 1.3; }
@media (max-width: 800px) { .sec-head { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- Research cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card .num { font-family: var(--mono); font-size: .78rem; color: var(--accent); letter-spacing: .08em; }
.card p { color: var(--muted); margin: 8px 0 14px; font-size: .98rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--chip); color: var(--muted); border: 1px solid var(--line); }
@media (max-width: 700px) { .cards { grid-template-columns: 1fr; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(28px, 6vw, 64px); }
.about-grid p { margin: 0 0 1em; }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; align-self: start; }
.facts h3 { font-size: .8rem; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.facts dl { margin: 0; display: grid; gap: 14px; }
.facts dt { font-size: .82rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 550; }
.callout { margin-top: 28px; padding: 18px 22px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); font-size: .98rem; }
.callout b { font-family: var(--display); }
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } }

/* ---------- Publications ---------- */
.tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; position: sticky; top: 62px; z-index: 10; padding: 14px 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.search { flex: 1 1 260px; position: relative; }
.search input { width: 100%; font: inherit; font-size: .97rem; padding: 11px 16px 11px 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { appearance: none; font: inherit; font-size: .88rem; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.result-count { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin: 6px 0 18px; }
.year-group { display: grid; grid-template-columns: 100px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.year { font-family: var(--display); font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; color: var(--muted); line-height: 1.2; }
.pubs { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.pub .badge { display: inline-block; font-family: var(--mono); font-size: .68rem; letter-spacing: .07em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); margin-right: 8px; vertical-align: 2px; }
.pub .t { font-weight: 600; line-height: 1.4; }
.pub .badge.auto { background: transparent; border: 1px dashed var(--muted); color: var(--muted); }
.pub .tlink { color: inherit; text-decoration-color: var(--line); }
.pub .tlink:hover { color: var(--accent); text-decoration-color: var(--accent); }
.pub .a { color: var(--muted); font-size: .95rem; margin-top: 3px; }
.pub .a mark { background: none; color: var(--ink); font-weight: 650; }
.pub .v { color: var(--muted); font-size: .93rem; font-style: italic; }
.pub .v span { font-style: normal; }
 .sorter { margin-left: auto; }
.sorter .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pubs.flat { border-top: 1px solid var(--line); padding-top: 22px; }
.pub.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.pub-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 104px; text-align: right; }
.pub-side .py { font-family: var(--display); font-weight: 700; font-size: 1.2rem; line-height: 1; letter-spacing: -.01em; color: var(--muted); font-variant-numeric: tabular-nums; }
.pub-side .cites { margin: 0; }
.pub-side .cites.zero { background: var(--chip); color: var(--muted); }
@media (max-width: 600px) { .pub.row { grid-template-columns: 1fr; gap: 8px; } .pub-side { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; } .sorter { margin-left: 0; } }
.empty { padding: 40px 0; color: var(--muted); text-align: center; border-top: 1px solid var(--line); }
.scholar-note { margin-top: 24px; color: var(--muted); font-size: .95rem; }
@media (max-width: 700px) { .year-group { grid-template-columns: 1fr; gap: 8px; } .tools { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* ---------- Projects ---------- */
.project { display: grid; grid-template-columns: 1.25fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.proj-main { padding: clamp(24px, 4vw, 44px); }
.proj-meta { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #1f9d63; box-shadow: 0 0 0 4px color-mix(in srgb, #1f9d63 22%, transparent); }
.project h3 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); letter-spacing: -.03em; line-height: 1; margin: 14px 0 6px; }
.proj-sub { color: var(--accent); font-weight: 600; margin: 0 0 16px; }
.proj-main p { color: var(--muted); }
.proj-main .cta { margin-top: 22px; }
.proj-papers { padding: clamp(24px, 4vw, 40px); background: var(--accent-soft); border-left: 1px solid var(--line); }
.proj-papers[hidden] { display: none; }
.proj-papers h4 { font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 16px; }
.proj-list { margin: 0; padding-left: 1.25em; display: grid; gap: 16px; }
.proj-list li::marker { color: var(--accent); font-weight: 700; }
.proj-list a { color: inherit; font-weight: 600; line-height: 1.4; }
.proj-list a::after { content: " \2197"; font-size: .8em; color: var(--muted); }
.proj-list .m { color: var(--muted); font-size: .86rem; margin-top: 3px; }
.proj-list mark { background: none; color: var(--ink); font-weight: 650; }
.proj-fund { color: var(--muted); font-size: .84rem; margin: 14px 0 0; max-width: 90ch; }
@media (max-width: 860px) { .project { grid-template-columns: 1fr; } .proj-papers { border-left: 0; border-top: 1px solid var(--line); } }
.req-row { margin-top: 8px; }
.reqpdf { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid transparent; border-radius: 999px; padding: 3px 11px; text-decoration: none; }
.reqpdf:hover, .reqpdf:focus-visible { border-color: var(--accent); }
.pub .tlink::after { content: " \2197"; font-size: .8em; color: var(--muted); font-weight: 400; }

/* ---------- Citation tracker ---------- */
.cite[hidden] { display: none; }
.cite { display: grid; grid-template-columns: auto 1fr; gap: 12px 40px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 20px; box-shadow: var(--shadow); }
.cite-nums { display: flex; gap: 36px; }
.cite-nums b { display: block; font-family: var(--display); font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cite-nums span { color: var(--muted); font-size: .88rem; }
.cite-chart { display: flex; align-items: flex-end; gap: 6px; height: 84px; }
.cite-bar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; }
.cite-bar i { display: block; width: 100%; max-width: 34px; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .85; min-height: 2px; }
.cite-bar:hover i { opacity: 1; }
.cite-bar span { font-family: var(--mono); font-size: .64rem; color: var(--muted); }
.cite-note { grid-column: 1 / -1; margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.cites { display: inline-block; font-family: var(--mono); font-size: .74rem; color: var(--accent); background: var(--accent-soft); padding: 1px 8px; border-radius: 999px; margin-left: 8px; font-style: normal; white-space: nowrap; }
@media (max-width: 760px) { .cite { grid-template-columns: 1fr; } .cite-nums { gap: 24px; } }

/* ---------- People ---------- */
.people-group + .people-group { margin-top: 44px; }
.people-group > h3 { font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 16px; display: flex; align-items: baseline; gap: 12px; }
.people-group > h3 small { font-size: .78rem; letter-spacing: 0; text-transform: none; font-family: var(--sans); font-weight: 400; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.05rem; background: var(--accent-soft); color: var(--accent); letter-spacing: .02em; }
img.avatar.photo { object-fit: cover; background: var(--chip); border: 1px solid var(--line); }
/* ---------- People: photo + name + logo tiles; hover or focus expands the card with the full affiliation ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.pcell { position: relative; height: 226px; }
.person { position: absolute; top: 0; left: 0; right: 0; min-height: 100%; box-sizing: border-box; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 18px 12px 14px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; outline: none; transition: left .22s ease, right .22s ease, box-shadow .22s ease, border-color .22s ease; }
.person:hover, .person:focus-visible, .person:focus-within { z-index: 20; left: -14px; right: -14px; border-color: var(--accent); box-shadow: 0 18px 44px rgba(10, 14, 30, .22); }
.person .avatar, .person img.avatar.photo { width: 84px; height: 84px; font-size: 1.45rem; }
.person h4 { margin: 0; min-height: 2.5em; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: .96rem; line-height: 1.25; letter-spacing: -.005em; }
.org-logo { flex: none; display: block; width: 116px; height: 46px; box-sizing: border-box; object-fit: contain; background: #fff; border-radius: 9px; padding: 6px 10px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.org-text { flex: none; width: 116px; min-height: 46px; box-sizing: border-box; display: grid; place-items: center; padding: 4px 8px; border-radius: 9px; border: 1px dashed var(--line); color: var(--muted); font-size: .72rem; line-height: 1.25; }
.p-more { display: grid; grid-template-rows: 0fr; width: 100%; transition: grid-template-rows .25s ease; }
.p-more-in { overflow: hidden; min-height: 0; }
.person:hover .p-more, .person:focus-visible .p-more, .person:focus-within .p-more { grid-template-rows: 1fr; }
.person .aff { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 0; padding: 9px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); line-height: 1.35; }
.person .aff .pos { font-weight: 700; font-size: .86rem; }
.person .aff .inst { font-weight: 500; font-size: .75rem; opacity: .95; }
.li-badge { position: absolute; top: 9px; right: 9px; width: 22px; height: 22px; border-radius: 5px; background: #0a66c2; color: #fff; font: 700 .72rem/22px var(--sans); text-align: center; letter-spacing: -.02em; opacity: .85; }
.person:hover .li-badge, .person:focus-visible .li-badge { opacity: 1; }
.person:focus-visible { box-shadow: 0 0 0 3px var(--accent), 0 18px 44px rgba(10, 14, 30, .22); }
/* Touch screens have no hover: show everything, in a plain grid */
@media (hover: none) {
  .people-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .pcell { height: auto; }
  .person { position: relative; left: 0 !important; right: 0 !important; min-height: 0; height: 100%; }
  .p-more { grid-template-rows: 1fr; }
}
@media (max-width: 420px) { .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .org-logo, .org-text { width: 100%; max-width: 116px; } }
@media (prefers-reduced-motion: reduce) { .person, .p-more { transition: none; } }
.people-summary { color: var(--muted); font-size: .95rem; margin: 0 0 18px; max-width: 70ch; }
details.all-authors { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.all-authors summary { cursor: pointer; padding: 14px 20px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.all-authors summary::-webkit-details-marker { display: none; }
details.all-authors summary::after { content: "+"; font-family: var(--mono); color: var(--muted); }
details.all-authors[open] summary::after { content: "–"; }
.author-list { list-style: none; margin: 0; padding: 4px 20px 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.author-list li { font-size: .88rem; padding: 3px 10px; border-radius: 999px; background: var(--chip); border: 1px solid var(--line); color: var(--muted); }
.author-list li b { color: var(--ink); font-weight: 600; font-family: var(--mono); font-size: .72rem; margin-left: 6px; }

/* ---------- Testimonials ---------- */
.testi-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(20px, 4vw, 40px); align-items: start; }
.testi-grid > * { min-width: 0; }
@media (max-width: 900px) { .testi-grid { grid-template-columns: minmax(0, 1fr); } }

.slider { position: relative; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; border-radius: var(--radius); }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; }
.quote-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(28px, 4vw, 44px); min-height: 300px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; box-shadow: var(--shadow); margin: 0; }
.quote-card::before { content: "\201C"; position: absolute; top: 6px; left: 22px; font-family: Georgia, "Times New Roman", serif; font-size: 6rem; line-height: 1; color: var(--accent); opacity: .25; pointer-events: none; }
.quote-card blockquote { margin: 18px 0 0; font-family: var(--display); font-size: clamp(1.1rem, 2.2vw, 1.4rem); line-height: 1.5; letter-spacing: -.01em; }
.quote-card figcaption { display: flex; align-items: center; gap: 14px; }
.quote-card .who b { display: block; font-family: var(--display); }
.quote-card .who span { color: var(--muted); font-size: .9rem; }
.sample-tag { align-self: flex-start; font-family: var(--mono); font-size: .68rem; letter-spacing: .07em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: var(--chip); border: 1px dashed var(--muted); color: var(--muted); }
.slider-ui { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.slider-ui[hidden], svg[hidden] { display: none; }
.dots { display: flex; gap: 8px; flex: 1; justify-content: center; flex-wrap: wrap; }
.dot-btn { appearance: none; border: 0; padding: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--line); cursor: pointer; transition: transform .2s, background .2s; }
.dot-btn:hover { background: var(--muted); }
.dot-btn[aria-selected="true"] { background: var(--accent); transform: scale(1.3); }
.slides-empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: clamp(28px, 4vw, 44px); min-height: 300px; display: grid; place-content: center; text-align: center; gap: 8px; color: var(--muted); }
.slides-empty b { font-family: var(--display); font-size: 1.2rem; color: var(--ink); }
.slides-empty p { margin: 0; max-width: 40ch; }

.testi-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3vw, 32px); }
.testi-form h3 { font-size: 1.35rem; margin-bottom: 8px; }
.form-lede { color: var(--muted); margin: 0 0 20px; font-size: .96rem; }
.field { margin-bottom: 16px; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field.two { grid-template-columns: 1fr; } }
.testi-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.testi-form label small { font-weight: 400; color: var(--muted); }
.testi-form input[type="text"], .testi-form select, .testi-form textarea { width: 100%; font: inherit; font-size: .97rem; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.testi-form textarea { resize: vertical; min-height: 120px; }
.testi-form input:focus, .testi-form select:focus, .testi-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.testi-form .invalid { border-color: #c2410c; }
.count { text-align: right; font-family: var(--mono); font-size: .74rem; color: var(--muted); margin-top: 4px; }
.testi-form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .92rem; color: var(--muted); margin: 4px 0 20px; cursor: pointer; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.form-actions .btn { cursor: pointer; font: inherit; font-weight: 600; font-size: .97rem; }
.form-status { margin: 14px 0 0; min-height: 1.4em; font-size: .92rem; color: var(--muted); }
.form-status.ok { color: #1f9d63; }
.btn[hidden] { display: none; }
.my-status { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--ink); font-size: .92rem; }
.my-status[hidden] { display: none; }
.pending-note { margin: 14px 2px 0; font-size: .82rem; color: var(--muted); }
.pending-note[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status.err { color: #c2410c; }

/* ---------- Timeline ---------- */
.timeline { display: grid; gap: 0; }
.entry { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 24px 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; padding-top: 0; }
.when { font-family: var(--mono); font-size: .84rem; color: var(--muted); padding-top: 3px; }
.entry .org { color: var(--muted); font-size: .98rem; margin: 0 0 8px; }
.entry p { margin: 0 0 8px; color: var(--muted); font-size: .98rem; }
.entry p b { color: var(--ink); font-weight: 600; }
.entry.current .when::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1f9d63; margin-right: 8px; }
.sub { margin-top: 14px; display: grid; gap: 10px; border-left: 2px solid var(--line); padding-left: 16px; }
.sub div { font-size: .96rem; }
.sub .st { font-weight: 600; }
.sub .sd { color: var(--muted); font-family: var(--mono); font-size: .78rem; display: block; }
@media (max-width: 700px) { .entry { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- Two-column lists ---------- */
.cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel h3 { margin-bottom: 14px; }
.panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.panel li { font-size: .98rem; }
.panel li small { display: block; color: var(--muted); font-size: .88rem; }
.panel li .yr { font-family: var(--mono); color: var(--accent); font-size: .78rem; margin-right: 6px; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } }
.mt { margin-top: 16px; }

/* ---------- Contact / footer ---------- */
.contact-box { background: var(--ink); color: var(--bg); border-radius: 24px; padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: end; }
.contact-box h2 { color: var(--bg); max-width: 16ch; }
.contact-box p { margin: 14px 0 0; opacity: .75; max-width: 46ch; }
.contact-links { display: grid; gap: 10px; }
.contact-links a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--bg) 25%, transparent); color: var(--bg); text-decoration: none; font-weight: 550; }
.contact-links a:hover { background: color-mix(in srgb, var(--bg) 12%, transparent); }
.contact-links small { opacity: .6; font-weight: 400; font-family: var(--mono); font-size: .78rem; }
@media (max-width: 800px) { .contact-box { grid-template-columns: 1fr; } }
footer { padding: 40px 0 56px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
footer .ack { max-width: 90ch; margin: 0 0 14px; }
footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .card { transition: none; }
}
@media print {
  .nav, .tools, .hero::before, .hero::after, .menu-btn { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  body { font-size: 12pt; }
}


/* ---------- Testimonial: call-to-action card and the preview window ---------- */
.testi-cta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3vw, 32px); }
.testi-cta h3 { font-size: 1.35rem; margin-bottom: 8px; }
.testi-cta .btn { cursor: pointer; font: inherit; font-weight: 600; font-size: .97rem; display: inline-flex; align-items: center; gap: 8px; }
.testi-dialog { width: min(94vw, 680px); max-height: 92vh; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); overflow: auto; margin: auto; }
.testi-dialog:not([open]) { display: none; }
.testi-dialog::backdrop { background: rgba(8, 10, 16, .62); backdrop-filter: blur(3px); }
body.modal-open { overflow: hidden; }
.testi-dialog .testi-form { background: none; border: 0; border-radius: 0; padding: clamp(18px, 3vw, 28px); }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.dlg-head h3 { font-size: 1.3rem; margin: 0 0 2px; }
.dlg-sub { margin: 0; color: var(--muted); font-size: .9rem; }
.dlg-close { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.dlg-close:hover { border-color: var(--accent); color: var(--accent); }
.testi-form .quote-card.preview { min-height: 0; gap: 14px; padding: clamp(22px, 3.5vw, 34px); margin-bottom: 16px; }
.preview .rel-pick { margin-left: 44px; align-self: flex-start; max-width: calc(100% - 44px); }
.testi-form .preview select { width: auto; max-width: 100%; font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; padding: 6px 30px 6px 12px; border-radius: 999px; background-color: var(--accent-soft); color: var(--accent); border: 1px dashed var(--accent); cursor: pointer; }
.preview .pv-text { margin-top: 2px; }
.testi-form .preview textarea { display: block; width: 100%; min-height: 150px; padding: 8px 0; border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; background: transparent; box-shadow: none; color: var(--ink); font-family: var(--display); font-size: clamp(1.05rem, 2vw, 1.3rem); line-height: 1.5; letter-spacing: -.01em; resize: vertical; }
.testi-form .preview textarea::placeholder, .testi-form .preview .who input::placeholder { color: var(--muted); opacity: .75; }
.testi-form .preview textarea::placeholder { letter-spacing: .06em; font-family: var(--mono); font-size: .9rem; }
.testi-form .preview textarea:focus, .testi-form .preview .who input:focus { outline: none; border-bottom: 1px solid var(--accent); box-shadow: none; }
.preview .count { text-align: right; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.preview figcaption { align-items: flex-start; }
.preview .who { flex: 1; min-width: 0; display: grid; gap: 6px; }
.dash-row { display: flex; align-items: baseline; gap: 8px; }
.dash { color: var(--muted); }
.testi-form .preview .who input[type="text"] { flex: 1; min-width: 0; width: 100%; padding: 3px 0; border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; background: transparent; box-shadow: none; color: var(--ink); font: inherit; font-size: .92rem; }
.testi-form .preview .who input.nm { font-family: var(--display); font-weight: 700; font-size: 1rem; }
.testi-form .preview input.invalid, .testi-form .preview textarea.invalid { border-bottom-color: #c2410c; }
.testi-form .preview select.invalid { border-color: #c2410c; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.form-actions .btn.ghost:hover { color: var(--ink); }
@media (max-width: 560px) { .testi-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: auto; border-radius: 16px 16px 0 0; margin: auto 0 0; } .preview .rel-pick { margin-left: 36px; } }
@media (max-width: 560px) {
  .preview figcaption { gap: 10px; }
  .preview figcaption .avatar { width: 40px; height: 40px; font-size: .9rem; }
  .testi-form .preview .who input[type="text"] { font-size: .8rem; }
  .testi-form .preview .who input.nm { font-size: .76rem; letter-spacing: -.01em; }
  .testi-form .quote-card.preview { padding: 20px 16px; }
}


/* ---------- Free-text relation and optional photo in the testimonial card ---------- */
.testi-form .preview .rel-pick input[type="text"] { width: 100%; font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); border: 1px dashed var(--accent); }
.testi-form .preview .rel-pick input[type="text"]::placeholder { color: var(--accent); opacity: .75; }
.testi-form .preview .rel-pick input[type="text"]:focus { outline: none; border-style: solid; box-shadow: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.photo-pick { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; text-align: center; }
.photo-pick.no-photo { width: auto; }
.photo-pick.no-photo .photo-hint, .photo-pick.no-photo .cam, .photo-pick.no-photo .photo-clear { display: none; }
.avatar-btn { position: relative; display: block; cursor: pointer; border-radius: 50%; }
.avatar-btn .avatar[hidden], .avatar-btn img[hidden] { display: none; }
.avatar-btn .cam { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border: 2px solid var(--surface); }
.avatar-btn:hover .avatar, .photo-pick input:focus-visible ~ .avatar-btn .avatar { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-pick input:focus-visible + .photo-clear { outline: none; }
.photo-hint { font-size: .72rem; line-height: 1.2; color: var(--muted); }
.photo-hint[hidden], .photo-clear[hidden] { display: none; }
.photo-hint small { display: block; font-size: .68rem; }
.photo-clear { appearance: none; border: 0; background: none; padding: 0; font: inherit; font-size: .72rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
.photo-clear:hover { color: #c2410c; }
.preview figcaption .avatar-btn img.avatar.photo { width: 56px; height: 56px; }
@media (max-width: 560px) { .photo-pick { width: 64px; } .preview figcaption .avatar-btn img.avatar.photo { width: 40px; height: 40px; } }
.preview .rel-pick { align-self: stretch; }


/* ---------- Logos in the experience timeline ---------- */
.entry .has-ico { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; align-items: start; }
.org-ico { display: block; width: 96px; height: 58px; box-sizing: border-box; object-fit: contain; background: #fff; border-radius: 11px; padding: 7px 9px; box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 700px) { .entry .has-ico { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; } .org-ico { width: 72px; height: 46px; padding: 5px 7px; } }


/* ---------- Signature intro (only when <html> carries .intro: set once per session for outside visitors) ----------
   The page underneath is the real, live page: visible from the first frame through a frosted-glass overlay, and it scrolls as usual
   (the overlay ignores the pointer). The signature writes itself on the glass (S, w, triangle; 0.35s-3.08s, timed inside the SVG file).
   When the file has loaded JS adds .go: at 3.18s (0.1s after the last stroke) the signature starts to zoom out and fade;
   at 3.6s, once it is already receding, the glass starts to lose its tint and blur (done at 6.0s). The header, which has its
   own blur and so cannot be frosted by the glass, is blurred and washed out in step with it. */
#intro { display: none; }
.intro #intro { display: grid; place-items: center; position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
#intro .glass { position: absolute; inset: -90px; background: var(--bg); opacity: .8; -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2); }
#intro img { position: relative; width: min(62vw, 440px); height: auto; will-change: transform, opacity; }
[data-theme="dark"] #intro img { filter: invert(1) hue-rotate(180deg) brightness(.95); }
.intro #intro.go .glass { animation: introClear 2.4s linear 3.6s forwards; }
.intro #intro.go img { animation: introRecede 1.2s cubic-bezier(.5, 0, .75, .4) 3.18s forwards; }
.intro #intro.skip { animation: introOut .35s ease forwards; }
.intro .nav { filter: blur(18px); opacity: .55; transition: filter .3s ease, opacity .3s ease; }
.intro #intro.go ~ .nav { animation: introNav 2.4s linear 3.6s forwards; }
.intro #intro.skip ~ .nav { animation: none; filter: none; opacity: 1; }
@keyframes introNav { to { filter: blur(0); opacity: 1; } }
@keyframes introRecede { 0% { transform: scale(1); opacity: 1; } 65% { opacity: .2; } 100% { transform: scale(.45); opacity: 0; } }
@keyframes introClear {
  0%   { opacity: .8; -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2); }
  50%  { opacity: .42; -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1); }
  100% { opacity: 0;   -webkit-backdrop-filter: blur(0) saturate(1);      backdrop-filter: blur(0) saturate(1); }
}
@keyframes introOut { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { #intro { display: none !important; } }
