:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #eef1f4;
  --text: #15171a;
  --muted: #68707a;
  --line: #e2e6ea;
  --accent: #0057b8;
  --accent-soft: #eaf3ff;
  --success: #16794a;
  --success-soft: #eaf8f1;
  --review: #9a5a00;
  --review-soft: #fff4df;
  --future: #6750a4;
  --future-soft: #f1edff;
  --nav: rgba(255,255,255,.9);
  --shadow: 0 18px 42px rgba(15, 23, 42, .08);
  --radius: 16px;
  --max: 1040px;
}

[data-theme="dark"] {
  --bg: #111315;
  --surface: #181b1f;
  --surface-2: #20242a;
  --text: #edf0f2;
  --muted: #a4adb8;
  --line: #2b3037;
  --accent: #72b6ff;
  --accent-soft: #172a3f;
  --success: #70d5a2;
  --success-soft: #153126;
  --review: #ffc56a;
  --review-soft: #3d2a0e;
  --future: #c5b7ff;
  --future-soft: #28213f;
  --nav: rgba(17,19,21,.9);
  --shadow: 0 18px 42px rgba(0,0,0,.24);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.66;
  letter-spacing: -.01em;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, a { -webkit-tap-highlight-color: transparent; }

.container { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.navbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-weight: 760;
  color: var(--text);
  font-size: 1.02rem;
  letter-spacing: -.025em;
}
.brand:hover { text-decoration: none; }

.nav-links { display: flex; align-items: center; gap: 25px; }
.nav-links a { color: var(--muted); font-size: .92rem; position: relative; }
.nav-links a.active, .nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active::after {
  content: "";
  position: absolute;
  height: 2px;
  left: 0;
  right: 0;
  bottom: -20px;
  background: var(--accent);
  border-radius: 999px;
}

.nav-actions { display: flex; gap: 8px; }
.icon-button {
  width: 36px; height: 36px; border-radius: 999px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--text); cursor: pointer;
  transition: transform .16s ease, border-color .16s ease;
}
.icon-button:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.mobile-toggle { display: none; }

main { padding: 58px 0 84px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 62px;
  align-items: center;
  padding: 18px 0 32px;
}
.hero-copy { min-width: 0; }

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .72rem;
  font-weight: 780;
  margin-bottom: 9px;
}

h1, h2, h3 { line-height: 1.18; letter-spacing: -.035em; }
h1 { font-size: clamp(2.55rem, 6vw, 4.35rem); margin: 0 0 10px; font-weight: 800; }
h2 { font-size: 1.52rem; margin: 0 0 20px; font-weight: 770; }
h3 { font-size: 1.02rem; margin: 0 0 6px; font-weight: 730; }
.subtitle { font-size: 1.16rem; color: var(--muted); margin: 0 0 22px; }
.lead { font-size: 1.18rem; line-height: 1.55; max-width: 720px; margin: 0 0 18px; }
.bio { font-size: 1.01rem; max-width: 720px; margin: 0 0 16px; color: color-mix(in srgb, var(--text) 90%, var(--muted)); }

.profile-column { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.profile-photo-wrap { position: relative; }
.profile-photo {
  display: block;
  width: 198px;
  height: 198px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.profile-photo-wrap::after {
  content: "";
  position: absolute;
  width: 34px; height: 34px;
  border-radius: 50%;
  right: 12px; bottom: 9px;
  background: var(--accent);
  border: 5px solid var(--bg);
}
.profile-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
}
.status-dot { width: 7px; height: 7px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 4px var(--success-soft); }

.social-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.social-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px;
  font-size: .85rem; color: var(--text); background: var(--surface);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.social-link:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }

.snapshot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 22px 0 0;
}
.snapshot-item { padding: 18px 22px 18px 0; }
.snapshot-item + .snapshot-item { border-left: 1px solid var(--line); padding-left: 22px; }
.snapshot-item strong { display: block; font-size: .94rem; font-weight: 700; }
.snapshot-kicker { display: block; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }

.section { padding-top: 54px; }
.compact-section { padding-top: 42px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 3px; }
.section-heading .more { font-size: .88rem; }

.news-list { border-top: 1px solid var(--line); }
.news-item {
  display: grid; grid-template-columns: 115px 1fr; gap: 24px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
}
.news-date { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .89rem; }
.news-copy { margin: 0; }

.paper-list { display: grid; gap: 17px; }
.paper-card {
  display: grid; grid-template-columns: 118px 1fr; gap: 20px;
  align-items: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.paper-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.featured-paper { background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--accent-soft) 42%, var(--surface))); }
.paper-thumb {
  width: 118px; height: 88px; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; position: relative;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-2));
  border: 1px solid var(--line);
}
.paper-thumb span { font-size: 1.18rem; font-weight: 830; color: var(--accent); letter-spacing: -.04em; text-align: center; padding: 8px; }
.paper-card h3 { margin-top: 7px; }
.paper-venue { color: var(--muted); font-size: .88rem; margin-top: 4px; }
.paper-authors { color: var(--muted); font-size: .9rem; margin-top: 3px; }
.paper-summary { color: var(--muted); font-size: .9rem; margin: 7px 0 0; }
.paper-links, .pub-links { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 8px; font-size: .86rem; }
.paper-links a, .pub-links a { font-weight: 660; }
.paper-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .7rem;
  line-height: 1.35;
  font-weight: 720;
  letter-spacing: .015em;
  white-space: nowrap;
}
.status-published { color: var(--success); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 20%, var(--line)); }
.status-review { color: var(--review); background: var(--review-soft); border-color: color-mix(in srgb, var(--review) 20%, var(--line)); }
.status-forthcoming { color: var(--future); background: var(--future-soft); border-color: color-mix(in srgb, var(--future) 20%, var(--line)); }

.section-intro { max-width: 760px; color: var(--muted); margin: 0 0 18px; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.service-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.service-card h3 { margin: 7px 0 7px; }
.service-card p { margin: 0; color: var(--muted); font-size: .91rem; }
.service-stat { color: var(--accent); font-weight: 840; font-size: 1.55rem; letter-spacing: -.04em; }
.service-note { margin: 14px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.6; }

.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.focus-card { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.focus-card p { margin: 8px 0 0; color: var(--muted); font-size: .92rem; }
.focus-number { color: var(--accent); font-weight: 790; font-size: .76rem; letter-spacing: .08em; margin-bottom: 16px; }

.callout {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 38px;
  align-items: start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.callout h2 { margin: 0; max-width: 420px; }
.callout p { margin: 0; color: var(--muted); }

.page-header { margin-bottom: 38px; max-width: 780px; }
.page-header h1 { font-size: clamp(2.35rem, 5vw, 3.6rem); }
.page-header p { max-width: 690px; color: var(--muted); font-size: 1.02rem; }
.papers-header { max-width: 860px; }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.filter-button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: .82rem;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.filter-button:hover, .filter-button.active { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }

.publication-group { margin-top: 50px; }
.publication-group:first-of-type { margin-top: 0; }
.publication-group-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 9px; }
.publication-group-heading h2 { margin-bottom: 0; }
.publication-group-heading p { color: var(--muted); font-size: .82rem; max-width: 330px; margin: 0; text-align: right; }
.year-heading { margin: 30px 0 10px; font-size: 1rem; color: var(--muted); letter-spacing: 0; }
.publication { padding: 18px 0; border-top: 1px solid var(--line); }
.publication:last-child { border-bottom: 1px solid var(--line); }
.pub-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.pub-title { font-weight: 720; max-width: 820px; }
.pub-meta { color: var(--muted); font-size: .91rem; margin-top: 4px; }
.pub-note { color: var(--muted); font-size: .88rem; margin-top: 7px; max-width: 820px; }
.working-label { font-size: .66rem; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-left: 5px; white-space: nowrap; }
.manuscript-note { margin-top: 42px; }

.project-feature {
  display: grid;
  grid-template-columns: 1fr 210px;
  gap: 42px;
  align-items: center;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--accent-soft) 38%, var(--surface)));
  border-radius: calc(var(--radius) + 3px);
  padding: 30px;
}
.project-feature h2 { font-size: 2rem; margin: 7px 0 8px; }
.project-lead { font-size: 1.08rem; margin: 0 0 9px; }
.project-feature p:not(.project-lead) { color: var(--muted); }
.project-mark {
  width: 180px;
  height: 180px;
  border-radius: 32px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 3.4rem;
  font-weight: 850;
  letter-spacing: -.08em;
  box-shadow: var(--shadow);
}
.project-actions { display: flex; gap: 8px; margin-top: 17px; }
.project-index { font-size: .72rem; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-weight: 780; }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.project-grid-spaced { margin-top: 18px; }
.project-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.project-card h2 { font-size: 1.18rem; margin: 9px 0 8px; }
.project-card p { color: var(--muted); font-size: .92rem; }
.project-card .stack { font-size: .8rem; color: var(--muted); padding-top: 5px; }
.quiet-card { background: transparent; }

.cv-grid { display: grid; grid-template-columns: 220px 1fr; gap: 46px; }
.cv-side { position: sticky; top: 92px; align-self: start; }
.cv-side .mini-profile { width: 98px; height: 98px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); }
.cv-name { margin: 14px 0 3px; }
.cv-role { color: var(--muted); font-size: .9rem; }
.cv-side ul { padding: 0; list-style: none; margin: 18px 0 0; }
.cv-side li { margin: 6px 0; font-size: .88rem; }
.cv-section { margin-bottom: 34px; }
.cv-section > h2 { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cv-entry { display: grid; grid-template-columns: 132px 1fr; gap: 18px; padding: 11px 0; }
.cv-entry .when { color: var(--muted); font-size: .86rem; }
.cv-entry .what { font-weight: 690; }
.cv-entry .where { color: var(--muted); font-size: .89rem; }
.cv-detail { color: var(--muted); font-size: .86rem; margin-top: 3px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tags span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; font-size: .81rem; }
.print-button { cursor: pointer; font: inherit; }

.notice { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--accent-soft); font-size: .9rem; color: var(--text); }
.footer { border-top: 1px solid var(--line); padding: 30px 0 44px; color: var(--muted); font-size: .83rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

.is-hidden { display: none !important; }

@media (max-width: 820px) {
  .container { width: min(calc(100% - 30px), var(--max)); }
  .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 4px; }
  .profile-column { grid-row: 1; align-items: flex-start; }
  .profile-photo { width: 138px; height: 138px; }
  .profile-photo-wrap::after { width: 29px; height: 29px; right: 3px; bottom: 2px; }
  .profile-note { text-align: left; }
  .focus-grid, .service-grid, .project-grid { grid-template-columns: 1fr; }
  .project-feature { grid-template-columns: 1fr; }
  .project-mark { width: 120px; height: 120px; border-radius: 24px; font-size: 2.5rem; grid-row: 1; }
  .callout { grid-template-columns: 1fr; gap: 16px; }
  .cv-grid { grid-template-columns: 1fr; gap: 24px; }
  .cv-side { position: static; }
}

@media (max-width: 700px) {
  main { padding-top: 42px; }
  .snapshot { grid-template-columns: 1fr; }
  .snapshot-item { padding: 13px 0; }
  .snapshot-item + .snapshot-item { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .paper-card { grid-template-columns: 1fr; padding: 14px; }
  .paper-thumb { width: 100%; height: 76px; }
  .news-item { grid-template-columns: 1fr; gap: 2px; }
  .publication-group-heading { display: block; }
  .publication-group-heading p { text-align: left; margin-top: 8px; }
  .pub-top { display: block; }
  .pub-top .status-pill { margin-top: 7px; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    padding: 16px 18px 20px; background: var(--bg); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: flex-start; gap: 13px;
  }
  .nav-links.open { display: flex; }
  .nav-links a.active::after { display: none; }
  .mobile-toggle { display: inline-grid; }
  .cv-entry { grid-template-columns: 1fr; gap: 2px; }
}

@media print {
  .site-header, .footer, .print-hide { display: none !important; }
  body { background: white; color: black; font-size: 10.5pt; }
  main { padding: 0; }
  .container { width: 100%; max-width: none; }
  .cv-grid { grid-template-columns: 175px 1fr; gap: 26px; }
  .cv-side { position: static; }
  .cv-section { break-inside: avoid; margin-bottom: 20px; }
  .cv-section > h2 { margin-bottom: 8px; }
  .cv-entry { padding: 7px 0; }
  .skill-tags span { background: white; }
  a { color: black; }
}

/* --- Motion & depth layer ------------------------------------------------- */
body {
  background-image:
    radial-gradient(circle at 78% 8%, color-mix(in srgb, var(--accent) 7%, transparent) 0, transparent 30rem),
    radial-gradient(circle at 8% 34%, color-mix(in srgb, var(--future) 5%, transparent) 0, transparent 28rem);
  background-attachment: fixed;
}

.hero {
  position: relative;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20px -30px -40px 48%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--accent) 8%, transparent), transparent 65%);
  filter: blur(20px);
}

.hero-orbit {
  width: 290px;
  height: 290px;
  position: relative;
  display: grid;
  place-items: center;
  perspective: 850px;
  transform-style: preserve-3d;
  --orbit-x: 0deg;
  --orbit-y: 0deg;
}

.hero-network {
  position: absolute;
  inset: -15px;
  width: 320px;
  height: 320px;
  opacity: .9;
  pointer-events: none;
}

.hero-orbit .profile-photo-wrap {
  z-index: 3;
  transform: rotateX(var(--orbit-x)) rotateY(var(--orbit-y)) translateZ(34px);
  transition: transform .18s ease-out;
  transform-style: preserve-3d;
}

.hero-orbit .profile-photo {
  width: 186px;
  height: 186px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  box-shadow:
    0 24px 54px rgba(15, 23, 42, .12),
    0 0 0 8px color-mix(in srgb, var(--bg) 82%, transparent);
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  pointer-events: none;
  transform-style: preserve-3d;
}

.orbit-ring-a {
  width: 250px;
  height: 250px;
  animation: orbit-spin-a 18s linear infinite;
}

.orbit-ring-b {
  width: 216px;
  height: 216px;
  border-style: dashed;
  opacity: .6;
  animation: orbit-spin-b 13s linear infinite reverse;
}

.orbit-label {
  position: absolute;
  z-index: 4;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--muted);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: .66rem;
  font-weight: 720;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(15,23,42,.05);
  pointer-events: none;
}

.orbit-label-a { top: 28px; right: 2px; animation: label-float 5.2s ease-in-out infinite; }
.orbit-label-b { left: -5px; bottom: 47px; animation: label-float 6.1s ease-in-out .8s infinite; }
.orbit-label-c { right: -8px; bottom: 35px; animation: label-float 5.7s ease-in-out 1.5s infinite; }

@keyframes orbit-spin-a {
  from { transform: rotateX(68deg) rotateZ(0deg); }
  to { transform: rotateX(68deg) rotateZ(360deg); }
}

@keyframes orbit-spin-b {
  from { transform: rotateY(67deg) rotateZ(0deg); }
  to { transform: rotateY(67deg) rotateZ(360deg); }
}

@keyframes label-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Cards gain depth only when JS enables it. */
[data-tilt] {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform .18s ease-out, box-shadow .2s ease, border-color .2s ease;
}

[data-tilt] > * { transform: translateZ(0); }
[data-tilt]:hover { box-shadow: 0 22px 54px rgba(15, 23, 42, .10); }

.reveal-ready {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .62s cubic-bezier(.22,.8,.28,1), transform .62s cubic-bezier(.22,.8,.28,1);
}

.reveal-ready.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-copy > * {
  animation: hero-enter .7s cubic-bezier(.22,.8,.28,1) both;
}
.hero-copy > *:nth-child(2) { animation-delay: .04s; }
.hero-copy > *:nth-child(3) { animation-delay: .08s; }
.hero-copy > *:nth-child(4) { animation-delay: .12s; }
.hero-copy > *:nth-child(5) { animation-delay: .16s; }
.hero-copy > *:nth-child(6) { animation-delay: .20s; }
.hero-copy > *:nth-child(7) { animation-delay: .24s; }

@keyframes hero-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
  .hero-orbit { width: 210px; height: 210px; }
  .hero-network { inset: -35px; width: 280px; height: 280px; }
  .hero-orbit .profile-photo { width: 132px; height: 132px; }
  .orbit-ring-a { width: 185px; height: 185px; }
  .orbit-ring-b { width: 158px; height: 158px; }
  .orbit-label { font-size: .58rem; }
  .orbit-label-a { top: 7px; right: -20px; }
  .orbit-label-b { left: -25px; bottom: 25px; }
  .orbit-label-c { right: -25px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit-ring,
  .orbit-label,
  .hero-copy > * { animation: none !important; }
  .reveal-ready { opacity: 1; transform: none; transition: none; }
  [data-tilt],
  .hero-orbit .profile-photo-wrap { transform: none !important; transition: none !important; }
}

@media (max-width: 820px) {
  body { background-attachment: scroll; }
}

@media print {
  body { background-image: none !important; }
  .reveal-ready { opacity: 1 !important; transform: none !important; }
  [data-tilt] { transform: none !important; }
}
