/* HyDra project page */

@font-face {
  /* TencentSans W7, subset to "H", "a", "y" (same subset the paper embeds) */
  font-family: "TXHy";
  src: url("../fonts/txhy.ttf") format("truetype");
  font-display: swap;
  unicode-range: U+0048, U+0061, U+0079;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-band: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --fig-bg: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #4a4a47;
  --muted: #7c7b76;
  --line: #e4e4e0;
  --line-2: #d4d4ce;
  --hy-blue: #0052d9;   /* Hunyuan blue, sampled from the Tencent Hy logo */
  --brand: #0052d9;
  --brand-ink: #0043b3;
  --brand-soft: #edf3fd;
  --orange: #d9622b;
  --orange-soft: #fdf0e8;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Linux Libertine O", "Linux Libertine", "Libertinus Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* explorer chart tokens (validated: blue/green pair passes CVD + contrast) */
  --surface-chart: #fcfcfb;
  --series-hydra: #2a78d6;
  --series-mcore: #008300;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1115;
    --bg-band: #14171c;
    --surface: #181b21;
    --surface-2: #1f232a;
    --fig-bg: #ffffff;
    --ink: #f2f2ef;
    --ink-2: #c3c2b7;
    --muted: #8f8e88;
    --line: #2a2e35;
    --line-2: #383d45;
    --brand: #6f9dff;
    --brand-ink: #8fb2ff;
    --brand-soft: #1a2440;
    --orange: #f08a57;
    --orange-soft: #33221a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);

    --surface-chart: #181b21;
    --series-hydra: #3987e5;
    --series-mcore: #0ca30c;
    --grid: #2c2f35;
    --axis: #42464e;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
b, strong { font-weight: 650; }
sup { font-size: .7em; line-height: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.wrap.section { padding: 72px 24px; }
.band { background: var(--bg-band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); }
.muted-inline { color: var(--muted); font-weight: 500; font-size: .8em; }
.fine { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 10px 0 0; }

/* ---------- logo ---------- */
.hy { font-family: "TXHy", var(--sans); font-weight: 800; color: var(--hy-blue); font-style: normal; letter-spacing: -.01em; }
.dra { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--ink); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 28px; }
.nav-logo { display: inline-flex; align-items: center; font-size: 22px; line-height: 1; text-decoration: none !important; }
.nav-mark { width: 24px; height: 24px; margin-right: 8px; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--ink-2); font-size: 15px; font-weight: 500; text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); border-bottom-color: var(--brand); }
.nav-cta { font-size: 14px; font-weight: 600; color: #fff !important; background: var(--brand); padding: 7px 14px; border-radius: 999px; text-decoration: none !important; }
@media (prefers-color-scheme: dark) { .nav-cta { color: #0b1220 !important; } }
@media (max-width: 640px) { .nav-links { display: none; } .nav-cta { margin-left: auto; } }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 40px; text-align: center; }
.hero-glow {
  position: absolute; inset: -40% -10% auto; height: 620px; pointer-events: none;
  background:
    radial-gradient(40% 50% at 30% 40%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    radial-gradient(35% 45% at 72% 35%, color-mix(in srgb, var(--orange) 12%, transparent), transparent 70%);
  filter: blur(10px);
}
.hero-inner { position: relative; }
.eyebrow { margin: 0 0 18px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.title { margin: 0; font-weight: 400; }
.logo { display: block; font-size: clamp(64px, 11vw, 120px); line-height: 1; letter-spacing: -.01em; }
.subtitle { display: block; max-width: 820px; margin: 18px auto 0; font-size: clamp(22px, 3.1vw, 34px); line-height: 1.25; font-weight: 650; letter-spacing: -.015em; color: var(--ink); }
.authors, .affils { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; }
.authors { margin: 30px auto 6px; gap: 6px 22px; font-size: 18px; font-weight: 500; max-width: 860px; }
.affils { margin: 0 auto; gap: 4px 22px; font-size: 15.5px; color: var(--ink-2); }
.authors sup, .affils sup { color: var(--brand); margin-left: 1px; }
.affils sup { margin-right: 3px; }
.org-logo { display: inline-block; margin-top: 22px; opacity: .92; transition: opacity .15s; }
.org-logo:hover { opacity: 1; }
.org-logo img { height: 34px; width: auto; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); text-decoration: none !important;
  transition: transform .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--brand); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { border-color: var(--ink); }

/* ---------- figures ---------- */
.fig { margin: 0; }
.fig img {
  width: 100%; background: var(--fig-bg); border-radius: 10px; padding: 12px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.fig figcaption, .caption { margin-top: 10px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.caption { margin: 8px 0 0; }
.fig-wide { margin: 24px 0; }
.fig-narrow { max-width: 720px; }
.fig-sm img { max-width: 380px; margin: 0 auto; }
.zoomable img { cursor: zoom-in; }
.fig-row { display: grid; gap: 18px; align-items: start; }
.fig-row.r-2 { grid-template-columns: 0.8fr 1.2fr; align-items: center; }
.fig-row.r-2b { grid-template-columns: 0.8fr 1.2fr; align-items: center; }
.fig-row.r-3 { grid-template-columns: repeat(3, 1fr); align-items: end; }
.fig-row.r-pies { grid-template-columns: 1fr; max-width: 520px; justify-self: center; width: 100%; }
.fig-row.r-step { grid-template-columns: 1.2fr 1.3fr 2.27fr; align-items: end; }
@media (max-width: 760px) {
  .fig-row.r-2, .fig-row.r-2b, .fig-row.r-pies { grid-template-columns: 1fr; }
  .fig-row.r-3 { grid-template-columns: repeat(2, 1fr); }
  .fig-row.r-step { grid-template-columns: 1fr 1fr; }
  .fig-row.r-step > :last-child { grid-column: 1 / -1; }
}

/* ---------- teaser ---------- */
.teaser { padding-top: 8px; padding-bottom: 8px; }
.teaser .fig figcaption { text-align: center; max-width: 900px; margin-left: auto; margin-right: auto; }
.tldr {
  position: relative; margin: 36px auto 0; max-width: 920px; padding: 22px 26px 22px 26px;
  background: var(--brand-soft); border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
}
.tldr p { margin: 0; font-size: 17.5px; }
.tldr-tag { display: inline-block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--brand-ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 28px 0 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow); }
.stat-label { font-size: 13.5px; line-height: 1.35; color: var(--ink-2); min-height: 2.7em; }
.stat-value { margin-top: 6px; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; }
.stat-note { margin-top: 4px; font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- headings & prose ---------- */
.h2 { display: flex; align-items: baseline; gap: 14px; margin: 0 0 28px; font-size: clamp(28px, 3.6vw, 38px); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.h2-num { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--brand); letter-spacing: 0; transform: translateY(-4px); }
.h3 { margin: 0 0 12px; font-size: 22px; line-height: 1.3; letter-spacing: -.01em; font-weight: 680; }
h4 { margin: 0 0 8px; font-size: 17.5px; font-weight: 680; }
.prose p { margin: 0 0 14px; }
.lead { font-size: 18px; color: var(--ink-2); max-width: 920px; margin: -8px 0 32px; }
.abstract { max-width: 880px; }
.abstract p { margin: 0 0 16px; color: var(--ink-2); text-align: justify; hyphens: auto; }
@media (max-width: 600px) { .abstract p { text-align: left; } }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
.split-even { margin-top: 32px; }
/* grid children must be allowed to shrink below their min-content (wide math, <pre>, SVG) */
.split > *, .two-col > *, .eq-grid > *, .design-grid > *, .paper-row > *, .viz-row > *,
.fig-row > *, .insights .panel > *, .stats > *, .kpis > *, .tablist > * { min-width: 0; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- tabs ---------- */
.insights { margin-top: 40px; }
.tablist { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tab {
  font: inherit; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 15px; font-weight: 600; line-height: 1.3; transition: border-color .15s, background .15s, color .15s;
}
.tab:hover { border-color: var(--line-2); color: var(--ink); }
.tab[aria-selected="true"] { border-color: var(--brand); color: var(--ink); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.tab:focus-visible, .seg button:focus-visible, .viz:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tab-num { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); }
.tab[aria-selected="true"] .tab-num { background: var(--brand); color: #fff; }
@media (max-width: 860px) { .tablist { grid-template-columns: repeat(2, 1fr); } }

.panel { margin-top: 18px; }
.insights .panel {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 32px; align-items: center;
  padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.insights .panel[hidden] { display: none; }
.insights .panel > .fig img { box-shadow: none; }
.insights .panel-text h3 { margin: 0 0 10px; font-size: 21px; line-height: 1.3; }
.insights .panel-text p { margin: 0 0 12px; color: var(--ink-2); font-size: 16px; }
.insights .fig-row { grid-template-columns: 1fr; }
.insights .fig-row .fig img { box-shadow: none; }
.insight { padding: 12px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; color: var(--ink) !important; }
.ticks { margin: 0 0 12px; padding-left: 18px; color: var(--ink-2); font-size: 16px; }
.ticks li { margin-bottom: 8px; }
@media (max-width: 860px) { .insights .panel { grid-template-columns: 1fr; padding: 20px; } }

/* ---------- design ---------- */
.design-grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .design-grid { grid-template-columns: 1fr; } }
.principles { margin: 0 0 20px; padding-left: 22px; color: var(--ink-2); }
.principles li { margin-bottom: 8px; }
.principles b { color: var(--ink); }
.component { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; color: var(--ink-2); }
.component b { color: var(--ink); }
.chip { flex: none; font-family: var(--mono); font-size: 12.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; margin-top: 2px; }
.chip-orange { background: var(--orange-soft); color: var(--orange); }
.chip-blue { background: var(--brand-soft); color: var(--brand-ink); }

.subsection { margin-top: 64px; }
.eq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 960px) { .eq-grid { grid-template-columns: 1fr; } }
.eq-card, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.eq-card p, .card p { margin: 0 0 10px; color: var(--ink-2); font-size: 15.5px; }
.eq-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-ink); }
.eq { overflow-x: auto; overflow-y: hidden; margin: 4px 0 8px; font-size: 15px; }
.eq .katex-display { margin: .5em 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.subsection .two-col + .fig-wide { margin-top: 28px; }
.complexity { display: flex; align-items: center; gap: 14px; margin-top: 8px; font-size: 18px; }
.complexity .old { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.complexity .arrow { color: var(--muted); }
.complexity .new { color: var(--brand-ink); font-weight: 700; }

/* ---------- explorer ---------- */
.explorer { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.explorer-head { display: flex; gap: 24px; justify-content: space-between; align-items: flex-start; }
.explorer-head p { margin: 0; max-width: 680px; font-size: 15.5px; }
@media (max-width: 860px) { .explorer-head { flex-direction: column; gap: 12px; } }
.control { flex: none; display: flex; flex-direction: column; gap: 6px; }
.control-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); }
.seg button {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border: 0; background: transparent; color: var(--ink-2);
  padding: 6px 14px; border-radius: 8px; transition: background .15s, color .15s; font-variant-numeric: tabular-nums;
}
.seg button:hover { color: var(--ink); }
.seg button.on, .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg .tab { display: inline-block; border: 0; box-shadow: none; }
.seg .tab[aria-selected="true"] { box-shadow: 0 1px 2px rgba(0,0,0,.12); background: var(--surface); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 20px 0 10px; font-size: 14px; color: var(--ink-2); }
.key { display: inline-flex; align-items: center; gap: 8px; }
.k-line { display: inline-block; width: 18px; height: 2px; border-radius: 2px; }
.k-mcore { background: var(--series-mcore); }
.k-hydra { background: var(--series-hydra); }
.k-area { display: inline-block; width: 14px; height: 10px; border-radius: 2px; background: color-mix(in srgb, var(--series-hydra) 14%, transparent); }
.viz-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .viz-row { grid-template-columns: 1fr; } }
.viz-card { background: var(--surface-chart); border: 1px solid var(--line); border-radius: 12px; padding: 14px 12px 6px; }
.viz-title { font-size: 14px; font-weight: 600; color: var(--ink); padding: 0 6px 4px; }
.viz { position: relative; width: 100%; height: 260px; border-radius: 6px; touch-action: pan-y; }
.viz svg { display: block; width: 100%; height: 100%; overflow: visible; }
.viz text { font-family: var(--sans); fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.viz .axis-title { fill: var(--ink-2); font-size: 12px; }
.viz .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.viz .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .ln-mcore { stroke: var(--series-mcore); }
.viz .ln-hydra { stroke: var(--series-hydra); }
.viz .diff { fill: color-mix(in srgb, var(--series-hydra) 12%, transparent); stroke: none; }
.viz .ref { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 4; }
.viz .ref-label { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.viz .end-label { fill: var(--ink); font-size: 12px; font-weight: 650; }
.viz .cross { stroke: var(--ink-2); stroke-width: 1; opacity: .55; shape-rendering: crispEdges; }
.viz .dot { stroke: var(--surface-chart); stroke-width: 2; }
.viz .dot-mcore { fill: var(--series-mcore); }
.viz .dot-hydra { fill: var(--series-hydra); }
.readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.readout .ro { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.readout .ro-v { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.readout .ro-l { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
@media (max-width: 700px) { .readout { grid-template-columns: 1fr; } }
.viz-tooltip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 180px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); font-size: 13px;
}
.viz-tooltip .tt-head { font-weight: 650; color: var(--ink); margin-bottom: 4px; }
.viz-tooltip .tt-row { display: flex; align-items: center; gap: 8px; color: var(--ink-2); white-space: nowrap; }
.viz-tooltip .tt-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.viz-tooltip .tt-row span:last-child { margin-left: auto; padding-left: 6px; }
.viz-tooltip .tt-key { width: 12px; height: 2px; border-radius: 2px; flex: none; }
.table-view { margin-top: 14px; font-size: 14px; }
.table-view summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
.table-scroll { overflow-x: auto; margin-top: 10px; }
.table-view table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-view th { color: var(--ink-2); font-weight: 600; }

/* ---------- results ---------- */
.result-block { margin-top: 56px; }
.result-block:first-of-type { margin-top: 0; }
.result-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.result-head .h3 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.kpi-v { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
.kpi-l { display: block; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.pp-stack { margin-top: 22px; padding: 16px 18px; background: var(--fig-bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pp-legend { width: 100%; max-width: min(560px, 100%); margin: 0 auto 6px; }
.pp { position: relative; margin: 0; padding-left: 92px; }
.pp img { width: 100%; cursor: zoom-in; }
.pp-tag { position: absolute; left: 0; top: 36%; transform: translateY(-50%); width: 84px; font-size: 13px; font-weight: 700; color: #4a4a47; }
.pp-tag-hydra { color: #0052d9; }
.pp-stack .caption { color: #4a4a47; }
@media (max-width: 640px) { .pp { padding-left: 0; padding-top: 18px; } .pp-tag { top: 0; transform: none; } }
.scale-grid { margin-top: 28px; }
.scale-legend { width: 100%; max-width: min(640px, 100%); margin: 0 auto 14px; background: var(--fig-bg); border-radius: 8px; padding: 6px 10px; }
.card .fig { margin-top: 14px; }
.card .fig img { box-shadow: none; }

/* ---------- paper & bibtex ---------- */
.paper-row { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 36px; align-items: center; }
@media (max-width: 860px) { .paper-row { grid-template-columns: 1fr; } }
.paper-thumb { position: relative; display: block; height: 340px; }
.paper-thumb img {
  position: absolute; top: 0; width: 220px; border-radius: 4px; border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(16, 24, 40, .14); transition: transform .3s; background: #fff;
}
.paper-thumb img:nth-child(1) { left: 0; z-index: 3; }
.paper-thumb img:nth-child(2) { left: 70px; top: 12px; z-index: 2; transform: rotate(3deg); }
.paper-thumb img:nth-child(3) { left: 140px; top: 24px; z-index: 1; transform: rotate(6deg); }
.paper-thumb:hover img:nth-child(1) { transform: translateY(-6px); }
.paper-thumb:hover img:nth-child(2) { transform: translateX(14px) rotate(5deg); }
.paper-thumb:hover img:nth-child(3) { transform: translateX(28px) rotate(9deg); }
@media (max-width: 520px) {
  .paper-thumb { height: 280px; }
  .paper-thumb img { width: 170px; }
  .paper-thumb img:nth-child(2) { left: 50px; }
  .paper-thumb img:nth-child(3) { left: 100px; }
}
.bib { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.bib-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.copy { font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; cursor: pointer; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); }
.copy:hover { border-color: var(--brand); }
.bib pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; color: var(--ink); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.footer p { margin: 0; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 4vh 3vw; background: rgba(10, 12, 16, .82); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 92vh; width: auto; background: #fff; border-radius: 10px; padding: 14px; }
.lb-close { position: absolute; top: 14px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
