/* Typefaces are served from this origin: no third-party font request. */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

/* ============================================================
   zhengxiangsheng.com
   ============================================================ */

:root {
  --bg: #f6f4ef;
  --bg-soft: #efece4;
  --ink: #15171b;
  --ink-soft: #3c4048;
  --muted: #5f636b;
  --line: rgba(21, 23, 27, 0.14);
  --accent: #a8432a;
  --header-bg: rgba(246, 244, 239, 0.82);
  --shadow: 0 24px 60px -32px rgba(21, 23, 27, 0.35);
}

[data-theme="dark"] {
  --bg: #0d0f12;
  --bg-soft: #15181d;
  --ink: #eae8e3;
  --ink-soft: #c9c6bf;
  --muted: #99a0a8;
  --line: rgba(234, 232, 227, 0.16);
  --accent: #e08b6f;
  --header-bg: rgba(13, 15, 18, 0.8);
  --shadow: 0 30px 70px -40px rgba(0, 0, 0, 0.9);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

h1,
h2,
h3 {
  font-family: "Newsreader", "Iowan Old Style", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0;
}

p {
  margin: 0;
}

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

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

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

.zh {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-weight: 400;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--bg);
  z-index: 50;
}

.skip:focus {
  left: 12px;
  top: 12px;
}

.wrap {
  width: min(1120px, 100% - 2 * clamp(20px, 5vw, 48px));
  margin-inline: auto;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wordmark .zh {
  font-size: 0.78rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
}

.site-nav a {
  display: block;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--ink);
}

.nav-zh {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  opacity: 0.7;
  margin-top: 2px;
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink);
  transform: rotate(-12deg);
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(72px, 11vw, 132px) clamp(56px, 8vw, 96px);
}

.eyebrow {
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin-top: 22px;
  max-width: 15ch;
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  line-height: 1.02;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-zh {
  margin-top: 26px;
  max-width: 36em;
  font-size: 1.02rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.lede {
  margin-top: 20px;
  max-width: 40em;
  font-size: 1.06rem;
  color: var(--ink-soft);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 38px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.btn-ghost {
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- sections ---------- */

.section {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  padding-block: clamp(52px, 7vw, 96px);
  border-top: 1px solid var(--line);
}

.section-head .index {
  font-family: "Newsreader", Georgia, serif;
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.section-head h2 {
  margin-top: 6px;
  font-size: clamp(1.7rem, 2.6vw, 2.15rem);
}

.section-head h2 .zh {
  display: block;
  margin-top: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.section-note {
  margin-top: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 26ch;
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  align-content: start;
}

.card {
  padding: 24px 22px 26px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--ink);
}

.card-index {
  font-family: "Newsreader", Georgia, serif;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.card h3 {
  margin-top: 14px;
  font-size: 1.35rem;
}

.card h3 .zh {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.card p:last-child {
  margin-top: 14px;
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

/* ---------- work ---------- */

.paper {
  padding: clamp(24px, 3vw, 36px);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.paper-meta {
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.paper h3 {
  margin-top: 14px;
  max-width: 24ch;
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
}

.paper-authors {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.paper-abstract {
  margin-top: 18px;
  max-width: 62ch;
  font-size: 0.96rem;
  color: var(--ink-soft);
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 24px;
  font-size: 0.92rem;
}

.paper-links a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

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

/* ---------- about ---------- */

.about {
  display: grid;
  gap: 18px;
  align-content: start;
}

.about p {
  max-width: 64ch;
  color: var(--ink-soft);
}

.about-zh {
  font-size: 0.98rem;
  color: var(--muted) !important;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 18px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.facts dt {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  margin: 6px 0 0;
  font-size: 0.94rem;
  color: var(--ink);
}

/* ---------- links ---------- */

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.links li {
  border-bottom: 1px solid var(--line);
}

.links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 4px;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  transition: color 0.2s ease, padding-left 0.25s ease;
}

.links a:hover {
  color: var(--accent);
  padding-left: 12px;
}

.link-sub {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: right;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 34px 46px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- motion ---------- */

.reveal {
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .section {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .section-note {
    max-width: 46ch;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .nav-zh {
    display: none;
  }

  .site-nav {
    gap: 18px;
  }

  .wordmark .zh {
    display: none;
  }

  .header-inner {
    min-height: 60px;
    gap: 14px;
  }

  .links a {
    flex-direction: column;
    gap: 4px;
  }

  .link-sub {
    text-align: left;
  }
}
