/* A quiet academic layout. System fonts, no third-party dependencies. */
:root {
  color-scheme: light;
  --paper: #fdfdfc;
  --text: #29312e;
  --muted: #536259;
  --link: #28654f;
  --line: #dce2dc;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --body-size: 18px;
  --detail-size: 16px;
  --small-size: 15px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 28px; }
body { margin: 0; background: var(--paper); color: var(--text); font: var(--body-size)/1.8 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--link); outline-offset: 5px; }
video:focus-visible { outline: 2px solid var(--link); outline-offset: 5px; }
p, h1, h2, h3, ul, dl, figure { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.35; }
h1 { font-size: 42px; letter-spacing: -.035em; margin-bottom: 6px; }
h2 { font-size: 30px; letter-spacing: -.025em; margin-bottom: 28px; }
h3 { font-size: 23px; letter-spacing: -.01em; margin-bottom: 11px; }
button { font: inherit; }
.container { width: min(960px, calc(100% - 64px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -80px; background: var(--text); color: white; padding: 8px 14px; z-index: 10; }
.skip-link:focus { top: 10px; }

/* Plain navigation remains available at every screen size, without JavaScript. */
.site-header { min-height: 86px; display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
.site-name { font: 21px/1.3 var(--serif); color: var(--text); white-space: nowrap; }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 25px; align-items: center; font-size: var(--detail-size); }
.site-nav a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--link); }

.profile { padding: 58px 0 8px; display: grid; grid-template-columns: minmax(0, 1fr) clamp(200px, 31.25vw, 300px); column-gap: 40px; align-items: start; }
.profile-heading { grid-column: 1; grid-row: 1; }
.profile-body { grid-column: 1; grid-row: 2; min-width: 0; }
.profile-photo-wrap { grid-column: 2; grid-row: 1 / span 2; position: relative; align-self: stretch; min-width: 0; }
.profile-photo { position: absolute; right: 0; bottom: 0; display: block; width: auto; max-width: 100%; height: auto; max-height: 100%; border: 1px solid var(--line); border-radius: 5px; }
.profile-role { margin-bottom: 0; color: var(--muted); font-size: var(--body-size); }
.profile-affiliation { margin-bottom: 25px; color: var(--muted); font-size: var(--detail-size); }
.profile-bio { max-width: 795px; }
.profile-bio p { margin-bottom: 13px; }
.profile-links, .resource-links { display: flex; flex-wrap: wrap; gap: 5px 23px; padding: 0; margin: 19px 0 0; list-style: none; font-size: var(--detail-size); }
.profile-links a, .resource-links a { min-height: 40px; display: inline-flex; align-items: center; }
.availability { font-size: var(--detail-size); color: var(--muted); margin: 14px 0 0; }
.academic-section { margin-top: 56px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 23px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > a { font-size: var(--small-size); white-space: nowrap; }
.research-entry { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 32px; padding: 27px 0; border-bottom: 1px solid var(--line); }
.research-entry:first-child { padding-top: 8px; }
.entry-meta { padding-top: 2px; font-size: var(--small-size); line-height: 1.75; color: var(--muted); }
.entry-meta p { margin-bottom: 3px; }
.entry-meta .entry-year { color: var(--text); font-size: var(--small-size); }
.entry-title a { color: var(--text); }
.entry-copy > p { font-size: var(--body-size); margin-bottom: 12px; line-height: 1.8; }
.entry-copy .entry-authors { color: var(--muted); font-size: var(--detail-size); }
.entry-authors strong { color: var(--text); font-weight: 600; }
.entry-copy .contribution { color: var(--muted); font-size: var(--detail-size); }
.contribution strong { font-weight: 600; }
.entry-copy .resource-links { margin-top: 6px; gap: 4px 22px; }
.publication-entry { grid-template-columns: 280px minmax(0, 1fr); align-items: start; }
.publication-entry .entry-copy { min-width: 0; }
.publication-entry .entry-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; padding-top: 0; margin-bottom: 12px; }
.publication-entry .entry-meta p { margin: 0; }
.publication-entry > .publication-preview { margin: 0; min-width: 0; }
.publication-preview video, .publication-preview img { border-radius: 4px; }
.publication-preview video.portrait-video { max-width: 236px; margin-inline: auto; }
.hardware-highlights { margin: 0 0 16px; padding-left: 19px; font-size: var(--detail-size); line-height: 1.7; }
.hardware-highlights li { padding-left: 3px; }
.hardware-highlights li + li { margin-top: 8px; }
.hardware-highlights strong { font-weight: 600; }
.hardware-media-pair { display: grid; grid-template-columns: minmax(0, 1fr) clamp(104px, 18.6%, 124px); gap: 16px; align-items: start; margin: 16px 0 12px; }
.entry-copy .hardware-media-pair > .actual-media { width: 100%; min-width: 0; margin: 0; }
.hardware-target-preview > a { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.hardware-target-preview img { background: white; }
.hardware-hand-preview video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: contain; padding: 0; border-radius: 4px; background: transparent; }
.hardware-hand-player { position: relative; }
.hardware-hand-toggle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid #ffffffb3; border-radius: 50%; background: #fdfdfce6; color: var(--link); font-size: 18px; line-height: 1; cursor: pointer; }
.hardware-hand-toggle.is-playing { opacity: 0; }
.hardware-hand-player:hover .hardware-hand-toggle, .hardware-hand-player:focus-within .hardware-hand-toggle { opacity: 1; }
.hardware-media-pair figcaption { margin-top: 6px; }
.entry-copy > .hardware-placement-note { font-size: var(--detail-size); color: var(--muted); margin-bottom: 6px; }
.additional-heading { font-family: var(--sans); font-size: var(--detail-size); font-weight: 600; margin: 31px 0 16px; }
.additional-list { list-style: none; padding: 0; margin-bottom: 0; }
.additional-list > li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.additional-list .resource-links { margin-top: 2px; }
.additional-list h3 { font: var(--body-size)/1.75 var(--sans); margin-bottom: 5px; }
.additional-list p { margin-bottom: 0; color: var(--muted); font-size: var(--small-size); }
.entry-label { font-size: 13px; font-weight: 600; color: var(--link); }
.education-list { margin: 0; }
.education-list > div { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 32px; padding: 0 0 21px; }
.education-list dt { font-size: var(--small-size); color: var(--muted); padding-top: 1px; }
.education-list dd { margin: 0; font-size: var(--body-size); display: flex; align-items: flex-start; gap: 20px; }
.education-emblem { display: block; flex: none; width: 64px; height: 64px; object-fit: contain; margin-top: 5px; }
.education-copy { min-width: 0; }
.education-list strong { font-weight: 600; }
.education-list p { margin: 1px 0 0; color: var(--muted); font-size: var(--detail-size); }
.honors-list { padding-left: 19px; font-size: var(--body-size); margin-bottom: 0; }
.honors-list li { padding-left: 3px; margin: 6px 0; }
.site-footer { border-top: 1px solid var(--line); margin-top: 58px; padding: 23px 0 32px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 25px; font-size: 14px; color: var(--muted); }
.site-footer p { margin: 0; }
.site-footer a { display: inline-flex; min-height: 32px; align-items: center; }

/* Project notes use the same reading width and typography as the homepage. */
.page-intro { padding-top: 43px; }
.back-link { display: inline-flex; min-height: 36px; align-items: center; margin-bottom: 20px; font-size: var(--small-size); }
.page-intro h1 { font-size: 36px; margin-bottom: 16px; }
.page-intro > p { max-width: 790px; margin-bottom: 14px; }
.media-notice { color: var(--muted); font-size: var(--detail-size); }
.project-index { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 17px 0 27px; font-size: var(--detail-size); }
.project-index a { display: inline-flex; align-items: center; min-height: 36px; }
.demo-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border-block: 1px solid var(--line); padding: 13px 0; margin-top: 17px; }
.demo-toolbar h2 { margin: 0; font: var(--detail-size) var(--sans); font-weight: 500; color: var(--muted); }
.filter-group { display: flex; flex-wrap: wrap; gap: 4px 9px; }
.filter-button { background: none; border: 0; border-bottom: 1px solid transparent; border-radius: 0; color: var(--muted); padding: 5px 7px; min-height: 40px; font-size: 14px; cursor: pointer; }
.filter-button:hover { color: var(--link); }
.filter-button.is-selected { color: var(--link); border-bottom-color: var(--link); font-weight: 600; }
.demo-item { padding: 34px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 18px; }
.demo-item:target h3 { color: var(--link); }
.project-heading { display: flex; align-items: baseline; gap: 15px; flex-wrap: wrap; margin-bottom: 9px; }
.project-heading h3 { font-size: 26px; margin: 0; }
.project-heading p { font-size: var(--small-size); color: var(--muted); margin: 0; }
.project-summary { font-size: var(--body-size); max-width: 850px; margin-bottom: 15px; }
.project-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 35px; margin: 19px 0 17px; }
.project-facts dt { font-size: var(--detail-size); font-weight: 600; margin-bottom: 4px; }
.project-facts dd { font-size: var(--detail-size); color: var(--muted); line-height: 1.8; margin: 0; }
.media-slot { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 14px; background: #f3f5f1; padding: 13px 17px; margin-top: 20px; font-size: 14px; color: var(--muted); }
.media-slot strong { font-size: 14px; font-weight: 600; color: #4c5d50; }
.demo-item .resource-links { margin-top: 10px; }
.demo-details { border-top: 1px solid var(--line); margin-top: 17px; padding-top: 6px; font-size: var(--detail-size); }
.demo-details summary { cursor: pointer; color: var(--link); padding: 8px 0; min-height: 40px; }
.demo-details > p { color: var(--muted); margin: 9px 0 0; }
.contact-note { margin-top: 33px; font-size: var(--detail-size); }
.actual-media { margin: 22px 0 0; }
.actual-media > a { display: block; }
.entry-copy .actual-media { margin: 18px 0; }
.actual-media img, .actual-media video { width: 100%; height: auto; display: block; object-fit: contain; background: #f3f5f1; }
.actual-media figcaption { margin-top: 8px; font-size: var(--detail-size); color: var(--muted); }

/* Independent project shells and their compact directory. */
.mini-project-subtitle { color: var(--muted); }
.mini-project-content { min-height: 240px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--detail-size); }
.project-directory { list-style: none; padding: 0; margin: 28px 0 0; }
.project-directory > li { border-bottom: 1px solid var(--line); scroll-margin-top: 20px; }
.directory-link { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 17px 0; min-height: 76px; }
.directory-link > span:first-child { min-width: 0; }
.directory-link strong { display: block; color: var(--text); font: 23px/1.35 var(--serif); }
.directory-meta { display: block; color: var(--muted); font-size: var(--detail-size); margin-top: 3px; }

/* Paper project pages keep the portfolio's quiet reading layout. */
.research-hero { max-width: 880px; }
.research-paper-title { font-size: 20px; line-height: 1.55; margin-bottom: 16px; }
.research-authors, .research-venue { font-size: var(--detail-size); color: var(--muted); margin-bottom: 10px; }
.research-authors strong { color: var(--text); font-weight: 600; }
.research-lead { margin: 20px 0 0; }
.research-section { margin-top: 48px; }
.research-section h2 { margin-bottom: 16px; }
.research-section > p { max-width: 880px; margin-bottom: 16px; }
.project-scene { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 48px; align-items: center; }
.project-scene > .actual-media { width: 100%; max-width: 360px; margin: 0; justify-self: center; }
.project-scene-wide { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; }
.project-scene-wide > .actual-media { max-width: none; }
.project-hand-row + .project-hand-row { margin-top: 32px; }
.project-hand-row > .hand-motion-media { max-width: 236px; }
.project-scene-copy { min-width: 0; }
.project-scene-copy p { margin-bottom: 16px; }
.project-scene-copy p:last-child { margin-bottom: 0; }
.project-image-stack { display: grid; gap: 14px; }
.project-image-stack a { display: block; }
.project-scene-copy code { font-size: .9em; overflow-wrap: anywhere; }
.project-formula { padding: 18px 14px; border: 1px solid var(--line); border-radius: 4px; background: #f4f7f3; font-size: 17px; overflow-x: auto; }
.project-formula .katex { font-size: 1.05em; }
.project-formula .katex-display { margin: 0; text-align: left; }
.project-formula .katex-display > .katex { text-align: left; }
.research-method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; margin: 25px 0; }
.research-method-grid h3 { font-size: 21px; margin-bottom: 9px; }
.research-method-grid p { margin-bottom: 0; }
.research-table-scroll { overflow-x: auto; margin: 23px 0 15px; overscroll-behavior-x: contain; }
.research-table-scroll:focus-visible { outline: 2px solid var(--link); outline-offset: 5px; }
.research-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--detail-size); font-variant-numeric: tabular-nums; line-height: 1.6; }
.research-comparison-table { min-width: 1120px; }
.research-table-scroll-summary { max-width: 680px; }
.research-summary-table { min-width: 480px; }
.research-table caption { text-align: left; font-weight: 600; margin-bottom: 10px; }
.research-table th, .research-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.research-table thead th { font-weight: 500; text-align: center; }
.research-table thead tr:first-child th { border-top: 1px solid var(--line); }
.research-table th[scope="row"], .research-table th[rowspan], .research-summary-table thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--paper); text-align: left; border-right: 1px solid var(--line); }
.research-table th[rowspan] { z-index: 2; }
.research-comparison-table td:nth-child(2n + 4), .research-comparison-table th[scope="colgroup"] + th, .research-comparison-table thead tr:nth-child(2) th:nth-child(2n + 3) { border-left: 1px solid var(--line); }
.research-table tbody th { font-weight: 400; }
.research-table td strong { color: var(--link); font-weight: 600; }
.research-table .research-average > * { background: #f0f4ef; border-top: 1px solid var(--line); }
.research-table .research-average th { font-weight: 600; }
.research-section .research-result-note { font-size: var(--detail-size); color: var(--muted); }
.research-transfer { margin-top: 25px; }
.research-real-figure { max-width: 580px; margin-inline: auto; margin-bottom: 20px; }
.research-compact-figure { max-width: 580px; margin-inline: auto; }
.research-feature-figure { max-width: 480px; margin-inline: auto; }
.research-contribution { border-top: 1px solid var(--line); padding-top: 25px; }

@media (min-width: 1200px) {
  .research-table-scroll-wide { width: 1120px; margin-inline: -80px; }
}
@media (max-width: 800px) {
  .container { width: min(960px, calc(100% - 44px)); }
  .site-nav { gap: 4px 19px; }
  .research-entry, .education-list > div { grid-template-columns: 130px minmax(0, 1fr); gap: 24px; }
  .publication-entry { grid-template-columns: 220px minmax(0, 1fr); }
  .project-scene { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 30px; }
  .project-scene-wide { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .publication-entry { grid-template-columns: 1fr; gap: 20px; }
  .research-method-grid { grid-template-columns: 1fr; gap: 20px; }
  .project-scene { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 570px) {
  .hardware-media-pair { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .entry-copy .hardware-media-pair > .hardware-hand-preview { max-width: 180px; justify-self: center; }
  .container { width: calc(100% - 36px); }
  .site-header { flex-wrap: wrap; gap: 4px; align-content: center; padding: 18px 0 10px; }
  .site-name { flex-basis: 100%; font-size: 20px; }
  .site-nav { gap: 0 21px; font-size: var(--small-size); }
  .site-nav a { min-height: 44px; }
  .profile { padding-top: 34px; grid-template-columns: minmax(0, 1fr) clamp(100px, 30vw, 120px); column-gap: 18px; row-gap: 16px; }
  .profile-body { grid-column: 1 / -1; }
  .profile-photo-wrap { grid-row: 1; align-self: start; }
  .profile-photo { position: static; width: 100%; max-height: none; }
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  .profile-bio { font-size: 17px; }
  .profile-affiliation { margin-bottom: 21px; }
  .profile-links { gap: 4px 23px; margin-top: 14px; }
  .profile-links a, .resource-links a { min-height: 40px; }
  .availability { font-size: var(--detail-size); }
  .academic-section { margin-top: 39px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 2px; margin-bottom: 15px; }
  .research-entry { grid-template-columns: 1fr; gap: 10px; padding: 23px 0; }
  .entry-meta { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 14px; row-gap: 2px; font-size: 14px; }
  .entry-meta p { margin: 0; }
  .entry-meta .entry-year { font-size: 14px; }
  h3 { font-size: 22px; }
  .entry-copy > p { font-size: 17px; }
  .education-list > div { grid-template-columns: 1fr; gap: 3px; }
  .education-list dd { gap: 14px; }
  .education-emblem { width: 52px; height: 52px; }
  .project-facts { grid-template-columns: 1fr; gap: 15px; }
  .project-heading { gap: 2px 14px; }
  .project-heading h3 { flex-basis: 100%; }
  .page-intro { padding-top: 28px; }
  .page-intro h1 { font-size: 31px; }
  .page-intro > p { font-size: 17px; }
  .demo-toolbar { align-items: flex-start; }
  .filter-group { gap: 3px 9px; }
  .filter-button { min-height: 44px; padding-inline: 4px; }
  .demo-item { padding-block: 27px; }
  .research-paper-title { font-size: 19px; }
  .research-project main { font-size: 17px; }
  .research-section { margin-top: 36px; }
  .site-footer { margin-top: 40px; flex-direction: column; padding-top: 19px; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  .container { width: 100%; }
  .site-header, .site-footer, .filter-group, .skip-link { display: none; }
  .profile { padding-top: 0; }
  .research-entry, .education-list > div { break-inside: avoid; }
}
