/* Dongyang Li — personal page */

@font-face { font-family: Roboto; font-style: normal; font-weight: 300; font-display: swap; src: url(fonts/roboto-300.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-style: italic; font-weight: 300; font-display: swap; src: url(fonts/roboto-300-italic.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/roboto-400.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/roboto-500.woff2) format("woff2"); }

:root {
  --text: #000;
  --body: #111;
  --soft: #646c78;
  --line: #e3e6ea;
  --accent: #1f5bc4;
  --hot: #c0392b;
  color-scheme: light only;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: #fff;
  color: var(--body);
  font-family: Roboto, -apple-system, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
}

html[data-lang="en"] .zh,
html[data-lang="zh"] .en { display: none; }
html[data-lang="zh"] body { line-height: 1.8; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 10px; }
p, li { text-wrap: pretty; }
img { max-width: 100%; height: auto; }
strong, b { font-weight: 500; color: var(--text); }
ul { margin: 0; padding: 0; list-style: none; }
.sep { color: #b3b9c2; margin: 0 5px; }
.hot { color: var(--hot); }
.nw { white-space: nowrap; }
.key { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: #8a919c; }

/* nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15.5px;
}
.nav .me { font-weight: 400; font-size: 17px; color: var(--text); }
.nav .me:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--body); }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.lang { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
.lang:hover { text-decoration: underline; }

.wrap { max-width: 980px; margin: 0 auto; padding: 36px 24px 36px; }

/* intro */

h1 {
  margin: 0 0 14px;
  font-size: 40px;
  line-height: 1.25;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 b { font-weight: 500; }
h1 span { font-size: 25px; color: var(--soft); margin-left: 12px; letter-spacing: 0; }

.intro::after { content: ""; display: block; clear: both; }
.side { float: right; width: 164px; margin: 6px 0 4px 36px; }
.photo {
  width: 100%;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.links {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  column-gap: 22px;
  row-gap: 1px;
  font-size: 14.5px;
}
.links a { white-space: nowrap; }

/* sections */

h2 {
  margin: 38px 0 12px;
  font-size: 25px;
  line-height: 1.3;
  font-weight: 300;
  color: var(--text);
}
h2 small { font-size: 13.5px; color: var(--soft); margin-left: 8px; }

/* research */

.points { list-style: disc; padding-left: 22px; }
.points li { margin-bottom: 5px; }
.points li:last-child { margin-bottom: 0; }

/* news */

.rows li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  column-gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.rows .d { font-weight: 500; color: var(--body); font-variant-numeric: tabular-nums; }

summary {
  cursor: pointer;
  color: var(--accent);
  margin-top: 10px;
  width: fit-content;
  list-style: none;
  font-size: 15px;
}
summary::-webkit-details-marker { display: none; }
summary:hover { text-decoration: underline; }
details[open] summary { display: none; }

/* publications */

.pub {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  column-gap: 24px;
  align-items: center;
  margin-bottom: 18px;
}
.thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.thumb img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

.pub p { margin: 0; }
.pub .t { font-weight: 400; line-height: 1.45; color: var(--text); text-wrap: balance; }
.pub .t a { color: inherit; }
.pub .t a:hover { color: var(--accent); text-decoration: none; }
.pub .a { text-wrap: balance; }
.pub .l { margin-top: 2px; }
.pub .l .soon { color: var(--soft); }

/* experience, awards, talks */

.items li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 24px;
  margin-bottom: 10px;
}
.items li:last-child { margin-bottom: 0; }
.items .d { color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.items p { margin: 0; }
.items b { font-weight: 400; }
.items .sub { color: var(--soft); font-size: 15px; }
.items .sub a { color: var(--accent); }
.items b a { color: inherit; }
.items b a:hover { color: var(--accent); text-decoration: none; }

.foot {
  margin-top: 40px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 13.5px;
}

/* small screens */

@media (max-width: 720px) {
  .nav-in { padding: 0 18px; height: 48px; }
  .nav-links a { display: none; }
  .wrap { padding: 24px 18px 28px; }
  h1 { font-size: 31px; margin-bottom: 12px; }
  h1 span { font-size: 20px; margin-left: 10px; }
  .side { float: none; width: auto; margin: 0 0 14px; display: flex; align-items: center; gap: 16px; }
  .photo { width: 96px; flex: none; }
  .links { margin: 0; }
  h2 { margin-top: 34px; font-size: 23px; }
  .rows li { grid-template-columns: 72px minmax(0, 1fr); column-gap: 10px; }
  .pub { grid-template-columns: minmax(0, 1fr); row-gap: 8px; margin-bottom: 24px; }
  .thumb { max-width: 260px; }
  .items li { grid-template-columns: minmax(0, 1fr); }
  .items .d { font-size: 14px; }
}
