/* Yiping Jia — personal site
   Self-contained: no external requests (fonts are in ./fonts). */

@font-face {
  font-family: 'Geist';
  src: url('fonts/geist-sans.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('fonts/geist-mono.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0a0b0d;
  --bg-2: #0f1114;
  --bg-3: #16191d;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);
  --text: #ecedee;
  --text-2: #a4aab2;
  --text-3: #7d848e;
  --accent: #4f8cff;
  --accent-rgb: 79, 140, 255;
  --neutral-mark: #5c636d;
  --ok: #5fd68a;
  --err: #f47c7c;
  /* Named CJK fonts come before system-ui: on Chinese Windows system-ui is the
     tighter "Microsoft YaHei UI", which reads cramped in body text. */
  --sans: 'Geist', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, 'PingFang SC', 'Microsoft YaHei', monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15.5px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
::selection { background: rgba(var(--accent-rgb), .35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }
.skip { position: fixed; top: -100px; left: 16px; z-index: 50; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 6px; }
.skip:focus { top: 12px; }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(10, 11, 13, .72);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-in { height: 56px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font: 500 14px var(--mono); letter-spacing: -.01em; }
.brand svg { width: 15px; height: 15px; color: var(--accent); }
.nav { display: flex; gap: 26px; margin-left: auto; font: 400 12.5px var(--mono); color: var(--text-3); }
.nav a { transition: color .15s; }
.nav a:hover, .nav a[aria-current="true"] { color: var(--text); }
.lang { display: flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; font: 500 11.5px var(--mono); }
.lang button { border: 0; background: none; color: var(--text-3); padding: 4px 10px; border-radius: 999px; transition: color .15s, background .15s; }
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.6px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 62% 78% at 74% 34%, #000 8%, transparent 72%);
  mask-image: radial-gradient(ellipse 62% 78% at 74% 34%, #000 8%, transparent 72%);
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(560px circle at 78% 32%, rgba(var(--accent-rgb), .085), transparent 65%);
}
.hero-in {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
  gap: clamp(32px, 5vw, 72px); align-items: center;
  padding-block: clamp(48px, 7vw, 88px) clamp(40px, 6vw, 72px);
}
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font: 400 12px/1.5 var(--mono); color: var(--text-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px 5px 10px;
  background: rgba(255, 255, 255, .02);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 0 rgba(95, 214, 138, .5); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(95, 214, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 214, 138, 0); } }

h1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-top: 28px; }
.h1-main { font: 600 clamp(56px, 8.2vw, 104px)/1 var(--sans); letter-spacing: -.045em; }
:lang(zh) .h1-main { font-size: clamp(56px, 7.6vw, 96px); letter-spacing: .02em; }
:lang(zh) body { letter-spacing: .015em; }
/* Negative tracking suits Latin display type but cramps CJK glyphs. */
:lang(zh) :is(h2, h3, h4, .headline) { letter-spacing: .02em; }
:lang(zh) .sec-head h2.contact-title { letter-spacing: .02em; }
.h1-alt { font: 400 15px var(--mono); color: var(--text-3); letter-spacing: 0; }
.role { margin-top: 18px; font: 400 13px var(--mono); color: var(--accent); }
.role i { font-style: normal; color: var(--text-3); margin-inline: 6px; }
.headline { margin-top: 26px; font-size: clamp(21px, 2.3vw, 27px); line-height: 1.45; font-weight: 500; letter-spacing: -.01em; max-width: 21em; text-wrap: balance; }
.intro { margin-top: 16px; color: var(--text-2); max-width: 34em; text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 13px var(--mono); padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02);
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.btn:hover { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .28); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #06101f; }
.btn-primary:hover { background: #6ea0ff; border-color: #6ea0ff; }
.btn-quiet { border-color: transparent; background: none; color: var(--text-2); }

/* Agent trace */
.trace {
  background: rgba(15, 17, 20, .86);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .4);
  font: 400 12.5px/1.55 var(--mono);
}
.trace-head { display: flex; align-items: center; gap: 12px; padding: 11px 10px 11px 16px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.trace-name b { font-weight: 500; color: var(--text); margin-right: 8px; }
.trace-state { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; }
.trace-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: blink 1s steps(2) infinite; }
.trace-state.done { color: var(--ok); }
.trace-replay { border: 0; background: none; color: var(--text-3); width: 28px; height: 28px; border-radius: 6px; font-size: 14px; line-height: 1; transition: color .15s, background .15s; }
.trace-replay:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.trace-issue { margin: 14px 16px 0; padding: 8px 12px; border-left: 2px solid var(--accent); background: rgba(var(--accent-rgb), .06); border-radius: 0 6px 6px 0; color: var(--text); }
.trace-issue span { color: var(--text-3); margin-right: 10px; }
.trace-lines { padding: 14px 16px 16px; display: grid; gap: 5px; }
.trace-lines li {
  display: grid; grid-template-columns: 18px 54px minmax(0, 1fr) auto; column-gap: 8px; align-items: baseline;
  opacity: 0; transform: translateY(3px); transition: opacity .25s, transform .25s;
}
.trace-lines li.on { opacity: 1; transform: none; }
.t-n { color: var(--text-3); opacity: .55; }
.t-k { color: var(--text-3); }
.t-v { color: var(--text); overflow-wrap: anywhere; }
.t-v em { font-style: normal; margin-left: 6px; white-space: nowrap; }
.t-m { color: var(--text-3); white-space: nowrap; font-size: 11.5px; }
.t-m b { color: var(--text-2); font-weight: 500; }
li[data-k="memory"] .t-k, li[data-k="memory"] .t-v { color: var(--accent); }
li[data-k="done"] .t-k, li[data-k="done"] .t-v { color: var(--ok); }
.res-pass { color: var(--ok); }
.res-fail { color: var(--err); }
li.cur .t-v::after { content: ''; display: inline-block; width: 7px; height: 1em; margin-left: 5px; vertical-align: -2px; background: var(--text-2); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.trace-meters { border-top: 1px solid var(--line); padding: 14px 16px 16px; display: grid; gap: 9px; font-size: 11.5px; }
.meter-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 76px; gap: 10px; align-items: center; color: var(--text-2); }
.meter { height: 6px; background: rgba(255, 255, 255, .06); border-radius: 0 3px 3px 0; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--neutral-mark); border-radius: 0 3px 3px 0; transition: width .45s cubic-bezier(.2, .7, .2, 1); }
.meter-row.hi .meter i { background: var(--accent); }
.meter-row output { text-align: right; color: var(--text); white-space: nowrap; }
.trace-note { margin-top: 12px; font-size: 12.5px; line-height: 1.6; color: var(--text-3); text-wrap: pretty; }

/* Stats strip */
.stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px; padding: 26px 24px 30px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat dd { font: 600 clamp(30px, 3.4vw, 40px)/1 var(--sans); letter-spacing: -.035em; }
.stat dt { font-size: 12.5px; line-height: 1.55; color: var(--text-2); max-width: 22em; text-wrap: pretty; }

/* ---------- Sections ---------- */
.sec { padding-block: clamp(56px, 8vw, 96px); border-bottom: 1px solid var(--line); }
.sec-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 16px; align-items: baseline; margin-bottom: 36px; }
.sec-no { font: 500 13px var(--mono); color: var(--accent); }
.sec-head h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.sec-lead { color: var(--text-2); font-size: 14px; max-width: 30em; text-align: right; }

/* Projects */
.proj { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: clamp(28px, 4.5vw, 64px); padding-block: 40px; border-top: 1px solid var(--line); }
.proj:last-child { padding-bottom: 0; }
.proj-kicker { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; font: 400 12px/1.6 var(--mono); color: var(--text-3); }
.proj-kicker .no { color: var(--accent); margin-right: 12px; }
.proj-kicker .name { color: var(--text-2); }
.proj h3 { margin-top: 16px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.3; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
/* Break Chinese titles at punctuation or spaces; split a phrase only if it cannot fit on a line. */
:lang(zh) .proj h3 { word-break: keep-all; overflow-wrap: anywhere; }
.ship { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; color: var(--ok); }
.ship::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.proj-sum { margin-top: 14px; color: var(--text-2); max-width: 40em; text-wrap: pretty; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tags li { font: 400 11.5px/1.4 var(--mono); color: var(--text-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; }
.proj details { margin-top: 20px; }
.proj summary { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; font: 500 12.5px var(--mono); color: var(--text); padding: 4px 0; border-bottom: 1px solid var(--line-2); transition: border-color .15s; }
.proj summary:hover { border-color: var(--accent); }
.proj summary::-webkit-details-marker { display: none; }
.proj summary::after { content: '+'; color: var(--accent); }
.proj details[open] summary::after { content: '−'; }
.proj details ul { margin-top: 14px; display: grid; gap: 10px; max-width: 40em; }
.proj details li { position: relative; padding-left: 18px; font-size: 14px; color: var(--text-2); text-wrap: pretty; }
.proj details li::before { content: ''; position: absolute; left: 2px; top: .72em; width: 5px; height: 5px; border-radius: 50%; border: 1px solid var(--accent); }
.tags li.tag-link { padding: 0; border-color: rgba(var(--accent-rgb), .5); }
.tag-link a { display: block; padding: 3px 8px; color: var(--accent); border-radius: 6px; transition: background .15s; }
.tag-link a:hover { background: rgba(var(--accent-rgb), .12); }

/* Figures */
.fig { align-self: start; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px 22px; }
.fig-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 500 11.5px/1.5 var(--mono); color: var(--text-3); margin-bottom: 18px; }
.fig-tag { border: 1px solid var(--line-2); border-radius: 999px; padding: 0 8px; font-size: 10.5px; white-space: nowrap; }
.fig-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.fig-hero strong { font: 600 clamp(48px, 6vw, 64px)/1 var(--sans); letter-spacing: -.045em; }
.fig-hero span { color: var(--text-2); font-size: 13px; }
.bars { margin-top: 22px; }
.bars-title { font-size: 12px; font-weight: 500; color: var(--text-3); margin-bottom: 10px; }
.bar + .bar { margin-top: 10px; }
.bar-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; line-height: 1.4; color: var(--text-2); margin-bottom: 6px; }
.bar-top b { font: 500 12.5px var(--mono); color: var(--text); white-space: nowrap; }
.bar-track { height: 8px; background: rgba(255, 255, 255, .05); border-radius: 0 4px 4px 0; }
.bar-fill { height: 100%; background: var(--neutral-mark); border-radius: 0 4px 4px 0; }
.bar.hi .bar-fill { background: var(--accent); }
.range-track { position: relative; height: 8px; background: rgba(255, 255, 255, .05); border-radius: 4px; }
.range-fill { position: absolute; top: 0; bottom: 0; background: var(--neutral-mark); border-radius: 4px; }
.bar.hi .range-fill { background: var(--accent); }
.range-axis { position: relative; height: 16px; margin-top: 8px; font: 400 10.5px var(--mono); color: var(--text-3); }
.range-axis span { position: absolute; top: 0; transform: translateX(-50%); }
.range-axis span:first-child { transform: none; }
.range-axis span:last-child { transform: translateX(-100%); }
.fig-note { margin-top: 16px; font-size: 12px; line-height: 1.6; color: var(--text-3); }
.fig-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.fig-stats strong { display: block; font: 600 26px/1.1 var(--sans); letter-spacing: -.03em; white-space: nowrap; }
.fig-stats strong small { font-size: 16px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-inline: 5px; vertical-align: 3px; }
.fig-stats span { display: block; margin-top: 7px; font-size: 12px; line-height: 1.5; color: var(--text-2); }

.heat { font: 400 12px/1.95 var(--mono); overflow-x: auto; }
.heat-line { display: grid; grid-template-columns: 12px 30px max-content; column-gap: 9px; align-items: center; white-space: pre; }
.heat-ln { color: var(--text-3); opacity: .55; text-align: right; }
.heat-risk { height: 6px; }
.heat-risk i { display: block; height: 100%; background: var(--accent); border-radius: 0 3px 3px 0; }
.heat-code span { background: rgba(var(--accent-rgb), calc(var(--h) * .62)); border-radius: 3px; padding: 2px 0; }
.heat-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 14px; font: 400 11px var(--mono); color: var(--text-3); }
.heat-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.heat-scale { width: 56px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, rgba(var(--accent-rgb), .05), rgba(var(--accent-rgb), .62)); }
.heat-key { width: 14px; height: 6px; background: var(--accent); border-radius: 0 3px 3px 0; }

.pipe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 400 11.5px/1.4 var(--mono); color: var(--text-2); margin-bottom: 22px; }
.pipe-step { display: inline-flex; align-items: center; gap: 6px; }
.pipe-step > span { border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; background: var(--bg-3); }
.pipe i { font-style: normal; color: var(--text-3); }

/* Segmented bar: one whole split into labelled parts */
.seg-row + .seg-row { margin-top: 12px; }
.seg-label { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.seg { display: flex; gap: 2px; height: 28px; }
.seg > span { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 9px; border-radius: 4px; font-size: 12px; white-space: nowrap; min-width: 0; }
.seg b { font-weight: 500; }
.seg em { font: 500 11px var(--mono); font-style: normal; color: var(--text-2); }
.seg-auto { background: rgba(255, 255, 255, .1); color: var(--text); }
.seg-judge { background: rgba(var(--accent-rgb), .3); color: var(--text); }
.seg-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font: 400 11px var(--mono); color: var(--text-3); }
.seg-legend span { display: inline-flex; align-items: center; gap: 7px; }
.seg-legend i { width: 10px; height: 10px; border-radius: 2px; }

.dg { display: block; width: 100%; height: auto; }
.dg-node { fill: var(--bg-3); stroke: var(--line-2); }
.dg-key { fill: rgba(var(--accent-rgb), .08); stroke: var(--accent); }
.dg-t { fill: var(--text); font: 500 11.5px var(--mono); text-anchor: middle; }
.dg-l { fill: var(--text-3); font: 400 10.5px var(--mono); }
.dg-a { fill: none; stroke: var(--text-3); stroke-width: 1.2; }
.dg-ah { fill: var(--text-3); }

/* Experience & education */
.path-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4.5vw, 64px); }
.col-label { font: 500 12px var(--mono); color: var(--text-3); padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.entry { padding-block: 22px; border-bottom: 1px solid var(--line); }
.entry .date { font: 400 12px var(--mono); color: var(--text-3); }
.entry h4 { margin-top: 8px; font-size: 18px; font-weight: 600; line-height: 1.4; letter-spacing: -.01em; }
.entry .entry-role { margin-top: 2px; font-size: 14px; color: var(--text); }
.entry .desc { margin-top: 10px; font-size: 14px; color: var(--text-2); text-wrap: pretty; }

/* Publications */
.paper { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 28px; column-gap: 20px; align-items: start; padding-block: 20px; border-top: 1px solid var(--line); }
.paper:last-child { border-bottom: 1px solid var(--line); }
.paper-year { font: 400 12.5px/1.7 var(--mono); color: var(--text-3); padding-top: 2px; }
.paper h3 { font-size: 16px; font-weight: 500; line-height: 1.5; text-wrap: pretty; }
.paper p { margin-top: 4px; font-size: 13.5px; color: var(--text-3); }
.paper p strong { color: var(--text-2); font-weight: 500; }
.badge { font: 400 11.5px/1.4 var(--mono); color: var(--text-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; margin-top: 3px; white-space: nowrap; }
.badge.hi { color: var(--accent); border-color: rgba(var(--accent-rgb), .5); }
.paper-link { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--text-2); transition: color .15s, background .15s; }
.paper-link:hover { color: var(--accent); background: rgba(255, 255, 255, .06); }

/* Skills */
.skill-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.skill { padding-top: 18px; border-top: 1px solid var(--line-2); }
.skill h3 { font-size: 15.5px; font-weight: 600; }
.skill p { margin-top: 8px; font-size: 13.5px; color: var(--text-2); text-wrap: pretty; }
.skill .tags { margin-top: 14px; }
.languages { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.languages span:first-child { font: 500 12px/2 var(--mono); color: var(--text-3); }

/* Off the clock */
.play { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(28px, 6vw, 88px); align-items: center; }
.play-text > p:first-child { font-size: 17px; line-height: 1.75; max-width: 30em; text-wrap: pretty; }
.play-hint { margin-top: 12px; font-size: 14px; color: var(--text-2); }
.play-actions { display: flex; gap: 8px; margin-top: 24px; }
.play-site { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 28px; font: 500 13px var(--mono); }
.play-site .ship { margin-left: 0; }
.play-site a { color: var(--accent); border-bottom: 1px solid rgba(var(--accent-rgb), .4); transition: border-color .15s; }
.play-site a:hover { border-color: var(--accent); }
.board {
  --cell: clamp(13px, calc((100vw - 130px) / 15), 21px);
  display: grid; grid-template-columns: repeat(15, var(--cell)); gap: 4px;
  padding: clamp(16px, 2.4vw, 28px); background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  width: max-content; max-width: 100%;
}
.peg { width: var(--cell); height: var(--cell); border-radius: 50%; cursor: pointer; background: radial-gradient(circle, rgba(255, 255, 255, .17) 0 13%, transparent 16%); transition: transform .12s; }
.peg:hover { transform: scale(1.18); }
.peg.on { background: radial-gradient(circle, var(--bg-2) 0 23%, var(--c) 27% 100%); box-shadow: inset 0 -2px 2px rgba(0, 0, 0, .28), inset 0 1px 1px rgba(255, 255, 255, .3); }

/* Contact */
.sec-contact { border-bottom: 0; }
.sec-contact .sec-head { margin-bottom: 14px; }
.sec-head h2.contact-title { font-size: clamp(44px, 7.5vw, 92px); line-height: 1.08; letter-spacing: -.035em; }
.contact-intro { color: var(--text-2); max-width: 34em; font-size: 16px; }
.c-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 40px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.c-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: baseline;
  padding: 22px 24px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: none; text-align: left; transition: background .15s;
}
.c-row:hover { background: var(--bg-2); }
.c-k { font: 400 12px var(--mono); color: var(--text-3); }
.c-v { font-size: 17px; overflow-wrap: anywhere; }
.c-a { font: 500 12px var(--mono); color: var(--accent); }

.foot { border-top: 1px solid var(--line); }
.foot-in { display: flex; justify-content: space-between; gap: 16px; padding-block: 22px; font: 400 12px var(--mono); color: var(--text-3); }
.foot a:hover { color: var(--text); }
.noscript { padding: 24px; text-align: center; }
.noscript a { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .skill-grid { grid-template-columns: 1fr 1fr; }
  .nav { gap: 18px; }
}
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-demo { max-width: 560px; }
  .proj { grid-template-columns: 1fr; gap: 28px; }
  .fig { max-width: 560px; width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding-left: 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .stat:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
  .stat:nth-last-child(-n+2) { border-bottom: 0; }
  .sec-head { grid-template-columns: auto minmax(0, 1fr); }
  .sec-lead { grid-column: 1 / -1; text-align: left; margin-top: 10px; }
  .play { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav { display: none; }
  .lang { margin-left: auto; }
}
@media (max-width: 760px) {
  .lang { margin-left: auto; }
  .path-cols { grid-template-columns: 1fr; gap: 40px; }
  .paper { grid-template-columns: minmax(0, 1fr) 28px; row-gap: 6px; }
  .paper-year { grid-column: 1 / -1; padding: 0; }
  .paper .badge { grid-column: 1; grid-row: 3; justify-self: start; margin-top: 6px; }
  .paper-link { grid-column: 2; grid-row: 2; }
  .c-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .skill-grid { grid-template-columns: 1fr; }
  .trace { font-size: 11.5px; }
  .trace-lines li { grid-template-columns: 16px 46px minmax(0, 1fr); }
  .t-m { grid-column: 3; font-size: 10.5px; }
  .meter-row { grid-template-columns: 86px minmax(0, 1fr) 64px; font-size: 11px; }
  .meter-row > span:first-child { white-space: nowrap; }
  .heat { font-size: 11px; }
  .fig { padding: 16px 16px 18px; }
  .c-row { padding: 18px 16px; grid-template-columns: 52px minmax(0, 1fr) auto; }
  .c-v { font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  :root { --bg: #fff; --bg-2: #fff; --bg-3: #f4f4f4; --text: #111; --text-2: #333; --text-3: #666; --line: #ddd; --line-2: #bbb; --neutral-mark: #999; }
  .top, .hero::before, .hero::after, .cta, .trace-replay, #play, .foot a { display: none; }
  .trace { box-shadow: none; }
  .trace-lines li { opacity: 1; transform: none; }
  .proj, .entry, .paper { break-inside: avoid; }
  .proj details > ul { display: grid; }
}
