/* Leo Y. Zhang — academic homepage.
   Single column, sans-serif, content over decoration. IBM Plex Mono is kept for
   the things that are data: sequence ids, term values, the certificate legend.
   The certificate strip is the only figure on the page and stays as it was. */

@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #f8f9fb;
  --ink: #16181d;
  --muted: #5c6373;
  --navy: #0b57a4;
  --ochre: #a8730d;
  --ochre-ink: #8e610b; /* ochre as text: 4.8:1 on the panel, where --ochre is 3.6:1 */
  --rule: #dfe4ea;
  --panel: #eef1f5;
  --cell: 13px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Palatino: the face many mathematics papers are set in (mathpazo). System copies only. */
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --ink: #e7e5df;
    --muted: #98a0ac;
    --navy: #74b3ec;
    --ochre: #d9a441;
    --ochre-ink: #d9a441;
    --rule: #282c33;
    --panel: #1b1f24;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 2.75rem 1.4rem 4rem;
  max-width: 45rem;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0125rem;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

p { margin: 0 0 0.95rem; }

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 2.5px;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  border-radius: 2px;
}

.m { font-family: var(--mono); font-size: 0.92em; }

/* ---------- masthead: name beside the mark, as an academic page does ------- */

.mast {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 1.25rem;
}
.portrait {
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 8px;
}
.ident { min-width: 0; }

h1 {
  font-size: clamp(1.75rem, 5.5vw, 2.3rem);
  font-weight: 650;
  letter-spacing: 0.005em;
  line-height: 1.12;
  margin: 0 0 0.28rem;
}
.role { margin: 0; color: var(--ink); font-size: 1rem; }
.affil { margin: 0.12rem 0 0; color: var(--muted); font-size: 0.92rem; }

/* ---------- section nav ---------- */

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.25rem;
  font-size: 0.9rem;
}
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a:focus-visible { color: var(--navy); text-decoration: underline; }

/* ---------- headings ---------- */

h2 {
  font-size: 1.28rem;
  font-weight: 650;
  letter-spacing: -0.008em;
  margin: 2.6rem 0 0.85rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
section:first-of-type h2 { margin-top: 0; padding-top: 0; border-top: 0; }

h3 {
  font-size: 1.02rem;
  font-weight: 640;
  margin: 0 0 0.3rem;
}

/* ---------- research: the two halves ---------- */

.halves { margin: 0 0 1.5rem; padding-left: 1.15rem; }
.halves li { margin-bottom: 0.5rem; }

/* ---------- the certificate ---------- */

.cert {
  margin: 0;
  padding: 1.15rem 1.2rem 1.05rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.cert .cells {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 0.85rem;
}

.cert .cells i {
  width: var(--cell);
  height: var(--cell);
  border-radius: 3px;
  opacity: 1; /* always visible: the strip is the point, not the animation */
}
.cert .c1 { background: var(--navy); }
.cert .c2 { background: var(--ochre); }
.cert .w  { border: 1.5px solid var(--muted); background: transparent; }

/* Entrance is pure enhancement, and only where motion is welcome. */
@media (prefers-reduced-motion: no-preference) {
  .cert .cells i {
    animation: cell-in 0.5s backwards;
    animation-delay: calc(var(--i) * 11ms);
  }
}
@keyframes cell-in {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

.cert figcaption {
  font-size: 0.86rem;
  line-height: 1.62;
  color: var(--muted);
}
.cert figcaption .claim {
  font-family: var(--mono);
  color: var(--ink);
  font-weight: 500;
}
.cert .k1 { color: var(--navy); font-weight: 600; }
.cert .k2 { color: var(--ochre-ink); font-weight: 600; }

/* ---------- research interests ---------- */

.interests { margin: 0; padding-left: 1.4rem; }
.interests > li { margin-bottom: 1.35rem; }
.interests > li::marker { color: var(--muted); font-family: var(--mono); font-size: 0.85rem; }
.interests p { margin: 0 0 0.35rem; }
.interests .standing {
  font-family: var(--mono);
  font-size: 0.79rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* ---------- the OEIS table ---------- */

.seqs {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.1rem;
  font-size: 0.93rem;
}
.seqs caption {
  caption-side: bottom;
  text-align: left;
  color: var(--muted);
  font-size: 0.82rem;
  padding-top: 0.6rem;
}
.seqs th, .seqs td {
  text-align: left;
  padding: 0.5rem 0.7rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}
.seqs thead th {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom-width: 1.5px;
}
.seqs tbody th { font-family: var(--mono); font-weight: 500; }
.seqs .ok { color: var(--navy); font-weight: 600; }
.seqs .pend { color: var(--muted); }

.withheld {
  border-left: 2px solid var(--ochre);
  padding: 0.15rem 0 0.15rem 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.withheld strong { color: var(--ink); }

/* ---------- software ---------- */

.projects { margin: 0; }
.projects dt {
  margin: 1.05rem 0 0.15rem;
  font-weight: 600;
}
.projects dt:first-child { margin-top: 0; }
.projects .lang {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.5rem;
}
.projects dd { margin: 0; color: var(--ink); }

/* ---------- at a glance: the three numbers, with their provenance --------- */

.glance {
  margin: 1.1rem 0 0.5rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.glance li {
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}
.glance strong {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--navy);
}
.asof {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.55rem 0 0;
}

/* ---------- news: dated, newest first ---------- */

.news { margin: 0; }
.news dt {
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  margin: 1.05rem 0 0.2rem;
}
.news dt:first-child { margin-top: 0; }
.news dd { margin: 0 0 0.1rem; }
.news dd + dd { margin-top: 0.55rem; }

/* ---------- the runnable check: the reader can refute the figure ---------- */

.run {
  margin: 0 0 0.95rem;
  padding: 0.8rem 0.95rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--navy);
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.75;
}
.run code { font: inherit; white-space: pre; }

/* ---------- a publication entry, in the shape an academic expects -------- */

.pub {
  padding-left: 0.9rem;
  border-left: 2px solid var(--navy);
  margin-bottom: 1.15rem;
}
.pub .venue { color: var(--muted); }
.pub .links {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.79rem;
}

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

footer {
  margin-top: 2.9rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.2rem;
  font-size: 0.88rem;
  color: var(--muted);
}
footer p { margin: 0; }

/* ---------- narrow screens ---------- */

@media (max-width: 30rem) {
  body { padding-top: 2rem; }
  .mast { gap: 0.9rem; }
  .portrait { width: 58px; height: 58px; }
  :root { --cell: 11px; }
  .cert { padding: 0.9rem; }
}

/* ---------- type and mark (23 Oct 2026) ---------- */

h1, h2, h3 { font-family: var(--serif); }
h1 { font-weight: 700; letter-spacing: 0; }
h2 { font-weight: 700; font-size: 1.36rem; letter-spacing: 0; }
h3 { font-weight: 700; font-size: 1.06rem; }
.portrait .m1 { fill: var(--navy); }
.portrait .m2 { fill: var(--ochre); }
