/* ==========================================================================
   AFI project page
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #fbfbf9;
  --bg-alt: #f3f2ee;
  --surface: #ffffff;
  --ink: #121212;
  --ink-2: #4a4945;
  --muted: #85837d;
  --line: #e3e1da;
  --afi: #2a78d6;
  --afi-strong: #1c5cab;
  --afi-wash: rgba(42, 120, 214, 0.08);
  --base: #b4b2ab;
  --grid: #ebe9e3;
  --axis: #c3c2b7;
  --good: #006300;
  --trap: #d03b3b;
  --saf: linear-gradient(90deg, #1f9d74 0%, #58b4d1 32%, #efbf4a 66%, #e2554c 100%);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f0f0e;
    --bg-alt: #161615;
    --surface: #1b1b1a;
    --ink: #f4f3ef;
    --ink-2: #c3c2b7;
    --muted: #8f8d86;
    --line: #2e2e2b;
    --afi: #3987e5;
    --afi-strong: #86b6ef;
    --afi-wash: rgba(57, 135, 229, 0.12);
    --base: #6b6a65;
    --grid: #2a2a28;
    --axis: #3a3a37;
    --good: #0ca30c;
    --trap: #e66767;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--afi); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
strong { font-weight: 650; }
sup { font-size: 0.68em; }
code, .mono { font-family: var(--mono); font-size: 0.88em; }

.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 760px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { font-weight: 750; letter-spacing: -0.01em; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 18px; height: 18px; border-radius: 5px; background: var(--saf); }
.nav-links { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--ink-2); font-size: 14px; font-weight: 500; padding: 6px 10px; border-radius: 8px; white-space: nowrap;
}
.nav-links a:hover { background: var(--bg-alt); text-decoration: none; }
.nav-links a.active { color: var(--ink); background: var(--bg-alt); }
@media (max-width: 720px) { .nav-links a.opt { display: none; } }

/* ---------- hero ---------- */
.hero { padding-block: 64px 32px; text-align: center; }
.venue {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-2); border: 1px solid var(--line); background: var(--surface);
  padding: 5px 12px; border-radius: 999px;
}
.venue-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--afi); }
.title {
  font-size: clamp(2.3rem, 5.6vw, 4rem); line-height: 1.05; letter-spacing: -0.035em;
  font-weight: 780; margin: 22px auto 10px; max-width: 900px;
}
.title .grad { background: var(--saf); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle {
  font-size: clamp(1.1rem, 2.4vw, 1.5rem); line-height: 1.35; font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink-2); margin: 0 auto 28px; max-width: 760px;
}
.authors { font-size: 17px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 0 auto; max-width: 820px; }
.authors a { color: var(--ink); border-bottom: 1px solid var(--line); }
.authors a:hover { text-decoration: none; border-bottom-color: var(--afi); }
.affils { font-size: 14.5px; color: var(--muted); margin: 10px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 999px; font-size: 15px; font-weight: 600; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--ink-2); transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 86%, var(--afi)); }

.tldr {
  max-width: 820px; margin: 40px auto 0; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.tldr::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--saf); }
.tldr-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.tldr p { margin: 0; font-size: 17.5px; color: var(--ink); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 980px; margin: 28px auto 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; text-align: left; }
.stat-value { font-size: 2.3rem; line-height: 1.05; font-weight: 720; letter-spacing: -0.03em; color: var(--ink); }
.stat-value .unit { font-size: 0.55em; font-weight: 650; margin-left: 2px; color: var(--ink-2); }
.stat-label { font-size: 14px; line-height: 1.45; color: var(--ink-2); margin-top: 6px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- sections ---------- */
.section { padding-block: 72px; }
.section-alt { background: var(--bg-alt); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--afi); margin: 0 0 10px; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); line-height: 1.15; letter-spacing: -0.028em; font-weight: 740; margin: 0 0 16px; }
h3 { font-size: 1.28rem; line-height: 1.3; letter-spacing: -0.015em; font-weight: 680; margin: 0 0 8px; }
.lead { font-size: 1.12rem; color: var(--ink-2); margin: 0 0 8px; max-width: 800px; }
.sub-head { margin-top: 56px; }
p { margin: 0 0 14px; }

/* ---------- figures ---------- */
.fig { margin: 28px 0 0; }
.fig-frame {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.fig img { width: 100%; border-radius: 6px; }
.fig img.zoomable { cursor: zoom-in; }
.fig figcaption { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); margin-top: 12px; max-width: 880px; }
.fig figcaption strong { color: var(--ink); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; margin-top: 40px; }
.two-col.flip > :first-child { order: 2; }
.two-col .fig { margin: 0; }
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; gap: 20px; }
  .two-col.flip > :first-child { order: 0; }
}

/* ---------- cards ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
@media (max-width: 860px) { .cards-3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card p { font-size: 15.5px; color: var(--ink-2); margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }
.step-num {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--afi-wash); color: var(--afi); font-weight: 700; font-size: 14px; margin-bottom: 12px;
}
.eq { font-family: var(--mono); font-size: 13.5px; background: var(--bg-alt); border-radius: 8px; padding: 8px 10px; color: var(--ink); overflow-x: auto; white-space: nowrap; }
.pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg-alt); color: var(--ink-2); border: 1px solid var(--line); }

/* ---------- agent + policy ---------- */
.split { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 10px; margin-top: 32px; }
.split-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.split-box .k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.split-box .v { font-size: 1.08rem; font-weight: 680; margin: 4px 0 6px; letter-spacing: -0.01em; }
.split-box p { font-size: 14.5px; color: var(--ink-2); margin: 0; }
.split-box.policy { border-color: color-mix(in srgb, var(--afi) 45%, var(--line)); background: color-mix(in srgb, var(--afi-wash) 60%, var(--surface)); }
.split-arrow { display: grid; place-items: center; color: var(--muted); }
.split-arrow svg { width: 22px; height: 22px; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split-arrow svg { transform: rotate(90deg); }
}

.timeline { position: relative; margin-top: 40px; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 26px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--axis);
}
.tl-item.ours::before { background: var(--afi); border-color: var(--afi); box-shadow: 0 0 0 4px var(--afi-wash); }
.tl-date { font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tl-item.ours .tl-date { color: var(--afi); }
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-top: 6px; }
.tl-item.ours .tl-card { border-color: color-mix(in srgb, var(--afi) 45%, var(--line)); }
.tl-card h3 { font-size: 1.08rem; margin-bottom: 4px; }
.tl-card .meta { font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.tl-card p { font-size: 15.5px; color: var(--ink-2); margin: 0 0 8px; }
.tl-card p:last-child { margin-bottom: 0; }
blockquote.quote {
  margin: 8px 0; padding: 8px 14px; border-left: 3px solid var(--axis); color: var(--ink); font-size: 15.5px; font-style: italic; background: var(--bg-alt); border-radius: 0 8px 8px 0;
}
.then-now { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; }
@media (max-width: 860px) { .then-now { grid-template-columns: 1fr; } }
.then-now .card { position: relative; overflow: hidden; }
.then-now h3 { margin: 4px 0 8px; }
.tn-k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tn-now { border-color: color-mix(in srgb, var(--afi) 45%, var(--line)); }
.tn-now::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--saf); }
.step-num + .pill { margin-left: 8px; vertical-align: top; margin-top: 3px; }

.callout {
  margin-top: 36px; border-radius: var(--radius); padding: 22px 24px; background: var(--surface);
  border: 1px solid var(--line); position: relative; overflow: hidden;
}
.callout::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--saf); }
.callout h3 { margin-bottom: 6px; }
.callout p { color: var(--ink-2); margin: 0; }

/* ---------- interactive demo ---------- */
.demo { margin-top: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.demo-stage { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.demo-canvas { background: var(--bg-alt); padding: 14px; border-right: 1px solid var(--line); }
.demo-svg { width: 100%; height: auto; display: block; }
.demo-panel { padding: 24px 24px 20px; display: flex; flex-direction: column; min-height: 100%; }
.demo-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.demo-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; margin: 4px 0 8px; line-height: 1.25; }
.demo-desc { font-size: 15.5px; color: var(--ink-2); margin: 0 0 14px; min-height: 6.2em; }
.demo-chips { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.chip {
  display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; transition: all .25s ease; background: var(--surface);
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--axis); flex: none; transition: all .25s ease; }
.chip.on { color: var(--ink); border-color: color-mix(in srgb, var(--trap) 55%, var(--line)); }
.chip.on .dot { background: var(--trap); border-color: var(--trap); }
.chip.good.on { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
.chip.good.on .dot { background: var(--good); border-color: var(--good); }
.demo-controls { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.demo-play {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--ink); color: var(--bg);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.demo-play svg { width: 16px; height: 16px; }
.demo-steps { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.demo-step {
  flex: 1 1 110px; position: relative; overflow: hidden; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 10px;
  padding: 7px 10px 9px; font: 600 13px/1.25 var(--font);
}
.demo-step .n { color: var(--muted); margin-right: 4px; }
.demo-step:hover { border-color: var(--axis); }
.demo-step[aria-current="step"] { color: var(--ink); border-color: var(--ink-2); }
.demo-step .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--afi); }
@media (max-width: 860px) {
  .demo-stage { grid-template-columns: 1fr; }
  .demo-canvas { border-right: 0; border-bottom: 1px solid var(--line); }
  .demo-desc { min-height: 0; }
}

/* ---------- charts ---------- */
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 16px; margin-top: 24px; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 20px; margin-bottom: 8px; }
.chart-title { font-size: 1.08rem; font-weight: 680; letter-spacing: -0.01em; margin: 0; }
.chart-sub { font-size: 14px; color: var(--muted); margin: 2px 0 0; }
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.charts-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.charts-3 .chart-card { margin-top: 0; }
@media (max-width: 960px) { .charts-3 { grid-template-columns: 1fr; } }

.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--ink-2); }
.viz-legend-item { display: inline-block; white-space: nowrap; }
.swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--base); display: inline-block; vertical-align: -1px; margin-right: 7px; }
.swatch.afi { background: var(--afi); }
.swatch.dot { border-radius: 50%; }
.viz-controls { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.seg-btn {
  font: 600 13px/1 var(--font); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 12px; cursor: pointer;
}
.seg-btn:hover { border-color: var(--axis); }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.viz-note { font-size: 14px; color: var(--ink-2); margin: 8px 0 0; }

.chart .grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .axis-label { fill: var(--muted); font-size: 12px; }
.chart .row-label { fill: var(--ink); font-size: 13.5px; }
.chart .group-label { fill: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.chart .row-label, .chart .group-label { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.chart .val-label { fill: var(--ink); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .val-muted { fill: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chart .delta-label { fill: var(--good); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chart .bar-base, .chart .dot-base { fill: var(--base); }
.chart .bar-afi, .chart .dot-afi { fill: var(--afi); }
.chart .dot-base, .chart .dot-afi { stroke: var(--surface); stroke-width: 2; }
.chart .dumb-line { stroke: var(--axis); stroke-width: 2; stroke-linecap: round; }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit:focus-visible { stroke: var(--afi); stroke-width: 2; }
.chart .hover-band { fill: var(--ink); opacity: 0; transition: opacity .12s ease; pointer-events: none; }
.chart .hover-band.on { opacity: 0.04; }

.viz-tooltip {
  position: fixed; z-index: 90; pointer-events: none; min-width: 160px; max-width: 280px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14); padding: 10px 12px; font-size: 13px; line-height: 1.4;
  opacity: 0; transform: translateY(4px); transition: opacity .12s ease, transform .12s ease;
}
.viz-tooltip.on { opacity: 1; transform: none; }
.tt-title { font-weight: 650; margin-bottom: 6px; color: var(--ink); }
.tt-row { display: flex; align-items: center; gap: 8px; }
.tt-key { width: 12px; height: 3px; border-radius: 2px; background: var(--base); flex: none; }
.tt-key.afi { background: var(--afi); }
.tt-val { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; }
.tt-name { color: var(--ink-2); }
.tt-foot { color: var(--good); font-weight: 650; margin-top: 4px; }

/* ---------- tables ---------- */
details.tableview { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
details.tableview summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.tableview summary::-webkit-details-marker { display: none; }
details.tableview summary::before { content: "▸"; transition: transform .15s ease; display: inline-block; }
details.tableview[open] summary::before { transform: rotate(90deg); }
.table-wrap { overflow-x: auto; margin-top: 12px; }
table.results { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 640px; }
table.results th, table.results td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.results th { font-size: 12.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
table.results td:first-child, table.results th:first-child, table.results td.l { text-align: left; }
table.results tr.hl td { background: var(--afi-wash); font-weight: 650; }
table.results tr.sep td { border-top: 1px solid var(--axis); }
table.results .up { color: var(--good); font-weight: 650; font-size: 12.5px; margin-left: 4px; }

/* ---------- robustness tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tile-label { font-size: 13.5px; color: var(--ink-2); }
.tile-value { font-size: 1.9rem; font-weight: 720; letter-spacing: -0.02em; line-height: 1.15; margin-top: 4px; }
.tile-note { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- limitations ---------- */
.limit-list { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.limit-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 15.5px; color: var(--ink-2); }
.limit-list li strong { color: var(--ink); }

/* ---------- bibtex ---------- */
.bib { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 20px; overflow: hidden; }
.bib-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.copy-btn { font: 600 13px/1 var(--font); color: var(--ink); background: var(--bg-alt); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.copy-btn:hover { border-color: var(--axis); }
.bib pre { margin: 0; padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; color: var(--ink); }

/* ---------- footer ---------- */
.footer { padding-block: 36px 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 24px;
  background: rgba(10, 10, 10, 0.86); cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: min(1600px, 100%); max-height: 100%; width: auto; border-radius: 8px; background: #fff; }

/* ---------- 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; } }
.no-js .reveal { opacity: 1; transform: none; }
