/* =====================================================================
   Chuncheng Liu 刘春成 — personal academic site
   Redesign: minimalist, elegant, near-monochrome.
   Serif headings (Spectral) · sans body (Schibsted Grotesk) ·
   one muted slate-blue accent · year-keyed index spine.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,400;0,500;0,600;1,400&family=Schibsted+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --paper:     #fcfbf9;
  --paper-2:   #f3f1ea;
  --ink:       #1b1b1a;
  --muted:     #67675f;
  --faint:     #9c9c92;
  --line:      #e7e5de;
  --line-2:    #efeee8;
  --accent:    #3c5070;
  --accent-h:  #2a3c58;

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans:  "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1080px;
  --measure: 70ch;
  --pad: clamp(22px, 5.5vw, 64px);

  --t: 0.45s cubic-bezier(.2,.6,.2,1);
}

html[data-theme="dark"] {
  --paper:     #16171b;
  --paper-2:   #1e2026;
  --ink:       #ecebe4;
  --muted:     #a3a39a;
  --faint:     #6f6f69;
  --line:      #2a2c33;
  --line-2:    #23252b;
  --accent:    #93a8c6;
  --accent-h:  #b5c5dd;
}

* { 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.65;
  font-feature-settings: "ss01" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--t), color var(--t);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

a { color: inherit; text-decoration: none; }
p { margin: 0 0 1.15em; }
img { max-width: 100%; display: block; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 13px; padding: 10px 16px;
}
.skip:focus { left: 10px; top: 10px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background var(--t), border-color var(--t);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 60px; gap: 18px;
}
.brand {
  font-family: var(--serif); font-weight: 500; font-size: 17px;
  letter-spacing: .01em; white-space: nowrap;
}
.brand .cn { color: var(--muted); margin-left: 7px; font-weight: 400; }

.menu {
  display: flex; align-items: center; gap: 2px;
  font-size: 14px; font-weight: 500;
}
.menu a, .menu .dropbtn {
  color: var(--muted); padding: 8px 12px; border-radius: 4px;
  background: none; border: 0; font: inherit; cursor: pointer;
  transition: color .2s, background .2s; white-space: nowrap;
}
.menu a:hover, .menu .dropbtn:hover { color: var(--ink); background: var(--paper-2); }
.menu a[aria-current="page"] { color: var(--accent); }
.menu .cn-link { font-family: var(--serif); }

/* dropdown */
.has-drop { position: relative; }
.drop {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 300px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px; opacity: 0; visibility: hidden;
  transform: translateY(-4px); transition: opacity .2s, transform .2s, visibility .2s;
  box-shadow: 0 14px 40px rgba(20,20,18,.10);
}
.has-drop:hover .drop, .has-drop:focus-within .drop {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.drop a {
  display: block; white-space: normal; line-height: 1.35;
  padding: 9px 11px; color: var(--muted); font-weight: 400;
}
.drop a:hover { color: var(--accent); }

/* theme + menu buttons */
.icon-btn {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--muted); cursor: pointer; padding: 7px 10px; font: inherit;
  font-size: 13px; transition: color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--muted); }
.menu-toggle { display: none; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- intro / hero ---------- */
.intro { padding: clamp(56px, 10vw, 110px) 0 clamp(34px, 5vw, 56px); }
.intro-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: start; }
@media (min-width: 820px) {
  .intro-grid { grid-template-columns: 1fr minmax(250px, 290px); gap: 56px; align-items: stretch; }
  .intro-text { display: flex; flex-direction: column; justify-content: space-between; }
  .intro-text .links-row { margin-top: 0; }
}
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 22px;
}
.intro h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 6.5vw, 68px); line-height: 1.02;
  letter-spacing: -0.015em; margin: 0;
}
.intro h1 .cn { font-weight: 400; color: var(--muted); margin-left: .28em; font-size: .58em; letter-spacing: .02em; }
.intro .role {
  margin: 20px 0 0; font-size: clamp(17px, 2vw, 19px); color: var(--muted);
  max-width: 46ch; line-height: 1.5;
}
.intro .role strong { color: var(--ink); font-weight: 500; }
.portrait { width: 100%; height: auto; display: block; }

.links-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.chip {
  font-size: 13px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px;
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.chip:hover { color: var(--accent); border-color: var(--accent); background: var(--paper-2); transform: translateY(-1px); }

/* ---------- generic page header ---------- */
.page-head { padding: clamp(48px, 8vw, 92px) 0 clamp(8px, 2vw, 22px); }
.page-head h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(34px, 5.5vw, 54px); line-height: 1.04;
  letter-spacing: -0.015em; margin: 0;
}
.lead { font-size: clamp(18px, 2.3vw, 21px); color: var(--muted); max-width: none; margin: 18px 0 0; }

/* ---------- sections ---------- */
.block { padding: clamp(34px, 5.5vw, 60px) 0; border-top: 1px solid var(--line); }
.block.first { border-top: 0; }
.kicker {
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 30px; display: flex; align-items: center; gap: 14px;
}
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--accent); border-radius: 2px; flex: none; }
.kicker::after { content: ""; flex: 1; height: 1px; background: var(--line); }

h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(27px, 3.6vw, 38px); line-height: 1.12;
  letter-spacing: -0.01em; margin: 0 0 .5em;
}
h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(20px, 2.6vw, 25px); line-height: 1.22;
  margin: 1.9em 0 .35em;
}
.prose { max-width: none; }
.prose p { color: var(--ink); }
.bio { max-width: none; }
.bio p { margin: 0 0 1.1em; }
.bio p:first-child { font-size: 1.06em; line-height: 1.55; color: var(--ink); }
.prose em, em { font-family: var(--serif); font-style: italic; }
.prose a, .inline-link {
  color: var(--accent); text-decoration: none; padding-bottom: 1px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 1.5px;
  transition: background-size .35s cubic-bezier(.2,.7,.2,1), color .2s;
}
.prose a:hover, .inline-link:hover { color: var(--accent-h); background-size: 100% 1.5px; }

/* ---------- publication index ---------- */
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs > li {
  display: grid; grid-template-columns: 62px 1fr; gap: 0;
  padding: 22px 0; border-top: 1px solid var(--line-2);
}
.pubs > li > div { border-left: 1px solid var(--line); padding-left: 24px; }
.pubs > li:first-child { border-top: 0; }
.pubs .yr {
  font-size: 14px; font-weight: 500; color: var(--muted);
  font-variant-numeric: tabular-nums; padding-top: 3px; letter-spacing: .01em;
}
.cite { margin: 0; }
.cite .toggle, .cite .ttl {
  display: block; font: inherit; font-weight: 400; color: var(--ink);
  font-size: 16.5px; line-height: 1.4; letter-spacing: -0.005em;
  background: none; border: 0; padding: 0; margin: 0; text-align: left; width: 100%;
}
.cite .toggle { cursor: pointer; }
.cite .toggle:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--faint); }
.cite .toggle .caret { color: var(--faint); transition: transform .25s ease, color .2s ease; display: inline-block; }
.cite .toggle:hover .caret { color: var(--accent); }
.cite .toggle[aria-expanded="true"] .caret { transform: rotate(90deg); }
.cite .meta { display: block; margin-top: 5px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.cite .meta .venue { font-style: italic; }
.cite .meta .auth { color: var(--faint); }

.abstract { margin: .7em 0 0; font-size: 15px; color: var(--muted); line-height: 1.6; max-width: none; }
.abstract[hidden] { display: none; }
.abstract.ab-in { animation: abIn .38s ease; }
@keyframes abIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.dois { margin-top: .65em; display: flex; flex-wrap: wrap; gap: 8px; }
.dois a {
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 10px;
  transition: color .2s, border-color .2s;
}
.dois a:hover { color: var(--accent); border-color: var(--accent); }
.dois a::after { content: " ↗"; color: var(--faint); }

@media (max-width: 540px) {
  .pubs > li { grid-template-columns: 1fr; gap: 6px; }
  .pubs > li > div { border-left: 0; padding-left: 0; }
  .pubs .yr { padding-top: 0; }
}

/* question-led (social credit) */
.qhead { font-family: var(--serif); font-weight: 500; }
.qhead .q { color: var(--accent); font-style: italic; margin-right: .35em; }

/* ---------- featured card ---------- */
.feature {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--paper-2); transition: background var(--t), border-color var(--t);
}
.feature .inner { padding: clamp(24px, 4vw, 40px); }
.feature .tag {
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
.feature h2 { margin-top: 0; }
.feature .prose { max-width: 64ch; }

/* ---------- link lists (media / talks / writing) ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  padding: 16px 0; border-top: 1px solid var(--line-2);
  display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; align-items: baseline;
}
.list li:first-child { border-top: 0; }
.list .where { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 15px; }
.list .when { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.list a.head { font-weight: 500; color: var(--ink); transition: color .2s; }
.list a.head:hover { color: var(--accent); }
.list .meta-row { grid-column: 1 / -1; display: flex; gap: 14px; align-items: baseline; }
@media (max-width: 600px) {
  .list li { grid-template-columns: 1fr; }
  .list .when { text-align: left; }
}

/* ---------- CV download ---------- */
.cv-card {
  display: inline-flex; align-items: center; gap: 16px;
  border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px;
  background: var(--paper-2); transition: border-color .2s, background var(--t); margin-top: 6px;
}
.cv-card:hover { border-color: var(--accent); }
.cv-card .badge {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--paper);
  background: var(--accent); padding: 8px 10px; border-radius: 6px;
}
.cv-card .t { font-weight: 600; }
.cv-card .s { font-size: 13px; color: var(--muted); }

/* selected work links on home */
.minilist { list-style: none; margin: 0; padding: 0; }
.minilist li { padding: 14px 0; border-top: 1px solid var(--line-2); }
.minilist li:first-child { border-top: 0; }
.minilist .yr { font-size: 13px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.minilist .t { color: var(--ink); }
.minilist .t:hover { color: var(--accent); }
.minilist .v { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 14px; }

.more { display: inline-block; margin-top: 22px; font-weight: 600; color: var(--accent); }
.more:hover { color: var(--accent-h); }
.more::after { content: " →"; transition: margin .2s; }
.more:hover::after { margin-left: 4px; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line); margin-top: 30px; padding: 40px 0 64px;
  font-size: 13.5px; color: var(--faint);
}
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 28px; align-items: baseline; }
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }
footer .fnav { display: flex; flex-wrap: wrap; gap: 18px; }

/* ---------- mobile nav ---------- */
@media (max-width: 860px) {
  .menu-toggle { display: inline-block; }
  .menu {
    position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--pad) 20px; display: none;
  }
  .menu.open { display: flex; }
  .menu a, .menu .dropbtn { padding: 12px 4px; border-bottom: 1px solid var(--line-2); text-align: left; }
  .has-drop { position: static; }
  .drop {
    position: static; opacity: 1; visibility: visible; transform: none;
    border: 0; box-shadow: none; background: transparent; padding: 0 0 0 14px; min-width: 0;
  }
  .drop a { color: var(--faint); }
  .theme-wrap-desktop { display: none; }
}
@media (min-width: 861px) { .theme-wrap-mobile { display: none; } }

/* ---------- print (CV) ---------- */
@media print {
  .topbar, footer, .skip { display: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; border: 0; }
}

/* social credit question headings: unified serif, no accent color */
.scs-q { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.25; color: var(--ink); margin: 0 0 14px; letter-spacing: -0.01em; }
@media (min-width: 820px) { .scs-q { font-size: 24px; } }

/* CV in-page PDF viewer */
.pdf-embed { display: block; width: 100%; height: 85vh; min-height: 560px; margin-top: 28px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); }
.pdf-fallback { padding: 28px; color: var(--muted); }
.pdf-fallback a { color: var(--accent); }
