/* Generative Modelling I-B (GANs) — slide system, shared with the VAE lecture.
   Visual tokens follow the ES 667 attention / CLIP lectures. */

:root {
  --paper: #FAFAFB;
  --card: #FFFFFF;
  --ink: #14171F;
  --ink-2: #4A5160;
  --ink-3: #6B7280;
  --line: #D9DDE5;
  --grid: #ECEEF2;

  /* semantic roles — one colour per role, everywhere */
  --x: #245EDB;   --x-t: #E4ECFF;    /* observed data x            */
  --enc: #8B2CDE; --enc-t: #F1E5FC;  /* encoder, q_phi(z|x)        */
  --dec: #0F766E; --dec-t: #D9F2EF;  /* decoder / generator, p_theta */
  --z: #AA4E08;   --z-t: #FCEFD9;    /* latent z and noise epsilon */
  --loss: #BE123C; --loss-t: #FDE2E7;/* loss, KL, gradients        */
  --disc: #334155; --disc-t: #E2E8F0;/* discriminator D (slate, as in the diagrams and plots) */

  --font-ui: "Avenir Next", "Avenir", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;
  --W: 1280px;
  --H: 720px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: #1d2027; font-family: var(--font-ui); color: var(--ink); }
body.reading { background: #E9EBEF; }

/* ------------------------------------------------------------------ stage */
#deck { position: fixed; inset: 0; display: grid; place-items: center; overflow: hidden; }
.slide {
  position: absolute; left: 50%; top: 50%;
  width: var(--W); height: var(--H);
  margin-left: calc(var(--W) / -2); margin-top: calc(var(--H) / -2);
  transform: scale(var(--scale, 1));
  background: var(--paper);
  padding: 44px 64px 40px;
  display: none; flex-direction: column;
  overflow: hidden;
}
.slide.current { display: flex; }

/* ------------------------------------------------------------------ type */
.kicker { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--sec, var(--ink-3)); margin: 0 0 6px; }
.slide h2 { font-size: 40px; line-height: 1.12; font-weight: 650; margin: 0 0 20px; letter-spacing: -.01em; }
.slide h2 .sub { display: block; font-size: 24px; font-weight: 500; color: var(--ink-2); margin-top: 8px; letter-spacing: 0; }
.slide p, .slide li { font-size: 26px; line-height: 1.4; margin: 0 0 12px; }
.slide .small, .slide .small p, .slide p.small { font-size: 21px; }
.slide .tiny { font-size: 17px; color: var(--ink-3); }
.slide .cap { font-size: 18px; color: var(--ink-3); text-align: center; margin-top: 6px; line-height: 1.3; }
.slide .muted { color: var(--ink-3); }
.slide b, .slide strong { font-weight: 650; }
.slide code, .slide .mono { font-family: var(--font-mono); font-size: .86em; }
.slide ul { margin: 0; padding-left: 1.1em; }
.slide ul li { margin-bottom: 10px; }
.body { flex: 1; position: relative; min-height: 0; }

/* the one question / takeaway line at the bottom of a frame */
.q {
  margin-top: auto; padding: 4px 0 0 18px; border-left: 5px solid var(--sec, var(--x));
  font-size: 25px !important; font-weight: 600; line-height: 1.35 !important; margin-bottom: 0 !important;
}
.q.take { border-left-color: var(--ink); }
.slide .src { position: absolute; left: 64px; right: 90px; bottom: 12px; font-size: 13px; line-height: 1.3; color: var(--ink-3); margin: 0; }
.slide:has(.src) { padding-bottom: 46px; }
.src a { color: var(--ink-3); }
.pageno { position: absolute; right: 22px; bottom: 12px; font-size: 13px; color: #B3B8C2; font-variant-numeric: tabular-nums; }

/* section colours */
.sec-hook  { --sec: #245EDB; }
.sec-dist  { --sec: #AA4E08; }
.sec-ae    { --sec: #8B2CDE; }
.sec-kl    { --sec: #BE123C; }
.sec-prob  { --sec: #245EDB; }
.sec-elbo  { --sec: #0F766E; }
.sec-rep   { --sec: #AA4E08; }
.sec-vae   { --sec: #8B2CDE; }
.sec-gan   { --sec: #147737; }
.sec-end   { --sec: #245EDB; }
/* GAN lecture: opener, then one colour per part (the part's role colour) */
.sec-open { --sec: #245EDB; }
.sec-p1 { --sec: #334155; } .sec-p2 { --sec: #0F766E; } .sec-p3 { --sec: #BE123C; }
.sec-p4 { --sec: #245EDB; } .sec-p5 { --sec: #AA4E08; }

/* role colour helpers for text */
.cx { color: var(--x); } .cenc { color: var(--enc); } .cdec { color: var(--dec); }
.cz { color: var(--z); } .closs { color: var(--loss); } .cdisc { color: var(--disc); }

/* ------------------------------------------------------------------ builds */
[data-b], [data-hl], [data-dim] { transition: opacity .28s ease, filter .28s ease, background-color .28s, color .28s, border-color .28s; }
.hidden { opacity: 0 !important; pointer-events: none; }
.gone { display: none !important; }
.dim { opacity: .28; }
.hl { background: #FFF4C2; border-radius: 6px; box-shadow: 0 0 0 4px #FFF4C2; }

/* ------------------------------------------------------------------ layout helpers */
.row { display: flex; gap: 28px; align-items: center; }
.row.top { align-items: flex-start; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { display: flex; justify-content: center; align-items: center; }
.stack { position: relative; }
.stack > * + * { position: absolute; inset: 0; }
.fig { display: block; max-width: 100%; }
.pix { image-rendering: pixelated; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; }
.callout { border-radius: 12px; padding: 14px 18px; font-size: 22px; line-height: 1.35; }
.callout.x { background: var(--x-t); } .callout.enc { background: var(--enc-t); }
.callout.dec { background: var(--dec-t); } .callout.z { background: var(--z-t); }
.callout.loss { background: var(--loss-t); } .callout.disc { background: var(--disc-t); }
.callout.plain { background: #F0F2F5; }

.mathblock { font-size: 30px; text-align: center; margin: 10px 0; }
.mathblock.big { font-size: 36px; }
.mathblock.left { text-align: left; }

/* step-by-step equation ladder */
.ladder { display: grid; grid-template-columns: auto auto 1fr; column-gap: 14px; row-gap: 6px; align-items: center; font-size: 27px; }
.ladder .lhs { text-align: right; }
.ladder .why { font-size: 18px; color: var(--ink-3); padding-left: 18px; line-height: 1.25; }
.ladder .why b { color: var(--ink-2); }

/* Jay-Alammar-style blocks */
.node {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 12px; padding: 10px 16px; font-size: 22px; font-weight: 600; line-height: 1.15;
  border: 2px solid currentColor; background: #fff; min-width: 90px; text-align: center;
}
.node small { font-size: 15px; font-weight: 500; color: var(--ink-3); margin-top: 3px; }
.node.x { color: var(--x); background: var(--x-t); } .node.enc { color: var(--enc); background: var(--enc-t); }
.node.dec { color: var(--dec); background: var(--dec-t); } .node.z { color: var(--z); background: var(--z-t); }
.node.loss { color: var(--loss); background: var(--loss-t); } .node.disc { color: var(--disc); background: var(--disc-t); }
.node.ghost { color: #9AA1AD; background: #F3F4F6; border-style: dashed; }
.arrow { font-size: 30px; color: #9AA1AD; padding: 0 2px; }

/* vectors drawn as cells */
.vec { display: inline-flex; border-radius: 6px; overflow: hidden; border: 1.5px solid currentColor; vertical-align: middle; }
.vec span { display: inline-block; min-width: 64px; padding: 5px 8px; font-family: var(--font-mono); font-size: 19px; text-align: center; color: var(--ink); }
.vec span + span { border-left: 1.5px solid currentColor; }
.vec.z { color: var(--z); } .vec.z span { background: var(--z-t); }
.vec.enc { color: var(--enc); } .vec.enc span { background: var(--enc-t); }
.vec.x { color: var(--x); } .vec.x span { background: var(--x-t); }
.vec.dec { color: var(--dec); } .vec.dec span { background: var(--dec-t); }
.vec.loss { color: var(--loss); } .vec.loss span { background: var(--loss-t); }

/* tables of worked numbers */
table.work { border-collapse: collapse; font-size: 22px; }
table.work th { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; text-align: right; padding: 6px 14px; border-bottom: 1.5px solid var(--line); }
table.work td { padding: 8px 14px; text-align: right; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--grid); }
table.work td:first-child, table.work th:first-child { text-align: left; }
table.work tr.total td { border-top: 2px solid var(--ink); font-weight: 650; border-bottom: none; }

/* bars (probability tables) */
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px; align-items: center; font-size: 21px; }
.bars .bar { height: 22px; border-radius: 4px; background: var(--c, var(--x)); }
.bars .lab { font-family: var(--font-mono); }
.bars .val { font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* code */
pre.code {
  margin: 0; background: #F3F4F7; border-radius: 12px; padding: 16px 20px; font-family: var(--font-mono);
  font-size: 19px; line-height: 1.5; color: #1F2430; border-left: 5px solid var(--sec, var(--ink-3)); white-space: pre;
}
pre.code .k { color: #8B2CDE; } pre.code .c { color: #6B7280; } pre.code .f { color: #245EDB; } pre.code .n { color: #AA4E08; }
pre.code .line { display: inline-block; width: 100%; border-radius: 4px; transition: background .25s, opacity .25s; }
pre.code .line.hl { background: #FFF1B8; box-shadow: none; }

/* digit image tiles */
.tiles { display: grid; gap: 6px; }
.tiles img { width: 100%; image-rendering: pixelated; border-radius: 4px; display: block; }
.tile-lab { font-size: 16px; color: var(--ink-3); text-align: center; }

/* braces under math */
.brace-wrap { display: inline-flex; flex-direction: column; align-items: center; }
.brace-lab { font-size: 18px; font-weight: 600; margin-top: 4px; }

/* interactive controls */
.ctrl { display: flex; align-items: center; gap: 12px; font-size: 20px; color: var(--ink-2); }
.ctrl input[type=range] { width: 260px; accent-color: var(--sec, var(--x)); }
.readout { font-family: var(--font-mono); font-size: 22px; font-variant-numeric: tabular-nums; }
.print .ctrl input { display: none; }
.print .ctrl[data-widget="kl"] { display: none; }

/* section opener */
.slide.opener { justify-content: center; padding-left: 96px; }
.slide.opener h2 { font-size: 56px; margin-bottom: 18px; }
.slide.opener p { font-size: 28px; color: var(--ink-2); max-width: 900px; }
.slide.opener .kicker { font-size: 16px; }

/* ------------------------------------------------------------------ notes, overview, reading */
aside.notes { display: none; }
#notes-panel {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 34vh; overflow: auto; z-index: 20;
  background: #111318ee; color: #E8EAEE; font-size: 18px; line-height: 1.45; padding: 14px 24px 18px; display: none;
}
#notes-panel.open { display: block; }
#notes-panel h4 { margin: 0 0 6px; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: #9AA3B2; }
#notes-panel p { margin: 0 0 8px; }
#overview { position: fixed; inset: 0; background: #F4F5F7; z-index: 30; overflow: auto; padding: 28px 40px; display: none; }
#overview.open { display: block; }
#overview ol { columns: 3; column-gap: 32px; font-size: 16px; line-height: 1.6; }
#overview a { color: var(--ink); text-decoration: none; }
#overview a:hover { text-decoration: underline; }
#overview .sec { font-weight: 700; break-after: avoid; list-style: none; margin: 10px 0 2px -18px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
#hud { position: fixed; right: 14px; bottom: 10px; color: #8A909C; font-size: 12px; z-index: 10; font-family: var(--font-ui); }

body.reading #deck { position: static; display: block; padding: 24px 0 80px; }
body.reading .slide { position: relative; left: auto; top: auto; margin: 24px auto 0; transform: none; display: flex; box-shadow: 0 2px 14px #0002; }
body.reading aside.notes { display: block; width: var(--W); margin: 0 auto; background: #fff; padding: 16px 24px; font-size: 18px; line-height: 1.5; border-top: 1px solid var(--line); }
body.reading aside.notes p { margin: 0 0 8px; }

/* print: every page is one 1280x720 frame */
@page { size: 1280px 720px; margin: 0; }
body.print { background: #fff; }
body.print #deck { position: static; display: block; }
body.print .slide { position: relative; left: auto; top: auto; margin: 0; transform: none; display: flex; page-break-after: always; break-after: page; }
body.print [data-b], body.print [data-hl], body.print [data-dim] { transition: none; }
body.print #hud, body.print #notes-panel { display: none; }

/* ------------------------------------------------------------------ slide-specific components */
.diagram { width: 100%; height: auto; display: block; overflow: visible; }
.body.center > .diagram, .body > .diagram { max-height: 470px; }
.slide.cover .body { display: flex; flex-direction: column; }

/* predict-then-reveal application grid */
.appgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 40px; margin-top: 2px; }
.app-t { font-size: 19px !important; font-weight: 650; color: var(--ink-2); margin: 0 0 6px !important; }
.app-row { display: flex; align-items: center; gap: 10px; }
.app-row > img, .app-out img { height: 150px; width: auto; border-radius: 6px; display: block; }
.app-out { width: 168px; height: 150px; }
.app-out > * { position: absolute; inset: 0; }
.qbox { border: 2px dashed #C7CCD4; border-radius: 6px; display: grid; place-items: center; font-size: 54px; font-weight: 700; color: #B3B8C2; background: #fff; }

/* the route */
ol.route { list-style: none; padding: 0; margin: 8px 0 0; counter-reset: r; display: grid; gap: 12px; }
ol.route li { counter-increment: r; display: flex; align-items: center; gap: 18px; font-size: 26px; margin: 0; }
ol.route li::before { content: counter(r); width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 700; font-size: 20px; display: grid; place-items: center; flex: none; }
ol.route li > span { font-size: 20px; color: var(--ink-3); padding-top: 3px; }

/* vertical probability bars */
.vbars { display: flex; gap: 26px; align-items: flex-end; height: 260px; }
.vbars > div { width: 110px; height: calc(var(--h) * 300px); background: var(--c); border-radius: 6px 6px 0 0; position: relative; }
.vbars > div > span { position: absolute; top: -32px; left: 0; right: 0; text-align: center; font-size: 22px; font-weight: 650; color: var(--ink); }
.vlabs { display: flex; gap: 26px; }
.vlabs > span { width: 110px; text-align: center; font-size: 20px; color: var(--ink-2); border-top: 1.5px solid var(--ink-3); padding-top: 6px; }

/* stacked decomposition bar */
.stackbar { display: flex; height: 92px; border-radius: 10px; overflow: hidden; gap: 3px; }
.stackbar > div { border: 2px solid; border-radius: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 25px; min-width: 120px; }
.stackbar > div > span { font-size: 16px; color: var(--ink-3); }

/* stat tiles */
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; width: 245px; display: flex; flex-direction: column; gap: 6px; }
.stat b { font-size: 34px; font-variant-numeric: tabular-nums; }
.stat > span { font-size: 17px; color: var(--ink-3); line-height: 1.3; }

/* number line for the ELBO gap */
.numline { position: relative; width: 1000px; height: 120px; }
.nl-track { position: absolute; left: 0; right: 0; top: 60px; height: 3px; background: #C7CCD4; border-radius: 2px; }
.nl-mark { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; display: flex; flex-direction: column; align-items: center; color: var(--c); }
.nl-mark b { font-size: 22px; }
.nl-mark > span { font-size: 20px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.nl-mark::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--c); margin-top: 8px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--c); }
.nl-gap { position: absolute; top: 86px; height: 30px; border: 2.5px solid var(--loss); border-top: none; border-radius: 0 0 10px 10px; }
.nl-gap > span { position: absolute; top: 34px; left: 0; right: 0; text-align: center; font-size: 19px; color: var(--loss); font-weight: 650; }

/* beta comparison */
.beta3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.beta3 .col { gap: 6px; }
.beta3 p.small { margin: 0 !important; }

/* GAN small multiples */
.film5 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 14px; }
.film5 img { width: 100%; }
.filmlabs { display: grid; grid-template-rows: repeat(8, 1fr); height: 500px; align-items: center; font-size: 17px; color: var(--ink-3); text-align: right; padding: 4px 0; }

/* vote reveal */
.tiles.vote .vt img { border: 4px solid transparent; border-radius: 6px; }
.tiles.vote .vt p { display: flex; justify-content: space-between; font-size: 16px; margin: 4px 2px 0; }
.tiles.vote .vk { font-weight: 650; }
.slide[data-build="2"] .tiles.vote .vt.real img { border-color: var(--x); }
.slide[data-build="2"] .tiles.vote .vt.fake img { border-color: var(--dec); }
.tiles.vote .vt.real .vk { color: var(--x); }
.tiles.vote .vt.fake .vk { color: var(--dec); }

/* exit questions */
ol.exitq { font-size: 25px; padding-left: 1.2em; margin: 0; }
ol.exitq li { margin-bottom: 20px; }
ol.exitq .ans { display: block; font-size: 20px; color: var(--dec); margin-top: 6px; line-height: 1.35; }

/* latent explorer */
.explorer { position: relative; display: inline-block; cursor: crosshair; }
.lens { display: none; position: absolute; right: -14px; top: -14px; width: 150px; height: 150px; border: 3px solid var(--enc); border-radius: 10px; background-repeat: no-repeat; image-rendering: pixelated; box-shadow: 0 4px 16px #0003; background-color: #fff; }

/* vocabulary table */
table.vocab td:nth-child(3) { text-align: left; color: var(--ink-2); font-size: 21px; }
table.vocab th:nth-child(3) { text-align: left; }

/* fixes after the first visual pass */
.slide.cover .body { justify-content: center; }
.chain .node { min-width: 54px; padding: 8px 12px; font-size: 22px; }
.chain .arrow { font-size: 24px; }
.film5 { grid-template-columns: repeat(3, 330px); justify-content: center; gap: 2px 18px; }
.beta3 img[src$="scatter.svg"] { width: 230px !important; }
.beta3 img.pix { width: 300px !important; }
.tiles.vote .vt p { font-size: 15px; }

/* centre each frame's content between the title and the bottom line */
.body { display: flex; flex-direction: column; justify-content: center; }
.body.center { flex-direction: row; }
.body.center.col { flex-direction: column; }

/* ------------------------------------------------------------------ maths */
.katex-display { margin: .25em 0; }
.mathblock .katex-display { margin: .1em 0; }
.mathblock.left .katex-display, .mathblock.left .katex-display > .katex { text-align: left; }
.ladder .katex-display { margin: 0; }
.slide h2 .katex { font-size: 1.0em; }
.q .katex, .callout .katex, .stat .katex, .cap .katex, .small .katex { font-size: 1.08em; }
.fo { font-family: var(--font-ui); white-space: nowrap; overflow: visible; }
.fo .katex { font-size: 1.1em; }
table.work th { text-transform: none; letter-spacing: .02em; font-size: 16px; }
.deriv-prev { opacity: .45; font-size: 24px; }
.why { font-size: 20px; color: var(--ink-2); }

/* ------------------------------------------------------------------ review annotations */
.anno-pin { position: absolute; z-index: 40; transform: translate(-50%, -50%); width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; background: #E11D48; color: #fff; font: 700 13px/22px var(--font-ui); text-align: center; padding: 0;
  box-shadow: 0 2px 6px #0004; cursor: pointer; }
.anno-box, .anno-panel { position: fixed; z-index: 60; display: none; background: #fff; border-radius: 12px; box-shadow: 0 10px 40px #0005;
  font-family: var(--font-ui); color: var(--ink); }
.anno-box { width: 360px; padding: 12px; }
.anno-target { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; line-height: 1.35; max-height: 52px; overflow: hidden; }
.anno-box textarea { width: 100%; font: 15px/1.4 var(--font-ui); border: 1px solid var(--line); border-radius: 8px; padding: 8px; resize: vertical; }
.anno-actions { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.anno-actions span { flex: 1; }
.anno-actions button { font: 600 13px var(--font-ui); border: 1px solid var(--line); background: #F3F4F6; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.anno-actions button.primary { background: #14171F; color: #fff; border-color: #14171F; }
.anno-panel { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(820px, 92vw); max-height: 80vh; overflow: auto; padding: 18px 22px; }
.anno-panel h4 { margin: 0 0 8px; font-size: 16px; }
.anno-panel pre { white-space: pre-wrap; font: 14px/1.45 var(--font-mono); margin: 0; }
body.print .anno-pin, body.reading .anno-pin { display: none; }

.kicker .katex { text-transform: none; font-size: 1.15em; }
.stackbar b .katex { font-size: 1.05em; }
.erows { display: grid; grid-template-columns: 640px 1fr; row-gap: 6px; align-items: center; }
.erows .lab { font-size: 21px; color: var(--ink-2); }
.anno-pin.done { background: #0F766E; font-size: 14px; }
.anno-reply { font-size: 13px; color: #0F766E; background: #D9F2EF; border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; line-height: 1.35; }
.anno-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 70; background: #14171F; color: #fff;
  font: 600 14px var(--font-ui); padding: 8px 14px; border-radius: 10px; opacity: 0; transition: opacity .25s; pointer-events: none; }

/* ------------------------------------------------------------------ section breaks and recaps */
.slide.break { padding-left: 80px; }
.break-grid { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: center; height: 100%; }
.slide.break h2 { font-size: 50px; margin-bottom: 18px; }
.slide.break .why { font-size: 25px; color: var(--ink-2); line-height: 1.45; }
.slide.break .why b { color: var(--ink); }
ol.route-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ol.route-mini li { display: flex; align-items: center; gap: 14px; font-size: 19px; color: #9AA1AD; margin: 0; }
ol.route-mini .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700; flex: none;
  border: 2px solid #C7CCD4; color: #9AA1AD; background: #fff; }
ol.route-mini li.done { color: var(--ink-2); }
ol.route-mini li.done .dot { background: #E5E7EB; border-color: #E5E7EB; color: var(--ink-2); }
ol.route-mini li.now { color: var(--ink); font-weight: 700; font-size: 21px; }
ol.route-mini li.now .dot { background: var(--c); border-color: var(--c); color: #fff; width: 38px; height: 38px; font-size: 17px; }
.recap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.recap h3 { font-size: 18px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; font-weight: 650; }
.recap ol { margin: 0; padding-left: 1.2em; }
.recap li { font-size: 22px; line-height: 1.4; margin-bottom: 10px; }
.recap .next { background: #F0F2F5; border-radius: 14px; padding: 18px 22px; }
.steps2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.steps2 > div { border-radius: 14px; padding: 18px 22px; }
.steps2 h3 { margin: 0 0 8px; font-size: 24px; }
.cmp { border-collapse: collapse; margin: 0 auto; font-size: 22px; }
.cmp th { font-size: 16px; color: var(--ink-3); font-weight: 650; text-align: left; padding: 8px 18px; border-bottom: 1.5px solid var(--line); }
.cmp td { padding: 12px 18px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.cmp td:first-child { font-weight: 650; color: var(--ink-2); }
.cands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cands .col { align-items: center; }
.cands .ll { font-size: 22px; }

.condgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 30px; }
.cond { display: flex; flex-direction: column; gap: 4px; }
.cond-c { font-size: 18px !important; margin: 0 !important; line-height: 1.35 !important; min-height: 50px; }
.cond-c .mono { font-size: 15px; color: var(--ink-2); }
.chip { display: inline-block; background: #F0F2F5; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 15px; font-weight: 650; color: var(--ink-2); margin-right: 6px; }
.cond .cap { margin: 0; font-size: 15px; text-align: left; }
.cvlabs { display: grid; grid-template-rows: repeat(10, 1fr); height: 470px; font-size: 19px; color: var(--ink-3); text-align: right; align-items: center; padding: 2px 0; }

/* ------------------------------------------------------------------ latent-space app */
.lx { display: grid; grid-template-columns: 470px 1fr; gap: 34px; align-items: center; }
.lx-plotwrap { position: relative; width: 470px; height: 470px; }
.lx-plot { width: 470px; height: 470px; border: 1px solid var(--line); border-radius: 10px; cursor: crosshair; display: block; }
.lx-tip { position: absolute; display: none; transform: translate(14px, -50%); background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 8px 4px 4px; gap: 8px; align-items: center; box-shadow: 0 4px 14px #0002; pointer-events: none; font-size: 15px; color: var(--ink-2); }
.lx-tip canvas { width: 56px; height: 56px; image-rendering: pixelated; }
.lx-side { display: flex; flex-direction: column; gap: 14px; }
.lx-imgs { display: flex; gap: 24px; }
.lx-imgs figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 16px; color: var(--ink-3); }
.lx-imgs canvas { width: 190px; height: 190px; image-rendering: pixelated; border: 2.5px solid var(--dec); border-radius: 6px; }
.lx-origfig canvas { border-color: var(--x); }
.lx-z { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--z); font-weight: 650; }
.lx label { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.lx input[type=range] { width: 340px; accent-color: var(--z); }
.lx-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.lx-btns button { font: 600 16px var(--font-ui); border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; }
.lx-btns button:hover { border-color: var(--z); }
.lx-static { display: none; }
body.print .lx, .lx.lx-offline { display: none; }
body.print .lx-static, .lx-offline + .lx-static { display: block; }

.cond img.fig { height: 132px; width: auto; max-width: 100%; object-fit: contain; align-self: flex-start; }
.cond img.pix { height: 66px; }
.condgrid { gap: 10px 34px; }

/* code walk-throughs: code on the left, the explanation of the highlighted lines on the right */
.codewalk { display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px; align-items: start; }
.codewalk pre.code { font-size: 17px; line-height: 1.55; }
.codewalk .notes-col p.small { margin: 0 0 10px; }
.codewalk .notes-col .callout { font-size: 20px; }
.kinds td:nth-child(2), .kinds td:nth-child(3) { font-size: 19px; }

.dae-labels { display: grid; grid-template-rows: repeat(4, 1fr); height: 312px; font-size: 18px; color: var(--ink-2); text-align: right; align-items: center; width: 250px; }
.dae-cover, .dae-cover2 { position: absolute; left: 0; right: 0; bottom: 0; background: var(--paper); }
.dae-cover { top: 25%; }
.dae-cover2 { top: 50%; }

/* ------------------------------------------------------------------ GAN lecture additions */
.bridge2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 8px; }
.bridge2 > div { border-radius: 14px; padding: 14px 18px; display: grid; grid-template-columns: 1fr 230px; gap: 4px 16px; align-items: center; }
.bridge2 h3 { grid-column: 1 / -1; margin: 0 0 2px; font-size: 21px; letter-spacing: .02em; }
.bridge2 p.small { margin: 0 0 8px !important; font-size: 19px !important; line-height: 1.35 !important; }
.bridge2 img { width: 230px; image-rendering: pixelated; border-radius: 4px; }
.bridge2 .cap { grid-column: 2; margin: 0 !important; font-size: 14px !important; }
.cover-row { display: grid; grid-template-columns: 560px 1fr; gap: 40px; align-items: center; }
ol.takeaways { margin: 0; padding-left: 1.2em; }
ol.takeaways li { font-size: 22px; line-height: 1.4; margin-bottom: 12px; }
.film-cols { display: grid; grid-auto-flow: column; grid-auto-columns: 226px; justify-content: center; gap: 0; }
.film-cols img { width: 226px; display: block; }
.film-cols.four { grid-auto-columns: 262px; }
.film-cols.four img { width: 262px; }
