/* main.css — Hengxu Lin personal site.
   Inter body + Cardo display, cool graphite neutrals, blue accent,
   1180px page with hairline section bands and a 180px label column. */

/* ---------- Fonts (self-hosted, SIL OFL) ---------- */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter/Inter-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cardo";
  src: url("../fonts/cardo/Cardo-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cardo";
  src: url("../fonts/cardo/Cardo-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Cardo";
  src: url("../fonts/cardo/Cardo-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --bg: #fcfcfd;
  --text: #17181a;
  --body: #3c3f45;
  --muted: #6b6e76;
  --faint: #9a9da4;
  --line: #e6e7ea;
  --panel: #f3f4f6;
  --accent: oklch(0.48 0.17 262);
  --pad-x: clamp(1.25rem, 5vw, 4.5rem);
  --label-col: 180px;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 1180px; margin: 0 auto; }

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: #c6c9cf;
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: var(--text); }

img { max-width: 100%; height: auto; }

h1, h2, .site-title, .zh-name, .epigraph {
  font-family: "Cardo", Georgia, "Times New Roman", serif;
  font-weight: 400;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 28px var(--pad-x);
  border-bottom: 1px solid var(--line);
}
.site-title { font-size: 19px; text-decoration: none; }
.site-title .zh { color: var(--faint); }
.site-nav { display: flex; gap: 36px; font-size: 14.5px; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  border-bottom: 2px solid var(--text);
  padding-bottom: 3px;
}

/* ---------- Hero (home) ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(3rem, 6vw, 4.5rem) var(--pad-x) 0;
  align-items: center;
}
.kicker {
  margin: 0 0 18px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 650;
}
h1 { font-size: clamp(2.6rem, 5vw, 3.625rem); line-height: 1.08; margin: 0; }
.zh-name { font-size: 26px; color: var(--faint); margin: 10px 0 0; }
.intro { font-size: 17.5px; line-height: 1.6; margin: 26px 0 0; max-width: 32em; color: var(--body); }
.hero-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 30px 0 0; font-size: 14.5px; font-weight: 550; }
.hero-links a { text-decoration: none; color: var(--muted); }
.hero-links a:first-child { color: var(--accent); }
.hero-links a:hover { color: var(--text); }
.portrait { width: 380px; height: 440px; object-fit: cover; border-radius: 8px; display: block; }

/* ---------- Page heading (inner pages) ---------- */

.page-head { padding: clamp(2.5rem, 5vw, 4rem) var(--pad-x) 0; }
.page-head h1 { font-size: clamp(2.25rem, 4vw, 2.875rem); line-height: 1.1; }
.page-head .interests { display: flex; flex-direction: column; gap: 8px; margin: 28px 0 0; font-size: 15.5px; color: var(--body); }
.page-head .interests p { margin: 0; }
.page-head .interests strong { color: var(--text); font-weight: 650; }
.page-head .lead { margin: 22px 0 0; font-size: 16px; line-height: 1.7; color: var(--body); }

/* ---------- Section bands ---------- */

.band, .epigraph-band { padding: 3.5rem var(--pad-x) 0; }

.epigraph { margin: 0; border-top: 1px solid var(--line); padding: 44px 0 0; text-align: center; }
.epigraph p { margin: 0; font-style: italic; font-size: 23px; line-height: 1.45; color: var(--body); }

.section {
  border-top: 1px solid var(--line);
  padding-top: 48px;
  display: grid;
  grid-template-columns: var(--label-col) 1fr;
  gap: 40px;
}
.section > h2 { font-size: 28px; line-height: 1.25; margin: 0; }

.section-body { font-size: 16px; line-height: 1.7; color: var(--body); }
.section-body p { margin: 0 0 16px; }
.section-body p:last-child { margin-bottom: 0; }
.section-body ul { margin: 0 0 16px; padding-left: 1.3em; }
.section-body li { margin: 0.25em 0; }

/* ---------- Publications ---------- */

.pub-list { display: flex; flex-direction: column; gap: 40px; }
.pub-list.tight { gap: 30px; }

.pub { display: grid; grid-template-columns: 80px 1fr; gap: 24px; }
.pub-year { font-size: 14.5px; color: var(--faint); padding-top: 2px; }
.pub-tag {
  font-size: 12px;
  color: var(--accent);
  padding-top: 4px;
  letter-spacing: 0.05em;
  font-weight: 650;
  text-transform: uppercase;
}
.pub-title { font-size: 17.5px; font-weight: 600; line-height: 1.4; margin: 0; }
.pub-title a { text-decoration: none; }
.pub-title a:hover { text-decoration: underline; }
.pub-authors { font-size: 14.5px; color: var(--body); margin: 8px 0 0; }
.pub-venue { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.pub-links { font-size: 13.5px; margin: 10px 0 0; display: flex; gap: 16px; flex-wrap: wrap; }
.pub-links a { text-decoration: none; color: var(--accent); }
.pub-links a:hover { text-decoration: underline; }

.pub details { margin-top: 10px; }
.pub summary { cursor: pointer; font-size: 13.5px; color: var(--muted); }
.pub summary:hover { color: var(--text); }
.pub details > p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  background: var(--panel);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 10px 0 0;
}

.more-link { font-size: 14.5px; font-weight: 550; text-decoration: none; color: var(--accent); }
.more-link:hover { text-decoration: underline; }

/* ---------- Personal page ---------- */

.bio-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: clamp(2rem, 5vw, 4rem);
  padding: 3rem var(--pad-x) 0;
  align-items: start;
}
.bio-grid h2 { font-size: 28px; margin: 0 0 20px; }
.bio-text { font-size: 16px; line-height: 1.7; color: var(--body); }
.bio-text p { margin: 0 0 16px; }
.bio-text p:last-child { margin-bottom: 0; }
.personal-photo { width: 340px; height: 404px; object-fit: cover; border-radius: 8px; display: block; }

.fav-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.fav-grid h3 {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 650;
  margin: 0 0 14px;
}
.fav-grid ul {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 12px;
  font-size: 15px; line-height: 1.5; color: var(--body);
}
.fav-grid li a { text-decoration: none; }
.fav-grid li a:hover { text-decoration: underline; }
.fav-meta { color: var(--muted); font-size: 13.5px; }

/* GoatCounter tracking pixel — keep out of layout and paint. */
.counter { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 4.5rem;
  padding: 28px var(--pad-x);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 13.5px;
  color: var(--faint);
}

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .hero, .bio-grid { grid-template-columns: 1fr; }
  .portrait, .personal-photo { width: 100%; height: auto; }
  .section { grid-template-columns: 1fr; gap: 20px; }
  .fav-grid { grid-template-columns: 1fr; }
  .site-header { justify-content: center; text-align: center; }
  .site-footer { justify-content: center; text-align: center; }
}
</content>
