/* Huaizhou Li — custom academic homepage
   Warm editorial base with navy and copper accents.
   Fonts: Manrope + IBM Plex Mono. */

:root {
  --paper: #f7f4ef;
  --paper-raised: #fffdf9;
  --paper-muted: #eee8df;
  --ink: #16283a;
  --ink-soft: #4f5b66;
  --ink-faint: #7c858d;
  --navy: #173a5e;
  --navy-deep: #0e2945;
  --copper: #b66a3c;
  --copper-deep: #8f4d28;
  --copper-tint: rgba(182, 106, 60, 0.09);
  --line: #ddd7cf;
  --line-strong: #c9bfb4;
  --shadow: 0 24px 60px -38px rgba(22, 40, 58, 0.45);
  --radius: 14px;
  --max-width: 1040px;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  background:
    radial-gradient(circle at 92% 2%, rgba(182, 106, 60, 0.08), transparent 27rem),
    linear-gradient(var(--paper), var(--paper));
}

::selection {
  color: #fff;
  background: var(--copper);
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.container {
  width: min(100% - 44px, var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(201, 191, 180, 0.7);
  background: rgba(247, 244, 239, 0.88);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

.site-nav {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--navy);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--paper-raised);
  background: var(--navy);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}

.nav-brand:hover .brand-mark {
  transform: rotate(-7deg);
  background: var(--copper);
  border-color: var(--copper);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
}

.nav-links a {
  position: relative;
  padding: 7px 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 100%;
  height: 2px;
  background: var(--copper);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.24s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--navy);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.hero {
  padding: 92px 0 78px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 74px;
  align-items: center;
}

.eyebrow,
.section-label {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper-deep);
}

.eyebrow {
  margin-bottom: 18px;
}

.hero h1 {
  max-width: 680px;
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  color: var(--ink);
}

.hero h1 span {
  color: var(--copper);
  font-weight: 500;
}

.role {
  margin-top: 22px;
  font-size: 1.07rem;
  line-height: 1.55;
  font-weight: 600;
  color: var(--navy);
}

.bio {
  max-width: 66ch;
  margin-top: 28px;
  font-size: 1.02rem;
  line-height: 1.82;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--navy);
  background: rgba(255, 253, 249, 0.72);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease), color 0.22s var(--ease);
}

.button:hover {
  transform: translateY(-2px);
  border-color: var(--copper);
  color: var(--copper-deep);
  background: var(--paper-raised);
}

.button.primary {
  color: #fff;
  border-color: var(--navy);
  background: var(--navy);
}

.button.primary:hover {
  color: #fff;
  border-color: var(--navy-deep);
  background: var(--navy-deep);
}

.portrait-wrap {
  position: relative;
  justify-self: end;
  width: min(100%, 310px);
}

.portrait-accent {
  position: absolute;
  inset: 18px -16px -16px 18px;
  border-radius: 24px 24px 78px 24px;
  background: var(--copper);
  opacity: 0.82;
}

.portrait-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 24px 24px 78px 24px;
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}

.portrait-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 28%;
}

.portrait-card figcaption {
  padding: 14px 18px 17px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  background: var(--paper-raised);
}

.research-section {
  padding: 60px 0 20px;
}

.working-papers {
  padding-top: 70px;
  padding-bottom: 88px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--navy);
}

.section-heading h2,
.profile-strip h2 {
  margin-top: 7px;
  font-size: clamp(1.9rem, 4vw, 2.65rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.section-note {
  padding-bottom: 4px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-align: right;
}

.paper-list {
  counter-reset: papers;
}

.paper {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 24px;
  padding: 30px 16px 32px 8px;
  border-bottom: 1px solid var(--line);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}

.paper:hover {
  background: linear-gradient(90deg, var(--copper-tint), transparent 72%);
}

.paper-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-top: 2px;
  border: 1px solid var(--copper);
  border-radius: 12px 4px 12px 4px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--copper-deep);
  background: var(--paper-raised);
}

.paper-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.paper h3 {
  max-width: 760px;
  font-size: 1.18rem;
  line-height: 1.45;
  letter-spacing: -0.018em;
  color: var(--ink);
}

.paper h3 a {
  background-image: linear-gradient(var(--copper), var(--copper));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: color 0.22s var(--ease), background-size 0.35s var(--ease);
}

.paper h3 a:hover {
  color: var(--navy);
  background-size: 100% 2px;
}

.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--navy);
  background: var(--paper-raised);
  white-space: nowrap;
}

.badge.published {
  color: #fff;
  border-color: var(--navy);
  background: var(--navy);
}

.badge.highlight {
  color: #fff;
  border-color: var(--copper);
  background: var(--copper);
}

.authors {
  margin-top: 8px;
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.paper-meta {
  margin-top: 7px;
  font-size: 0.9rem;
  color: var(--ink-faint);
}

.paper-meta em {
  color: var(--ink-soft);
}

.conference-line {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.65;
  color: var(--ink-faint);
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.paper-links a {
  color: var(--copper-deep);
  border-bottom: 1px solid rgba(143, 77, 40, 0.35);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.paper-links a:hover {
  color: var(--navy);
  border-color: var(--navy);
}

.paper-links span {
  color: var(--ink-faint);
}

.profile-strip {
  padding: 58px 0;
  background: var(--paper-muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-strip-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 70px;
  align-items: center;
}

.profile-strip-grid > p {
  max-width: 64ch;
  font-size: 0.98rem;
  line-height: 1.8;
}

.site-footer {
  padding: 58px 0 24px;
  color: rgba(255, 255, 255, 0.72);
  background: var(--navy-deep);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 50px;
}

.footer-grid p {
  font-size: 0.9rem;
  line-height: 1.75;
}

.footer-name {
  margin-bottom: 5px;
  font-size: 1.05rem !important;
  font-weight: 700;
  color: #fff;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.73rem;
}

.footer-contact a {
  transition: color 0.2s var(--ease);
}

.footer-contact a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  font-family: var(--mono);
  font-size: 0.67rem;
  color: rgba(255, 255, 255, 0.42);
}

/* Teaching page */
.page-hero {
  padding: 84px 0 54px;
}

.page-hero h1 {
  margin-top: 10px;
  font-size: clamp(2.8rem, 6vw, 4.7rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.page-intro {
  max-width: 66ch;
  margin-top: 22px;
  font-size: 1.03rem;
  line-height: 1.8;
}

.teaching-list {
  padding-bottom: 84px;
}

.teaching-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 34px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.teaching-card:last-child {
  border-bottom: 1px solid var(--line);
}

.course-code {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--copper-deep);
}

.course-level {
  display: block;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 0.67rem;
  color: var(--ink-faint);
}

.teaching-card h2 {
  font-size: 1.27rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.teaching-card p {
  max-width: 68ch;
  margin-top: 9px;
  font-size: 0.94rem;
}

.teaching-card .teaching-role {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--navy);
}

@media (max-width: 850px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .portrait-wrap {
    justify-self: start;
    width: min(72vw, 310px);
  }

  .profile-strip-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(100% - 30px, var(--max-width));
  }

  .site-nav {
    min-height: auto;
    align-items: flex-start;
    padding: 15px 0 13px;
  }

  .nav-brand > span:last-child {
    display: none;
  }

  .nav-links {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-links a {
    font-size: 0.68rem;
  }

  .hero {
    padding: 66px 0 58px;
  }

  .hero h1 {
    font-size: clamp(2.65rem, 15vw, 4rem);
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-note {
    text-align: left;
  }

  .paper {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-inline: 4px;
  }

  .paper-title-row {
    flex-direction: column;
    gap: 11px;
  }

  .badge {
    align-self: flex-start;
  }

  .footer-grid,
  .footer-bottom {
    flex-direction: column;
  }

  .footer-contact {
    align-items: flex-start;
  }

  .teaching-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
