/* Styles for /blog pages. The colour variables, fonts, header and footer copy the home page's
   <style> block, so keep them in step when that changes. */
@font-face{font-family:'Instrument Sans';font-style:normal;font-weight:400 700;font-display:swap;src:url(fonts/instrument-sans-latin.woff2) format('woff2')}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/ibm-plex-mono-400-latin.woff2) format('woff2')}

/* Site colours, with chart colours added. The chart palette is checked for colour-blind
   separation and contrast on both surfaces; change it only after re-checking. */
:root{
  --bg:#FFFFFF; --ink:#1B1D29; --body:#3A3E51; --muted:#5E6275;
  --line:#E3E1E8; --rule:#1B1D29;
  --accent:#4E3596; --accent-hover:#2F1F66; --select:#D9D1F2;
  --btn-bg:#1B1D29; --btn-hover:#3A3E52; --btn-ink:#FFFFFF;
  --panel:#F7F6FA;
  --viz-violet:#6A4CE2; --viz-aqua:#00B894; --viz-orange:#F47230; --viz-gray:#9C99AE;
  --viz-pos:#EC4647; --viz-neg:#257DE0;
  --viz-grid:#ECEAF0; --viz-axis:#C9C6D3;
  color-scheme:light;
}
@media (prefers-color-scheme: dark){:root:not([data-theme]){
  --bg:#14151D; --ink:#EDEBF5; --body:#C8C5D6; --muted:#9C99AE;
  --line:#2D3042; --rule:#9C99AE;
  --accent:#B9A9EE; --accent-hover:#D6CCF7; --select:#4E3596;
  --btn-bg:#EDEBF5; --btn-hover:#FFFFFF; --btn-ink:#14151D;
  --panel:#1B1D27;
  --viz-violet:#9887EF; --viz-aqua:#00A888; --viz-orange:#E76624; --viz-gray:#6E6B80;
  --viz-pos:#EB6263; --viz-neg:#338CED;
  --viz-grid:#232533; --viz-axis:#3A3D50;
  color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#14151D; --ink:#EDEBF5; --body:#C8C5D6; --muted:#9C99AE;
  --line:#2D3042; --rule:#9C99AE;
  --accent:#B9A9EE; --accent-hover:#D6CCF7; --select:#4E3596;
  --btn-bg:#EDEBF5; --btn-hover:#FFFFFF; --btn-ink:#14151D;
  --panel:#1B1D27;
  --viz-violet:#9887EF; --viz-aqua:#00A888; --viz-orange:#E76624; --viz-gray:#6E6B80;
  --viz-pos:#EB6263; --viz-neg:#338CED;
  --viz-grid:#232533; --viz-axis:#3A3D50;
  color-scheme:dark;
}

html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);font-family:'Instrument Sans',system-ui,sans-serif;font-size:17px;line-height:1.55;-webkit-font-smoothing:antialiased}
h1,h2,h3,p,ul,ol,figure{margin:0}
a{color:var(--accent)}a:hover{color:var(--accent-hover)}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:2px}
::selection{background:var(--select)}
[hidden]{display:none !important}
@media (prefers-reduced-motion: reduce){html{scroll-behavior:auto}}

.skip{position:absolute;left:16px;top:-60px;z-index:20;background:var(--btn-bg);color:var(--btn-ink);padding:10px 16px;border-radius:4px;font-weight:600;text-decoration:none}
.skip:focus{top:12px;color:var(--btn-ink)}
.wrap{max-width:1120px;margin:0 auto;padding-inline:32px}
.mono{font-family:'IBM Plex Mono',monospace;font-size:14px;font-weight:400;color:var(--muted)}
.muted{color:var(--muted)}

/* Header (as on the home page) */
.btn{display:inline-flex;align-items:center;box-sizing:border-box;min-height:48px;padding:0 22px;border-radius:4px;border:1px solid var(--btn-bg);background:var(--btn-bg);color:var(--btn-ink);font-weight:600;text-decoration:none}
.btn:hover{background:var(--btn-hover);border-color:var(--btn-hover);color:var(--btn-ink)}
.btn-line,.btn-line:hover{min-height:44px;padding:0 18px;background:transparent;border-color:var(--ink);color:var(--ink)}
.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:4px;background:transparent;color:var(--ink);cursor:pointer}
.icon-btn:hover{border-color:var(--ink)}
:root[data-theme="dark"] .moon,:root:not([data-theme="dark"]) .sun{display:none}
.top{position:sticky;top:0;z-index:10;background:var(--bg)}
.top-in{display:flex;flex-wrap:wrap;align-items:center;gap:12px 32px;padding-block:16px;border-bottom:1px solid var(--rule)}
.logo{font-size:26px;font-weight:700;letter-spacing:-.04em;line-height:1;color:var(--accent);text-decoration:none}
.nav{margin-left:auto;display:flex;align-items:center;gap:24px;font-size:15px}
.nav a{color:var(--ink);text-decoration:none;padding-block:10px}
.nav a:hover,.nav a[aria-current]{color:var(--accent)}
.top-actions{display:flex;gap:8px}

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

/* Blog index */
.blog-head{padding-block:72px 40px}
.blog-head h1{font-size:clamp(34px,4.4vw,48px);line-height:1.08;letter-spacing:-.03em;font-weight:600}
.blog-head p{margin-top:16px;max-width:620px;font-size:19px;color:var(--body)}
.posts{padding:0;list-style:none;border-top:1px solid var(--line);margin-bottom:64px}
.posts li{display:flex;flex-wrap:wrap;gap:8px 40px;padding-block:28px;border-bottom:1px solid var(--line)}
.posts .mono{flex:1 1 160px;padding-top:4px}
.posts div{flex:999 1 480px;min-width:0}
.posts h2{font-size:24px;line-height:1.25;letter-spacing:-.015em;font-weight:600}
.posts h2 a{color:var(--ink);text-decoration:none}
.posts h2 a:hover{color:var(--accent)}
.posts p{margin-top:8px;color:var(--body);max-width:640px}

/* Article: text in a 680px measure; figures may run to the full 1056px */
.post{padding-block:64px 32px}
.post-head{max-width:760px}
.post-head h1{font-size:clamp(34px,4.6vw,52px);line-height:1.06;letter-spacing:-.03em;font-weight:600}
.post-head .dek{margin-top:20px;font-size:20px;line-height:1.5;color:var(--body)}
.byline{display:flex;flex-wrap:wrap;gap:4px 16px;margin-top:24px}
.prose{max-width:680px}
.prose > * + *{margin-top:20px}
.prose h2[id]{scroll-margin-top:84px}
.prose h2{margin-top:56px;font-size:28px;line-height:1.2;letter-spacing:-.02em;font-weight:600}
.prose h3{margin-top:36px;font-size:20px;line-height:1.3;font-weight:600}
.prose p,.prose li{color:var(--body)}
.prose strong{color:var(--ink);font-weight:600}
.prose ul,.prose ol{padding-left:22px}
.prose li + li{margin-top:8px}
.prose code{font-family:'IBM Plex Mono',monospace;font-size:.88em}
.prose pre{margin:12px 0 18px;padding:12px 14px;border:1px solid var(--line);border-radius:6px;overflow-x:auto;font-size:13px;line-height:1.5}
.prose pre code{font-size:inherit;white-space:pre}
.key{margin-top:40px;padding:24px 28px;background:var(--panel);border:1px solid var(--line);border-radius:4px}
.key h2{margin:0;font-size:14px;font-family:'IBM Plex Mono',monospace;font-weight:400;color:var(--muted);letter-spacing:0}
.key ul{margin-top:12px}
.key .code-link{margin-top:14px;padding-top:12px;border-top:1px solid var(--line);font-size:15px}
.prose .table{overflow-x:auto}
.prose table{width:100%;border-collapse:collapse;font-size:15px}
.prose th,.prose td{padding:10px 16px 10px 0;text-align:left;vertical-align:top}
.prose thead th{font-family:'IBM Plex Mono',monospace;font-size:13px;font-weight:400;color:var(--muted);white-space:nowrap}
.prose tbody tr{border-top:1px solid var(--line)}
.prose tbody th{font-weight:500;color:var(--ink)}
.prose td.num,.prose th.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.prose td:last-child,.prose th:last-child{padding-right:0}
.why .table + .table{margin-top:28px}
.prose .why thead th{white-space:normal}
.why tbody th .muted{font-weight:400;font-size:14px;color:var(--muted)}
@media (max-width:640px){.why th,.why td{padding-right:8px;font-size:14px}.why thead th{font-size:12px}}
.why caption{caption-side:top;text-align:left;padding-bottom:8px;font-size:15px;color:var(--body)}
.why figcaption{margin-top:12px;max-width:680px;font-size:14px;color:var(--muted)}
details.method{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding-block:4px}
details.method summary{cursor:pointer;padding-block:12px;font-weight:600;color:var(--ink)}
details.method > * + *{margin-top:16px}
details.method > :last-child{margin-bottom:16px}
.cta{margin-top:56px;padding-top:32px;border-top:1px solid var(--rule)}
.cta p{color:var(--body)}
.cta .actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px;margin-top:20px}
.refs{margin-top:48px}
.refs h2{margin-top:0;font-size:20px}
.refs ol{margin-top:12px;font-size:15px}
.refs li + li{margin-top:6px}
.aside{margin-top:48px;padding-top:24px;border-top:1px solid var(--line)}
.aside h2{margin-top:0;font-size:20px}
.aside ul{margin-top:12px}
.disclosure{margin-top:40px;font-size:15px;color:var(--muted)}
.prose .disclosure strong{color:var(--body)}

/* Animated diagram: light and dark GIFs, one shown to match the theme. Both images are lazy, so the
   hidden one is not downloaded. */
.pipeline{margin-block:40px}
.prose > .pipeline{width:min(1056px, 100vw - 64px)}
.pipeline picture,.pipeline img{display:block;width:100%;height:auto}
.pipeline figcaption{margin-top:12px;max-width:680px;font-size:15px;color:var(--muted)}
.pipeline .theme-dark{display:none}
@media (prefers-color-scheme: dark){
  :root:not([data-theme]) .pipeline .theme-light{display:none}
  :root:not([data-theme]) .pipeline .theme-dark{display:block}
}
:root[data-theme="dark"] .pipeline .theme-light{display:none}
:root[data-theme="dark"] .pipeline .theme-dark{display:block}

/* Charts (assets/charts.js). Each figure holds its data as a table, which stays the
   no-JavaScript and screen-reader view. */
.viz{margin-block:40px;max-width:1056px}
/* Figures break out of the 680px text column to the page width. */
.prose > .viz{width:min(1056px, 100vw - 64px)}
.prose .viz-legend{padding:0}
.prose .viz-legend li{margin:0}
.viz figcaption{max-width:680px}
.viz figcaption strong{display:block;font-size:18px;line-height:1.35;font-weight:600;color:var(--ink)}
.viz figcaption span{display:block;margin-top:6px;font-size:15px;color:var(--muted)}
.viz-legend{display:flex;flex-wrap:wrap;gap:4px 8px;margin-top:16px;padding:0;list-style:none}
.viz-legend button{display:inline-flex;align-items:center;gap:8px;min-height:32px;padding:0 10px;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--body);font:inherit;font-size:14px;cursor:default}
.viz-legend button:hover,.viz-legend button:focus-visible{border-color:var(--line);color:var(--ink)}
.viz-key{display:inline-block;flex:none;width:16px;height:2px;border-radius:1px}
.viz-key.dot{width:9px;height:9px;border-radius:50%}
.viz-key.ref{height:0;border-top:1px solid var(--muted);border-radius:0}
.viz-plot{position:relative;margin-top:8px;height:340px;touch-action:pan-y;outline-offset:4px}
.viz-plot canvas{position:absolute;inset:0;width:100%;height:100%}
.viz-labels{position:absolute;inset:0;pointer-events:none;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.viz-labels span{position:absolute;white-space:nowrap;line-height:1}
.viz-labels .end{font-size:13px;color:var(--body)}
.viz-labels .end b{font-weight:600;color:var(--ink)}
.viz-labels .axis-title{font-family:'IBM Plex Mono',monospace;font-size:12px}
.viz-tip{position:absolute;z-index:2;min-width:180px;max-width:280px;padding:10px 12px;background:var(--bg);border:1px solid var(--line);border-radius:4px;box-shadow:0 4px 12px rgba(20,21,29,.12);font-size:13px;pointer-events:none}
.viz-tip .h{margin-bottom:6px;font-family:'IBM Plex Mono',monospace;font-size:12px;color:var(--muted)}
.viz-tip .r{display:flex;align-items:center;gap:8px;padding-block:2px}
.viz-tip .r b{min-width:44px;font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}
.viz-tip .r span{color:var(--body)}
.viz-tip .r.dim{opacity:.45}
.viz-data{margin-top:12px}
.viz-data summary{cursor:pointer;font-size:14px;color:var(--muted);padding-block:6px}
.viz-data summary:hover{color:var(--ink)}
.viz-data .table{margin-top:8px}
.viz.no-webgl .viz-plot,.viz.no-webgl .viz-legend{display:none}
/* Example images from the image datasets. */
.examples{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:20px 24px;margin-block:28px}
.examples img{display:block;width:100%;max-width:160px;height:auto;border-radius:4px;image-rendering:pixelated}
.examples img[src$=".jpg"]{image-rendering:auto}
.examples figcaption{margin-top:8px;font-size:14px;color:var(--muted)}
/* Two point clouds side by side on wide screens, stacked on a phone. */
.viz-pair{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:24px 32px;margin-block:40px}
.prose > .viz-pair{width:min(1056px, 100vw - 64px)}
.viz-pair .viz{margin:0}
.viz-pair .viz-plot{height:360px}
/* Bar chart rows: question text on the left, bar on the right; stacked on a phone. */
.viz-bars .viz-plot{height:auto}

/* Phone */
@media (max-width: 700px){
  .wrap{padding-inline:20px}
  .top-in{justify-content:space-between;padding-block:8px}
  .nav{order:3;flex-basis:100%;margin:0;justify-content:space-between;gap:12px}
  .post{padding-block:40px 24px}
  .blog-head{padding-block:48px 32px}
  .viz-plot{height:300px}
  .prose > .viz,.prose > .pipeline,.prose > .viz-pair{width:auto}
  .prose h2{margin-top:44px;font-size:24px}
}
