/* Licheng Liu — personal site
   Style borrowed from anthropic.com's own design tokens: warm ivory paper,
   clay accent, serif display over a grotesque body. Palette values are read
   from https://www.anthropic.com/ant-brand.shared.*.min.css:
     ivory-light #faf9f5 · ivory-medium #f0eee6 · ivory-dark #e8e6dc
     clay #d97757 · accent #c6613f · kraft #d4a27f · oat #e3dacc
     slate-dark #141413 · slate-medium #3d3d3a · slate-light #5e5d59
   Fonts: Anthropic's own faces are proprietary, so this uses the closest
   open substitutes — Source Serif 4 (≈ Tiempos/Anthropic Serif) for display
   and headings, Hanken Grotesk (≈ Styrene/Anthropic Sans) for body text.
   Both are self-hosted; the only third-party request on the site is the
   busuanzi visitor counter. No dark theme: the design is light by intent. */

/* ---------- fonts ---------- */
@font-face {
  font-family: "Serif 4";
  src: url("/assets/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Hanken";
  src: url("/assets/fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  --paper: #f0eee6;
  --card: #faf9f5;
  --band: #e8e6dc;
  --ink: #141413;
  --ink-soft: #3d3d3a;
  --muted: #5e5d59;
  --clay: #d97757;
  --clay-deep: #c6613f;
  --kraft: #d4a27f;
  --oat: #e3dacc;
  --line: rgba(20, 20, 19, 0.12);
  --serif: "Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Hanken", "Helvetica Neue", Arial, sans-serif;
  --measure: 68rem;
  --radius: 0.75rem;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  color: var(--clay-deep);
}
strong,
b {
  color: var(--ink);
  font-weight: 600;
}
sup {
  font-size: 0.68em;
  line-height: 0;
}
:focus-visible {
  outline: 2px solid var(--clay-deep);
  outline-offset: 3px;
  border-radius: 3px;
}
.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.75rem;
}

/* ---------- top bar ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(240, 238, 230, 0.86);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
header.site .bar {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0.9rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
nav.site {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-size: 0.94rem;
}
nav.site a {
  color: var(--ink-soft);
}
nav.site a:hover,
nav.site a[aria-current="page"] {
  color: var(--ink);
}
.btn {
  background: var(--clay);
  color: #fff !important;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.5rem 1.05rem;
  border-radius: 100vw;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.btn:hover {
  background: var(--clay-deep);
}

/* ---------- hero ---------- */
.hero {
  padding: 4.5rem 0 1.6rem;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 4rem;
  align-items: center;
}
.eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clay-deep);
  margin-bottom: 1.1rem;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 500;
  margin: 0 0 1.4rem;
  text-wrap: balance;
}
h1 .soft {
  color: var(--muted);
}
.standfirst {
  font-size: 1.09rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 0 1.5rem;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.7rem;
}
.chip {
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.34rem 0.8rem;
  border-radius: 100vw;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.chip.clay {
  background: rgba(217, 119, 87, 0.14);
  border-color: rgba(198, 97, 63, 0.28);
  color: var(--clay-deep);
}
.chip.oat {
  background: var(--oat);
  border-color: transparent;
}
.portrait img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

/* ---------- sections ---------- */
section {
  padding: 1.4rem 0 0;
}
section.tight {
  padding-bottom: 1rem;
}
.rule {
  border-top: 1px solid var(--line);
  padding-top: 2.6rem;
}
.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}
h2 {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0;
}
.head a {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}
.head a:hover {
  color: var(--clay-deep);
}

/* dated lists (news, posts) */
ul.news,
ul.posts {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul.news li,
ul.posts li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
ul.news li:first-child,
ul.posts li:first-child {
  border-top: 0;
}
.when {
  font-size: 0.84rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
ul.news p,
ul.posts .title {
  margin: 0;
  color: var(--ink-soft);
}
ul.posts .title {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}
ul.posts .desc {
  margin: 0.3rem 0 0;
  font-size: 0.94rem;
  color: var(--muted);
}
.inline-link {
  border-bottom: 1px solid var(--line);
}
.inline-link:hover {
  border-bottom-color: var(--clay);
}
.more {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 1.2rem 0 0;
}

/* ---------- publications ---------- */
.pub {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.7rem;
  margin-bottom: 1rem;
  transition:
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.pub:hover {
  box-shadow: 0 8px 26px rgba(20, 20, 19, 0.07);
  transform: translateY(-1px);
}
.ptitle {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.pauth {
  font-size: 0.94rem;
  color: var(--muted);
  margin-bottom: 0.7rem;
}
.pauth b {
  color: var(--ink);
  font-weight: 600;
}
.prow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.venue {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.7rem;
  border-radius: 100vw;
  background: var(--oat);
  color: var(--ink);
}
.venue.honour {
  background: var(--kraft);
  color: #4a2c1c;
}
.awards {
  font-size: 0.85rem;
  color: var(--muted);
}
.plinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.plinks a {
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.34rem 0.85rem;
  border-radius: 100vw;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.plinks a:hover {
  border-color: var(--clay);
  color: var(--clay-deep);
}
.plinks a.key {
  background: var(--clay);
  border-color: var(--clay);
  color: #fff;
}
.plinks a.key:hover {
  background: var(--clay-deep);
  border-color: var(--clay-deep);
  color: #fff;
}

/* bibtex disclosure */
details.bib {
  margin-top: 1rem;
  font-size: 0.88rem;
}
details.bib summary {
  cursor: pointer;
  color: var(--muted);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
details.bib summary::-webkit-details-marker {
  display: none;
}
details.bib summary::before {
  content: "▸";
  font-size: 0.8em;
  color: var(--clay);
}
details.bib[open] summary::before {
  content: "▾";
}
details.bib summary:hover {
  color: var(--clay-deep);
}
details.bib pre {
  margin: 0.8rem 0 0;
  padding: 1rem 1.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-soft);
}
details.bib code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.legend {
  font-size: 0.86rem;
  color: var(--muted);
  margin: 1.2rem 0 0;
}

/* ---------- writing card ---------- */
.postcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.7rem;
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}
.postcard h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.22rem;
  line-height: 1.35;
  margin: 0 0 0.4rem;
  color: var(--ink);
}
.postcard p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted);
}
.postcard .date {
  font-size: 0.86rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- article ---------- */
article.post {
  max-width: 46rem;
  margin: 0 auto;
}
article.post > header {
  padding: 3.4rem 0 0.5rem;
}
article.post h1 {
  font-size: clamp(1.95rem, 4.4vw, 2.7rem);
  line-height: 1.12;
  margin-bottom: 0.9rem;
}
article.post .meta {
  font-size: 0.88rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.6rem;
}
article.post h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 2.6rem 0 0.9rem;
  color: var(--ink);
}
article.post p {
  margin: 0 0 1.15rem;
  color: var(--ink-soft);
}
article.post ul {
  margin: 0 0 1.15rem;
  padding-left: 1.25rem;
  color: var(--ink-soft);
}
article.post li {
  margin-bottom: 0.4rem;
}
article.post blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1.3rem;
  border-left: 3px solid var(--kraft);
  font-family: var(--serif);
  font-size: 1.08rem;
  color: var(--ink);
}
article.post blockquote p {
  margin: 0 0 0.5rem;
  color: inherit;
}
article.post blockquote p:last-child {
  margin-bottom: 0;
}
article.post hr.sep {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.6rem 0;
}
article.post code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}
.backlink {
  display: inline-block;
  margin-top: 2.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- footer ---------- */
footer.site {
  margin-top: 4.5rem;
  background: var(--band);
  border-top: 1px solid var(--line);
}
footer.site .in {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.4rem 1.75rem 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}
footer.site .links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
}
footer.site a {
  color: var(--ink-soft);
}
footer.site a:hover {
  color: var(--clay-deep);
}
#busuanzi_container_site_pv {
  display: none;
}

/* the counter element is filled in by busuanzi and must not push the layout */
.busuanzi-show #busuanzi_container_site_pv {
  display: inline !important;
}

/* ---------- responsive ---------- */
@media (max-width: 52rem) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.2rem;
    padding-top: 3rem;
  }
  .portrait {
    max-width: 13rem;
  }
  ul.news li,
  ul.posts li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  nav.site {
    gap: 1rem;
  }
}
@media (max-width: 34rem) {
  body {
    font-size: 16.5px;
  }
  header.site .bar {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }
  .pub {
    padding: 1.25rem 1.2rem;
  }
}

@media print {
  header.site,
  footer.site {
    display: none;
  }
  body {
    background: #fff;
    font-size: 11pt;
  }
  .pub {
    border-color: #ccc;
    break-inside: avoid;
  }
}
