/* EgoJEPA project page
   Warm-paper editorial look (after the pi05 blog post), laid out as a visual showcase:
   every block sits on one shared column, so the title, links, video and figures line up.
   Chart colors follow the paper's figures: purple = EgoJEPA, orange = retargeting. */

:root {
  color-scheme: light;
  --bg: #f5f4ef;
  --bg-card: #eeece4;
  --bg-raised: #fbfaf7;
  --ink: #111110;
  --ink-2: #4a4945;
  --muted: #6b6a65;
  --faint: #898781;
  --rule: #d8d4c7;
  --hair: #e8e5db;
  --card-border: #e0d9c3;
  --hl-border: #e2b21f;
  --accent: #6a4f94;
  --font-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --col: 1040px;
  --radius: 10px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
::selection { background: rgba(251, 212, 91, .55); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 13px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.page { padding: 16px; }
@media (min-width: 768px) { .page { padding: 40px 48px; } }

/* the one shared column */
.col { max-width: var(--col); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 12px 24px; margin-bottom: 56px;
}
@media (min-width: 768px) { .site-header { margin-bottom: 80px; } }
.brand {
  font-family: var(--font-serif); font-size: 30px; line-height: 1; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.brand.small { font-size: 20px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--font-mono); font-size: 14px; }
.site-nav a {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 8px; text-decoration-color: rgba(17, 17, 16, .45);
}
.site-nav a:hover { text-decoration-thickness: 2px; text-decoration-color: var(--ink); }

/* ---------- title + links ---------- */
h1 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(34px, 5.4vw, 58px); line-height: 1.07; letter-spacing: -0.018em;
  margin: 0 0 28px; max-width: 920px; text-wrap: balance;
}
.links { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 40px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 16px 9px 13px;
  font-family: var(--font-mono); font-size: 14px; line-height: 1; color: var(--ink); text-decoration: none;
  background: var(--bg-raised); border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: #fff; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- hero ---------- */
.hero { margin-top: 0; margin-bottom: 40px; }
.hero-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #1a1a19;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
}
.hero-video { width: 100%; height: 100%; object-fit: cover; }
.hero-ui {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 12px;
  padding: 40px 16px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, .38), rgba(0, 0, 0, 0));
}
.hero-chip {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  font-family: var(--font-mono); font-size: 12px; line-height: 1;
  background: rgba(245, 244, 239, .92); color: var(--ink);
  padding: 7px 11px; border-radius: 999px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hero-dot { width: 7px; height: 7px; border-radius: 50%; background: #d43c2f; }
.hero:not(.is-playing) .hero-dot { background: var(--faint); }
.hero-segs { flex: 1; display: flex; gap: 4px; min-width: 60px; }
.hero-seg {
  position: relative; flex-basis: 0; height: 4px; padding: 0; border: 0; border-radius: 2px; cursor: pointer;
  background: rgba(255, 255, 255, .38);
}
.hero-seg::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; bottom: -10px; }
.hero-seg .fill {
  position: absolute; inset: 0; border-radius: 2px; background: #fff;
  transform-origin: left center; transform: scaleX(0);
}
.hero-seg:hover { background: rgba(255, 255, 255, .6); }
.hero-toggle {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(245, 244, 239, .92); color: var(--ink);
}
.hero-toggle svg { width: 15px; height: 15px; fill: currentColor; }
.hero-toggle .i-play { display: none; }
.hero:not(.is-playing) .hero-toggle .i-play { display: block; }
.hero:not(.is-playing) .hero-toggle .i-pause { display: none; }
.hero-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 96px; height: 96px; border-radius: 50%; border: 0; cursor: pointer;
  display: none; place-items: center; color: var(--ink);
  background: rgba(245, 244, 239, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background-color .2s ease;
}
.hero-play:hover { background: rgba(245, 244, 239, .95); }
.hero-play svg { width: 40px; height: 40px; fill: currentColor; margin-left: 5px; }
.hero.needs-play:not(.is-playing) .hero-play { display: grid; }
@media (max-width: 600px) {
  .hero-frame { border-radius: 10px; }
  .hero-ui { padding: 28px 10px 10px; gap: 8px; flex-wrap: wrap; }
  .hero-segs { order: -1; flex-basis: 100%; }
  .hero-chip { font-size: 11px; padding: 6px 9px; min-width: 0; flex: 0 1 auto; }
  .hero-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero-toggle { margin-left: auto; width: 30px; height: 30px; }
  .hero-play { width: 72px; height: 72px; }
  .hero-play svg { width: 30px; height: 30px; }
}

/* ---------- short summary ---------- */
.tldr p {
  max-width: 820px; margin: 0 0 40px; font-size: 21px; line-height: 1.55; color: var(--ink);
}
.tldr strong { font-weight: 600; }
@media (max-width: 600px) { .tldr p { font-size: 18px; } }
.muted { color: var(--muted); }

/* ---------- KPI row ---------- */
.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
}
.kpi { padding: 18px 18px 20px; }
.kpi:first-child { padding-left: 0; }
.kpi + .kpi { border-left: 1px solid var(--rule); }
.kpi-label { font-size: 14px; color: var(--ink-2); }
.kpi-value { font-size: 44px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin: 8px 0 6px; }
.kpi-note { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-left: 0; padding-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .kpi-value { font-size: 36px; }
}

/* ---------- section heads ---------- */
.section {
  position: relative; font-family: var(--font-serif); font-weight: 400; font-size: clamp(28px, 3.4vw, 36px);
  line-height: 1.15; letter-spacing: -0.01em; margin: 96px 0 8px; scroll-margin-top: 24px;
}
.sec-head + .viz, .sec-head + .paper-fig { margin-top: 24px; }
.sec-sub { font-size: 17px; line-height: 1.5; color: var(--ink-2); margin: 0 0 24px; max-width: 720px; }
.anchor {
  position: absolute; left: -26px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 18px; color: var(--faint);
  text-decoration: none; opacity: 0; transition: opacity .15s;
}
.section:hover .anchor, .anchor:focus-visible { opacity: 1; }
@media (max-width: 1120px) { .anchor { display: none; } }

.caption {
  font-family: var(--font-mono); font-style: italic; font-size: 12px; line-height: 1.65;
  color: var(--ink-2); margin: 12px 0 0;
}

/* ---------- video carousel ---------- */
.rollouts {
  width: 100vw; position: relative; left: 50%; margin-left: -50vw;
}
.track {
  --pad: max(16px, calc((100vw - var(--col)) / 2));
  display: flex; gap: 16px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad);
  padding: 6px var(--pad) 14px; scrollbar-width: none;
}
@media (min-width: 768px) { .track { --pad: max(48px, calc((100vw - var(--col)) / 2)); } }
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { outline-offset: -2px; }
.card { flex: 0 0 auto; width: min(380px, 80vw); scroll-snap-align: start; }
.card-media {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #1a1a19;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 10px -4px rgba(0, 0, 0, .12);
}
.card-media video { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.card h3 { font-size: 17px; font-weight: 600; margin: 12px 0 2px; }
.card .robot { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.card-sr { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--ink-2); margin: 4px 0 0; }
.card-sr b { color: var(--ink); font-weight: 600; }
.speed, .expand {
  position: absolute; border: 0; cursor: pointer; color: var(--ink);
  background: rgba(245, 244, 239, .92); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .15s ease;
}
.speed {
  top: 8px; right: 8px; padding: 4px 8px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
}
.expand { bottom: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.expand svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.card-media:hover .speed, .card-media:hover .expand, .speed:focus-visible, .expand:focus-visible,
.speed.is-fast, .card-media.needs-play .expand { opacity: 1; }
@media (hover: none) { .speed, .expand { opacity: 1; } }
.rollouts-foot {
  max-width: var(--col); margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 16px;
}
@media (min-width: 768px) { .rollouts-foot { padding: 0 48px; } }
@media (min-width: 1136px) { .rollouts-foot { padding: 0; } }
.rollouts-foot .caption { margin: 0; }
.car-nav { display: flex; gap: 10px; }
.car-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--ink); color: #fff;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.car-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.car-btn:hover:not(:disabled) { background: #fff; color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.car-btn:active:not(:disabled) { transform: translateY(1px); }
.car-btn:disabled { opacity: .25; cursor: default; }

/* ---------- paper figures ---------- */
.paper-fig { margin-top: 24px; margin-bottom: 0; }
.zoomable {
  display: block; width: 100%; padding: 0; margin: 0; cursor: zoom-in;
  background: #fff; border: 1px solid #e3dfd2; border-radius: 12px; overflow: hidden;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.zoomable:hover { border-color: #cfc9b6; box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.zoomable img { width: 100%; height: auto; }
#fig-method .zoomable { padding: clamp(10px, 2.2vw, 28px); }
.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
@media (max-width: 760px) { .grid4 { grid-template-columns: 1fr; } }

/* ---------- three stages ---------- */
.stage-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
@media (max-width: 860px) { .stage-cards { grid-template-columns: 1fr; } }
.stage-card { background: var(--bg-card); border: 1px solid var(--card-border); padding: 16px 16px 18px; }
.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stage-num, .stage-tag {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600;
}
.stage-tag { background: #fff; border: 1px solid var(--card-border); padding: 2px 6px; font-weight: 500; }
.stage-tag.tag-hl { border-color: var(--hl-border); background: #fff6d6; }
.stage-card h3 { font-family: var(--font-serif); font-weight: 400; font-size: 23px; line-height: 1.15; margin: 8px 0 6px; letter-spacing: -0.005em; }
.stage-card p { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: 0; }

/* ---------- data stats ---------- */
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
}
.stat { padding: 14px 14px 16px; }
.stat:first-child { padding-left: 0; }
.stat + .stat { border-left: 1px solid var(--rule); }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.stat-label { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
@media (max-width: 640px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .stat-value { font-size: 22px; }
}

/* ---------- charts ---------- */
.viz {
  margin-top: 20px; margin-bottom: 0; padding: 20px 20px 16px;
  background: var(--bg-raised); border: 1px solid #e3dfd2; border-radius: 12px;
}
.viz + .viz { margin-top: 20px; }
@media (max-width: 600px) { .viz { padding: 16px 12px 12px; border-radius: 10px; } }
.viz-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; }
.viz-title { font-size: 19px; font-weight: 600; margin: 0; line-height: 1.3; }
.viz-sub { font-size: 14px; color: var(--ink-2); margin: 2px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.lg { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.lg-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.lg-dot.filled { background: var(--ink-2); }
.lg-dot.ring { border: 2px solid var(--ink-2); background: var(--bg-raised); }
.lg-line { width: 16px; height: 2px; border-radius: 1px; background: var(--c); display: inline-block; }
.lg-sq { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.viz-controls { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 6px; }
.seg-btn {
  font-family: var(--font-mono); font-size: 12px; line-height: 1; padding: 7px 11px; cursor: pointer;
  border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink);
  transition: background-color .15s, color .15s;
}
.seg-btn:hover { background: var(--bg-card); }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.viz-plot { position: relative; margin-top: 10px; min-height: 120px; }
.viz-plot svg { overflow: visible; }
.viz-plot:focus-visible { outline-offset: 4px; border-radius: 6px; }
.viz-foot { display: flex; justify-content: flex-start; margin-top: 4px; }
.table-toggle {
  font-family: var(--font-mono); font-size: 12px; background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px;
}
.table-toggle:hover { color: var(--ink); text-decoration-thickness: 2px; }
.viz-table { margin-top: 10px; }
.viz .caption { margin-top: 8px; }
.multiples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 22px; }
@media (max-width: 820px) { .multiples { grid-template-columns: 1fr; } }
.cost-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 8px 28px; align-items: start; }
@media (max-width: 860px) { .cost-grid { grid-template-columns: 1fr; } }

.viz-plot text { font-family: var(--font-sans); }
.ax-label { font-size: 12px; fill: var(--faint); font-variant-numeric: tabular-nums; }
.ax-label.sub { font-size: 11px; }
.ax-title { font-size: 12px; fill: var(--ink-2); }
.panel-title { font-size: 13.5px; font-weight: 600; fill: var(--ink); }
.grid-line { stroke: var(--hair); stroke-width: 1; shape-rendering: crispEdges; }
.base-line { stroke: #c3c2b7; stroke-width: 1; shape-rendering: crispEdges; }
.row-label { font-size: 14px; fill: var(--ink); }
.row-label.strong { font-weight: 700; }
.group-label { font-family: var(--font-mono) !important; font-size: 10px; letter-spacing: .08em; fill: var(--muted); text-transform: uppercase; }
.val-label { font-size: 12.5px; font-weight: 600; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.end-label { font-size: 12.5px; fill: var(--ink-2); }
.end-label .v { font-weight: 600; fill: var(--ink); }
.note-label { font-size: 11.5px; fill: var(--faint); font-style: italic; }
.seg-label { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.row-band { fill: transparent; }
.row-band.is-hover { fill: rgba(17, 17, 16, .04); }
.hit { fill: transparent; cursor: default; }
.crosshair { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }

.viz-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 150px; max-width: 280px;
  background: #fff; border: 1px solid rgba(11, 11, 11, .1); border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .12); font-size: 13px; line-height: 1.35;
}
.tip-title { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.tip-desc { font-size: 12.5px; color: var(--ink-2); margin: 6px 0 0; }
.tip-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.tip-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.tip-key.dot { width: 9px; height: 9px; border-radius: 50%; }
.tip-key.ring { width: 9px; height: 9px; border-radius: 50%; background: transparent !important; border: 2px solid var(--kc); }
.tip-key.sq { width: 10px; height: 10px; border-radius: 2px; }
.tip-val { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.tip-lab { color: var(--ink-2); }

/* ---------- tables (data-table views) ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.4; }
.table th, .table td { padding: 7px 12px 7px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.table thead th {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); border-bottom: 1px solid var(--ink); white-space: nowrap;
}
.table tbody th { font-weight: 600; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.row-hl th, .table tr.row-hl td { background: rgba(106, 79, 148, .09); }
.table td:last-child, .table th:last-child { padding-right: 0; }
.table-note { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin: -6px 0 0; }

/* ---------- BibTeX ---------- */
.bibtex { position: relative; margin-top: 20px; }
.bibtex pre {
  margin: 0; padding: 18px 20px; overflow-x: auto; background: var(--bg-raised);
  border: 1px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-mono); font-size: 13px; line-height: 1.6; color: var(--ink);
}
.copy-btn {
  position: absolute; top: 10px; right: 10px; font-family: var(--font-mono); font-size: 11.5px;
  padding: 5px 10px; border: 1px solid var(--ink); background: var(--bg); cursor: pointer;
}
.copy-btn:hover { background: var(--ink); color: #fff; }

/* ---------- footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px;
  border-top: 1px solid var(--ink); margin-top: 96px; padding: 22px 0 8px;
}
.foot-top { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); text-underline-offset: 6px; }

/* ---------- lightbox ---------- */
.lightbox {
  width: min(1200px, 94vw); max-height: 92vh; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: #111110; color: #f5f4ef; box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
}
.lightbox::backdrop { background: rgba(17, 17, 16, .72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 16px; }
.lb-caption { margin: 0; font-family: var(--font-mono); font-size: 12.5px; }
.lb-close {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(245, 244, 239, .12); color: #f5f4ef;
}
.lb-close:hover { background: rgba(245, 244, 239, .25); }
.lb-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lightbox video { width: 100%; max-height: calc(92vh - 56px); background: #000; }
.lightbox video[hidden], .lightbox img[hidden] { display: none; }
.lb-img { width: 100%; max-height: calc(92vh - 56px); object-fit: contain; background: #fff; }
@media (max-width: 760px) {
  /* On phones, show figures larger than the screen and let the reader pan sideways. */
  .lightbox.is-image { overflow: auto; }
  .lightbox.is-image .lb-head { position: sticky; left: 0; top: 0; width: min(100%, 94vw); }
  .lightbox.is-image .lb-img { width: 230%; max-width: none; max-height: none; }
}

@media print {
  .hero-ui, .car-nav, .speed, .expand, .table-toggle, .copy-btn, .links { display: none !important; }
  .viz-table[hidden] { display: block !important; }
}
