/* ==========================================================
   justin-js-ma.github.io — shared styles
   ========================================================== */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --ink: #0e1116;
  --muted: #5b6270;
  --faint: #8a909b;
  --line: #e6e5e0;
  --accent: #2f47d0;
  --accent-soft: #eef0fc;
  --warm: #974712;
  --warm-soft: #fbeee2;
  --nav-bg: rgba(250, 250, 248, 0.82);
  --radius: 16px;
  --maxw: 1160px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="dark"] {
  --bg: #0c0f14;
  --surface: #131821;
  --ink: #e9ecf2;
  --muted: #a0a8b6;
  --faint: #7a8392;
  --line: #242b37;
  --accent: #9aa9ff;
  --accent-soft: #1b2242;
  --warm: #f1b27c;
  --warm-soft: #32231a;
  --nav-bg: rgba(12, 15, 20, 0.82);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f14;
    --surface: #131821;
    --ink: #e9ecf2;
    --muted: #a0a8b6;
    --faint: #7a8392;
    --line: #242b37;
    --accent: #9aa9ff;
    --accent-soft: #1b2242;
    --warm: #f1b27c;
    --warm-soft: #32231a;
    --nav-bg: rgba(12, 15, 20, 0.82);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
p a, li a, .text-link { color: var(--accent); }
p a:hover, li a:hover, .text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { font-weight: 600; }
.mono { font-family: var(--mono); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-nav .container { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; margin-right: auto; white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}
.brand:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: 8px; font-size: 15px; color: var(--muted); }
.nav-links a:hover { color: var(--ink); background: var(--accent-soft); }
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-links a.active::after { content: ""; display: block; height: 2px; margin-top: 2px; border-radius: 2px; background: var(--accent); }
.nav-cv { padding: 8px 14px !important; border: 1px solid var(--line); color: var(--ink) !important; }
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.theme-toggle:hover { background: var(--accent-soft); }
.theme-toggle svg { width: 17px; height: 17px; }

/* ---------- Common blocks ---------- */
.eyebrow { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink); background: var(--surface);
}
.chip-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .chip-accent { color: #0c0f14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip-accent { color: #0c0f14; } }
.badge { align-self: flex-start; display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--warm-soft); color: var(--warm); font-size: 12px; font-weight: 600; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px;
  font-size: 15px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.btn:hover { color: var(--ink); border-color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-primary:hover { color: var(--bg); opacity: 0.88; }
.btn svg, .icon-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Home: hero ---------- */
.hero { padding: 88px 0 56px; }
.hero .container { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 72px; align-items: center; }
.hero h1 { margin: 18px 0 20px; font-size: clamp(44px, 6.4vw, 76px); line-height: 1; letter-spacing: -0.035em; font-weight: 700; }
.hero h1 .phd { color: var(--faint); font-weight: 500; }
.hero-role { font-size: 19px; font-weight: 600; margin: 0; }
.hero-org { font-size: 16px; color: var(--muted); margin: 2px 0 22px; }
.hero-lead { font-size: 18px; line-height: 1.7; color: var(--muted); max-width: 640px; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.icon-link {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.icon-link:hover { border-color: var(--ink); color: var(--ink); }
.hero-photo { position: relative; }
.hero-photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 22px; }
.hero-photo .status {
  position: absolute; left: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 999px; background: rgba(10, 13, 18, 0.74); color: #fff; font-size: 13px; font-weight: 500;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25); }

/* ---------- Home: stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 26px 24px 26px 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat-num { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat-label { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* ---------- Home: sections ---------- */
.section { padding: 96px 0 0; }
.section-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; }
.section-head { position: sticky; top: 100px; align-self: start; }
.section-head .num { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.section-head h2 { margin: 8px 0 10px; font-size: 32px; line-height: 1.1; letter-spacing: -0.02em; }
.section-head p { margin: 0; font-size: 15px; color: var(--muted); }
.section-head .text-link { display: inline-block; margin-top: 14px; font-size: 15px; font-weight: 600; }

/* Research */
.research-intro { font-size: 18px; line-height: 1.75; margin: 0 0 28px; }
.figure { padding: 14px; margin: 0 0 20px; }
.figure img { border-radius: 10px; width: 100%; background: #fff; }
.figure figcaption { font-size: 13px; color: var(--faint); padding: 12px 4px 0; }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.theme h3 { font-size: 17.5px !important; }
.theme { padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.theme-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.theme-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.theme-icon svg { width: 20px; height: 20px; }
.theme-when { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.theme h3 { margin: 4px 0 0; font-size: 19px; letter-spacing: -0.01em; }
.theme p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.65; }
.theme .result { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13.5px; color: var(--ink); }
.theme .result span { font-family: var(--mono); font-size: 11.5px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 6px; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 36px 40px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line);
}
.tl-item.current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-when { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.tl-item.current .tl-when { color: var(--accent); }
.tl-title { margin: 4px 0 2px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.tl-role { font-size: 16px; }
.tl-meta { font-size: 14px; color: var(--muted); margin-top: 2px; }
.tl-points { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.tl-points li { margin: 5px 0; }
.tl-points li::marker { color: var(--faint); }
.tl-sub { margin-top: 14px; padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tl-sub + .tl-sub { margin-top: 10px; }
.tl-sub-title { font-weight: 600; font-size: 15px; }
.tl-sub-meta { font-size: 13px; color: var(--faint); font-family: var(--mono); }
.tl-sub p { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); }

/* Education */
.edu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.edu-item { padding: 22px; }
.edu-item .when { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.edu-item .deg { font-size: 22px; font-weight: 700; margin-top: 6px; }
.edu-item .school { font-size: 15px; }
.edu-item .lab { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* Publications (home) */
.pubs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pub { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.pub:hover { border-color: var(--ink); color: var(--ink); }
.pub-title { font-size: 17.5px; font-weight: 600; line-height: 1.45; }
.pub-authors { font-size: 14px; color: var(--muted); }
.pub-venue { margin-top: auto; font-size: 13.5px; color: var(--faint); font-family: var(--mono); }

/* Talks, service, honors */
.talk { padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; }
.talk-title { font-size: 18px; font-weight: 600; line-height: 1.4; }
.talk p { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); }
.talk .when { font-family: var(--mono); font-size: 13px; color: var(--faint); white-space: nowrap; }
.sub-h { font-size: 13px; font-family: var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin: 36px 0 14px; }
.reviews { display: flex; flex-wrap: wrap; gap: 8px; }
.reviews .chip { background: var(--surface); }
.reviews .chip em { font-style: normal; color: var(--faint); font-family: var(--mono); font-size: 12px; }
.honors { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.honors li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.honors .h-title { font-weight: 500; }
.honors .h-org { display: block; font-size: 14px; color: var(--muted); }
.honors .h-year { font-family: var(--mono); font-size: 13px; color: var(--faint); padding-top: 2px; white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 120px; border-top: 1px solid var(--line); }
.footer-cta { padding: 64px 0 48px; display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.footer-cta h2 { margin: 0; font-size: clamp(32px, 4.6vw, 52px); line-height: 1.05; letter-spacing: -0.03em; }
.footer-cta h2 span { color: var(--accent); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0 36px; font-size: 13px; color: var(--faint); border-top: 1px solid var(--line); flex-wrap: wrap; }
.hits { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.hits img { height: 16px; }

/* ---------- Inner pages (Bio / Research / Publications) ---------- */
.page { padding: 72px 0 0; }
.page-header { margin-bottom: 44px; }
.page-header h1, .page h1 { margin: 10px 0 12px; font-size: clamp(38px, 5vw, 56px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; }
.page-header p { margin: 0; font-size: 17px; color: var(--muted); max-width: 760px; }
.page .lead { font-size: 18px; line-height: 1.75; color: var(--muted); max-width: 860px; }
.page .section { padding: 56px 0 0; }
.page .section > h2, .page .section h2 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.page h3 { font-size: 20px; margin: 44px 0 14px; letter-spacing: -0.01em; }
.page p { max-width: 860px; }

/* Bio */
.bio-body { max-width: 860px; }
.bio-body .profile-pic { float: right; width: 280px; margin: 6px 0 24px 36px; border-radius: 18px; aspect-ratio: 4 / 5; object-fit: cover; }
.bio-body p { font-size: 17px; line-height: 1.8; color: var(--ink); margin: 0 0 20px; }
.back { margin-top: 40px; }
.back a { color: var(--accent); font-weight: 600; }

/* Research page */
.overview-img { width: 100%; border-radius: 14px; border: 1px solid var(--line); background: #fff; padding: 10px; margin: 8px 0 28px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid .card { padding: 26px; }
.grid .card h3 { margin: 0 0 10px; font-size: 19px; }
.grid .card p { margin: 0; font-size: 15.5px; color: var(--muted); line-height: 1.7; }
.bullets { padding-left: 20px; }
.bullets li { margin: 8px 0; }
.note { color: var(--faint); font-size: 14px; }

/* Publications page */
.ordered { margin: 0; padding: 0; list-style: none; counter-reset: pub; }
.ordered li {
  counter-increment: pub; position: relative; padding: 16px 0 16px 52px; border-bottom: 1px solid var(--line);
  font-size: 15.5px; line-height: 1.65;
}
.ordered li::before {
  content: counter(pub, decimal-leading-zero); position: absolute; left: 0; top: 18px;
  font-family: var(--mono); font-size: 12.5px; color: var(--faint);
}
.me { font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.journal-name { font-style: italic; font-weight: 600; }
.tag { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-left: 4px; vertical-align: 1px; }
.link-btn { font-size: 13.5px; font-weight: 600; color: var(--accent); margin-left: 4px; }
.pub-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .hero-photo { max-width: 360px; order: -1; }
  .hero-photo img { aspect-ratio: 1 / 1; object-position: 50% 12%; }
  .section-grid { grid-template-columns: 1fr; gap: 24px; }
  .section-head { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .site-nav .container { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; gap: 8px; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; gap: 0; margin: 0 -8px; }
  .nav-links a { font-size: 14px; padding: 6px 8px; white-space: nowrap; }
  .hero { padding: 40px 0 40px; }
  .hero-photo { max-width: 240px; }
  .hero-photo .status { font-size: 12px; padding: 6px 10px; left: 10px; bottom: 10px; }
  .hero-lead { font-size: 16.5px; }
  .themes, .pubs, .edu, .grid { grid-template-columns: 1fr; }
  .section { padding-top: 72px; }
  .talk { grid-template-columns: 1fr; }
  .bio-body .profile-pic { float: none; width: 100%; max-width: 320px; margin: 0 0 24px; }
  .ordered li { padding-left: 40px; }
  .stat-num { font-size: 28px; }
}

/* ---------- Publications: card list ---------- */
.pub-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; position: sticky; top: 68px; z-index: 5; padding: 12px 0; background: var(--bg); }
.filter {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.filter span { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.filter:hover { color: var(--ink); border-color: var(--ink); }
.filter.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter.is-active span { color: var(--bg); opacity: 0.7; }
.filter--ext { margin-left: auto; color: var(--accent); }
.pub-group { padding-top: 40px; }
.pub-group[hidden] { display: none; }
.pub-group-title { display: flex; align-items: baseline; gap: 10px; font-size: 22px !important; margin: 0 0 16px !important; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.pub-group-title span { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--faint); }
.pubcard {
  display: grid; grid-template-columns: 148px minmax(0, 1fr) 88px; gap: 24px; align-items: center;
  padding: 18px 22px 18px 18px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.pubcard:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-1px); box-shadow: 0 6px 22px -14px rgba(20, 30, 80, 0.35); }
.pubcard[hidden] { display: none; }
.pubcard--compact { grid-template-columns: minmax(0, 1fr) 88px; padding: 16px 22px; }
.pub-thumb {
  position: relative; height: 104px; border-radius: 11px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 12px; color: var(--accent); background: var(--accent-soft);
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--accent) 22%, transparent) 1px, transparent 0);
  background-size: 10px 10px;
}
.pub-thumb svg { width: 26px; height: 26px; }
.pub-thumb span { font-family: var(--mono); font-size: 11px; line-height: 1.35; color: var(--ink); opacity: 0.8; }
.pub-thumb--optics { color: #b4532a; background-color: #fbefe6; background-image: radial-gradient(circle at 1px 1px, rgba(180, 83, 42, 0.18) 1px, transparent 0); }
.pub-thumb--matter { color: #1f7a5c; background-color: #e7f4ee; background-image: radial-gradient(circle at 1px 1px, rgba(31, 122, 92, 0.18) 1px, transparent 0); }
.pub-thumb--plain { color: var(--muted); background-color: var(--bg); background-image: none; border: 1px dashed var(--line); }
.pub-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
:root[data-theme="dark"] .pub-thumb--optics { background-color: #2c1d14; }
:root[data-theme="dark"] .pub-thumb--matter { background-color: #12261f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pub-thumb--optics { background-color: #2c1d14; }
  :root:not([data-theme="light"]) .pub-thumb--matter { background-color: #12261f; }
}
.pub-body { min-width: 0; }
.pub-name { margin: 0 0 6px !important; font-size: 17px !important; line-height: 1.4; letter-spacing: -0.005em; font-weight: 600; }
.pub-name .lang { font-weight: 400; color: var(--faint); font-size: 14px; }
.pub-by { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.pub-in { margin: 3px 0 0; font-size: 14px; color: var(--ink); }
.pub-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; }
.pill--status { background: var(--warm-soft); color: var(--warm); }
.pill--first { background: var(--accent-soft); color: var(--accent); }
.pill--link { border: 1px solid var(--line); color: var(--ink); font-family: var(--mono); font-weight: 500; text-transform: uppercase; font-size: 11px; }
.pill--link:hover { border-color: var(--accent); color: var(--accent); }
.pub-year { justify-self: end; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; color: color-mix(in srgb, var(--ink) 22%, transparent); font-variant-numeric: tabular-nums; }
.pub-empty { color: var(--faint); padding: 24px 0; }
@media (max-width: 720px) {
  .pubcard, .pubcard--compact { grid-template-columns: 1fr; gap: 6px; padding: 16px; }
  .pub-thumb { display: none; }
  .pub-year { order: -1; justify-self: start; font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--faint); letter-spacing: 0; }
  .filter--ext { margin-left: 0; }
  .pub-filters { top: 96px; }
}

/* ---------- Bio page ---------- */
.bio-header { margin-bottom: 48px; }
.bio-tagline { font-size: clamp(19px, 2.2vw, 23px) !important; line-height: 1.45; color: var(--muted); margin: 0 !important; letter-spacing: -0.01em; }
.bio-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 72px; align-items: start; }
.bio-aside { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 24px; }
.bio-photo { width: 100%; aspect-ratio: 4 / 5; height: auto; object-fit: cover; border-radius: 18px; }
.bio-facts { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.bio-facts div { padding-top: 14px; border-top: 1px solid var(--line); }
.bio-facts dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.bio-facts dd { margin: 0; font-size: 14.5px; line-height: 1.55; }
.bio-links { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.bio-links a { color: var(--accent); }
.bio-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bio-text { max-width: 660px; }
.bio-text p { font-size: 18px; line-height: 1.8; margin: 0 0 1.35em; max-width: none; }
.bio-text .bio-lead { font-size: 21px; line-height: 1.6; letter-spacing: -0.01em; color: var(--ink); }
.bio-text .bio-close { padding-top: 1.35em; border-top: 1px solid var(--line); color: var(--ink); font-weight: 500; }
@media (max-width: 980px) {
  .bio-layout { grid-template-columns: 1fr; gap: 36px; }
  .bio-aside { position: static; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px 24px; }
  .bio-aside .bio-photo { grid-row: span 2; }
  .bio-links { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .bio-header { margin-bottom: 32px; }
  .bio-aside { grid-template-columns: 112px minmax(0, 1fr); gap: 14px 16px; }
  .bio-aside .bio-photo { grid-row: span 1; border-radius: 12px; }
  .bio-facts { gap: 10px; }
  .bio-facts div:first-child { padding-top: 0; border-top: 0; }
  .bio-facts dd { font-size: 13.5px; }
  .bio-text p { font-size: 16.5px; line-height: 1.75; margin-bottom: 1.2em; }
  .bio-text .bio-lead { font-size: 18.5px; }
}
.pub-thumb.has-art { padding: 0; display: block; }
.pub-thumb .thumb-art { width: 100%; height: 100%; display: block; }

/* ---------- Home: research infographic ---------- */
.flow { padding: 28px; margin: 0 0 20px; display: flex; flex-direction: column; gap: 28px; }
.flow-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.flow-sub { font-size: 14px; color: var(--faint); }
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; counter-reset: none; }
.flow-step { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.flow-step:not(:last-child)::after {
  content: ""; position: absolute; top: 34px; right: -12px; width: 12px; height: 12px; z-index: 1;
  background: no-repeat center / 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 2l4 4-4 4' fill='none' stroke='%238a909b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.flow-step.is-now { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.flow-top { display: flex; justify-content: space-between; align-items: center; }
.flow-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); color: var(--accent); border: 1px solid var(--line); }
.flow-icon svg { width: 19px; height: 19px; }
.flow-num { font-family: var(--mono); font-size: 11.5px; color: var(--faint); letter-spacing: 0.04em; }
.flow-step.is-now .flow-num { color: var(--accent); font-weight: 500; }
.flow-step h3 { margin: 4px 0 0; font-size: 17px; letter-spacing: -0.01em; }
.flow-step p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.flow-proof { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line); font-family: var(--mono); font-size: 11px; line-height: 1.45; color: var(--ink); }

.spectrum { display: flex; flex-direction: column; gap: 10px; }
.spectrum-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.spectrum-track { position: relative; padding: 30px 0 26px; }
.spectrum-bar { position: relative; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); }
:root[data-theme="dark"] .spectrum-bar { filter: saturate(0.9) brightness(0.85); }
.spectrum-now {
  position: absolute; top: 0; height: 22px; border: 1.5px solid var(--accent); border-bottom: 0; border-radius: 8px 8px 0 0;
  display: flex; align-items: flex-start; justify-content: flex-start;
}
.spectrum-now em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent); background: var(--surface); padding: 0 6px; margin-left: 8px; transform: translateY(-9px); white-space: nowrap; }
.spectrum-dot {
  position: absolute; top: 25px; transform: translateX(-50%); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 10.5px; font-weight: 500; box-shadow: 0 0 0 3px var(--surface);
}
.spectrum-axis { position: relative; height: 16px; margin-top: 8px; }
.spectrum-axis span { position: absolute; transform: translateX(-50%); font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.spectrum-axis span:first-child { transform: none; }
.spectrum-axis span:last-child { transform: translateX(-100%); }
.spectrum-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.spectrum-legend li { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: start; }
.spectrum-legend b { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 10px; font-weight: 500; }

.flow-path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.flow-path em { font-style: normal; font-family: var(--mono); font-size: 11.5px; font-weight: 400; color: var(--faint); margin-left: 4px; }
.flow-path .arrow { color: var(--faint); }
.flow-path .is-now { color: var(--accent); }

@media (max-width: 980px) {
  .flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-step:nth-child(2)::after { display: none; }
}
@media (max-width: 720px) {
  .flow { padding: 18px; gap: 22px; }
  .flow-steps { grid-template-columns: 1fr; }
  .flow-step::after { display: none; }
  .spectrum-legend { grid-template-columns: 1fr; }
  .spectrum-axis span:nth-child(2), .spectrum-axis span:nth-child(5) { display: none; }
  .spectrum-now em { font-size: 10px; }
}

/* ---------- Stats: animated ---------- */
.stat { position: relative; overflow: hidden; }
.stat-num { font-variant-numeric: tabular-nums; font-size: clamp(38px, 4.4vw, 52px) !important; transition: color .6s ease; }
.stats.is-armed .stat-num { color: var(--accent); }
.stats.is-in .stat-num.done { color: var(--ink); }
.stat-sub { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 4px; letter-spacing: 0.02em; }
.stat-bar { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.stat + .stat .stat-bar { left: 24px; width: calc(100% - 24px); }
.stats.is-armed .stat-bar { transition: transform 1.4s cubic-bezier(.16, 1, .3, 1); }
.stats.is-in .stat-bar { transform: scaleX(1); }
.stats.is-in .stat:nth-child(2) .stat-bar { transition-delay: .14s; }
.stats.is-in .stat:nth-child(3) .stat-bar { transition-delay: .28s; }
.stats.is-in .stat:nth-child(4) .stat-bar { transition-delay: .42s; }
.stats:not(.is-armed) .stat-bar { transform: scaleX(1); opacity: .35; }

/* ---------- Original research figure ---------- */
.figure--hero { padding: 18px; }
.figure--hero img { border-radius: 12px; }
.figure--hero figcaption { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13.5px; color: var(--muted); padding: 14px 4px 2px; }
.figure--hero figcaption span { font-weight: 600; color: var(--ink); }

/* ---------- Spectrum: regions + visible zoom ---------- */
.spectrum-track { padding-top: 48px !important; }
.spectrum-now { top: 0 !important; }
.spectrum-regions { position: relative; height: 16px; margin-bottom: 4px; }
.spectrum-regions span { position: absolute; top: 0; text-align: center; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.02em; color: var(--faint); border-left: 1px dashed var(--line); line-height: 16px; white-space: nowrap; overflow: hidden; }
.spectrum-regions span:first-child { border-left: 0; }
.seg { position: absolute; top: 0; bottom: 0; }
.seg-mw { background: linear-gradient(90deg, #cfd7fa, #a9b8f4); }
.seg-mm { background: linear-gradient(90deg, #a9b8f4, #8e9cef); }
.seg-thz { background: linear-gradient(90deg, #8e9cef, #a58fe0); }
.seg-ir { background: linear-gradient(90deg, #b58ec9, #d98a7a 70%, #c0392b); }
.seg-vis { background: linear-gradient(90deg, #ff2d2d, #ff9a1f, #ffe11f, #37d67a, #1fb5ff, #3b4cff, #8a2be2); }
.seg-uv { background: linear-gradient(90deg, #7b3fe4, #b6a6f0); }
.spectrum-dot { top: 63px !important; }
.spectrum-zoom { margin: 14px 0 0 auto; width: min(360px, 100%); position: relative; }
.spectrum-zoom::before { content: "zoom · visible band"; display: block; text-align: right; margin-bottom: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.zoom-bar { position: relative; height: 14px; border-radius: 999px; background: linear-gradient(90deg, #d7191c 0%, #ff7f00 18%, #ffe11f 36%, #2fc46b 52%, #1fb5ff 68%, #3b4cff 84%, #7a2be2 100%); }
.zoom-bar .spectrum-dot { top: -3px !important; left: 50%; }
.zoom-scale { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 6px; font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.zoom-scale b { font-family: var(--font); font-size: 12.5px; font-weight: 600; color: var(--ink); }

/* ---------- Research scenes (sci-fi screens) ---------- */
.scene { position: relative; height: 150px; border-radius: 12px; overflow: hidden; background: #060912; border: 1px solid rgba(95, 227, 255, 0.2);
  box-shadow: 0 10px 30px -18px rgba(40, 80, 255, 0.55), inset 0 0 0 1px rgba(150, 132, 255, 0.06); }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene .c { position: absolute; width: 10px; height: 10px; border-color: #5fe3ff; border-style: solid; border-width: 0; opacity: .75; pointer-events: none; }
.scene .tl { top: 6px; left: 6px; border-top-width: 1.5px; border-left-width: 1.5px; }
.scene .tr { top: 6px; right: 6px; border-top-width: 1.5px; border-right-width: 1.5px; }
.scene .bl { bottom: 6px; left: 6px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.scene .br { bottom: 6px; right: 6px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.theme .scene { margin: -10px -10px 6px; }
.card--scene { display: flex; flex-direction: column; }
.card--scene .scene { height: 170px; margin: -10px -10px 18px; }
@media (max-width: 720px) { .scene { height: 140px; } .card--scene .scene { height: 150px; } .spectrum-regions span { font-size: 8.5px; letter-spacing: 0; } .spectrum-regions span:nth-child(3) { visibility: hidden; } }

/* ---------- Research: highlights timeline ---------- */
.highlights { list-style: none; margin: 0; padding: 0; position: relative; }
.highlights::before { content: ""; position: absolute; left: 96px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.hl { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 32px; padding: 0 0 26px; position: relative; }
.hl::before { content: ""; position: absolute; left: 91px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.hl-year { font-family: var(--mono); font-size: 13px; color: var(--faint); text-align: right; padding-top: 1px; }
.hl-tag { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.hl h3 { margin: 4px 0 6px !important; font-size: 18px !important; letter-spacing: -0.01em; }
.hl p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--muted); max-width: 760px; }
.hl-link { font-family: var(--mono); font-size: 12px; font-weight: 500; white-space: nowrap; }
.page .note a { color: var(--accent); }

/* ---------- Footer message ---------- */
.footer-message { max-width: 920px; }
.footer-message h2 { font-size: clamp(30px, 4vw, 46px) !important; }
.footer-message p { margin: 16px 0 0; font-size: 16.5px; line-height: 1.7; color: var(--muted); }
@media (max-width: 720px) {
  .highlights::before { left: 6px; }
  .hl { grid-template-columns: 1fr; gap: 4px; padding-left: 28px; }
  .hl::before { left: 1px; }
  .hl-year { text-align: left; }
}

/* ---------- Stats: five columns ---------- */
.stats--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats.is-in .stat:nth-child(5) .stat-bar { transition-delay: .56s; }
@media (max-width: 980px) {
  .stats--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats--5 .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stats--5 .stat:nth-child(odd) .stat-bar { left: 0; width: 100%; }
  .stats--5 .stat:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--line); }
  .stats--5 .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stats--5 .stat:nth-child(5) { grid-column: 1 / -1; }
}

/* ---------- Publications: numbering + year dividers ---------- */
.pubcard { grid-template-columns: 136px minmax(0, 1fr) 64px; padding: 16px 20px 16px 16px; margin-bottom: 10px; }
.pubcard--compact { grid-template-columns: minmax(0, 1fr) 64px; }
.pub-thumb { height: 92px; }
.pub-name { font-size: 17.5px !important; line-height: 1.38; }
.pub-by { color: color-mix(in srgb, var(--ink) 62%, var(--bg)); }
.pub-in { margin-top: 5px; font-size: 14px; font-weight: 500; }
.pub-in .journal-name { color: var(--accent); font-style: italic; font-weight: 600; }
.pub-y { color: var(--faint); font-weight: 400; }
.pub-no { justify-self: end; align-self: start; margin-top: 2px; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; min-width: 44px; text-align: center; }
.pubcard[data-first="true"] .pub-no { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
.pub-yeardiv { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; }
.pub-yeardiv:first-of-type { margin-top: 4px; }
.pub-yeardiv span { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink); }
.pub-yeardiv::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pub-yeardiv[hidden] { display: none; }
.pub-group-title { margin-bottom: 8px !important; }
@media (max-width: 720px) {
  .pubcard, .pubcard--compact { grid-template-columns: minmax(0, 1fr) auto; }
  .pub-no { order: 0; grid-row: 1; grid-column: 2; }
  .pub-thumb, .pub-thumb.has-art { display: none; }
  .pub-body { grid-row: 1; grid-column: 1; }
}
.bio-facts .fact { display: block; }
.bio-facts .fact + .fact { margin-top: 8px; }
.pub-thumb.has-img { background: #ffffff; border: 1px solid var(--line); }
.pub-thumb.has-img img { object-fit: contain; padding: 4px; }

/* ---------- Home overview scene ---------- */
.overview-fx { margin: 0 0 20px; }
.scene--hero { height: auto !important; aspect-ratio: 12 / 5; border-radius: 16px; }
.overview-fx figcaption { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 12px 4px 0; font-size: 13.5px; color: var(--muted); }
.overview-fx figcaption span { font-weight: 600; color: var(--ink); }
@media (max-width: 560px) { .scene--hero { aspect-ratio: 10 / 16.5; } }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 4px 0 2px; }
.tl-head .tl-title { margin: 0; }
.tl-where { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--faint); }
.tl-where svg { width: 13px; height: 13px; flex-shrink: 0; position: relative; top: 1px; }
.pill--new { background: color-mix(in srgb, #1f9d6b 14%, transparent); color: #147a52; }
:root[data-theme="dark"] .pill--new { color: #6fe3b0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill--new { color: #6fe3b0; } }

/* ---------- Home: philosophy statement ---------- */
.motto { padding: 104px 0 8px; }
.motto .container { display: flex; flex-direction: column; align-items: center; text-align: center; }
.motto-line { margin: 0; font-size: clamp(30px, 4.4vw, 54px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; max-width: 980px; }
.motto-line span { color: var(--accent); }
.motto-text { margin: 22px 0 0; max-width: 640px; font-size: 17px; line-height: 1.7; color: var(--muted); }
.motto + .section { padding-top: 104px; }
.footer-message--contact h2 { margin-top: 8px !important; font-size: clamp(26px, 3vw, 34px) !important; }
@media (max-width: 720px) {
  .motto { padding: 72px 0 0; }
  .motto .container { align-items: flex-start; text-align: left; }
  .motto-line { font-size: 26px; line-height: 1.15; }
  .motto-text { font-size: 15.5px; margin-top: 16px; }
  .motto + .section { padding-top: 72px; }
}
