:root {
  color-scheme: dark;
  --paper: #43382f;
  --ink: #f1e4ce;
  --rule-overhang: .55em;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] {
  color-scheme: light;
  --paper: #c7bca8;
  --ink: #302b24;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body, h1, p { margin: 0 }
.sheet {
  width: min(100%, 1640px);
  min-height: 100svh;
  margin-inline: auto;
  padding-inline: clamp(20px, 6vw, 100px);
}
header { display: flex; align-items: center; justify-content: flex-end; padding-block: clamp(12px, 3vh, 30px) }
.languages { display: flex; gap: 3px }
button {
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  min-width: 44px;
  min-height: 44px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .07em;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 0;
}
.languages button[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 6px }
#theme {
  margin-inline-start: 8px;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.theme-icon {
  width: 17px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 50%;
  overflow: hidden;
}
.theme-icon::before { content: ""; display: block; width: 50%; height: 100%; background: currentColor }
main { padding-block: clamp(52px, 20svh, 225px) 48px }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, .9fr);
  align-items: start;
  gap: clamp(20px, 8vw, 140px);
  width: 88%;
  margin-inline: auto;
}
.identity {
  width: max-content;
  align-self: center;
  font-size: clamp(24px, 3.85vw, 56px);
  font-weight: 400;
  letter-spacing: -.026em;
  line-height: 1.16;
}
#name { font: inherit; letter-spacing: inherit; padding-inline-end: var(--rule-overhang) }
#primary-name, #alias, .slash { display: block; width: fit-content }
#primary-name { white-space: nowrap }
.slash { font-size: .72em; line-height: 1.35 }
html:lang(zh) #name { letter-spacing: .025em }
.rule { height: 1px; background: currentColor; margin-bottom: .36em; transform-origin: left }
nav { display: grid; justify-items: start; align-content: start; gap: clamp(2px, 1vh, 12px) }
a { color: inherit; text-decoration: none }
nav a, .back, .back-to-top {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--directory-font, clamp(16px, 1.48vw, 22px));
  line-height: 1.35;
  letter-spacing: -.008em;
}
a:hover, a:focus-visible { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px }
:focus-visible { outline: 1px solid currentColor; outline-offset: 3px }
h1:focus { outline: none }
.range-defs { position: absolute; pointer-events: none }
.interest-entry { width: 3em; min-height: 44px }
.interest-entry svg { height: 1.85em; overflow: visible }
.entry-pellet { fill: #c8ff00; stroke: #536900; stroke-width: .65 }
.entry-taut { opacity: 0 }
.interest-entry:is(:hover,:focus-visible,:active) .entry-string { opacity: 0 }
.interest-entry:is(:hover,:focus-visible,:active) .entry-taut { opacity: 1 }
.interest-entry:is(:hover,:focus-visible,:active) .entry-pellet { transform: translate(-18px,7px) }
@media (prefers-reduced-motion: no-preference) {
  .entry-pellet { transition: transform .35s ease }
  .entry-string,.entry-taut { transition: opacity .35s ease }
}
#section { width: 88%; margin-inline: auto }
.back { gap: .4em; width: fit-content; margin-bottom: 4vh }
#section-title { font-size: clamp(28px, 3.5vw, 50px); font-weight: 400; letter-spacing: -.035em; line-height: 1.15 }
#empty { margin-top: 20px }
main:has(#about:not([hidden])) { padding-block: clamp(10px, 4svh, 68px) 48px }
#section:has(#about:not([hidden])) { width: 100% }
#section:has(#about:not([hidden])) .back { margin-bottom: clamp(12px, 2.8svh, 40px) }
#section:has(:is(#about, #experience, #design-view):not([hidden]), #research-view:not([hidden]) > .research-index) #section-title { width: fit-content }
#section:has(:is(#about, #experience, #design-view):not([hidden]), #research-view:not([hidden]) > .research-index) #section-title::after {
  content: "";
  display: block;
  width: calc(100% + var(--rule-overhang));
  margin-top: .35em;
  height: 1px;
  background: currentColor;
  transform-origin: left;
}
#about {
  display: grid;
  grid-template-areas: "facts" "interests" "contact";
  gap: 28px;
  margin-top: clamp(28px, 7svh, 96px);
  font-size: clamp(17px, 1.48vw, 30px);
  line-height: 1.42;
}
#about dl {
  min-width: 0;
  margin: 0;
}
.about-facts {
  grid-area: facts;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: clamp(16px, 3.8svh, 60px) 1em;
}
.about-interests { grid-area: interests }
.about-contact { grid-area: contact }
#about dt {
  border-inline-start: 2px solid currentColor;
  padding-inline-start: .6em;
  line-height: 1.15;
  margin-bottom: .65em;
  font-size: clamp(13px, .95vw, 19px);
  font-weight: 500;
}
#about dd { margin: 0; overflow-wrap: anywhere }
#about dd p + p { margin-top: .6em }
.contacts { display: grid; justify-items: start; gap: .55em }
.contacts a { text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px }
.contacts .cv-download {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: .5em;
  padding: .45em 1em;
  border: 1px solid currentColor;
  font-size: 1rem;
  text-decoration: none;
}
.cv-download:is(:hover, :focus-visible) { background: var(--ink); color: var(--paper) }

@media (min-width: 520px) {
  #about {
    grid-template-areas: "facts interests" "facts contact";
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    column-gap: clamp(24px, 5vw, 72px);
  }
}
@media (min-width: 960px) {
  #about {
    grid-template-areas: "facts interests contact";
    grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr) minmax(0, .88fr);
    column-gap: clamp(32px, 4.5vw, 160px);
  }
}
@media (orientation: landscape) and (max-height: 520px) {
  main:has(#about:not([hidden])) { padding-block: 0 20px }
  #section:has(#about:not([hidden])) {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  #section:has(#about:not([hidden])) .back { grid-column: 2; grid-row: 1; margin: 0 }
  #section:has(#about:not([hidden])) h1 { grid-column: 1; grid-row: 1 }
  #about {
    grid-column: 1 / -1;
    margin-top: 14px;
    row-gap: 16px;
    font-size: 15px;
  }
  #about dt { margin-bottom: .25em }
  #about dd p + p, .contacts { margin: 0 }
  .contacts { gap: .1em }
}
@media (min-width: 900px) and (min-height: 521px) {
  .sheet {
    width: 100%;
    padding-inline: clamp(40px, 5vw, 180px);
  }
  main { padding-block: clamp(36px, 8svh, 120px) 6svh }
  .layout {
    width: auto;
    margin-inline: 8vw;
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 6vw;
  }
  .identity {
    font-size: clamp(44px, 3.85vw, 72px);
    font-weight: 400;
  }
  #directory {
    min-height: 62svh;
    align-content: space-between;
    gap: 20px;
  }
  nav { --directory-font: clamp(20px, 1.65vw, 36px) }
}
@media (max-width: 740px) {
  .layout { width: 100%; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(16px, 5vw, 32px) }
  .identity { font-size: clamp(24px, 6.4vw, 34px) }
  #section { width: 100% }
  nav { gap: 8px }
  nav a { padding-block: 7px }
}
@media (orientation: landscape) and (max-height: 520px) {
  header { padding-block: 2px }
  main { padding-block: 18px }
  nav { gap: 0 }
}
/* Share the viewport row so the toolbar does not shift the home composition. */
.sheet:has(#home:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.sheet:has(#home:not([hidden])) > header {
  grid-area: 1 / 1;
  place-self: start end;
  z-index: 1;
}
main:has(#home:not([hidden])) {
  grid-area: 1 / 1;
  align-self: center;
  padding-block: clamp(48px, 11svh, 100px);
}
@media (max-width: 740px) and (orientation: portrait) {
  .sheet:has(#home:not([hidden])) {
    grid-template-rows: auto 1fr;
    padding-inline: clamp(22px, 7vw, 48px);
  }
  .sheet:has(#home:not([hidden])) > header {
    padding-block: max(8px, env(safe-area-inset-top)) 4px;
  }
  main:has(#home:not([hidden])) {
    grid-area: 2 / 1;
    align-self: stretch;
    display: grid;
    align-content: center;
    padding-block: clamp(24px, 5svh, 52px) max(48px, 11svh, env(safe-area-inset-bottom));
  }
  #home.layout {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    gap: clamp(30px, 7svh, 72px);
  }
  #home .identity { font-size: clamp(34px, 9vw, 52px) }
  #home #alias {
    display: flex;
    align-items: baseline;
    gap: .4em;
    margin-top: .18em;
    font-size: .67em;
  }
  #directory { gap: clamp(1px, .7svh, 8px) }
  #directory a { font-size: clamp(18px, 4.6vw, 23px) }
}
@media (prefers-reduced-motion: no-preference) {
  #section-title.draw::after,
  .rule.draw { animation: extend .9s cubic-bezier(.34,.08,.34,1) both }
  #home .rule.draw { animation-duration: 2.2s; animation-timing-function: ease-in-out }
  @keyframes extend { from { transform: scaleX(0) } to { transform: scaleX(1) } }
}

main:has(#experience:not([hidden])) { padding-block: 0 clamp(36px, 7vh, 88px) }
#section:has(#experience:not([hidden])) { width: 100% }
#section:has(#experience:not([hidden])) .back { margin-bottom: clamp(10px, 2vh, 28px) }
#experience { margin-top: clamp(28px, 5vh, 64px) }
.chapters {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(8px, 3vw, 60px);
  background: var(--paper);
  padding-block: 7px;
}
.chapters a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-size: clamp(16px, 2.05vw, 38px);
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.12;
}
.chapters [aria-current] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .22em }
.timeline-group {
  margin-top: clamp(36px, 7svh, 80px);
  scroll-margin-top: 80px;
}
.timeline-group:last-child { min-height: calc(100svh - 80px) }
.timeline-group:focus { outline: none }
.timeline-group > h2 {
  font-size: clamp(34px, 4.25vw, 76px);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -.04em;
  margin: 0 0 clamp(24px, 4svh, 48px);
}
.timeline-group article + article { margin-top: clamp(56px, 8.5svh, 100px) }
.entry-body dd:last-child { margin-bottom: 0 }
#experience article {
  scroll-margin-top: 80px;
  display: grid;
  align-content: start;
  align-items: start;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
  gap: clamp(36px, 7vw, 140px);
  overflow-wrap: anywhere;
}
#experience article:focus { outline: none }
.entry-heading { max-width: 42em }
.entry-date { font-size: clamp(19px, 1.7vw, 32px); font-weight: 550; font-variant-numeric: tabular-nums }
.institution { display: flex; align-items: flex-start; gap: clamp(12px, 1.45vw, 26px); margin: .9em 0 }
.institution img {
  flex: none;
  width: clamp(44px, 4.6vw, 78px);
  height: clamp(44px, 4.6vw, 78px);
  object-fit: contain;

}
.entry-heading h3 {
  font-size: clamp(32px, 3.45vw, 70px);
  letter-spacing: -.045em;
  font-weight: 575;
  line-height: 1.08;
  margin: 0;
}
.entry-role { max-width: 47ch; font-size: clamp(16px, 1.4vw, 25px); line-height: 1.4 }
.entry-body { font-size: clamp(16px, 1.22vw, 22px); line-height: 1.5; max-width: 62ch }
.definition-source { display: block; margin-top: .25em }
.definition-source a { text-decoration: underline; text-underline-offset: .16em }
.entry-body dl { margin: 0 }
.entry-body dt { font-weight: 650; font-size: 1.08em }
.entry-body dd { margin: .22em 0 1.25em }
.entry-body details { margin-top: 1.4em }
.entry-body summary {
  border: 1px solid currentColor;
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: space-between;
  gap: 1.4em;
  min-height: 44px;
  padding: .5em .9em;
  font-weight: 550;
  cursor: pointer;
}
.entry-body summary::-webkit-details-marker { display: none }
.disclosure-icon::before { content: "+" }
details[open] .disclosure-icon::before { content: "−" }
.entry-body h4 { font-size: 1em; margin: 1.6em 0 .5em }
.entry-body ul { list-style: none; padding: 0; margin: 0 }
.entry-body li { display: grid; align-items: baseline; grid-template-columns: 5.2em minmax(0, 1fr) max-content; gap: .5em; padding: .45em 0; font-size: .94em }
.mark { justify-self: end; white-space: nowrap }
@media (max-width: 680px) {
  #experience article { grid-template-columns: 1fr; gap: 24px }
  .chapters a { min-height: 46px }
}
@media (orientation: landscape) and (max-height: 520px) {
  #experience { margin-top: 12px }
  #experience article { gap: 24px; grid-template-columns: minmax(0,.85fr) minmax(0,1fr) }
  .entry-heading h3 { font-size: 26px }
  .entry-date { font-size: 18px }
  .chapters { padding-block: 2px }
}
