@font-face {
  font-family: Allura;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/allura-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: Allura;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/allura-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Allura;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/allura-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --paper: #f5f1e8;
  --surface: #fbf8f0;
  --ink: #1d2922;
  --muted: #4e5a52;
  --line: #d9d1c1;
  --accent: #8d352f;
  --shell-max: 84rem;
  --shell-side: clamp(1rem, 3.5vw, 3rem);
  --serif: Georgia, "Noto Serif SC", "Songti SC", SimSun, serif;
  --script: Allura, "Kaiti SC", KaiTi, var(--serif);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-block-start: 4rem; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle, rgba(99, 79, 49, .11) .55px, transparent .8px) 0 0 / 5px 5px,
    radial-gradient(ellipse at 8% 0%, #eee7d9, transparent 53%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: .9375rem;
  line-height: 1.5;
}
h1, h2, p, ul { margin: 0; }
a { color: inherit; text-underline-offset: .18em; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: min(var(--shell-max), calc(100% - 2 * var(--shell-side))); margin-inline: auto; }
.skip-link { position: absolute; top: .5rem; left: .5rem; z-index: 10; padding: .5rem .8rem; transform: translateY(-180%); background: var(--paper); }
.skip-link:focus { transform: none; }

.homepage-loading { display: flex; min-height: 100dvh; padding: 2rem; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; color: var(--muted); text-align: center; }
.homepage-loading button { padding: .45rem .9rem; border: 1px solid var(--line); border-radius: .25rem; background: var(--surface); color: var(--ink); }

.masthead {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.masthead-inner { display: flex; min-height: 3rem; align-items: center; gap: clamp(1.1rem, 4vw, 3.7rem); }
.brand { flex: none; color: var(--ink); font-family: var(--serif); font-size: 1rem; font-weight: 600; text-decoration: none; }
.masthead nav { display: flex; align-items: center; gap: clamp(1.1rem, 2vw, 1.9rem); }
.masthead nav a, .back-home { flex: none; padding-block: .7rem; color: var(--muted); font-size: .9375rem; text-decoration: none; white-space: nowrap; }
.masthead nav a:hover, .back-home:hover { color: var(--accent); text-decoration: underline; }

.academic-layout {
  --page-inset: max(var(--shell-side), (100% - var(--shell-max)) / 2);
  --main-start: calc(var(--page-inset) + 13.75rem + clamp(1.75rem, 3.2vw, 2.9rem));
  display: grid;
  width: 100%;
  grid-template-columns: var(--main-start) minmax(0, min(60rem, calc(100% - var(--main-start) - var(--page-inset)))) 1fr;
  align-items: start;
  padding-block: 2.25rem 3.5rem;
}
.profile {
  position: sticky;
  top: 5.2rem;
  justify-self: center;
  width: min(calc(100% - 2rem), 13.75rem);
  text-align: center;
  overflow-wrap: anywhere;
}
.portrait {
  position: relative;
  display: grid;
  width: 10.625rem;
  margin-inline: auto;
  aspect-ratio: 5 / 6;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #d5cbb8;
}
.portrait svg { width: 72%; }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-name { margin-top: .75rem; color: var(--ink); font-family: var(--script); font-size: clamp(1.9rem, 2.6vw, 2.25rem); font-weight: 400; line-height: 1.2; }
.profile-institution { margin-top: .4rem; }
.profile-affiliation { margin-top: 1rem; white-space: pre-line; }
.profile-links {
  display: grid;
  gap: .55rem;
  width: fit-content;
  max-width: 100%;
  margin: .9rem auto 0;
  padding: 0;
  text-align: start;
  list-style: none;
}
.profile-links li { display: grid; grid-template-columns: 1rem minmax(0, 1fr); gap: .4rem; align-items: start; }
.profile-link-icon { display: grid; block-size: 1.5em; block-size: 1lh; place-items: center; color: var(--accent); }
.profile-link-icon svg { display: block; width: .95rem; height: .95rem; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.profile-links a { text-decoration: none; }
.profile-links a:hover { text-decoration: underline; }
.copy-email { justify-self: start; max-width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: start; overflow-wrap: anywhere; cursor: copy; }
.copy-email:hover { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }
.copy-email:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy-feedback {
  position: fixed;
  z-index: 4;
  inset-inline: 1rem;
  inset-block-end: max(1rem, env(safe-area-inset-bottom));
  width: max-content;
  margin-inline: auto;
  padding: .38rem .8rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--surface);
  box-shadow: 0 .2rem .7rem rgb(29 41 34 / .12);
  color: var(--accent);
  font-size: .85rem;
  pointer-events: none;
}
.copy-feedback:empty { opacity: 0; }

.academic-content { min-width: 0; overflow-wrap: anywhere; }
.academic-section + .academic-section { margin-top: 1.2rem; }
.academic-section > h1, .academic-section > h2 {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-bottom: .42rem;
  border-bottom: 1px solid var(--accent);
  color: var(--ink);
  font-family: var(--script);
  font-size: clamp(1.85rem, 2.4vw, 2.15rem);
  font-weight: 400;
  line-height: 1.2;
}
.academic-content .heading-icon { width: 1rem; height: 1rem; flex: none; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.academic-section > p { margin-top: .65rem; }
.biography { white-space: pre-wrap; }
.empty-note { color: var(--muted); }
.academic-list { margin-top: .55rem; padding-inline-start: 1.85rem; }
.academic-list li { margin-block: .35rem; }
.academic-list em { color: var(--accent); font-variant-numeric: tabular-nums; }
.academic-list a { color: var(--accent); }
#about-details h2 { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; font-family: var(--script); font-size: 1.6rem; font-weight: 400; line-height: 1.2; }

@media (min-width: 47.001rem) {
  /* Preserve the current 1280px desktop design and scale all rem-based dimensions with it. */
  html.homepage-document { font-size: 1.25vw; }
  .home-page .academic-content { grid-column: 2; }
  .home-page .profile {
    position: fixed;
    top: calc(5.25rem + 1px);
    left: calc((var(--main-start) - 13.75rem) / 2);
    width: 13.75rem;
    max-height: calc(100dvh - 6.25rem - 1px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

@media (max-width: 47rem) {
  html { scroll-padding-block-start: 6.5rem; }
  .academic-layout { width: calc(100% - 2 * var(--shell-side)); grid-template-columns: minmax(0, 1fr); gap: 1.3rem; padding-top: 1.4rem; }
  .profile { position: static; display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1rem; width: 100%; padding: 0 0 1.15rem; border-bottom: 1px solid var(--line); text-align: start; }
  .portrait { width: 100%; }
  .profile-name { margin-top: 0; }
  .profile-affiliation { margin-top: .4rem; }
  .profile-links { gap: .35rem; margin: .6rem 0 0; }
  .masthead-inner { gap: .9rem; }
  .home-page .masthead-inner { align-items: flex-start; padding-block: .3rem; }
  .home-page .brand { padding-block: .35rem; }
  .home-page .masthead nav { flex: 1; flex-wrap: wrap; gap: 0 .85rem; }
  .home-page .masthead nav a { padding-block: .35rem; }
  .masthead nav a, .back-home { font-size: .86rem; }
}
