/* Yide Ran — editorial, light only. Warm paper, ink, one serif. */
:root {
  --bg: #faf9f6;
  --ink: #171613;
  --ink-2: #4a4842;
  --muted: #837f75;
  --line: #e7e4dc;
  --line-strong: #c9c5ba;
  --accent: #1f3fd1;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-sans: "Geist", "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: .9375rem; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.wrap { max-width: 1160px; margin-inline: auto; padding-inline: max(40px, env(safe-area-inset-left)) max(40px, env(safe-area-inset-right)); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
::selection { background: #e9e4d5; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 20; padding: 10px 18px; background: var(--ink); color: var(--bg); }
.skip-link:focus { top: 12px; }
.u { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: var(--line-strong); transition: text-decoration-color .15s, color .15s; }
.u:hover { text-decoration-color: currentColor; }
.arrow::after { content: "\2197"; display: inline-block; margin-left: .3em; font-size: .8em; color: var(--muted); transition: transform .15s, color .15s; }
.arrow:hover::after { color: currentColor; transform: translate(1px, -1px); }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; height: 68px; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.brand { font-family: var(--font-serif); font-size: 1.375rem; line-height: 1; letter-spacing: -.01em; }
.nav nav { display: flex; gap: 28px; }
.nav nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: .8125rem; color: var(--muted); transition: color .15s; }
.nav nav a:hover, .nav nav a[aria-current="location"] { color: var(--ink); }

/* Hero */
.hero { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 52px; align-items: center; padding-block: 48px 56px; }
.hero > * { min-width: 0; }
.photo { grid-column: 1; grid-row: 1; }
.hero-copy { grid-column: 2; grid-row: 1; }
.avatar { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; outline: 1px solid rgba(23, 22, 19, .08); outline-offset: -1px; }
h1 { margin: 0 0 20px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(3.75rem, 7vw, 5.5rem); line-height: .95; letter-spacing: -.02em; }
.statement { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.375rem, 2.2vw, 1.75rem); line-height: 1.3; white-space: nowrap; }
.meta { margin-top: 20px; font-size: .9375rem; line-height: 1.5; color: var(--ink-2); }
.focus { margin-top: 4px; font-size: .875rem; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; margin: 20px 0 0; padding: 0; list-style: none; font-size: .9375rem; }
.links li { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; }
.links .email span { user-select: all; }
.copy { font: inherit; font-size: .75rem; line-height: 1.4; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; cursor: pointer; transition: color .15s, border-color .15s; }
.copy:hover { color: var(--ink); border-color: var(--line-strong); }

/* Section rows */
.row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px 56px; padding-block: 44px; border-top: 1px solid var(--line); }
.row > * { min-width: 0; }
.row > h2 { margin: 0; position: sticky; top: 84px; align-self: start; font-family: var(--font-serif); font-weight: 400; font-size: 1.625rem; line-height: 1.1; letter-spacing: -.01em; }

/* Selected work */
.project { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 24px 56px; }
.project + .project { margin-top: 36px; padding-top: 32px; border-top: 1px solid var(--line); }
.project-main { display: grid; gap: 14px; align-content: start; }
.project-main.wide { grid-column: 1 / -1; }
.kicker { font-size: .8125rem; color: var(--muted); }
h3 { margin: 0; font-family: var(--font-serif); font-weight: 400; font-size: 2.25rem; line-height: 1.05; letter-spacing: -.015em; }
.project-main h3 { margin-top: -4px; }
.lead { max-width: 60ch; font-size: 1rem; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.plinks { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: .9375rem; }
.blog-card { display: block; max-width: 600px; margin-top: 4px; border-radius: 6px; overflow: hidden; outline: 1px solid rgba(23, 22, 19, .08); outline-offset: -1px; transition: opacity .15s; }
.blog-card img { display: block; width: 100%; height: auto; }
.blog-card:hover { opacity: .9; }
.partners { display: block; width: 100%; max-width: 600px; height: auto; margin-top: 6px; mix-blend-mode: multiply; }
.metrics { grid-column: 2; display: grid; align-content: start; }
.figs { display: grid; margin: 0; }
.figs div { padding: 12px 0 14px; border-top: 1px solid var(--line); }
.figs div:first-child { padding-top: 0; border-top: 0; }
.figs dt { font-family: var(--font-serif); font-size: 2.5rem; line-height: 1; letter-spacing: -.02em; font-variant-numeric: lining-nums; }
.figs dd { margin: 4px 0 0; font-size: .8125rem; line-height: 1.5; color: var(--muted); }
.note { font-size: .8125rem; line-height: 1.55; color: var(--muted); }
.metrics .note { padding-top: 12px; border-top: 1px solid var(--line); }
.stages { font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-2); }
.stages span { margin: 0 .55em; color: var(--muted); }
summary { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; list-style: none; cursor: pointer; font-size: .875rem; color: var(--ink-2); transition: color .15s; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--font-serif); font-size: 1.25rem; line-height: 1; color: var(--muted); }
details[open] summary::after { content: "\2212"; }
summary:hover { color: var(--ink); }
.detail-body { display: grid; gap: 14px; max-width: 64ch; padding: 6px 0 8px; font-size: .9375rem; line-height: 1.6; color: var(--ink-2); }
.detail-body .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.detail-body .figs div { padding-top: 14px; border-top: 1px solid var(--line); }
.detail-body .figs dt { font-size: 2.25rem; }
.cmd { display: inline-flex; align-items: center; justify-self: start; gap: 14px; max-width: 100%; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.cmd code { font-family: var(--font-mono); font-size: .8125rem; color: var(--ink); white-space: nowrap; overflow-x: auto; }

/* News */
ol.news { list-style: none; margin: 0; padding: 0; }
ol.news li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 24px; padding-block: 12px; border-top: 1px solid var(--line); }
ol.news li:first-child { padding-top: 0; border-top: 0; }
.date { padding-top: .1em; font-size: .8125rem; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
ol.news p { color: var(--ink-2); }
ol.news a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: var(--line-strong); }
ol.news a:hover { text-decoration-color: currentColor; }
.news-archive { border-top: 1px solid var(--line); }
.news-archive ol li:first-child { padding-top: 6px; }

/* Publications */
.pub-year { margin: 0 0 2px; font-family: var(--font-serif); font-weight: 400; font-size: 1.5rem; line-height: 1.2; color: var(--ink); }
ol.pubs + .pub-year { margin-top: 28px; }
ol.pubs { list-style: none; margin: 0; padding: 0; }
ol.pubs li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 2px 22px; padding-block: 15px; border-top: 1px solid var(--line); }
ol.pubs li > :not(.venue-logo) { grid-column: 2; }
.venue-logo { grid-column: 1; grid-row: 1 / span 3; align-self: start; display: flex; align-items: center; width: 84px; height: 52px; margin-top: 0; }
.venue-logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.ptitle { font-weight: 500; font-size: 1.0625rem; line-height: 1.4; letter-spacing: -.01em; text-wrap: pretty; }
.authors { font-size: .875rem; line-height: 1.55; color: var(--muted); }
.authors strong { font-weight: 500; color: var(--ink); }
.venue { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 18px; margin-top: 2px; font-size: .8125rem; }
.venue .v { color: var(--ink-2); }
.venue .v.review { color: var(--muted); }
.venue a { color: var(--muted); }
.venue a:hover { color: var(--ink); }

/* About */
.prose { display: grid; gap: .75em; max-width: 68ch; font-size: .9375rem; line-height: 1.65; color: var(--ink-2); }

/* About: faded photo of Tracy McGrady with the Orlando Magic, right of the text.
   Source: m.hupu.com/bbs/53460490.html (edit by Hupu user a好吃的花卷; original photographer unknown). File kept unaltered; only its upper half shows. */
#about { position: relative; isolation: isolate; }
#about .prose { max-width: 58ch; }
#about::after { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; right: 0; width: min(40%, 460px); pointer-events: none;
  background: url("tracy-mcgrady-magic.jpg") 50% 4% / cover no-repeat; opacity: .5;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 38%), linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 38%), linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
  mask-composite: intersect; }

/* Experience, education */
ol.entries { list-style: none; margin: 0; padding: 0; }
ol.entries li { display: grid; grid-template-columns: 140px 44px minmax(0, 1fr); gap: 4px 20px; align-items: start; padding-block: 15px; border-top: 1px solid var(--line); }
ol.entries li:first-child { padding-top: 0; border-top: 0; }
.logo { width: 44px; height: 44px; margin-top: 0; object-fit: contain; }
.org { display: block; font-weight: 500; font-size: 1rem; line-height: 1.5; }
.what { display: block; font-size: .875rem; color: var(--ink-2); }
.desc { display: block; max-width: 64ch; margin-top: 4px; font-size: .875rem; line-height: 1.55; color: var(--muted); }

/* Toolbox */
dl.kit { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 0 20px; margin: 0; }
dl.kit dt, dl.kit dd { margin: 0; padding-block: 9px; border-top: 1px solid var(--line); }
dl.kit dt:first-of-type, dl.kit dd:first-of-type { padding-top: 0; border-top: 0; }
dl.kit dt { font-size: .8125rem; color: var(--muted); }
dl.kit dd { color: var(--ink-2); }

/* Honors */
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; padding-block: 9px; border-top: 1px solid var(--line); color: var(--ink-2); }
ul.plain li:first-child { padding-top: 0; border-top: 0; }
ul.plain .yr { font-size: .8125rem; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; padding-block: 20px 32px; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--muted); }
footer a { min-height: 32px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 150px minmax(0, 1fr); gap: 40px; }
  .row { grid-template-columns: 150px minmax(0, 1fr); column-gap: 40px; }
  .project { grid-template-columns: minmax(0, 1fr) 170px; column-gap: 40px; }
  .statement { white-space: normal; }
  ol.entries li { grid-template-columns: 120px 44px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  #about .prose { max-width: none; }
  #about::after { width: 72%; opacity: .2; }
  html { scroll-padding-top: 76px; }
  .wrap { padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right)); }
  .nav { height: 60px; }
  .nav nav { gap: 18px; }
  .nav nav a { font-size: .75rem; }
  .hero { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; padding-block: 28px 40px; }
  .photo { order: -1; width: 96px; }
  h1 { margin-bottom: 16px; font-size: clamp(3rem, 13vw, 4.25rem); }
  .statement { font-size: 1.375rem; max-width: 22ch; }
  .meta { margin-top: 16px; }
  .links { gap: 4px 20px; margin-top: 16px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-block: 36px; }
  .row > h2 { position: static; font-size: 1.5rem; }
  .project { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .project + .project { margin-top: 32px; padding-top: 28px; }
  .metrics { grid-column: 1; }
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .figs div, .figs div:first-child { padding: 12px 0 0; border-top: 1px solid var(--line); }
  .figs dt { font-size: 2.5rem; }
  h3 { font-size: 2rem; }
  .lead { font-size: 1rem; }
  ol.news li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  ol.pubs li { grid-template-columns: 60px minmax(0, 1fr); gap: 4px 16px; padding-block: 20px; }
  .venue-logo { width: 60px; height: 40px; grid-row: 1; }
  ol.pubs li > .authors, ol.pubs li > .venue { grid-column: 1 / -1; }
  .ptitle { font-size: 1rem; }
  ol.entries li { grid-template-columns: 40px minmax(0, 1fr); gap: 6px 16px; }
  .logo { width: 40px; height: 40px; }
  ol.entries .date { grid-column: 1 / -1; padding-top: 0; }
  dl.kit { grid-template-columns: minmax(0, 1fr); }
  dl.kit dd { padding-top: 0; border-top: 0; }
  dl.kit dt:first-of-type ~ dt { padding-top: 14px; }
  ul.plain li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
@media (max-width: 400px) {
  .wrap { padding-inline: 20px; }
  .nav nav { gap: 14px; }
  h1 { font-size: 3rem; }
  .statement { font-size: 1.25rem; }
  h3 { font-size: 1.75rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
