/* ============================================
   Shuang Chen — Personal Website
   Elegant serif, clean academic style
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 56px;
}

body {
  font-family: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.3;
  color: #1a1a2e;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a {
  color: #1a365d;
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: #2c5282; }

/* --- Container --- */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header / Navigation --- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e2e8f0;
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
}

.nav__logo {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a1a2e;
  white-space: nowrap;
}

.nav__links {
  display: flex;
  list-style: none;
  gap: 0;
}

.nav__link {
  padding: 5px 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #4a5568;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
}
.nav__link:hover { background: #f0f4f8; color: #1a365d; }

.nav__link--cv {
  background: #1a365d;
  color: #fff;
  padding: 5px 13px;
  font-weight: 600;
}
.nav__link--cv:hover { background: #2c5282; color: #fff; }
.nav__link--active { color: #1a365d; background: #ebf4ff; }

/* Hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #1a1a2e;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav__toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px,4px); }
.nav__toggle.active span:nth-child(2) { opacity: 0; }
.nav__toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px,-4px); }

/* --- Sections --- */
.section { padding: 22px 0; }
.section + .section { border-top: 1px solid #e2e8f0; }
#about { padding-top: 100px; border-top: none; }

.section--dark {
  background: #1a365d;
  color: #fff;
  border-top: none;
}

.section__title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #c2410c;
  margin-bottom: 12px;
}
.section__title--light { color: #bee3f8; }

/* --- About --- */
#about .container {
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

.about__left { flex: 1; min-width: 0; }
.about__right { flex-shrink: 0; padding-top: 54px; text-align: center; }

.about__photo {
  width: 220px;
  height: 220px;
  border-radius: 6px;
  object-fit: cover;
  background: #e2e8f0;
  margin-bottom: 10px;
  margin-left: auto;
}

.about__name {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.15;
  margin-bottom: 12px;
}

.about__title {
  font-size: 1rem;
  font-weight: 400;
  color: #4a5568;
  margin: 5px 0 14px;
}

.about__bio { margin-bottom: 0; }
.about__bio p { margin-bottom: 0.45rem; }
.about__bio p:last-child { margin-bottom: 0; }

.about__links {
  font-size: 1.05rem;
}
.about__links a {
  display: block;
  color: #4a5568;
  font-weight: 500;
  padding: 2px 4px;
  line-height: 1.4;
}
.about__links a:hover { color: #1a365d; }

.about__sub { margin-top: 18px; }

/* --- Markdown content --- */
.md-content p { margin-bottom: 0.45rem; }
.md-content p:last-child { margin-bottom: 0; }
.md-content ul, .md-content ol { padding-left: 1.3rem; margin-bottom: 0; }
.md-content li { margin-bottom: 0.3rem; }
.md-content li:last-child { margin-bottom: 0; }
.md-content strong { color: #1a1a2e; }
.md-content em { color: #4a5568; }
.md-content a { font-weight: 500; }
.md-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-top: 14px;
  margin-bottom: 6px;
}

/* Tighter news items */
#news .md-content li { margin-bottom: 0.15rem; }

/* --- Footer --- */
.footer {
  background: #0f2440;
  color: #718096;
  padding: 12px 0;
  font-size: 0.85rem;
  text-align: center;
}
.footer__update {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #4a5568;
  font-style: italic;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .section { padding: 18px 0; }
  #about { padding-top: 82px; }

  #about .container {
    flex-direction: column;
    gap: 16px;
  }

  .about__right {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .about__photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin-bottom: 8px;
  }

  .about__links { justify-content: center; }
  .about__name, .about__title { text-align: left; }

  .nav__links {
    position: fixed;
    top: 50px; left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    padding: 10px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  }
  .nav__links.active { display: flex; }
  .nav__toggle { display: flex; }
}

@media (min-width: 1100px) {
  .container { max-width: 860px; }
}
