/* Academic profile: static adaptation of AcadHomepage.
 * Original structure copyright (c) 2022 Yi Ren, MIT License; see /LICENSE.
 */
:root {
  --ink: #494e52;
  --muted: #636b72;
  --accent: #224b8d;
  --accent-dark: #153463;
  --line: #eeeeee;
  --sans: "Trebuchet MS", Helvetica, sans-serif;
  --header-offset: 85px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Offset content targets without making focused sticky-header links scroll the page. */
#main, #top, .academic-section { scroll-margin-top: var(--header-offset); }
body { margin: 0; min-height: 100vh; background: #fff; color: var(--ink); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
svg { width: 20px; height: 20px; flex-shrink: 0; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-dark); }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: #dae6f4; color: var(--accent-dark); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.3; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 10px 20px; background: white; border: 2px solid var(--accent); }
.skip-link:focus { top: 12px; }
.masthead { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.masthead__inner-wrap { position: relative; max-width: 1280px; min-height: 64px; margin: auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-brand { color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-name { font-size: 19px; font-weight: 700; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a { font-size: 15px; text-decoration: none; color: var(--ink); padding: 8px 0; }
@media (hover: hover) {
  .site-nav a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 6px; }
}
.site-nav .nav-cv { color: var(--accent); }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 12px 10px; background: transparent; border: 0; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
/* Match the sticky inset from the first pixel of scrolling. */
.page-shell { max-width: 1280px; margin: 20px auto 0; padding: 0 24px; }
.profile-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; align-items: start; }
.sidebar { min-width: 0; margin-bottom: 28px; }
.author__avatar { margin-bottom: 20px; }
.author__avatar img { display: block; object-fit: cover; object-position: center 42%; width: 200px; height: 200px; border-radius: 50%; border: 4px solid #fff; outline: 1px solid var(--line); }
.author__name { margin-bottom: 6px; font-size: 22px; letter-spacing: -.4px; white-space: nowrap; }
.author__pronouns { font-size: 13px; line-height: 1.5; color: var(--muted); margin-bottom: 10px; }
.author__university { font-size: 14px; line-height: 1.6; margin-bottom: 0; }
.author__urls-wrapper { margin-top: 16px; }
.author__urls { list-style: none; padding: 0; margin: 0; }
.author__urls a, .author__location, .pending-link { display: flex; align-items: center; min-height: 32px; gap: 9px; color: var(--ink); text-decoration: none; font-size: 14px; }
.author__urls a:hover { color: var(--accent); text-decoration: underline; }
.author__urls svg { width: 17px; height: 17px; }
.author__urls .email-link { min-height: 50px; margin-bottom: 2px; }
.email-link > span { min-width: 0; }
.email-label { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.email-address { display: block; font-size: 13px; overflow-wrap: anywhere; }
.pending-link { color: var(--muted); }
.pending-label { margin-left: -4px; font-size: 12px; }
.author__urls .sidebar-cv { color: var(--accent); }
.page, .page__inner-wrap, .page__content { min-width: 0; }
.academic-section { margin-bottom: 28px; }
.academic-section:last-child { margin-bottom: 0; }
.section-heading { margin-bottom: 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.section-heading h2 { font-size: 24px; margin: 0; }
.page__content p { margin-bottom: 14px; }
.page__content strong { font-weight: 700; }
.page__content .soon { margin: 0; }
.academic-section .research-date { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
/* Literal hyphens in the HTML keep entries plain, including copied text. */
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding-left: .65em; text-indent: -.65em; margin-bottom: 7px; }
.plain-list li:last-child { margin-bottom: 0; }
.site-footer { margin: 42px 0 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 0 24px; color: var(--muted); }
.site-footer p { font-size: 12px; margin: 0 0 3px; }
.site-footer .footer-credit { font-size: 11px; }
.footer-credit a { color: inherit; }
.back-to-top { font-size: 12px; text-decoration: none; }
.back-to-top span { margin-left: 7px; }
/* The CV shares the profile's plain white layout. */
.document-shell { max-width: 1040px; margin: 32px auto 24px; padding: 0 24px; }
.document-heading { margin-bottom: 24px; }
.document-heading h1 { font-size: 32px; margin-bottom: 8px; }
.document-heading p { color: var(--muted); margin-bottom: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 43px; padding: 8px 16px; border: 1px solid var(--accent); border-radius: 3px; font-size: 14px; text-decoration: none; }
.button-outline { color: var(--accent); background: white; }
.button-outline:hover { background: #f5f7fa; }
.button-solid { color: white; background: var(--accent); }
.button-solid:hover { color: white; background: var(--accent-dark); }
.cv-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cv-help { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.cv-viewer { display: block; width: 100%; height: 80vh; min-height: 650px; border: 1px solid var(--line); background: white; }
.document-footer { max-width: 992px; margin: 0 auto 24px; }
.error-shell { max-width: 640px; margin: 64px auto; padding: 0 24px; }
.eyebrow { font-size: 12px; color: var(--muted); }
.error-shell h1 { font-size: 32px; }
.error-shell > p { color: var(--muted); }
@media (min-width: 801px) {
  .sidebar {
    position: sticky;
    top: var(--header-offset);
    margin-bottom: 0;
  }
  /* Keep one page scrollbar. The portrait yields space to the contact links. */
  .profile_box { display: flex; flex-direction: column; max-height: calc(100dvh - var(--header-offset) - 20px); }
  .author__avatar { position: relative; flex: 0 1 200px; min-height: 0; margin-bottom: clamp(8px, calc((100dvh - 600px) / 10), 20px); }
  .author__avatar img { position: absolute; top: 0; left: 0; width: auto; height: 100%; aspect-ratio: 1; }
  .author__content, .author__urls-wrapper { flex-shrink: 0; }
  .author__urls-wrapper { margin-top: clamp(8px, calc((100dvh - 600px) / 10), 16px); }
  .author__urls a, .author__location, .pending-link { min-height: clamp(26px, calc(3dvh + 8px), 32px); }
  .author__urls .email-link { min-height: clamp(38px, calc(6dvh + 2px), 50px); }
}
@media (max-width: 1080px) {
  .site-nav { gap: 18px; }
  .profile-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 32px; }
  .document-footer { margin-left: 24px; margin-right: 24px; }
}
@media (max-width: 800px) {
  :root { --header-offset: 84px; }
  .masthead__inner-wrap { gap: 16px; flex-wrap: wrap; }
  .brand-name { font-size: clamp(16px, 4.6vw, 19px); }
  html:not(.js) { --header-offset: 20px; }
  html:not(.js) .masthead { position: static; }
  .js .nav-toggle { display: block; }
  .site-nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 6px 24px; padding-bottom: 12px; }
  .js #site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; width: auto; padding: 14px 24px; background: white; border-bottom: 1px solid var(--line); }
  .js #site-nav.is-open { display: flex; }
  .page-shell { margin-top: 24px; }
  .profile-layout { display: block; }
  .sidebar { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
  .profile_box { display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: 24px; align-items: center; }
  .author__avatar { margin: 0; align-self: start; }
  .author__avatar img { width: 160px; height: 160px; }
  .author__urls-wrapper { grid-column: 1 / -1; margin-top: 20px; }
  .author__urls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .author__location, .author__urls > li:has(.email-link) { grid-column: 1 / -1; }
  .author__urls a, .pending-link { min-height: 38px; }
  .site-footer { margin-top: 32px; }
}
@media (max-width: 520px) {
  .masthead__inner-wrap { padding: 0 18px; }
  .page-shell { padding: 0 18px; }
  .profile_box { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .author__avatar { justify-self: center; }
  .author__avatar img { width: 180px; height: 180px; }
  .author__content { text-align: center; }
  .author__name { font-size: clamp(20px, 5.6vw, 23px); }
  .author__urls-wrapper { margin-top: 0; }
  .author__urls { column-gap: 12px; }
  .author__urls a, .pending-link { gap: 7px; font-size: 13px; }
  .author__urls > li:has(.pending-link), .author__urls > li:has(.sidebar-cv) { grid-column: 1 / -1; }
  .pending-label { font-size: 11px; }
  .section-heading h2 { font-size: 22px; }
  .page__content { font-size: 15px; }
  .academic-section { margin-bottom: 24px; }
  .site-footer { align-items: flex-start; gap: 16px; }
  .site-footer p { font-size: 11px; }
  .site-footer .footer-credit { font-size: 10px; }
  .back-to-top { font-size: 11px; white-space: nowrap; }
  .document-shell { padding: 0 18px; }
  .document-footer { margin-left: 18px; margin-right: 18px; }
  .document-heading h1 { font-size: 28px; }
  .cv-viewer { min-height: 520px; }
  .error-shell { margin: 36px auto; padding: 0 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  body { font-size: 11pt; color: black; }
  .masthead, .nav-toggle, .skip-link, .back-to-top, .cv-actions, .cv-help { display: none; }
  .page-shell, .document-shell, .error-shell { margin: 0; padding: 0; max-width: none; }
  .profile-layout { display: block; }
  .sidebar { position: static; margin: 0; padding: 0 0 16px; border-bottom: 1px solid #ccc; }
  .profile_box { display: block; }
  .author__avatar, .author__urls-wrapper { display: none; }
  .academic-section { break-inside: avoid; }
  .site-footer { margin: 20px 0 0; padding: 20px 0; }
  a { color: black; }
}
