:root {
  color-scheme: light;
  --paper: #f8f8f2;
  --ink: #19251f;
  --muted: #505d53;
  --rule: #ced3c8;
  --dark: #16241e;
  --gold: #ffcf55;
  --mono: "IBM Plex Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 74px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 Inter, "Segoe UI", Arial, sans-serif; }
a { color: inherit; text-underline-offset: 4px; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #c9870e; outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: min(1240px, 90%); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -100px; background: white; padding: 8px; z-index: 10; }
.skip:focus { top: 5px; }
.header { position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 1px solid var(--rule); }
nav, .navlinks, .actions, .demo-header, footer .wrap { display: flex; align-items: center; }
nav, footer .wrap, .demo-header { justify-content: space-between; }
nav { min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 850; font-size: 21px; letter-spacing: -.055em; text-decoration: none; }
.brand i { width: 19px; height: 19px; background: repeating-linear-gradient(118deg, var(--ink) 0 3px, transparent 3px 6px); transform: skewX(-12deg); }
.navlinks { gap: clamp(14px, 3vw, 38px); font-size: 14px; font-weight: 580; }
.navlinks a { text-decoration: none; }
.navlinks a:hover, .textlink:hover, footer a:hover { text-decoration: underline; }
.hero { display: grid; grid-template-columns: 1.02fr 1fr; align-items: stretch; gap: clamp(28px, 5vw, 76px); padding-block: clamp(36px, 5vw, 76px); }
.intro { padding-block: 6px; align-self: center; }
.kicker, .micro, figcaption { font-family: var(--mono); font-size: 12px; }
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; color: var(--muted); margin: 0 0 17px; }
.kicker b { font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.kicker b::before { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--gold); border: 1px solid #b08828; margin-right: 8px; }
.kicker span { border-left: 1px solid #b7c0b4; padding-left: 13px; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: clamp(48px,5.65vw,89px); letter-spacing: -.074em; line-height: .99; font-weight: 680; }
h1 span { color: #b2800d; }
.subtitle { font-size: clamp(17px,1.42vw,23px); line-height: 1.34; color: var(--muted); margin-top: 17px; max-width: 41ch; }
.authors { font-size: 14px; margin-top: 18px; }
.authors a { font-weight: 650; }
.actions { flex-wrap: wrap; gap: 10px 22px; margin-top: 24px; }
.primary { display: inline-flex; gap: 9px; align-items: center; text-decoration: none; background: var(--ink); color: white; border-radius: 4px; padding: 11px 18px; font-size: 14px; font-weight: 650; }
.primary span { color: var(--gold); font-size: 11px; }
.primary:hover { background: #304538; }
.textlink { text-decoration: none; font-weight: 650; font-size: 14px; }
.hero-shot { min-height: 330px; display: block; color: white; background: #262722; overflow: hidden; position: relative; border-radius: 5px; }
.hero-shot img { display: block; position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 47% center; transition: transform .3s; }
.hero-shot:hover img { transform: scale(1.025); }
.shot-caption { position: absolute; inset: auto 0 0; display: flex; align-items: end; justify-content: space-between; background: linear-gradient(transparent, #111912ed); padding: 55px 25px 19px; }
.shot-caption small { color: #ffe09a; font: 12px var(--mono); }
.shot-caption strong { display: block; font-size: 23px; letter-spacing: -.04em; }
.play { width: 43px; height: 43px; display: grid; place-items: center; padding-left: 2px; border: 1px solid #ffffff9e; border-radius: 50%; }
h2 { font-size: clamp(34px, 3.8vw, 55px); font-weight: 620; letter-spacing: -.055em; line-height: 1.05; }
h3 { font-size: clamp(23px, 2.2vw, 33px); font-weight: 610; letter-spacing: -.045em; line-height: 1.14; }
.demos { background: var(--dark); color: #f9faf4; padding: 44px 0 48px; }
.demo-header { gap: 18px; margin-bottom: 24px; }
.switches { border: 1px solid #657067; border-radius: 5px; display: inline-flex; padding: 3px; }
.switches button { border: 0; padding: 8px 14px; font-size: 14px; color: #e4e8df; background: transparent; border-radius: 2px; }
.switches button[aria-pressed=true] { background: #e9eddd; color: var(--ink); font-weight: 650; }
.reel { display: grid; grid-template-columns: minmax(0,2.05fr) minmax(240px,1fr); gap: clamp(20px,3.8vw,56px); align-items: start; }
.reel + .reel { margin-top: 28px; }
.switches:not([hidden]) ~ * { scroll-margin-top: 1rem; }
.demos:has(.switches:not([hidden])) .reel { margin-top: 0; }
.screen { background: black; border: 1px solid #3a483f; border-radius: 4px; overflow: hidden; }
video { display: block; width: 100%; aspect-ratio: 16/9; }
.micro { letter-spacing: .045em; text-transform: uppercase; }
.micro span { margin-inline: 5px; opacity: .6; }
.reel-info .micro { color: #ffda7e; }
.reel-info h3, .result h3 { margin-block: 7px 10px; }
.reel-info > p:not(.micro) { color: #c8d1c8; font-size: 15px; }
.chapters { margin: 17px 0 11px; border-top: 1px solid #415248; }
.chapters button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 7px 5px; background: none; border: 0; border-bottom: 1px solid #415248; color: #e3e9dd; text-align: left; font-size: 14px; }
.chapters button[aria-current=true], .chapters button:hover { color: var(--gold); }
.chapters time { font: 12px var(--mono); }
.video-file { color: #c8d1c8; display: inline-block; padding: 4px 0; font-size: 12px; }
.method { display: grid; align-items: center; grid-template-columns: .8fr 1.2fr; gap: clamp(30px,5.5vw,84px); padding-block: 72px; border-bottom: 1px solid var(--rule); }
.method-intro > p:last-child, .section-intro > p:last-child { color: var(--muted); margin-top: 16px; max-width: 69ch; }
.plot { display: block; background: white; border: 1px solid var(--rule); padding: 14px; border-radius: 4px; cursor: zoom-in; }
.plot:hover { border-color: #778978; }
.plot img { width: 100%; height: auto; display: block; }
figcaption { margin-top: 9px; color: var(--muted); }
figcaption span { font-family: Inter, "Segoe UI", sans-serif; margin-left: 8px; }
.beyond { padding-block: 66px 75px; }
.section-intro { margin-bottom: 28px; }
.mdps { border-top: 1px solid var(--rule); padding-block: clamp(32px, 4vw, 64px); }
.trace-intro { margin: 14px 0 20px; color: var(--muted); max-width: 70ch; }
.mdp-tabs, .trace-fields { display: flex; flex-wrap: wrap; gap: 5px; }
.mdp-tabs button { min-height: 44px; padding: 8px 17px; border: 1px solid #89978d; border-radius: 5px; background: transparent; color: var(--ink); font-weight: 600; }
.mdp-tabs button:hover, .trace-fields button:hover { background: #eef0e8; }
.mdp-tabs button[aria-selected="true"] { background: var(--dark); border-color: var(--dark); color: white; }
.trace-fields { margin: 12px 0 0; padding: 6px 0; border-block: 1px solid var(--rule); }
.trace-fields button { min-height: 44px; padding: 5px 10px; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; font-size: .9375rem; }
.trace-fields button[aria-pressed="true"] { color: var(--ink); border-bottom-color: #a77b11; font-weight: 700; }
.mdp-panel { max-width: 100%; min-width: 0; padding-top: 20px; }
.trace-heading, .trace-label, .appendix-head { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; align-items: baseline; }
.trace-heading { max-width: 960px; margin-bottom: 12px; align-items: center; }
.mdp-panel .rollout-link, .source-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: .9375rem; }
.trace-part { max-width: 960px; min-width: 0; padding: clamp(14px, 2vw, 25px); background: #fffefa; border: 1px solid var(--rule); border-radius: 6px; overflow-wrap: anywhere; }
.trace-label { align-items: center; border-bottom: 1px solid var(--rule); padding-bottom: 10px; margin-bottom: 12px; }
.trace-label h4 { margin: 0; font-size: 1.2rem; }
.trace-label span { color: var(--muted); font: .78rem/1.4 var(--mono); }
.trace-part p { margin-block: .4em .7em; }
.trace-part .math-hint { color: var(--muted); font-size: .85rem; }
.trace-part > ul { padding: 0; list-style: none; margin: 0; }
.trace-part > ul > li + li { margin-top: 11px; }
.trace-part ul ul { padding-left: 1.25rem; list-style: disc; }
.trace-part li li { margin-top: 5px; }
.trace-part code { font-family: var(--mono); font-size: .91em; }
.trace-math { max-width: 100%; overflow-x: auto; }
.trace-math.inline { display: inline-block; vertical-align: middle; }
.trace-math.block { display: block; background: #f0f3ea; border-left: 3px solid #ac831c; padding: .7em .85em; margin-block: .55em; }
.trace-math.block math { margin: 0; width: max-content; }
.alternate-input, .study-detail { margin-top: 16px; }
.alternate-input summary, .study-detail summary { cursor: pointer; padding: 10px 0; min-height: 44px; font-weight: 650; }
.appendix { padding-block: clamp(36px, 5vw, 76px); background: #edf0e7; border-top: 1px solid var(--rule); }
.appendix-head { align-items: end; margin-bottom: 25px; }
.source-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.experiment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 3vw, 42px); }
.experiment, .debug-study { background: var(--paper); border-top: 2px solid #516454; padding: clamp(17px, 2.6vw, 34px); }
.experiment h3, .debug-study h3 { margin: 8px 0 12px; }
.experiment .micro, .debug-study .micro { color: var(--muted); }
.success-bars { border-collapse: collapse; width: 100%; margin-top: 18px; font-size: .94rem; font-variant-numeric: tabular-nums; }
.success-bars caption { text-align: left; font-weight: 600; margin-bottom: 5px; }
.success-bars th, .success-bars td { text-align: left; font-weight: 500; padding: 5px 0; }
.success-bars thead th { color: var(--muted); border-bottom: 1px solid var(--rule); font-size: .85rem; }
.success-bars tbody tr:first-child th { font-weight: 750; }
.success-bars td { white-space: nowrap; }
.bar { display: inline-block; width: 54%; height: .55rem; margin-right: .6rem; background: linear-gradient(to right, #758778 var(--rate), #dde2d8 var(--rate)); vertical-align: middle; }
.success-bars tbody tr:first-child .bar { background: linear-gradient(to right, #334e3c var(--rate), #dde2d8 var(--rate)); }
.audit-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-block: 12px; margin-block: 14px; border-block: 1px solid var(--rule); }
.audit-comparison div { display: grid; }
.audit-comparison strong { font-size: clamp(1.75rem, 3vw, 2.6rem); line-height: 1.2; letter-spacing: -.045em; }
.audit-comparison small, .audit-comparison span { font-size: .875rem; color: var(--muted); }
.study-detail { border-top: 1px solid var(--rule); }
.study-detail ul { padding-left: 1.3rem; }
.study-detail li + li { margin-top: .4rem; }
.debug-study { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 5vw, 68px); align-items: center; margin-top: 22px; }
.debug-study .plot { padding: 8px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.result .micro { color: var(--muted); }
.result > div { padding-top: 16px; }
.result p:not(.micro) { color: var(--muted); }
.main-result { grid-column: 1/-1; display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px,4vw,70px); align-items: center; margin-bottom: 4px; }
footer { padding: 24px 0; border-top: 1px solid var(--rule); font-size: 14px; }
footer .wrap { flex-wrap: wrap; gap: 8px 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.cite { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(24px, 5vw, 76px); align-items: start; padding-block: clamp(40px, 5vw, 72px); }
.cite > div:first-child > p:not(.kicker) { color: var(--muted); margin-top: 14px; }
.cite-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: .9375rem; }
.bibtex { background: var(--dark); color: #e6ebe1; border-radius: 6px; overflow: hidden; min-width: 0; }
.bibtex-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 18px; border-bottom: 1px solid #344339; font: 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #ffda7e; }
.copy-bib { min-height: 36px; padding: 4px 14px; border: 1px solid #657067; border-radius: 4px; background: transparent; color: #f1f4ed; font: 600 13px Inter, "Segoe UI", Arial, sans-serif; letter-spacing: 0; text-transform: none; }
.copy-bib:hover { background: #2a3a30; }
.bibtex pre { margin: 0; padding: 18px; overflow-x: auto; font: 13px/1.6 var(--mono); tab-size: 2; }
.figure-view { padding: 0; width: min(1050px, 96vw); max-width: 100%; max-height: 94vh; max-height: 94dvh; border: 1px solid var(--rule); border-radius: 8px; background: white; color: var(--ink); }
.figure-view::backdrop { background: #101911b8; }
body:has(.figure-view[open]) { overflow: hidden; }
.figure-tools { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 9px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.figure-tools strong { flex: 1; min-width: 0; line-height: 1.2; }
.figure-tools button { min-height: 44px; border-radius: 5px; padding-inline: 10px; border: 1px solid var(--rule); background: white; color: var(--ink); }
.figure-pan { max-height: 74vh; max-height: 74dvh; overflow: auto; overscroll-behavior: contain; }
.figure-pan img { width: 100%; height: auto; display: block; }
.figure-pan.enlarged img { width: max(1040px, 150%); max-width: none; }
video.portrait-cut { aspect-ratio: 640 / 796; object-fit: contain; }
@media (orientation: landscape) and (max-height: 560px) {
  .header { position: static; }
  video { max-height: 88vh; max-height: 88dvh; object-fit: contain; }
}
@media (max-width: 760px) {
  .mdp-tabs button { padding-inline: 12px; }
  .experiment-grid, .debug-study { grid-template-columns: minmax(0, 1fr); }
  .trace-fields { gap: 2px; }
  .trace-fields button { padding-inline: 7px; }
  .wrap { width: min(92%,640px); }
  html { scroll-padding-top: 56px; }
  nav { min-height: 48px; }
  .brand, .navlinks a, .actions a, .video-file, footer a { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
  .navlinks { gap: clamp(8px, 3vw, 20px); }
  .navlinks a { justify-content: center; }
  .hero, .method, .reel, .main-result { grid-template-columns: 1fr; }
  .hero.wrap { width: 100%; padding: 0; color: white; background: linear-gradient(90deg,#0c1711f5 0%,#0c1711df 50%,#0c1711a3), url('media/jumping-ant.jpg') 54% center / cover; }
  .intro { width: min(92%,640px); margin: auto; padding: 20px 0 18px; }
  .hero .kicker { margin-bottom: 10px; color: #eef2e9; }
  .hero .kicker b, h1 span { color: var(--gold); }
  .hero .kicker span { border-color: #a8b3a8; }
  h1 { font-size: clamp(38px, 9.4vw, 56px); letter-spacing: -.055em; }
  h1 br { display: none; }
  .subtitle { margin-top: 8px; font-size: 16px; color: #f1f4ed; }
  .authors { margin-top: 10px; line-height: 1.45; }
  .actions { margin-top: 12px; gap: 18px; }
  .primary { color: var(--ink); background: var(--gold); }
  .primary:hover { background: #ffda7e; }
  .primary span { color: var(--ink); }
  .hero-shot { display: none; }
  .demo-header { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
  .demo-header h2 { font-size: 30px; }
  .switches { display: grid; grid-template-columns: 1fr 1fr; }
  .switches button { min-height: 44px; font-size: 15px; }
  .demos, .method, .beyond { padding-block: 34px; }
  .demos { padding-top: 19px; }
  .demos { container-type: inline-size; }
  .screen { margin-inline: calc((100% - 100cqw) / 2); border-inline: 0; border-radius: 0; }
  video.portrait-cut { max-height: 72svh; }
  .method { gap: 19px; }
  .reel { gap: 17px; }
  .reel-info { display: flex; flex-direction: column; align-items: stretch; }
  .reel-info > p:not(.micro), .video-file { order: 1; }
  .video-file { align-self: start; }
  .chapters { margin: 3px 0 13px; border: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .chapters button { min-height: 46px; padding: 6px 8px; gap: 5px; line-height: 1.25; border: 1px solid #526256; border-radius: 5px; }
  .chapters button[aria-current=true] { background: #2e3e30; border-color: #d2ab51; }
  .result-grid { grid-template-columns: 1fr; gap: 34px; }
  .result, .main-result { display: flex; flex-direction: column; align-items: stretch; }
  .result > div { order: -1; padding: 0 0 12px; }
  .cite { grid-template-columns: 1fr; gap: 18px; padding-block: 34px; }
  .bibtex pre { font-size: 12px; padding: 14px; }
  .plot { padding: 6px; }
  .plot::after { content: "Enlarge ↗"; display: block; text-align: right; padding: 5px 4px 0; color: var(--muted); font: 12px var(--mono); }
  .plot { text-decoration: none; }
  .figure-tools { font-size: 14px; }
}
@media (max-width: 550px) {
  .nav-qualifier { display: none; }
  .navlinks { gap: 5px; font-size: 13px; }
  .navlinks a { min-width: 0; padding-inline: 2px; }
  .brand { gap: 5px; font-size: 18px; }
  .brand i { width: 15px; }
}
@media (max-width: 760px) and (max-height: 660px) and (orientation: portrait) {
  .demo-header h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .intro { padding-block: 14px; }
  .demos { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .hero-shot img { transition: none; } }
