/* ─────────────── tokens ─────────────── */
:root {
  --bg: #faf6ee;
  --surface: #fdfbf6;
  --ink: #2b2620;
  --ink-2: #5d554b;
  --muted: #8f8679;
  --rule: #e8e1d3;
  --hl: #efe8da;
  --hl-hover: #e5dac4;
  --accent: #b5532e;     /* terracotta */
  --accent-2: #3d6f8f;   /* slate blue */
  --good: #4f7d4a;
  --bad: #c0624a;
  --bar-bg: #ece5d6;
  --shadow: 0 1px 0 rgba(60, 45, 20, .04), 0 1px 3px rgba(60, 45, 20, .05);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1916; --surface: #23201c; --ink: #ece6da; --ink-2: #c3bbad; --muted: #8e877b;
    --rule: #36322b; --hl: #2f2b25; --hl-hover: #3b362e; --accent: #e08a62; --accent-2: #7fb0d0;
    --good: #8cbc84; --bad: #e08a72; --bar-bg: #312d27; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1916; --surface: #23201c; --ink: #ece6da; --ink-2: #c3bbad; --muted: #8e877b;
  --rule: #36322b; --hl: #2f2b25; --hl-hover: #3b362e; --accent: #e08a62; --accent-2: #7fb0d0;
  --good: #8cbc84; --bad: #e08a72; --bar-bg: #312d27; --shadow: none; color-scheme: dark;
}

/* ─────────────── base ─────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.68 var(--serif); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; transition: background .25s, color .25s;
}
a { color: inherit; text-decoration: none; }
p a:not(.hl), .actions a, .pub-venue a { color: var(--accent-2); }
p a:not(.hl):hover, .actions a:hover, .pub-venue a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { font-weight: 600; }
.hl {
  background: var(--hl); padding: 1px 5px; border-radius: 3px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background .15s;
}
a.hl:hover { background: var(--hl-hover); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ─────────────── top bar ─────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule); font-family: var(--sans);
}
.brand { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.topbar nav { display: flex; align-items: center; gap: 26px; font-size: 15px; font-weight: 500; }
.topbar nav a { color: var(--ink-2); transition: color .15s; }
.topbar nav a:hover { color: var(--ink); }
.theme-toggle {
  border: 0; background: none; color: var(--ink-2); cursor: pointer; padding: 4px; border-radius: 6px;
  display: grid; place-items: center;
}
.theme-toggle:hover { color: var(--ink); background: var(--hl); }

/* ─────────────── layout ─────────────── */
main { max-width: 680px; margin: 0 auto; padding: 32px 24px 40px; }
section { margin-bottom: 56px; }
h1, h2 {
  font-weight: 700; letter-spacing: -.015em; line-height: 1.2;
  padding-bottom: 14px; border-bottom: 1px solid var(--rule); margin: 0 0 22px;
}
h1 { font-size: 26px; margin-top: 18px; }
h2 { font-size: 23px; }
h3 { font-size: 19px; margin: 0; line-height: 1.3; }
p { margin: 0 0 18px; }

/* ─────────────── cards ─────────────── */
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: var(--shadow); font-family: var(--sans);
}
.currently { padding: 14px 16px 12px; max-width: 300px; margin-bottom: 26px; font-size: 13px; }
.label {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  font-weight: 500; margin-bottom: 8px;
}
.currently dl { margin: 0; }
.currently dl > div { margin-bottom: 6px; line-height: 1.55; }
.currently dt { display: inline; color: var(--muted); }
.currently dd { display: inline; margin: 0; color: var(--ink-2); }
.currently .hl { padding: 0 4px; }

.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pill {
  font: 500 13px var(--sans); padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2);
  transition: border-color .15s, color .15s, transform .15s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ─────────────── interests ─────────────── */
.pillars { padding-left: 20px; margin: 0; }
.pillars li { margin-bottom: 10px; }
.pillars li::marker { color: var(--muted); }

/* ─────────────── timeline ─────────────── */
.lede { color: var(--ink-2); }
.timeline { list-style: none; padding: 0; margin: 32px 0 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 13px; top: 8px; bottom: 8px; width: 1px; background: var(--rule);
}
.step { position: relative; padding-left: 48px; margin-bottom: 52px; }
.step:last-child { margin-bottom: 0; }
.num {
  position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg); border: 1px solid var(--rule);
  font: 600 11.5px var(--sans); color: var(--ink-2);
}
.step.future .num { border-style: dashed; }
.venue { font: 500 12.5px var(--sans); color: var(--muted); margin: 4px 0 12px; letter-spacing: .01em; }
.mark { font-weight: 700; color: var(--accent); }
.mark.q { color: var(--accent-2); }
.actions { display: flex; gap: 18px; font: 500 13.5px var(--sans); }

/* ─────────────── demo figure ─────────────── */
.demo {
  position: relative; margin: 8px 0 0; padding: 26px 22px 18px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow);
  font-family: var(--sans); font-size: 13px; color: var(--ink-2);
}
.demo.collapsed { padding: 12px 22px; }
.demo.collapsed .demo-body { display: none; }
.demo.collapsed::before { content: "interactive figure"; color: var(--muted); font-size: 12px; }
.hide-btn {
  position: absolute; top: 10px; right: 12px; border: 0; background: none; cursor: pointer;
  font: 500 11.5px var(--sans); color: var(--muted); padding: 2px 4px;
}
.hide-btn:hover { color: var(--ink); }
.demo figcaption {
  margin-top: 14px; font: 15px/1.55 var(--serif); color: var(--ink); text-align: center;
  min-height: 3.1em; max-width: 520px; margin-left: auto; margin-right: auto;
}
.note { font-size: 11.5px; color: var(--muted); text-align: center; margin: 8px 0 0; }

.seg { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 16px; }
.seg button, .ghost {
  font: 500 12.5px var(--sans); color: var(--ink-2); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.seg button:hover, .ghost:hover { border-color: var(--muted); color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg button:focus-visible, .ghost:focus-visible, .hide-btn:focus-visible, .theme-toggle:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px;
}

/* complementary-label demo */
.cll-image { display: flex; align-items: center; gap: 14px; justify-content: center; margin-bottom: 18px; }
.thumb {
  width: 64px; height: 64px; border-radius: 8px; flex: none;
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 55%),
    radial-gradient(circle at 70% 75%, color-mix(in srgb, var(--accent-2) 35%, transparent), transparent 55%),
    var(--bar-bg);
  display: grid; place-items: center; font: 600 22px var(--serif); color: var(--muted);
}
.cll-meta { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cll-tag { font-size: 14px; color: var(--ink); }
.cll-tag strong { color: var(--bad); }
.ghost { padding: 3px 10px; font-size: 11.5px; margin-top: 2px; }

.bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; align-items: end; height: 150px; padding: 0 2px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; min-width: 0; }
.bar .fill {
  width: 100%; max-width: 34px; border-radius: 4px 4px 1px 1px; background: var(--accent-2);
  transition: height .45s cubic-bezier(.3,.7,.2,1), background .3s, opacity .3s; min-height: 2px;
}
.bar .p { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar .name { font-size: 10.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bar.neg .fill { background: var(--bad); opacity: .35; }
.bar.neg .name { text-decoration: line-through; color: var(--bad); }
.bar.enh .fill { background: var(--bad); opacity: .18; }
.bar.enh .name { text-decoration: line-through; color: var(--muted); }
.bar.guess .fill { background: var(--accent); }
.bar.guess .name { color: var(--accent); font-weight: 600; }

/* long-tail demo */
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 26px; margin-bottom: 18px; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.controls output { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 4px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.lt-chart { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; height: 160px; align-items: end; }
.lt-col { display: flex; flex-direction: column-reverse; height: 100%; justify-content: flex-start; align-items: center; }
.lt-col .seg-clean, .lt-col .seg-noisy, .lt-col .seg-borrow {
  width: 100%; max-width: 34px; transition: height .45s cubic-bezier(.3,.7,.2,1);
}
.seg-clean { background: var(--accent-2); border-radius: 0 0 1px 1px; }
.seg-noisy {
  background: repeating-linear-gradient(135deg, var(--bad) 0 3px, color-mix(in srgb, var(--bad) 35%, transparent) 3px 6px);
}
.seg-borrow {
  background: color-mix(in srgb, var(--good) 55%, transparent);
  border: 1px dashed var(--good); border-bottom: 0; border-radius: 4px 4px 0 0;
}
.lt-col .top { border-radius: 4px 4px 0 0; }
.lt-experts { display: grid; grid-template-columns: 3fr 3fr 4fr; gap: 6px; margin-top: 8px; text-align: center; }
.lt-experts span {
  font-size: 11px; padding: 3px 0; border-top: 2px solid var(--rule); color: var(--muted);
  transition: border-color .3s, color .3s;
}
.lt-experts.on span[data-g="head"] { border-color: var(--accent-2); color: var(--accent-2); }
.lt-experts.on span[data-g="med"]  { border-color: var(--accent); color: var(--accent); }
.lt-experts.on span[data-g="tail"] { border-color: var(--good); color: var(--good); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 12px 0 14px; font-size: 11.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.sw.clean { background: var(--accent-2); }
.sw.noisy { background: repeating-linear-gradient(135deg, var(--bad) 0 2px, color-mix(in srgb, var(--bad) 35%, transparent) 2px 4px); }
.sw.borrow { background: color-mix(in srgb, var(--good) 55%, transparent); border: 1px dashed var(--good); }

/* kv-cache demo */
.kv { position: relative; padding: 0 0 6px; margin-bottom: 26px; }
.kv-axis { display: flex; justify-content: space-between; margin: 0 0 8px 92px; font-size: 11px; color: var(--muted); }
.kv-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.kv-label { width: 80px; flex: none; font-size: 11.5px; color: var(--muted); text-align: right; }
.kv-track { position: relative; flex: 1; height: 26px; background: var(--bar-bg); border-radius: 5px; overflow: hidden; }
.kv-bar {
  position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; white-space: nowrap; overflow: hidden; border-radius: 4px;
  transition: left .6s cubic-bezier(.3,.7,.2,1), width .6s cubic-bezier(.3,.7,.2,1);
}
.kv-bar.queue { background: color-mix(in srgb, var(--muted) 55%, transparent); color: var(--ink); }
.kv-bar.compute { background: var(--accent-2); }
.kv-bar.io { background: var(--accent); }
.kv-bar.io2 { background: color-mix(in srgb, var(--accent) 65%, var(--accent-2)); }
.kv-ttft {
  position: absolute; top: 18px; bottom: 0; width: 0; border-left: 2px dashed var(--ink);
  transition: left .6s cubic-bezier(.3,.7,.2,1);
}
.kv-ttft span {
  position: absolute; bottom: -18px; left: -14px; font-size: 10.5px; font-weight: 600; color: var(--ink);
}

/* ─────────────── publications ─────────────── */
.pubs { list-style: none; padding: 0; margin: 0; }
.pubs li { padding: 14px 0; border-bottom: 1px dashed var(--rule); }
.pubs li:first-child { padding-top: 0; }
.pub-title { font-weight: 600; line-height: 1.4; }
.pub-authors { color: var(--ink-2); font-size: 15px; margin-top: 2px; }
.pub-authors u { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.pub-venue { font: 500 12.5px var(--sans); margin-top: 6px; color: var(--muted); }
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 4px; margin-right: 8px;
  background: var(--hl); color: var(--ink); font-weight: 600;
}
.tag.muted-tag { color: var(--muted); font-weight: 500; }

/* ─────────────── demo: image steering ─────────────── */
.chat { display: flex; gap: 14px; align-items: flex-start; }
.chat-img {
  flex: none; width: 74px; height: 74px; border-radius: 8px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 55%, var(--bar-bg)), color-mix(in srgb, var(--good) 45%, var(--bar-bg)));
}
.chat-img::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--accent) 35%, transparent) 0 1px, transparent 1px 4px);
}
.chat-img.armed::after { opacity: .55; }
.chat-col { flex: 1; min-width: 0; }
.chat-asks { justify-content: flex-start; margin-bottom: 10px; }
.chat-asks button { font-size: 11.5px; }
.bubble { font: 14px/1.5 var(--sans); padding: 9px 12px; border-radius: 10px; margin-bottom: 8px; max-width: 92%; }
.bubble.user { background: var(--ink); color: var(--bg); margin-left: auto; width: fit-content; border-bottom-right-radius: 3px; }
.bubble.bot { background: var(--bar-bg); color: var(--ink); border-bottom-left-radius: 3px; min-height: 3em; }
.bubble mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--ink); padding: 0 2px; border-radius: 3px; }

/* ─────────────── demo: ideal learner ─────────────── */
.ev-q { font-size: 15px; text-align: center; margin: 0 0 12px; color: var(--ink-2); }
.ev-q strong { color: var(--ink); }
.ev-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 22px; margin-bottom: 6px; }
.ev-chips i { font: 600 11px/20px var(--sans); font-style: normal; width: 20px; height: 20px; border-radius: 4px; text-align: center; }
.ev-chips i.hit { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); }
.ev-chips i.miss { background: color-mix(in srgb, var(--bad) 20%, transparent); color: var(--bad); }
.ev-chips i.new { animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.ev-chart { display: block; width: 100%; height: auto; overflow: visible; }
.ev-chart .grid { stroke: var(--rule); stroke-width: 1; }
.ev-chart .prior { stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; }
.ev-chart text { font: 9px var(--sans); fill: var(--muted); }
.ev-chart .ln { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.ev-chart .ideal { stroke: var(--accent-2); } .ev-chart circle.ideal { fill: var(--accent-2); }
.ev-chart .model { stroke: var(--accent); }  .ev-chart circle.model { fill: var(--accent); }
.sw.ev-ideal { background: var(--accent-2); } .sw.ev-model { background: var(--accent); }
.legend b { font-variant-numeric: tabular-nums; color: var(--ink); }

/* ─────────────── demo: where gains come from ─────────────── */
.controls.one { grid-template-columns: 1fr; }
.gain { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; height: 150px; align-items: end; }
.g-grp { display: flex; flex-direction: column; height: 100%; }
.g-bars { flex: 1; display: flex; gap: 4px; align-items: flex-end; justify-content: center; }
.g-bar { width: 38%; max-width: 26px; border-radius: 4px 4px 0 0; position: relative; transition: height .2s; }
.g-bar span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font: 10px var(--sans); color: var(--muted); padding-bottom: 2px; font-variant-numeric: tabular-nums; }
.g-bar.base { background: color-mix(in srgb, var(--muted) 55%, var(--bar-bg)); }
.g-bar.new { background: var(--accent); }
.g-name { font: 11.5px var(--sans); color: var(--ink-2); text-align: center; margin-top: 6px; border-top: 1px solid var(--rule); padding-top: 4px; }
.g-grp.avg .g-name { font-weight: 600; color: var(--ink); }
.sw.g-base { background: color-mix(in srgb, var(--muted) 55%, var(--bar-bg)); } .sw.g-new { background: var(--accent); }

/* ─────────────── honors & service ─────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.plain { list-style: none; padding: 0; margin: 0; font-size: 15.5px; }
.plain li { margin-bottom: 10px; line-height: 1.45; }
.yr { display: block; font: 500 11px var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ─────────────── footer ─────────────── */
footer {
  max-width: 680px; margin: 0 auto; padding: 22px 24px 40px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font: 12.5px var(--sans); color: var(--muted);
}

/* ─────────────── reading page ─────────────── */
.topbar nav a[aria-current="page"] { color: var(--ink); }
.reading h1 { margin-bottom: 16px; }
.search {
  width: 100%; font: 15px var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: 8px; padding: 11px 14px; margin: 4px 0 16px;
  -webkit-appearance: none; appearance: none;
}
.search::placeholder { color: var(--muted); }
.search:focus { outline: 2px solid color-mix(in srgb, var(--accent-2) 50%, transparent); outline-offset: 0; }
.r-top { display: grid; grid-template-columns: 220px 1fr; gap: 12px; margin-bottom: 12px; }
.r-stats { padding: 14px 16px; font-size: 13px; line-height: 1.75; }
.r-stats span:not(.muted) { color: var(--ink); font-variant-numeric: tabular-nums; }
.r-filter { padding: 14px 16px; display: flex; flex-direction: column; align-items: flex-start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chips button {
  font: 500 12.5px var(--sans); color: var(--ink-2); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.chips button:hover { border-color: var(--muted); color: var(--ink); }
.chips button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.r-filter .ghost { margin-top: auto; }

.r-heat { padding: 14px 16px 12px; margin-bottom: 26px; }
.r-heat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.r-heat-head .label { margin: 0; }
.r-heat-head .small { font-size: 12px; }
.heat-scroll { overflow-x: auto; scrollbar-width: thin; }
.heat {
  display: grid; grid-template-columns: repeat(53, 9px); grid-template-rows: 14px repeat(7, 9px);
  gap: 3px; width: max-content; font-size: 10px; color: var(--muted);
}
.heat span { grid-row: 1; white-space: nowrap; line-height: 1; }
.heat i { display: block; border-radius: 2px; background: var(--bar-bg); }
.heat i.future { background: none; border: 1px solid var(--rule); }
.heat i.l1 { background: color-mix(in srgb, var(--accent-2) 60%, var(--bar-bg)); }
.heat i.l2 { background: color-mix(in srgb, var(--accent-2) 75%, var(--bar-bg)); }
.heat i.l3 { background: var(--accent-2); }

.r-list { display: flex; flex-direction: column; gap: 8px; }
.r-item { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; box-shadow: var(--shadow); }
.r-item summary {
  display: flex; align-items: baseline; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none;
}
.r-item summary::-webkit-details-marker { display: none; }
.r-item summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; border-radius: 8px; }
.r-title { flex: 1; font-weight: 600; line-height: 1.4; }
.r-date { font: 12px var(--sans); color: var(--muted); white-space: nowrap; }
.r-plus { position: relative; width: 11px; height: 11px; flex: none; align-self: center; }
.r-plus::before, .r-plus::after {
  content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 1.5px; background: var(--accent-2);
  transition: transform .2s;
}
.r-plus::after { transform: rotate(90deg); }
.r-item[open] .r-plus::after { transform: rotate(0); }
.r-body { margin: 0 14px; padding: 12px 0 4px; border-top: 1px solid var(--rule); font-size: 16px; }
.r-body p, .r-body ul, .r-body ol, .r-body blockquote, .r-body pre { margin: 0 0 12px; }
.r-body ul, .r-body ol { padding-left: 22px; }
.r-body blockquote { border-left: 3px solid var(--rule); padding-left: 12px; color: var(--ink-2); }
.r-body code { font-size: .88em; background: var(--hl); padding: 1px 4px; border-radius: 3px; }
.r-body pre { background: var(--hl); padding: 10px 12px; border-radius: 6px; overflow-x: auto; }
.r-body pre code { background: none; padding: 0; }
.r-body a { color: var(--accent-2); }
.r-body img { max-width: 100%; border-radius: 6px; }
.r-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font: 13px var(--sans); color: var(--ink-2); }
.r-meta a { color: var(--accent-2); }
.r-anchor { margin-left: auto; color: var(--muted) !important; }
.r-empty { text-align: center; color: var(--muted); font-style: italic; padding: 20px 0; }

@media (max-width: 640px) {
  .r-top { grid-template-columns: 1fr; }
  .r-item summary { flex-wrap: wrap; row-gap: 2px; }
  .r-date { order: 3; width: 100%; }
}

/* ─────────────── responsive ─────────────── */
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .topbar { padding: 12px 16px; }
  .topbar nav { gap: 14px; font-size: 14px; }
  main { padding: 20px 16px 32px; }
  footer { padding: 20px 16px 32px; }
  .currently { max-width: none; }
  .step { padding-left: 40px; }
  .demo { padding: 26px 12px 14px; margin-left: -40px; }
  .bars, .lt-chart { gap: 3px; }
  .bar .name { font-size: 9px; }
  .controls { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .kv-label { width: 62px; font-size: 10.5px; }
  .kv-axis { margin-left: 74px; }
  .chat-img { width: 44px; height: 44px; }
  .gain { gap: 6px; }
}
@media (max-width: 440px) {
  .brand { font-size: 14px; white-space: nowrap; }
  .topbar nav { gap: 12px; }
  .nav-papers { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
