/* ─────────────────────────────────────────────────────────────
   Kandinsky × procgen mockup
   palette pulled from the swatch column in the reference
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:        #ffffff;
  --bg-card:   #fafaf8;
  --rule:      #e6e4de;

  --ink:       #1c2845;   /* deep navy — primary text + display */
  --ink-soft:  #555c70;
  --ink-dim:   #9a9aa3;

  --teal:      #4c726f;       /* L* ≈ 45 */
  --blue:      #3d67c0;       /* L* ≈ 45 */
  --terra:     #ac4f36;       /* L* ≈ 45 */
  --mustard:   #e3b658;
  --silver:    #c4c1b5;

  --link:      #577BAF;   /* link/interactive accent */
  --link-hov:  #2c4a8a;

  --serif:  "Spectral", "Iowan Old Style", Georgia, serif;
  --sans:   "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --header-h: 64px;
  --page-max: 1240px;
  --page-pad: 60px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-variation-settings: "opsz" 14, "wght" 400, "SOFT" 0;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

a { color: inherit; }
a:hover { color: var(--link-hov); }

/* ──────────────────  ambient background scatter  ────────────────── */

.bg-scatter {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* swatch color classes — used by social-pill .circle for icon-bg tints */
.sw-teal    { background: var(--teal); }
.sw-blue    { background: var(--blue); }
.sw-terra   { background: var(--terra); }
.sw-mustard { background: var(--mustard); }
.sw-silver  { background: var(--silver); }

/* ──────────────────  site header  ────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  /* transparent — the dithered white panel lives on body::after below so that
     the brand + nav text sit ON TOP of the dither and stay crisp */
  background: transparent;
}

body { padding-top: var(--header-h); }

/* the dithered white backdrop for the header — separate from .site-header so
   the mask doesn't dither the text */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 38;
  pointer-events: none;
  background: #fff;
  /* 3×3 tile with one center hole = ~11% transparency */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='3' height='3'%3E%3Crect width='1' height='1' fill='black'/%3E%3Crect x='1' width='1' height='1' fill='black'/%3E%3Crect x='2' width='1' height='1' fill='black'/%3E%3Crect y='1' width='1' height='1' fill='black'/%3E%3Crect x='2' y='1' width='1' height='1' fill='black'/%3E%3Crect y='2' width='1' height='1' fill='black'/%3E%3Crect x='1' y='2' width='1' height='1' fill='black'/%3E%3Crect x='2' y='2' width='1' height='1' fill='black'/%3E%3C/svg%3E");
  mask-image:         url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='3' height='3'%3E%3Crect width='1' height='1' fill='black'/%3E%3Crect x='1' width='1' height='1' fill='black'/%3E%3Crect x='2' width='1' height='1' fill='black'/%3E%3Crect y='1' width='1' height='1' fill='black'/%3E%3Crect x='2' y='1' width='1' height='1' fill='black'/%3E%3Crect y='2' width='1' height='1' fill='black'/%3E%3Crect x='1' y='2' width='1' height='1' fill='black'/%3E%3Crect x='2' y='2' width='1' height='1' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-size: 3px 3px;
  mask-size: 3px 3px;
  -webkit-mask-repeat: repeat;
  mask-repeat: repeat;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
}

/* dithered 1px rule under the header — repeating "2px ink, 1px gap" pattern,
   matching the 3-pixel cadence of the dither tile above */
body::before {
  content: "";
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--ink-dim) 0 2px,
    transparent 2px 3px
  );
  z-index: 39;
  pointer-events: none;
}

.site-header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 16px var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
}

.brand {
  font-family: var(--serif);
  font-variation-settings: "opsz" 36, "wght" 600, "SOFT" 0;
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.005em;
  text-decoration: none;
  color: var(--ink);
}

/* nav reads as editorial serif italic — pairs with the Spectral display
   "Ziqian Zhong" rather than fighting it with a sans-uppercase chip strip */
.top-nav {
  display: flex;
  gap: 28px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0;
}

.top-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
  transition: color 0.18s;
}

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

.top-nav a.active {
  color: var(--ink);
  font-weight: 500;
}

/* ──────────────────  page wrapper  ────────────────── */

.page {
  position: relative;
  z-index: 5;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

/* ──────────────────  hero  ────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;         /* text vertically centered against the image */
  padding: 32px 0 0 0;         /* no bottom padding — divider snaps to image bottom */
}

.hero-art {
  position: relative;
  display: block;
}

.hero-img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-text {
  position: relative;
}

.display-name {
  font-family: var(--serif);
  font-variation-settings: "opsz" 144, "wght" 600, "SOFT" 0;
  font-weight: 600;
  /* full-width hits 60px; scales smoothly down to 42px on mobile */
  font-size: clamp(42px, 4.8vw, 60px);
  line-height: 1;
  letter-spacing: -0.022em;
  margin: 0 0 22px 0;
  color: var(--ink);
}

.rule-and-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px 0;
}

.rule-and-dot .rule {
  display: block;
  width: 80px;
  height: 1px;
  background: var(--link);
}

.rule-and-dot .dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--link);
}

.rule-and-dot.small .rule { width: 52px; }
.rule-and-dot.small .dot  { width: 5px; height: 5px; }

.bio {
  margin: 0 0 16px 0;
  /* gentle scale: ~17.5px at full width down to 15.5px on mobile */
  font-size: clamp(15.5px, 0.55vw + 10.5px, 17.5px);
  line-height: 1.7;
  color: var(--ink);
  font-variation-settings: "opsz" 14, "wght" 400, "SOFT" 0;
  overflow-wrap: break-word;
}

.bio a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--link);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.bio a:hover {
  color: var(--link-hov);
  border-bottom-color: var(--link-hov);
}

/* ──────────────────  art placeholders  ────────────────── */

.art-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 1px dashed #d8d6cf;
  border-radius: 2px;
  background:
    repeating-linear-gradient(
      45deg,
      transparent 0 22px,
      rgba(28,40,69,0.025) 22px 23px
    ),
    var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.art-placeholder-hero { aspect-ratio: 1 / 1; min-height: 0; }
.art-placeholder-card { aspect-ratio: 1 / 1; min-height: 240px; }

.ph-procart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.ph-tag {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  width: max-content;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ──────────────────  research interest card  ────────────────── */

.card-row {
  padding-top: 16px;          /* tighter — start sooner after the hero divider */
  border-top: 1px solid var(--rule);
}

.info-card {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  padding: 0 8px;             /* no top/bottom — image reaches the top, divider snaps */
}

.info-card.art-right {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.card-art {
  min-height: 240px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Card art bleeds outward past its column edge (mirror direction by side):
   art on the right (Research Interest) bleeds right; art on the left (News)
   bleeds left. */
.card-img,
.card-video {
  display: block;
  width: 130%;
  max-width: none;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.info-card.art-left .card-img,
.info-card.art-left .card-video {
  margin-left: -30%;             /* shift left so right edge sticks at column right */
  object-position: right center;
}

@media (max-width: 820px) {
  .card-img,
  .card-video,
  .info-card.art-left .card-img,
  .info-card.art-left .card-video {
    width: 100%;
    margin-left: 0;
  }
}

.card-body p + p {
  margin-top: 14px;
}

.card-body {
  padding: 40px 0 28px 0;      /* top breathing room only on text; image reaches the top */
}

.card-title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 72, "wght" 500, "SOFT" 0;
  font-weight: 500;
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 14px 0;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.card-body p {
  margin: 0;
  color: var(--ink);
  /* same responsive scale as .bio so paragraphs match across the page */
  font-size: clamp(15.5px, 0.55vw + 10.5px, 17.5px);
  line-height: 1.65;
}

.card-body strong {
  font-variation-settings: "opsz" 14, "wght" 700, "SOFT" 0;
  font-weight: 700;
  color: var(--ink);
}

/* ──────────────────  social pill row  ────────────────── */

.social-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-top: 0;              /* divider snaps to research card bottom (image bottom) */
}

.social-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px 12px;
  text-decoration: none;
  color: var(--ink);
  border-right: 1px solid var(--rule);
  transition: background 0.18s, color 0.18s;
}

.social-pill:last-child { border-right: none; }

.social-pill:hover {
  background: var(--bg-card);
  color: var(--ink);
}

.social-pill .circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ink);          /* icon stroke/fill is dark */
  transition: transform 0.18s;
}

.social-pill:hover .circle { transform: translateY(-2px); }

.social-pill .circle svg {
  width: 20px;
  height: 20px;
}

/* social-row tints — earthy palette. Alphas optimized to balance L* AND
   chroma equally (1:1 LCh weights, target L=91, C=8) — gives a more even
   "saturation feel" across all 5 cells than pure equal-L* */
.social-pill .circle.sw-silver  { background: rgba(154, 166, 118, 0.289); } /* Resume  → olive */
.social-pill .circle.sw-teal    { background: rgba(184, 168, 144, 0.353); } /* Email   → bronze */
.social-pill .circle.sw-blue    { background: rgba(172,  79,  54, 0.182); } /* Twitter → terra */
.social-pill .circle.sw-terra   { background: rgba(227, 182,  88, 0.197); } /* GitHub  → mustard */
.social-pill .circle.sw-mustard { background: rgba(205, 143, 124, 0.281); } /* Scholar → pink */

.social-pill .label {
  font-family: var(--serif);
  font-variation-settings: "opsz" 24, "wght" 500, "SOFT" 0;
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.005em;
}

.social-pill .arrow {
  color: var(--link);
  font-family: var(--serif);
  font-size: 18px;
  transition: transform 0.18s;
}

.social-pill:hover .arrow {
  transform: translateX(4px);
}

/* ──────────────────  lower fold (pubs / awards / projects)  ────────────────── */

.lower {
  padding-top: 60px;
}

.section-head {
  margin: 64px 0 18px 0;
  position: relative;
}

.lower > .pubs > .section-head:first-child,
.lower > div:first-child > .section-head:first-child {
  margin-top: 8px;
}

.section-title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 72, "wght" 500, "SOFT" 0;
  font-weight: 500;
  font-size: 30px;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0 0 6px 0;
}

/* ──────────────────  selected projects (small hero + card grid)  ────────────────── */

.proj-hero {
  margin: 8px 0 32px 0;
  max-width: 720px;
}

.proj-hero-title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 72, "wght" 500, "SOFT" 0;
  font-weight: 500;
  font-size: 28px;            /* matches .card-title */
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0 0 14px 0;
}

.proj-hero-title.small {
  font-size: 28px;
  margin-bottom: 12px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 22px 22px 24px 20px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  overflow: hidden;
  transition: background 0.2s;
}

.project-card:hover {
  background: var(--bg-card);
}

.proj-card-bg {
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 200px;
  height: 200px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.proj-num {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-top: 4px;
}

.proj-num .n {
  font-family: var(--serif);
  font-variation-settings: "opsz" 96, "wght" 400, "SOFT" 0;
  font-weight: 400;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: currentColor;
}

.proj-num .n-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid currentColor;
}

.sw-teal-fg    { color: var(--teal); }
.sw-blue-fg    { color: var(--blue); }
.sw-terra-fg   { color: var(--terra); }
.sw-mustard-fg { color: var(--mustard); }
.sw-silver-fg  { color: var(--ink-soft); }

.proj-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.proj-title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 36, "wght" 500, "SOFT" 0;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
  overflow-wrap: break-word;     /* break only if a word can't fit at all */
}

.proj-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 2px;
}

.proj-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.proj-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: #fff;
}

.proj-pill .pi {
  width: 13px;
  height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
}

.proj-pill .pi svg { width: 100%; height: 100%; }

.proj-pill:hover .pi { color: var(--ink); }

.proj-authors {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  font-style: italic;
}

.proj-venue {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 2px;
}

@media (max-width: 1024px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .project-card { padding: 22px 18px 24px; }
  .proj-card-bg { width: 160px; height: 160px; }
}

/* ──────────────────  compact card grid (awards / side projects) ────────────────── */

.section-head {
  margin-top: 64px;
}

.compact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.compact-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 22px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  transition: background 0.18s;
}

.compact-card:hover { background: var(--bg-card); }

.compact-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin-top: 2px;
}

.compact-body { min-width: 0; }

.compact-title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 24, "wght" 500, "SOFT" 0;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.35;
  color: var(--ink);
}

.compact-meta {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-top: 2px;
  text-transform: none;
}

.compact-meta:not(.sw-teal-fg):not(.sw-blue-fg):not(.sw-terra-fg):not(.sw-mustard-fg):not(.sw-silver-fg) {
  font-style: italic;
}

/* venue-style colored small caps for awards */
.compact-card .compact-meta.sw-teal-fg,
.compact-card .compact-meta.sw-blue-fg,
.compact-card .compact-meta.sw-terra-fg,
.compact-card .compact-meta.sw-mustard-fg,
.compact-card .compact-meta.sw-silver-fg {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  font-style: normal;
}

.compact-link {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--link);
  text-decoration: none;
  padding: 4px 6px;
  transition: transform 0.18s;
}

.compact-card:hover .compact-link { transform: translateX(3px); }

@media (max-width: 820px) {
  .compact-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ──────────────────  legacy block (unused after redesign, kept for safety)  ────────────────── */

.block {
  padding: 12px 0 14px 28px;
  position: relative;
  border-left: 1px solid transparent;
  transition: border-color 0.18s, padding-left 0.18s;
}

.block:hover {
  border-left-color: var(--link);
}

.block-title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 24, "wght" 500, "SOFT" 0;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
}

.block-title > a {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--link);
  margin-left: 6px;
  transition: color 0.15s;
}

.block-title > a:hover { color: var(--link-hov); }

.block-title > span {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 16px;
}

.block-desc {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin-top: 4px;
}

.block-desc > span { font-style: italic; }

.projects { margin-top: 8px; }

/* ──────────────────  footer  ────────────────── */

.footer-tag {
  margin-top: 40px;
  position: relative;
}

/* footer artwork — both halves rendered in the SAME grid cell so they can
   overlap. Each half hugs its own page edge; their max-width drives whether
   they meet (wide viewport) or overlap (narrow viewport). One layout at all
   sizes — no breakpoint jump. */
.footer-art {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "art";
  align-items: end;
  pointer-events: none;
}

/* dashed horizon strip — overlaps the bottom of the two art halves
   (behind the images in z-order). Its dashed top edge acts as a horizon
   line that visually connects the two hills. Height tracks the image
   max-height clamp(150,18vw,220) at a constant ~27% ratio so the line
   crosses the artwork at the same relative point at every viewport. */
.footer-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(41px, 4.9vw, 60px);
  z-index: 0;
  background:
    repeating-linear-gradient(
      90deg,
      #cccccc 0 6px,
      transparent 6px 12px
    )
    top left / 100% 1px no-repeat;
}

.footer-art-left,
.footer-art-right {
  position: relative;
  z-index: 1;          /* render images on top of the strip */
}

.footer-art-left,
.footer-art-right {
  grid-area: art;
  display: block;
  width: auto;
  height: auto;
  max-width: clamp(50%, 50% + (820px - 100vw) / 12, 65%);
  max-height: clamp(150px, 18vw, 220px);
}

.footer-art-left  { justify-self: start; }   /* hug the page's left edge  */
.footer-art-right { justify-self: end; }     /* hug the page's right edge */

/* hidden on request — flip to `display: revert` (or remove) to bring back */
.footer-art-left { display: none; }

/* ──────────────────  responsive  ────────────────── */

@media (max-width: 1024px) {
  :root { --page-pad: 40px; }
  .site-header-inner { padding: 14px var(--page-pad); }
  .page { padding: 0 var(--page-pad); }
  .hero { gap: 36px; }
}

@media (max-width: 820px) {
  :root { --page-pad: 28px; }
  .site-header-inner { padding: 12px var(--page-pad); }
  .top-nav { gap: 22px; }
  .page { padding: 0 var(--page-pad); }

  /* mobile: image is its own row above the text */
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 24px 0 0 0;
  }
  .hero-art {
    min-height: 0;
    order: -1;
    width: 100%;
  }
  .hero-img {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    object-position: left center;     /* left-align when responsive */
  }

  .card-row {
    padding-top: 28px;
  }
  .info-card,
  .info-card.art-right {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 24px 0;
  }
  .info-card.art-right .card-art { order: -1; }
  .card-art { max-width: 320px; }
  .card-body { padding-top: 0; }   /* image sits above text on mobile — no extra top pad */

  /* tablet/mobile: 2 columns; vertical AND horizontal dividers between cells */
  .social-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
  }
  .social-pill {
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 18px 12px;
  }
  .social-pill:nth-child(2n) { border-right: none; }
  .social-pill:nth-last-child(-n+1),
  .social-pill:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
  }

}

@media (max-width: 520px) {
  :root { --page-pad: 18px; }
  .site-header-inner { padding: 12px var(--page-pad); }
  .page { padding: 0 var(--page-pad); }

  /* the home hero already has "Ziqian Zhong" in the nav brand and again in
     the bio body — drop the giant display-name (and its rule-and-dot accent)
     to save space. Blog hero ("Blogs") stays visible. */
  .hero:not(.hero-blog) .display-name,
  .hero:not(.hero-blog) .hero-text > .rule-and-dot {
    display: none;
  }

  .top-nav {
    gap: 18px;
    font-size: 16px;
  }

  .hero { padding: 24px 0 32px 0; }
  .hero-img { max-height: 280px; }

  /* phone: a single horizontal row of just the colored icon circles —
     labels and arrows are hidden; tap-to-open with aria-label */
  .social-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .social-pill,
  .social-pill:nth-child(2n) {
    padding: 16px 4px;
    border-right: 1px solid var(--rule);
    border-bottom: none;
    gap: 0;
  }
  .social-pill:last-child { border-right: none; }
  .social-pill .label,
  .social-pill .arrow { display: none; }
  .social-pill .circle {
    width: 36px;
    height: 36px;
  }
  .social-pill .circle svg {
    width: 17px;
    height: 17px;
  }


  .ph-tag {
    font-size: 9.5px;
    letter-spacing: 0.1em;
    bottom: 8px;
    left: 8px;
    right: 8px;
  }

}


/* ──────────────────  blog index page  ────────────────── */

/* hero on the blog page: image left, title + bio + post list all in the
   right column. Image is top-aligned (not centered) so the artwork acts
   as a tall accent next to the scrolling list. */
.hero-blog {
  /* give the text column more room than on the home page so post titles
     fit comfortably; the abstract illustration is portrait so it still
     reads at a narrower column */
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1fr);
  align-items: start;
  padding: 32px 0 48px 0;
}
.hero-blog .hero-text {
  padding-top: 24px;     /* small breathing room so title isn't flush to the top */
}
.hero-blog .hero-img {
  max-width: 420px;      /* cap so the image doesn't get stretched in its column */
}

/* mobile: stack — image becomes the first row, text/list flows below */
@media (max-width: 820px) {
  .hero-blog {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 0 32px 0;
  }
  .hero-blog .hero-text { padding-top: 0; }
  .hero-blog .hero-img  { max-width: none; }
}

.blog-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 0 0;
  display: flex;
  flex-direction: column;
}

.blog-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  padding: 22px 4px;
  border-bottom: 1px solid var(--rule);
  transition: background 0.18s;
}

.blog-item:first-child { border-top: 1px solid var(--rule); }
.blog-item:hover { background: var(--bg-card); }

.blog-date {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--link);
  font-weight: 500;
  white-space: nowrap;
}

.blog-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.blog-title {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: color 0.15s;
}

.blog-title:hover { color: var(--link-hov); }

.blog-desc {
  margin: 0;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  font-style: italic;
}

@media (max-width: 520px) {
  .blog-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

/* ──────────────────  blog post  ────────────────── */

.post {
  max-width: 720px;
  margin: 0 auto;
  /* top/bottom only — leave L/R to .page's padding so mobile gets the same
     side gutters as the rest of the site */
  padding-top: 32px;
  padding-bottom: 80px;
}

.post-head {
  margin: 16px 0 36px;
}

.post-date {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--link);
  font-weight: 500;
  margin-bottom: 14px;
}

.post-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0 0 10px;
}

.post-subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0;
}

.post article p,
.post article ul,
.post article ol,
.post article blockquote {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 18px;
}

.post article ul,
.post article ol { padding-left: 22px; }
.post article li { margin: 4px 0; }

.post article h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.2;
  margin: 40px 0 12px;
  color: var(--ink);
  letter-spacing: -0.012em;
}

.post article h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.3;
  margin: 28px 0 10px;
  color: var(--ink);
}

.post article a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--link);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.post article a:hover {
  color: var(--link-hov);
  border-bottom-color: var(--link-hov);
}

.post article figure {
  margin: 32px 0;
}
.post article figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}
.post article figcaption {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  text-align: left;
  margin-top: 12px;
}

.post article blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--link);
  color: var(--ink-soft);
  font-style: italic;
}

.post article code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92em;
  background: var(--bg-card);
  padding: 1px 5px;
  border-radius: 3px;
}

.post article pre {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0 0 18px;
}
.post article pre code {
  background: none;
  padding: 0;
}

@media (max-width: 520px) {
  .post { padding-top: 24px; padding-bottom: 60px; }
  article p, article ul, article ol, article blockquote { font-size: 17px; }
}

.post-crosspost {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 18px 0 0 0;
}
.post-crosspost a {
  color: var(--link);
  border-bottom: 1px solid var(--link);
  text-decoration: none;
  font-style: normal;
}
.post-crosspost a:hover {
  color: var(--link-hov);
  border-bottom-color: var(--link-hov);
}

/* footnotes — superscript inline marker + numbered list at end of article */
.fn-ref {
  font-size: 0.78em;
  vertical-align: super;
  line-height: 0;
  text-decoration: none;
  color: var(--link);
  border-bottom: none;
  padding: 0 1px;
}
.fn-ref:hover { color: var(--link-hov); border-bottom: none; }

.footnotes {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.footnotes ol {
  padding-left: 22px;
  margin: 0;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.footnotes li { margin-bottom: 10px; }
.footnotes li:last-child { margin-bottom: 0; }
.footnotes a.fn-back {
  margin-left: 6px;
  text-decoration: none;
  color: var(--link);
  border-bottom: none;
}
.footnotes a.fn-back:hover { color: var(--link-hov); }
