/* ===== Fonts ===== */

@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-v36-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-v36-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-v36-latin-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-v36-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-v36-latin-700italic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto Mono';
  src: url('../fonts/roboto-mono-v30-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto Mono';
  src: url('../fonts/roboto-mono-v30-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto Mono';
  src: url('../fonts/roboto-mono-v30-latin-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans SC';
  src: url('../fonts/noto-sans-sc-v38-chinese-simplified-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ===== Reset & Base ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #121212;
  overflow-x: hidden;
  font-family: 'Lora', serif;
  color: #cccccc;
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.zh, :lang(zh) {
  font-family: 'Noto Sans SC', sans-serif;
}

/* ===== Layout ===== */

canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
}

main {
  max-width: 800px;
  margin: 100px auto;
  padding: 0 1rem;
}

section {
  margin-bottom: 3rem;
}

/* ===== Bio ===== */

#bio {
  position: relative;
  padding-left: 0;
}

.bio-avatar {
  float: left;
  width: 100px;
  height: 100px;
  border-radius: 25%;
  object-fit: cover;
  margin: 0 1.4rem 0.5rem 0;
}

/* ===== Typography ===== */

h2 {
  font-size: 1.4rem;
  color: #cccccc;
}

a {
  color: #00bcd4;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.5rem;
}

.monolinks {
  font-family: 'Roboto Mono', monospace;
}

.news-date {
  font-variant-numeric: tabular-nums;
}

/* ===== News ===== */

#news-toggle {
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  transition: color 0.2s;
}

#news-toggle:hover {
  color: #ffffff;
}

#news-toggle.expanded {
  color: #ffffff;
}

#news ul li {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
  max-height: 100px;
  opacity: 1;
}

#news ul li.news-hidden {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}

/* ===== Publications ===== */

#news ul,
#publications ul {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

#publications {
  margin: 0;
}

#publications ul {
  margin-top: 0;
}

#publications ul li {
  margin-bottom: 1rem;
}

.venue {
  font-size: 1.2em;
  font-weight: bold;
  color: #ffffff;
  padding-right: 1rem;
}

/* ===== Footer ===== */

footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  font-size: 0.8rem;
  color: #777;
  text-align: center;
}

/* ===== Accessibility ===== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  canvas {
    display: none;
  }
}

/* ===== Print ===== */

@media print {
  canvas {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
  a {
    color: #000;
    text-decoration: underline;
  }
  main {
    margin: 0 auto;
  }
}