/* Junli Wang — personal website. */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  --accent: #404040;
  --nav: #555555;
  --soft: #dddddd;
  --venue: #666666;
  --muted: #777777;
  --page: #f5f5f5;
  --surface: #fff;
  --text: #333333;
  --line: rgba(50,50,50,.17);
  --flag: #f5f5f5;
  margin: 0;
  color: var(--text);
  background: var(--page);
  font: 11pt/1.6 'Avenir Next', 'Nunito', 'Open Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
html.dark-mode body {
  --accent: #dddddd;
  --nav: #141414;
  --soft: rgba(220,220,220,.22);
  --venue: #bdbdbd;
  --muted: #aaaaaa;
  --page: #141414;
  --surface: #1e1e1e;
  --text: #dedede;
  --line: rgba(255,255,255,.12);
  --flag: #141414;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
strong, b { font-weight: 600; }
p { margin: 0 0 1.25rem; }
h1, h2 { margin: 0 0 1.25rem; font-weight: 600; line-height: 1.3; }
.site-shell { width: 100%; max-width: 1100px; margin: 25px auto; background: var(--surface); box-shadow: 0 0 10px var(--line); }
.masthead { position: relative; padding: 25px; }
.brand { display: inline-block; }
.brand-name { font-size: 2rem; line-height: 1; font-weight: 600; }
.brand-symbols { display: flex; justify-content: space-around; padding-top: 10px; margin-top: 10px; border-top: 1px solid #ebebeb; color: var(--accent); font-size: .9375rem; line-height: 1.4; }
.brand:hover { color: var(--text); }
.theme-toggle { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; background: transparent; color: var(--accent); border: 2px solid var(--accent); border-radius: 50%; transition: background-color .2s, color .2s, transform .2s; }
.theme-toggle i { font-size: 16px; }
.theme-toggle:hover { background: var(--accent); color: var(--surface); transform: scale(1.1); }
.navigation { background: var(--nav); border-bottom: 4px solid var(--accent); }
.navigation-links { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.navigation-links li { border-left: 1px solid rgba(255,255,255,.1); transition: background-color .25s; }
.navigation-links li:first-child { border-left: 0; }
.navigation-links a { display: block; padding: 7px 15px; font-size: 14px; font-weight: 600; color: #fff; }
.navigation-links i { margin-right: 4px; }
.navigation-links .active, .navigation-links li:hover { background: var(--accent); }
html.dark-mode .navigation { border-bottom-color: #555; }
html.dark-mode .navigation-links .active { background: #404040; }
html.dark-mode .navigation-links li:hover { background: #3a3a3a; }
.menu-toggle { display: none; width: 100%; padding: 7px 15px; border: 0; background: var(--nav); color: #fff; text-align: right; font-weight: 600; text-transform: uppercase; }
.menu-toggle i { margin-left: 8px; }
.page-layout { display: flex; gap: 2.5%; padding: 25px; }
.main-content { flex: 1 0 65.83%; min-width: 0; order: 1; }
.profile-sidebar { flex: 1 0 18%; min-width: 0; order: 0; }
.widget { margin-bottom: 25px; }
.widget-title { padding-bottom: 5px; margin-bottom: 8px; border-bottom: 3px solid var(--accent); font-size: 1rem; text-transform: uppercase; }
.widget-title i { margin-right: 4px; }
.profile { padding-top: 8px; text-align: center; }
.profile-avatar { display: block; width: 110px; height: 110px; margin: 0 auto 8px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 3px var(--accent); object-fit: cover; }
.profile-name { font-size: 1.25rem; }
@font-face { font-family: 'MyCustomFont'; src: url('../fonts/STKaiti.woff2') format('woff2'); font-weight: normal; font-style: normal; font-display: swap; }
.chinese { font-family: 'KaiTi SC', 'KaiTi', 'MyCustomFont'; }
.social-links { padding: 0; margin: 0; list-style: none; }
.social-links a { display: flex; align-items: center; gap: 8px; padding: 5px 10px; margin-bottom: 8px; font-weight: 600; transition: background-color .25s; }
.social-links a:hover { background: var(--accent); color: var(--surface); }
.social-links i { width: 24px; font-size: 24px; text-align: center; }
.scholar-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font: 20px/1 Georgia, serif; color: var(--surface); background: var(--text); }
.social-links a:hover .scholar-icon { color: var(--accent); background: var(--surface); }
html.dark-mode .widget-title { border-color: #555; }
html.dark-mode .profile-avatar { box-shadow: 0 0 0 3px #555; }
.bio a, .contact-content a, .main-content > p a { color: var(--accent); font-weight: 600; }
.bio a:hover, .contact-content a:hover, .main-content > p a:hover { text-decoration: underline; }
.bio { margin-bottom: 20px; }
.page-title { font-size: 2rem; }
.experience-timeline { position: relative; width: 760px; max-width: 100%; margin: 20px auto 0; padding: 1em 0; list-style: none; }
.experience-timeline::before { content: ''; position: absolute; top: 0; bottom: 0; left: calc(50% - 3px); width: 6px; background: linear-gradient(to bottom, transparent, #505050 8%, #505050 92%, transparent); }
.experience-item { position: relative; display: flow-root; padding: 1em 0; }
.experience-body { position: relative; width: calc(50% - 30px); }
.experience-item--left .experience-body { float: left; text-align: right; }
.experience-item--right .experience-body { float: right; }
.experience-heading { display: flex; align-items: center; position: relative; width: max-content; max-width: calc(100% + 10px); }
.experience-item--left .experience-heading { flex-direction: row-reverse; margin-left: auto; }
.experience-heading::before { content: ''; position: absolute; top: 50%; width: 20px; height: 20px; margin-top: -10px; border: 4px solid var(--accent); border-radius: 50%; background: var(--surface); z-index: 2; }
.experience-item--left .experience-heading::before { right: -40px; }
.experience-item--right .experience-heading::before { left: -40px; }
.experience-flag { position: relative; display: block; flex-shrink: 0; max-width: 100%; padding: 6px 10px; background: var(--flag); border-radius: 5px; box-shadow: 1px 1px 1px rgba(0,0,0,.15), 0 0 1px rgba(0,0,0,.15); font-weight: 600; text-align: left; }
.experience-flag a:hover { color: inherit; }
.experience-flag::after { content: ''; position: absolute; top: 50%; margin-top: -8px; border: 8px solid transparent; }
.experience-item--left .experience-flag::after { left: 100%; border-left-color: var(--flag); }
.experience-item--right .experience-flag::after { right: 100%; border-right-color: var(--flag); }
.experience-time { display: block; flex-shrink: 0; padding: 4px 6px; background: var(--flag); color: var(--accent); font-size: .66666em; line-height: 1em; white-space: nowrap; }
.experience-description { margin: 1em .75em 0 0; font-size: .77777em; line-height: 1.5; font-style: italic; }
.experience-item--right .experience-description { margin: 1em 0 0 .75em; }
.experience-description a:hover { text-decoration: underline; }
html.dark-mode .experience-timeline::before { background: linear-gradient(to bottom, transparent, #787878 8%, #787878 92%, transparent); }
html.dark-mode .experience-heading::before { border-color: #777; }
html.dark-mode .experience-time { color: var(--text); background: #3a3a3a; }
/* Existing experience data includes an explanatory Xinya College tooltip. */
.tooltip { position: relative; border-bottom: 1px dotted currentColor; cursor: help; }
.tooltip-text { display: none; position: absolute; bottom: 100%; left: 0; z-index: 5; width: 240px; max-width: 65vw; padding: 10px; background: var(--surface); color: var(--text); box-shadow: 0 2px 10px var(--line); font-size: 12px; font-style: normal; text-align: left; }
.tooltip:hover .tooltip-text, .tooltip:focus .tooltip-text { display: block; }
.contribution-note { display: inline-block; background: #555555; color: #fff; padding: 2px 6px; border-radius: 3px; font-size: .75em; font-weight: 600; }
.publication { padding: 18px 12px; border-bottom: 1px solid var(--soft); }
.publication:last-child { border: 0; }
.publication-title { margin: 0; color: var(--accent); font-size: inherit; line-height: inherit; }
.publication-title a:hover { text-decoration: underline; }
.publication-authors strong { text-decoration: underline; }
.publication-links { display: flex; flex-wrap: wrap; gap: 0 16px; color: var(--muted); font-weight: 600; }
.publication-links a:hover { text-decoration: underline; }
.publication-venue { color: var(--venue); font-weight: 600; }
.publication-summary { margin-top: 5px; font-size: .9em; }
.publication-summary summary { display: inline-block; color: var(--muted); cursor: pointer; }
.publication-summary summary::before { content: '▸ '; }
.publication-summary[open] summary::before { content: '▾ '; }
.publication-summary p { margin: 5px 0; }
.contact-content i { color: var(--accent); width: 20px; text-align: center; }
.site-footer { padding: 10px 25px; border-top: 3px solid var(--muted); color: var(--muted); font-size: .75rem; text-align: center; }
.skip-link { position: fixed; top: -100px; left: 10px; z-index: 20; background: var(--surface); color: var(--accent); padding: 8px 16px; }
.skip-link:focus { top: 10px; }
@media (max-width: 1475px) { .site-shell { width: 95%; } }
@media (max-width: 1100px) {
  .experience-timeline { width: 100%; padding-top: 4em; }
  .experience-item { padding: 2em 0; }
  .experience-item--left .experience-body, .experience-item--right .experience-body { float: none; width: 100%; text-align: center; }
  .experience-heading, .experience-item--left .experience-heading { display: block; width: auto; max-width: 100%; margin: 0; }
  .experience-flag { display: inline-block; padding: 6px 17px; max-width: calc(100% - 20px); background: var(--surface); }
  .experience-heading::before, .experience-item--left .experience-heading::before, .experience-item--right .experience-heading::before { top: -30px; left: calc(50% - 10px); right: auto; margin: 0; border-color: var(--accent); }
  .experience-flag::after, .experience-item--left .experience-flag::after, .experience-item--right .experience-flag::after { top: -16px; left: calc(50% - 8px); right: auto; margin: 0; border-color: transparent; border-bottom-color: var(--surface); }
  .experience-time { position: relative; width: max-content; margin: 4px auto 0; }
  .experience-description, .experience-item--right .experience-description { position: relative; margin: 1em 4em 0; padding: .75em; background: var(--flag); font-size: .88888em; box-shadow: 0 0 1px var(--line); }
}
@media (max-width: 900px) {
  .site-shell { width: 100%; margin: 0 auto; }
  .page-layout, .masthead { padding: 20px; }
  .widget { margin-bottom: 20px; }
}
@media (max-width: 767px) {
  .masthead { text-align: center; }
  .brand-name { font-size: 1.5rem; }
  .theme-toggle { width: 34px; height: 34px; right: 15px; top: 15px; }
  .page-layout { display: block; }
  .profile-sidebar { margin-top: 20px; }
  .navigation { border-bottom: 0; }
  .js .menu-toggle { display: block; }
  .navigation-links { display: block; }
  .js .navigation-links { display: none; }
  .js .navigation-links.is-open { display: block; }
  .navigation-links li { border-left: 0; border-top: 1px solid rgba(255,255,255,.1); }
  .social-links { max-width: 300px; margin: 0 auto; }
  .profile-avatar { margin-top: 5px; }
  .publication { padding: 18px 6px; }
}
@media (max-width: 399px) {
  .experience-description, .experience-item--right .experience-description { margin-left: 1em; margin-right: 1em; }
  .profile-name { font-size: 1.125rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
/* Keep timeline markers on the spine even with longer institution names. */
@media (min-width: 1101px) {
  .experience-heading { height: 1.6em; max-width: none; }
  .experience-item--left .experience-heading { float: right; }
  .experience-description { clear: both; padding-top: 1em; margin-top: 0; }
  .experience-item--right .experience-description { margin-top: 0; }
}
.linkedin-icon { border: 2px solid currentColor; border-radius: 2px; height: 24px; line-height: 20px; font-size: 19px !important; }
.masthead { padding-bottom: 27px; }
.scholar-svg { width: 24px; height: 24px; flex-shrink: 0; fill: currentColor; }
html.dark-mode .site-shell { box-shadow: 0 0 10px rgba(0,0,0,.3); }

/* Monochrome palette; layout is unchanged. */
body { --heading: #222222; --inline-link: #404040; }
html.dark-mode body { --heading: #f3f3f3; --inline-link: #dddddd; }
.brand-name, .widget-title, .page-title, .profile-name { color: var(--heading); }
.bio a, .contact-content a { color: var(--inline-link); }
.navigation-links .active, .navigation-links li:hover { background: #222222; }
html.dark-mode .navigation { border-bottom-color: rgba(220,220,220,.22); }
html.dark-mode .navigation-links .active { background: #404040; }
html.dark-mode .navigation-links li:hover { background: #303030; }
html.dark-mode .widget-title { border-color: rgba(220,220,220,.22); }
html.dark-mode .profile-avatar { box-shadow: 0 0 0 3px #404040; }
html.dark-mode .experience-time { background: #303030; }

@media (min-width: 1101px) {
  .experience-heading { gap: 6px; }
}

/* White lettering keeps the charcoal navigation readable. */
.navigation-links a, .menu-toggle { color: #ffffff; }
.navigation-links .active a, .navigation-links li:hover a { color: #fff; }
.contribution-note { color: #ffffff; }
html.dark-mode .navigation-links a, html.dark-mode .menu-toggle { color: var(--text); }

/* Match the reference Contact page's compact lines and map dimensions. */
.contact-content .contact-details { margin: 0 0 1.25rem; }
.contact-content .contact-details i { width: 1.25em; }
.contact-content .contact-details a { color: var(--text); font-weight: 400; }
.contact-content .contact-details a:hover { color: var(--accent); }
.contact-map { display: block; max-width: 100%; border: 0; }

.site-footer a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
