/* Weixing Wang — personal site. One typeface, one accent. */

@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/InterTight-Variable.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fafaf8;
  --ink: #151515;
  --muted: #686864;
  --line: #e3e2dd;
  --accent: #2a3bff;
  --font: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f10;
    --ink: #ebeae6;
    --muted: #9a9891;
    --line: #2a2a2d;
    --accent: #8a96ff;
  }
}

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

html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
strong { font-weight: 600; }
em { font-style: italic; }

a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 24px 40px;
}

/* Header: text + token portrait */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 40px;
  align-items: start;
  padding-bottom: 28px;
}
h1 {
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.roles { margin-top: 6px; color: var(--muted); }
.about { margin-top: 18px; }

.token-fig { margin: 4px 0 0; }
.token-frame { position: relative; }
.token-frame img,
.token-frame canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 36 / 39;
}
.token-frame img { object-fit: cover; }
.token-frame canvas {
  position: absolute;
  inset: 0;
  visibility: hidden;
  cursor: crosshair;
  touch-action: pan-y;
}
.token-fig.is-live img { visibility: hidden; }
.token-fig.is-live canvas { visibility: visible; }
.token-fig figcaption {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.readout { color: var(--accent); min-height: 1.45em; font-variant-numeric: tabular-nums; }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 12px;
  font-weight: 500;
}
.links a,
.more a,
.pub-links a {
  border-bottom: 1px solid var(--line);
  transition: color 0.15s, border-color 0.15s;
}
.links a:hover,
.more a:hover,
.pub-links a:hover { color: var(--accent); border-color: var(--accent); }

/* Job-market callout */
.callout {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.callout-dot {
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: translateY(-1px);
}
.callout a {
  color: var(--accent);
  font-weight: 500;
  border-bottom: 1px solid currentColor;
}
.callout a:hover { border-bottom-color: transparent; }

/* Sections */
section {
  padding: 22px 0 24px;
  border-top: 1px solid var(--line);
}
h2 {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Rows: date/venue + content */
.rows > li {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 16px;
  padding: 5px 0;
}
.pubs > li { padding: 8px 0; }
.when {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.title { font-weight: 600; }
.sub { font-weight: 400; color: var(--muted); }
.desc { color: var(--muted); }
.authors { color: var(--muted); font-size: 15px; }
.me {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.pubs .when { white-space: normal; }
.tag {
  display: inline-block;
  margin-top: 2px;
  padding: 0 5px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 18px;
}
.pub-links { display: flex; gap: 14px; font-size: 14px; font-weight: 500; }
.pub-links:empty { display: none; }
.more { margin-top: 10px; font-weight: 500; }

.foot {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* Small screens */
@media (max-width: 640px) {
  .page { padding-top: 32px; }
  .intro { grid-template-columns: 1fr; gap: 24px; }
  .token-fig { max-width: 280px; }
  h1 { font-size: 28px; }
  .rows > li { grid-template-columns: 1fr; gap: 0; padding: 7px 0; }
}

/* ---------- CV page ---------- */
.cv-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 28px;
  font-size: 14px;
  font-weight: 500;
}
.cv-nav a { border-bottom: 1px solid var(--line); }
.cv-nav a:hover { color: var(--accent); border-color: var(--accent); }

.cv-head { padding-bottom: 24px; }
.cv-contact { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 15px; }
.cv-contact > span { color: var(--muted); }
.cv-contact a { border-bottom: 1px solid var(--line); }
.cv-contact a:hover { color: var(--accent); border-color: var(--accent); }

.cv .rows > li { grid-template-columns: 164px 1fr; }
.cv-sub {
  margin: 14px 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.cv-sub:first-of-type { margin-top: 0; }
.bullets {
  margin-top: 4px;
  padding-left: 18px;
  list-style: disc;
  color: var(--muted);
}
.bullets li { padding: 1px 0; }
.bullets li::marker { color: var(--line); }
.venue { color: var(--muted); font-size: 14px; font-style: italic; }
.venue a { font-style: normal; font-weight: 500; color: var(--ink); border-bottom: 1px solid var(--line); }
.venue a:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 640px) {
  .cv .rows > li { grid-template-columns: 1fr; }
}

/* ---------- Print (used for the CV PDF) ---------- */
@media print {
  @page { size: A4; margin: 13mm 14mm; }
  :root {
    --bg: #ffffff;
    --ink: #000000;
    --muted: #3d3d3d;
    --line: #cfcfcf;
    --accent: #1f2fd6;
  }
  html { background: #fff; }
  body { font-size: 10pt; line-height: 1.38; }
  .page { max-width: none; padding: 0; }
  .cv-nav, .foot { display: none; }
  h1 { font-size: 22pt; }
  .cv-head { padding-bottom: 10px; }
  .cv-contact { font-size: 9.5pt; }
  section { padding: 8px 0 10px; }
  h2 { margin-bottom: 4px; font-size: 8.5pt; }
  .rows > li, .pubs > li { padding: 3px 0; break-inside: avoid; }
  .cv .rows > li { grid-template-columns: 134px 1fr; }
  .authors, .venue, .cv-sub { font-size: 9.5pt; }
  .callout, .callout-dot, .tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .callout { margin-top: 10px; padding: 6px 10px; }
  a { border-bottom: 0 !important; }
}
