/* Research profile — Scholar-style layout with a modern wearables × AI finish */

:root {
  --bg: #f7f8fa;
  --surface: #fff;
  --text: #0f172a;
  --gray: #64748b;
  --line: #e5e7eb;
  --line-strong: #d4d8de;
  --link: #1d4ed8;
  --visited: #5b21b6;
  --row-hover: #f1f5f9;
  --tag-bg: #f1f5f9;
  --dot: rgba(15, 23, 42, .07);

  --wear: #0d9488;
  --wear-ink: #0f766e;
  --wear-soft: #ccfbf1;
  --ai: #7c3aed;
  --ai-ink: #6d28d9;
  --ai-soft: #ede9fe;
  --energy: #d97706;
  --energy-ink: #b45309;
  --energy-soft: #fef3c7;

  --cover: #b45309;
  --cover-bg: #fef3c7;

  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f14;
    --surface: #11161d;
    --text: #e6edf3;
    --gray: #8b98a5;
    --line: #1f2731;
    --line-strong: #2b3542;
    --link: #7aa2ff;
    --visited: #b69cff;
    --row-hover: #151c25;
    --tag-bg: #19212b;
    --dot: rgba(230, 237, 243, .06);

    --wear: #2dd4bf;
    --wear-ink: #5eead4;
    --wear-soft: rgba(45, 212, 191, .14);
    --ai: #a78bfa;
    --ai-ink: #c4b5fd;
    --ai-soft: rgba(167, 139, 250, .16);
    --energy: #fbbf24;
    --energy-ink: #fcd34d;
    --energy-soft: rgba(251, 191, 36, .14);

    --cover: #fcd34d;
    --cover-bg: rgba(251, 191, 36, .14);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--visited); }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

button { font: inherit; }
:focus-visible { outline: 2px solid var(--wear); outline-offset: 2px; border-radius: 4px; }

.gray { color: var(--gray); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark, .wordmark:visited {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.wordmark:hover { text-decoration: none; }
.wm-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--wear), var(--ai));
  color: #fff;
  font: 500 11px/1 var(--mono);
  letter-spacing: .5px;
}
.topnav { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a, .topnav a:visited { color: var(--gray); font-size: 13px; white-space: nowrap; }
.topnav a:hover { color: var(--text); text-decoration: none; }

/* ---------- Page ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(var(--dot) 1px, transparent 1px) 0 0 / 18px 18px,
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 32px 72px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(closest-side, var(--ai-soft), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto auto -50% -10%;
  width: 520px;
  height: 520px;
  background: radial-gradient(closest-side, var(--wear-soft), transparent 70%);
  pointer-events: none;
}

.trace {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  width: 100%;
  height: 56px;
  z-index: 1;
}
.trace path { fill: none; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.trace-base { stroke: var(--line-strong); stroke-width: 1.25; }
.trace-scan {
  stroke: var(--wear);
  stroke-width: 2;
  stroke-dasharray: 90 910;
  filter: drop-shadow(0 0 4px var(--wear));
  animation: scan 6s linear infinite;
}
@keyframes scan { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }

.profile {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 156px 1fr auto;
  gap: 28px;
  align-items: start;
}
.avatar-wrap {
  width: 156px;
  height: 156px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, var(--wear), var(--ai), var(--energy), var(--wear));
}
.avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--surface);
  background: var(--tag-bg);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--wear-ink);
  background: var(--wear-soft);
  padding: 6px 10px;
  border-radius: 999px;
}
.pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wear);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wear);
  animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

.name {
  margin: 14px 0 8px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.tagline {
  margin: 0 0 14px;
  max-width: 52ch;
  font-size: 17px;
  line-height: 1.5;
  color: var(--gray);
}
.affil { font-size: 15px; margin-bottom: 2px; }
.profile-links { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.profile-links a, .profile-links a:visited {
  font-size: 13px;
  color: var(--text);
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
}
.profile-links a:hover { border-color: var(--text); text-decoration: none; }

.btn-follow, .btn-follow:visited {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.btn-follow:hover { text-decoration: none; opacity: .88; }

/* ---------- Research focus ---------- */
.focus {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0 40px;
}
.focus-card {
  --c: var(--wear); --c-ink: var(--wear-ink); --c-soft: var(--wear-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.focus-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--c);
}
.focus-card:hover {
  transform: translateY(-2px);
  border-color: var(--c);
  box-shadow: 0 10px 30px -18px var(--c);
}
.f-ai { --c: var(--ai); --c-ink: var(--ai-ink); --c-soft: var(--ai-soft); }
.f-energy { --c: var(--energy); --c-ink: var(--energy-ink); --c-soft: var(--energy-soft); }

.focus-k { font: 500 11px/1 var(--mono); letter-spacing: 1.2px; text-transform: uppercase; color: var(--c-ink); }
.focus-viz { width: 120px; height: 40px; margin: 8px 0 4px; overflow: visible; }
.focus-viz path { fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.focus-viz .edges path { stroke: var(--line-strong); stroke-width: 1; }
.focus-viz .nodes circle { fill: var(--surface); stroke: var(--c); stroke-width: 1.8; }
.focus-viz .nodes circle:last-child { fill: var(--c); }
.focus-viz .bolt { fill: var(--c-soft); stroke: var(--c); stroke-width: 1.4; }
.focus-t { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.focus-d { font-size: 13px; color: var(--gray); line-height: 1.5; flex: 1; }
.focus-n { margin-top: 6px; font: 12px var(--mono); color: var(--c-ink); }
.focus-n b { font-weight: 500; font-size: 18px; margin-right: 2px; }

/* ---------- Two-column layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px;
  align-items: start;
}
.side-col { position: sticky; top: 76px; }

.panel { margin-bottom: 48px; }
.panel-h, .box-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font: 500 12px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gray);
}
.panel-h::before {
  content: "";
  width: 14px;
  height: 2px;
  background: linear-gradient(90deg, var(--wear), var(--ai));
}
.panel-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Publications ---------- */
.pub-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 10px;
}
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  --c: var(--text); --c-soft: var(--tag-bg);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip.c-wear { --c: var(--wear-ink); --c-soft: var(--wear-soft); }
.chip.c-ai { --c: var(--ai-ink); --c-soft: var(--ai-soft); }
.chip.c-energy { --c: var(--energy-ink); --c-soft: var(--energy-soft); }
.chip.c-wear::before, .chip.c-ai::before, .chip.c-energy::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c);
}
.chip .n { color: var(--gray); font: 11px var(--mono); }
.chip:hover { border-color: var(--line-strong); }
.chip.is-on { background: var(--c-soft); border-color: transparent; color: var(--c); }
.chip.is-on .n { color: inherit; }

.seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--gray);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.seg button.is-on { background: var(--tag-bg); color: var(--text); font-weight: 500; }

.search {
  flex: 1 1 220px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 12px;
  min-width: 0;
}
.search:focus { outline: none; border-color: var(--wear); box-shadow: 0 0 0 3px var(--wear-soft); }

.pubs { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pubs th { text-align: left; font-weight: normal; border-bottom: 1px solid var(--line); padding: 0; }
.pubs .c-cites { width: 76px; text-align: right; }
.pubs .c-year { width: 60px; text-align: right; }
.sort {
  font: 500 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
  background: none;
  border: 0;
  padding: 10px 0;
  cursor: pointer;
}
.sort:hover { color: var(--text); }
.sort.is-on { color: var(--text); }
.sort.is-on::after { content: " \2193"; }
.sort[data-sort="title"] { cursor: default; }
.sort[data-sort="title"]:hover { color: var(--gray); }

.pubs td { padding: 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.pubs tr.pub:hover td { background: var(--row-hover); }
.pubs td.c-title { padding: 14px 16px 14px 0; }
.pubs td.c-cites, .pubs td.c-year { font: 13px var(--mono); }
.pubs td.c-year { color: var(--gray); padding-right: 4px; }
.pub-title { font-size: 15.5px; font-weight: 500; line-height: 1.35; letter-spacing: -.005em; }
.pubs .gray { font-size: 13px; margin-top: 3px; }
.pubs .gray b { color: var(--text); font-weight: 600; }
.pubs .venue { font-style: italic; }
.pubs sub { font-size: 70%; }

.topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.topic {
  --c: var(--wear-ink); --c-soft: var(--wear-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 11px/18px var(--mono);
  color: var(--c);
  background: var(--c-soft);
  padding: 0 8px;
  border-radius: 999px;
}
.topic::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.t-ai { --c: var(--ai-ink); --c-soft: var(--ai-soft); }
.t-energy { --c: var(--energy-ink); --c-soft: var(--energy-soft); }

.tag {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 4px;
  font: 11px/18px var(--mono);
  white-space: nowrap;
}
.tag-cover { background: var(--cover-bg); color: var(--cover); cursor: help; }

.empty { padding: 16px 0; }
.more-wrap { text-align: center; padding-top: 18px; }
.btn-more {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 22px;
  cursor: pointer;
}
.btn-more:hover { border-color: var(--text); }
.btn-more[hidden] { display: none; }

/* ---------- Prose & CV lists ---------- */
.prose { font-size: 15px; max-width: 70ch; }
.prose p { margin: 0 0 12px; }

.cv { list-style: none; margin: 0; padding: 0; }
.cv li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cv li:last-child { border-bottom: 0; }
.cv-when { color: var(--gray); font: 12px/1.9 var(--mono); }
.cv-title { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.cv-what p { margin: 6px 0 0; max-width: 70ch; }

.rec {
  margin: 0 0 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.rec blockquote { margin: 0 0 12px; font-size: 14.5px; max-width: 72ch; }
.rec figcaption { display: flex; align-items: center; gap: 10px; }
.rec img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

.kv { border-collapse: collapse; }
.kv th { text-align: left; font: 12px var(--mono); color: var(--gray); padding: 8px 24px 8px 0; vertical-align: top; white-space: nowrap; }
.kv td { padding: 7px 0; word-break: break-word; }

/* ---------- Sidebar ---------- */
.box {
  margin-bottom: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.box-h { margin-bottom: 12px; }
.stats { width: 100%; border-collapse: collapse; }
.stats th, .stats td { padding: 7px 0; text-align: right; border-bottom: 1px solid var(--line); }
.stats tr:last-child td { border-bottom: 0; }
.stats th { font: 11px var(--mono); color: var(--gray); text-transform: uppercase; letter-spacing: .8px; }
.stats td { font: 14px var(--mono); }
.stats td:first-child, .stats th:first-child { text-align: left; font: 13px var(--sans); }

.hist {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 150px;
  margin-top: 18px;
  padding-bottom: 20px;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.hist .col {
  position: relative;
  flex: 1;
  max-width: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.hist .bar {
  width: 100%;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--ai), var(--wear));
  transition: filter .15s ease;
}
.hist .col:hover .bar { filter: brightness(1.15); }
.hist .val { font: 10px var(--mono); color: var(--gray); margin-bottom: 3px; }
.hist .yr { position: absolute; bottom: -20px; font: 10px var(--mono); color: var(--gray); }
.hist .col.partial .bar {
  background: repeating-linear-gradient(135deg, var(--wear) 0 3px, transparent 3px 6px);
  border: 1px solid var(--wear);
  border-bottom: 0;
}

.coauthors { list-style: none; margin: 0; padding: 0; }
.coauthors li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.coauthors .ini {
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tag-bg);
  color: var(--gray);
  font: 11px var(--mono);
}
.coauthors .who { min-width: 0; font-size: 13px; }
.coauthors .who span { display: block; }
.coauthors .who .gray { font-size: 12px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font: 12px var(--mono);
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .trace-scan, .pulse::after { animation: none; }
  .trace-scan { stroke-dasharray: none; filter: none; opacity: .5; }
  .focus-card { transition: none; }
  .focus-card:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side-col { position: static; order: -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .side-col .box:first-child { grid-row: span 2; }
  .focus { grid-template-columns: 1fr; }
  .focus-card { display: grid; grid-template-columns: 1fr 120px; column-gap: 16px; }
  .focus-card > * { grid-column: 1; }
  .focus-card .focus-viz { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0; }
}

@media (max-width: 640px) {
  .hero { padding: 20px 16px 64px; border-radius: 16px; }
  .topnav { gap: 16px; }
  .profile { grid-template-columns: 1fr; gap: 16px; }
  .avatar-wrap { width: 96px; height: 96px; }
  .name { font-size: 30px; margin-top: 12px; }
  .tagline { font-size: 15px; }
  .affil { font-size: 14px; }
  .btn-follow { justify-self: start; }
  .focus-card { grid-template-columns: 1fr; }
  .focus-card .focus-viz { display: none; }
  .layout { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .side-col { display: contents; }
  .side-col .box:first-child { order: -1; margin-bottom: 32px; }
  .side-col .box { order: 1; }
  .pub-title { font-size: 15px; }
  .pubs .c-cites { width: 52px; }
  .pubs .c-year { width: 46px; }
  .cv li { grid-template-columns: 1fr; gap: 2px; }
}
