/* ===================================================================
   paralever — per-deck styles, layered ON TOP of the shared lean.css.
   Put only what's specific to THIS deck here: the header name, this
   deck's title-slide tuning, and its custom components. Loaded via
   `extraCss` in SlidesMain.lean and read at runtime → edit + re-run
   `lake exe slides`, no rebuild.
   =================================================================== */

/* header name shown at the top-left of every content slide
   (bump --name-w if you make the name longer) */
:root { --project: "Paralever"; --name-w: 5.4em; --sep: #cbd5e1; }

/* ---- title slide: anchor the block higher and tighten it ----
   lean.css centres the title vertically; with a subtitle + byline +
   event + links that reads low and loose, so top-anchor and close gaps. */
.reveal section[data-state="title"] {
  justify-content: flex-start;
  padding: 61.2px 89.6px 36px;
}
.reveal section[data-state="title"]::before { margin-bottom: 1em; }
.reveal section[data-state="title"] h2 { margin-bottom: 0.3em; }
.reveal .subheader { font-size: 1.3em; margin-bottom: 1.5em; }
.reveal .byline { font-size: 1.05em; line-height: 1.4; margin-bottom: 0.16em; }
/* lean.css draws a hairline above the first `.event` after a byline or
   subheader — a separator you get by accident of ordering and cannot put
   anywhere else. Dropped here in favour of `.ruled` below. */
.reveal .byline + .event,
.reveal .subheader + .event { margin-top: 1.2em; padding-top: 0.8em; border-top: none; }

/* ---- .prl : syntax colour for paralever source ----
   Painted by `prl.js`, whose scan and token classes mirror
   `Lang/Compile/Print.lean`'s `highlight` — the same six classes the ANSI
   printer uses, so a slide and `paralever to-prl --color` agree. Put `prl` on
   any element holding .prl text; an `<em>` caption inside it is left alone. */
.reveal .t-com { color: var(--muted); font-style: italic; }
.reveal .t-kw  { color: #7c3aed; font-weight: 600; }
.reveal .t-reg { color: #0e7490; }
.reveal .t-num { color: #b45309; }
.reveal .t-str { color: #15803d; }
.reveal .t-asg { color: var(--ink); font-weight: 700; }

/* ---- .lead : an optional emphasis on one byline ----
   lean.css gives a byline its blue only where the source wrote `*…*`, and
   nothing makes a line prominent for being first. `:::class "byline lead"`
   opts one line in, wherever it sits in the block, and leaves the rest alone. */
.reveal .byline.lead {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--lean-blue);
  letter-spacing: -0.005em;
  margin-bottom: 0.42em;
}
.reveal .byline.lead strong { color: inherit; font-weight: inherit; }

/* ---- .ruled : a separator above any block, anywhere ----
   `:::class "ruled"` draws the line over whatever it wraps; added to an
   existing class (`:::class "event ruled"`) it rules that block in place.
   `--line` is slate-200, invisible on a projector, so this uses its own. */
/* the class is doubled to carry weight, not by accident: lean.css's
   `.reveal .subheader + .event` is three classes deep, so a plain `.reveal
   .ruled` loses to it and the line keeps lean.css's near-invisible `--line`.
   `.ruled.ruled` matches the same element at equal specificity and, coming
   later, wins. */
.reveal .ruled.ruled {
  border-top: 1px solid var(--sep);
  margin-top: 1.3em;
  padding-top: 0.85em;
}
.reveal .ruled.thick { border-top-width: 2px; border-top-color: var(--lean-blue); }
.reveal .ruled.short { border-top-style: solid; max-width: 14em; }
.reveal .event { font-size: 0.9em; }
.reveal .links { margin-top: 0.9em; font-size: 0.8em; }

/* ---- section page: the section name in a rounded blue card ----
   The slide keeps its running header and its normal top-anchored layout; only
   the title changes, so the next slide goes back to normal with no further
   rules.

   The header hangs off `h2::before` (the project name) and `h2::after` (the
   blue rule), which lean.css parks in the h2's own 1.8em of top padding. A
   background on the h2 would paint over both, and an offset background cannot
   take a border-radius. So the slot becomes *margin* instead of padding —
   margin is outside the painting area — and the two pseudo-elements are lifted
   into it by the same 1.8em. The card then starts at the content box and rounds
   properly, while the header lands exactly where it does on every other slide.

   The compensation on `::before`: `top` resolves `em` against the element's own
   font-size, and that one is 1.05em, so 1.8 / 1.05 = 1.714 travels the same
   distance. `::after` has no font-size of its own and keeps the h2's. */
.reveal section[data-state="section"] h2 {
  color: #fff;
  background: var(--lean-blue);
  border-radius: 14px;
  padding: 0.5em 0.9em 0.55em;
  margin: 1.8em 0 1em;
  box-shadow: 0 3px 14px rgba(0, 115, 163, 0.26);
}
.reveal section[data-state="section"] h2::before { top: -1.714em; }
.reveal section[data-state="section"] h2::after  { top: -1.45em; }

/* ---- body: bump bullet-point text a touch ---- */
.reveal ul, .reveal ol { font-size: 0.92em; }

/* ---- staggered bullets ----
   `:::class "steps"` marks a list for stagger.js, which turns each item into a
   fragment. It carries no styling: a steps list is an ordinary bulleted list
   with lean.css's markers, which is what the other decks do.
   NOTE: the class is "steps" (plural). ":::class \"step\"" does nothing. */

/* ---- punch line: the one sentence a slide is actually about ---- */
.reveal .punch { font-size: 1.2em; font-weight: 700; color: var(--lean-blue); margin: 0.35em 0; }
.reveal .punch.center { text-align: center; }

/* ---- big-number stats ---- */
.reveal .stats { display: flex; justify-content: center; gap: 38.4px; margin: 0.5em 0; }
.reveal .stat { font-size: 1.9em; font-weight: 800; color: var(--lean-blue); text-align: center; }
.reveal .stat small { display: block; font-size: 0.34em; font-weight: 500; color: var(--muted); letter-spacing: 0.01em; }

/* ===================================================================
   Code cards — promoted to global (were scoped to the old template's
   per-slide states). A .gbox is a bordered card around a code block.
   =================================================================== */
.reveal .gbox {
  margin: 0.25em 0; padding: 0.4em 0.7em; border-radius: 8px; width: fit-content;
  max-width: 100%; border: 1px solid rgba(15,23,42,0.12);
  background: rgba(248,250,252,0.9);
  height: auto !important; max-height: none !important;
}
.reveal .gbox code { font-size: inherit; }
/* definition / theorem cards: distinguished by border weight and ground,
   not by an accent bar down one edge */
.reveal .defbox { border: 1px solid rgba(15,23,42,0.22); background: #fff; }
.reveal .thm    { border: 1px solid rgba(15,23,42,0.28); background: #fff; box-shadow: 0 1px 0 rgba(15,23,42,0.06); }
.reveal .thm code { font-size: inherit; }
.reveal .caplabel {
  font-size: 0.72em; font-weight: 700; color: var(--lean-blue); margin: 0 0 0.15em;
}

/* ---- arrows between stacked/side-by-side boxes ---- */
.reveal .arrow-right,
.reveal .arrow-down,
.reveal .arrow-dl,
.reveal .arrow-dr {
  color: var(--lean-teal); font-weight: 700; white-space: nowrap;
}
.reveal .arrow-right { align-self: center; font-size: 0.95em; }
.reveal .arrow-down  { align-self: center; font-size: 0.95em; margin: 0.1em 0; }

/* ===================================================================
   CRITICAL — do not remove.
   ```lean blocks are emitted with reveal's `r-stretch`, which
   mis-computes a tiny height and collapses the block to a single
   scrolling line. This neutralises it.
   =================================================================== */
.reveal code.hl.lean.block {
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  height: auto !important;
  max-height: none !important;
}

/* ===================================================================
   paralever-specific components
   =================================================================== */

/* ---- .rule : an inference rule — premises over a bar over the conclusion ---- */
.reveal .rulewrap { text-align: center; margin: 0.55em 0; }
.reveal .rule {
  display: inline-block; text-align: center;
  font-family: var(--mono); font-size: 0.68em; line-height: 1.5;
}
.reveal .rule .prem { padding: 0 0.7em 0.2em; }
.reveal .rule .bar  { border-top: 2px solid var(--lean-blue); margin: 0; }
.reveal .rule .conc { padding: 0.2em 0.7em 0; font-weight: 700; }
.reveal .rule .side {
  display: block; font-family: var(--sans); font-size: 0.82em;
  color: var(--muted); margin-top: 0.35em; font-weight: 400;
}

/* ---- .pullquote : a quotation from a cited paper, with its attribution ---- */
.reveal .pullquote {
  border-left: 3px solid var(--lean-teal);
  background: var(--tint);
  padding: 0.5em 0.9em; margin: 0.5em auto; max-width: 42em;
  font-size: 0.62em; line-height: 1.5; text-align: left; font-style: italic;
}
.reveal .pullquote .src {
  display: block; margin-top: 0.4em; font-style: normal;
  color: var(--muted); font-size: 0.9em;
}

/* ---- .notation : the key for the symbols a slide uses, as a quiet footer ---- */
.reveal .notation {
  font-size: 0.6em; color: var(--muted); margin-top: 0.7em;
  letter-spacing: 0.01em; text-align: center;
}
.reveal .notation code { font-size: 1em; color: var(--ink); }
.reveal .notation strong { color: var(--ink); }

/* ---- .more : the footer line on an overview slide that has vertical detail
   below.  It sits on the content box's bottom edge, not below it, so autofit's
   union rect never outgrows the box on its account -- ref: slides/src/autofit.js § 2 */
.reveal .more {
  position: absolute;
  left: var(--pad-l); right: var(--pad-r); bottom: calc(var(--pad-b) - 10px);
  font-family: var(--sans); font-size: 1.2em; font-weight: 600;
  color: #4b5563; text-align: center; letter-spacing: 0.02em;
}

/* ---- .dgm.big : one figure's node boxes a size up, for a slide with room ---- */
.reveal .dgm.big .nd  { font-size: 0.78em; }
.reveal .dgm.big .arr { font-size: 0.95em; }

/* ---- .cite : paper attribution under a borrowed theorem ----
   e.g. "Brookes, A Semantics for CSL, CONCUR'04 §5-7" */
.reveal .cite {
  font-size: 0.62em; color: var(--muted); font-style: italic;
  margin-top: 0.45em; letter-spacing: 0.01em;
}
.reveal .cite strong { font-style: normal; color: var(--ink); font-weight: 700; }

/* ---- .map : ASCII mental maps / flowcharts in a <pre> ----
   Tight leading and a hairline box so box-drawing characters line up. */
.reveal pre.map,
.reveal .map pre {
  font-family: var(--mono);
  font-size: 0.42em;
  line-height: 1.25;
  text-align: left;
  width: fit-content;
  max-width: 100%;
  margin: 0.3em auto;
  padding: 0.6em 0.9em;
  border: 1px solid var(--tint-line);
  border-radius: 8px;
  background: var(--tint);
  overflow-x: auto;
  white-space: pre;
  height: auto !important; max-height: none !important;
}
.reveal .map.tall pre, .reveal pre.map.tall { font-size: 0.36em; }
.reveal .map.wide pre, .reveal pre.map.wide { font-size: 0.38em; }

/* ===================================================================
   Diagram primitives — for ```html flowcharts / mental maps.
   `.dgm` is a flex container; `.nd` is a node box; `.arr` is an arrow.
   Compose: <div class="dgm col"> … </div> for a vertical flow.
   =================================================================== */
.reveal .dgm {
  display: flex; gap: 0.45em; align-items: center; justify-content: center;
  margin: 0.45em auto; flex-wrap: wrap; max-width: 100%;
}
.reveal .dgm.col  { flex-direction: column; }
.reveal .dgm.top  { align-items: flex-start; }
.reveal .dgm.tight { gap: 0.25em; }

.reveal .nd {
  border: 1px solid var(--tint-line); background: var(--tint);
  border-radius: 8px; padding: 0.34em 0.7em;
  font-size: 0.6em; line-height: 1.35; text-align: center;
}
.reveal .nd.mono {
  font-family: var(--mono); text-align: left; white-space: pre;
  font-size: 0.5em; padding: 0.45em 0.7em;
}
.reveal .nd.wide  { min-width: 20em; }
.reveal .nd.blue  { border-color: var(--lean-blue); }
.reveal .nd.key   { border: 2px solid var(--lean-blue); font-weight: 700; color: var(--lean-blue); }
.reveal .nd.good  { border-color: #16a34a; background: rgba(22,163,74,0.09); }
.reveal .nd.bad   { border-color: #dc2626; background: rgba(220,38,38,0.09); }
.reveal .nd.plain { border: none; background: none; padding: 0.1em 0.3em; }
.reveal .nd em    { color: var(--muted); font-style: normal; font-size: 0.86em; display: block; }
/* a source listing is boxed, whatever `.plain` says: a rule around the program marks where it
   starts and stops. Border only, so the token colours are what carries meaning inside it. */
.reveal .nd.prl, .reveal .nd.mlir,
.reveal .nd.plain.prl, .reveal .nd.plain.mlir,
.reveal .nd.prl.blue, .reveal .nd.mlir.blue {
  border: 1.5px solid #334155; border-radius: 8px; background: none;
  padding: 0.55em 0.85em;
}
.reveal .nd.prl em, .reveal .nd.mlir em { margin-top: 0.35em; }

.reveal .nd code  { font-size: 0.95em; }

.reveal .arr { color: var(--lean-teal); font-weight: 700; font-size: 0.75em; line-height: 1; }
.reveal .arr.lbl2 { display: flex; flex-direction: column; align-items: center; gap: 0.1em; }
.reveal .arr small { font-size: 0.62em; color: var(--muted); font-weight: 500; }

/* verdict chips — ACCEPTS / REJECTS / RACE / FINE */
.reveal .vd {
  display: inline-block; border-radius: 999px; padding: 0.06em 0.6em;
  font-size: 0.92em; font-weight: 700; letter-spacing: 0.02em;
}
.reveal .vd.ok { background: rgba(22,163,74,0.14);  color: #15803d; }
.reveal .vd.no { background: rgba(220,38,38,0.14);  color: #b91c1c; }

/* a branch fan: one parent, several children */
.reveal .fan { display: flex; gap: 0.5em; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.reveal .fan > .nd { flex: 0 1 auto; max-width: 14em; }

/* diagram-local tables (the trace table, the rfl results) */
.reveal table.dgmt { width: auto; margin: 0.4em auto; }
.reveal table.dgmt th, .reveal table.dgmt td {
  font-size: 0.52em !important; padding: 0.2em 0.7em; border: none;
  font-family: var(--mono); text-align: left;
}
.reveal table.dgmt th { font-family: var(--sans); color: var(--lean-blue); font-weight: 700; }
.reveal table.dgmt tbody tr + tr td { border-top: 1px solid var(--tint-line); }

/* ---- .defs : a definition table — the notation on the left, the definition in words on the
   right.  Its own class because `.dgmt` sets every cell in mono and a sentence is not code. */
.reveal table.defs { width: 100%; margin: 0.25em 0; border-collapse: collapse; }
.reveal table.defs td { border: none; vertical-align: top; padding: 0.3em 0.55em; }
.reveal table.defs td.sym {
  font-family: var(--mono); font-size: 0.58em; color: var(--lean-blue-2); white-space: nowrap;
}
.reveal table.defs td.def { font-family: var(--sans); font-size: 0.56em; line-height: 1.45; }
.reveal table.defs td.def b { color: var(--ink); font-weight: 700; }
.reveal table.defs td.def code { font-family: var(--mono); font-size: 0.95em; }
.reveal table.defs tr + tr td { border-top: 1px solid var(--tint-line); }

/* ---- .gap : the "nobody has this" row of the lineage table ---- */
.reveal .gap,
.reveal tr.gap td {
  background: rgba(37,99,235,0.1);
  font-weight: 700;
  color: var(--lean-blue);
}

/* ---- .ladder : the combinator ladder (cheapest route at the top) ---- */
.reveal .ladder { display: flex; flex-direction: column; gap: 0.25em; margin: 0.4em 0; }
.reveal .tier {
  display: flex; align-items: baseline; gap: 0.6em;
  padding: 0.28em 0.7em; border-radius: 6px;
  border: 1px solid var(--tint-line); background: var(--tint);
  font-size: 0.78em;
}
.reveal .tier strong { color: var(--lean-blue); min-width: 9em; }
.reveal .tier em { color: var(--muted); font-style: normal; font-size: 0.9em; }

.reveal .lose { color: var(--muted); text-decoration: line-through; }

/* ---- tables: keep them readable at slide size (was scoped to one state) ---- */
.reveal table {
  width: 100%; max-width: 100%; table-layout: auto;
  border-collapse: collapse; margin: 0.3em auto;
}
.reveal table th,
.reveal table td {
  font-size: 0.56em !important; padding: 0.24em 0.55em;
  vertical-align: top; overflow-wrap: anywhere;
}
.reveal table.tight th,
.reveal table.tight td { font-size: 0.5em !important; }

/* ---- the proof slides: the same five boxes, with room around them ----
   Every slide in this section is one flow of `.nd` boxes. At the deck's defaults they sit 0.45em
   apart at 0.6em text, which reads as a wall. Here the gap is trebled, the text in a box is set
   at the size of the prose around it, and the box itself is given real padding, so each step is
   read as a step. */
.reveal section[data-state="proof"] .dgm { gap: 0.75em; margin: 0.7em auto; }
.reveal section[data-state="proof"] .dgm.col { gap: 0.6em; }
.reveal section[data-state="proof"] .nd { font-size: 0.68em; padding: 0.5em 0.9em; }
.reveal section[data-state="proof"] .nd.mono { font-size: 0.56em; padding: 0.55em 1em; }
.reveal section[data-state="proof"] .nd em { margin-top: 0.3em; }
.reveal section[data-state="proof"] .arr { font-size: 1em; }
.reveal section[data-state="proof"] .steps { font-size: 0.9em; margin-top: 0.7em; }
.reveal section[data-state="proof"] .figwrap { margin: 0.6em auto; }
.reveal section[data-state="proof"] .r-hstack { gap: 12.8px; align-items: center; }
.reveal section[data-state="proof"] .r-hstack > * { flex: 1 1 0; min-width: 0; }
.reveal section[data-state="proof"] .figwrap svg { width: 100%; height: auto; }

/* ---- the definitions slide: one slide of Lean, so it is set larger than code
   that shares a slide with prose. ---- */
.reveal section[data-state="defs"] .r-hstack { gap: 12.8px; align-items: flex-start; }
.reveal section[data-state="defs"] .r-hstack > * { flex: 1 1 0; min-width: 0; }
.reveal section[data-state="defs"] .r-vstack { gap: 0.5em; }
.reveal section[data-state="defs"] code.hl.lean.block { font-size: 1.22em; }
.reveal section[data-state="defs"] .nd.mono { font-size: 0.56em; }
.reveal section[data-state="defs"] .steps { font-size: 0.86em; margin-top: 0.5em; }

/* ---- the language slide: the program left, the output and the bullets right ----
   `:::hstack` wraps its children in `.r-hstack`; the left cell is given the larger
   share and each panel hugs the centre line. */
.reveal section[data-state="lang"] .r-hstack { align-items: stretch; gap: 12.8px; }
.reveal section[data-state="lang"] .r-hstack > :first-child { flex: 1.05 1 0; min-width: 0; }
.reveal section[data-state="lang"] .r-hstack > .r-vstack { flex: 1 1 0; min-width: 0; gap: 0.6em; }
.reveal section[data-state="lang"] .nd.mono { font-size: 0.62em; width: fit-content; }
.reveal section[data-state="lang"] .r-hstack > :first-child .nd { margin-left: auto; }
.reveal section[data-state="lang"] .r-vstack > * { margin-right: auto; }
.reveal section[data-state="lang"] .steps { font-size: 0.8em; }
.reveal section[data-state="lang"] .steps li { margin-bottom: 0.2em; }

/* ---- the schedule-search slide: pseudocode left, search tree right ----
   `.map pre` is 0.42em, sized for a block that has a slide to itself. In half the
   width it still fits at half again that size, which is the point of the split. */
.reveal section[data-state="sched"] .r-hstack { gap: 12.8px; align-items: center; }
.reveal section[data-state="sched"] .r-hstack > * { flex: 1 1 0; min-width: 0; }
.reveal section[data-state="sched"] .map pre { font-size: 0.6em; margin: 0 0 0 auto; }
.reveal section[data-state="sched"] .figwrap svg { width: 100%; height: auto; }
.reveal section[data-state="sched"] .steps { font-size: 0.86em; }

/* ---- the race slide: the refused schedule as a trace table, then the two readings ----
   The tool prints one line per step; the columns are what a reader compares across, so they
   are columns here. The two rows that abort are ruled red rather than filled. */
.reveal section[data-state="race"] .trace {
  display: flex; align-items: center; justify-content: center; gap: 1.4em; margin-top: 0.5em;
}
.reveal section[data-state="race"] table.dgmt.ruled-table { margin: 0; }
.reveal section[data-state="race"] table.dgmt.ruled-table th,
.reveal section[data-state="race"] table.dgmt.ruled-table td {
  font-size: 0.52em !important; padding: 0.22em 0.7em;
}
.reveal tr.racing td { color: #dc2626; border-color: #dc2626 !important; }
.reveal .verdict { text-align: left; font-size: 0.56em; line-height: 1.5; }
.reveal .verdict .refusal { color: #dc2626; }
.reveal .verdict .readings { display: flex; gap: 0.6em; margin: 0.45em 0 0.3em; }
.reveal .verdict .reading {
  border: 1px solid var(--tint-line); border-radius: 6px; padding: 0.18em 0.6em;
  font-family: var(--mono); color: var(--muted);
}
.reveal .verdict .reading b { color: var(--ink); }
.reveal .verdict em { color: var(--muted); font-style: normal; font-size: 0.86em; }

/* .ruled-table : a table that is the slide's exhibit rather than a label inside a figure.
   Bigger than `.dgmt`'s 0.52em, and every cell ruled, because the numbers are read across
   as well as down. */
.reveal table.dgmt.ruled-table { margin: 0.7em auto; border-collapse: collapse; }
.reveal table.dgmt.ruled-table th,
.reveal table.dgmt.ruled-table td {
  font-size: 0.78em !important; padding: 0.3em 0.95em;
  border: 1px solid var(--tint-line); text-align: right;
}
.reveal table.dgmt.ruled-table th:first-child,
.reveal table.dgmt.ruled-table td:first-child { text-align: left; }
.reveal table.dgmt.ruled-table thead th {
  border-bottom: 2px solid var(--lean-blue); background: var(--tint);
}
.reveal table.dgmt.ruled-table tbody tr + tr td { border-top: 1px solid var(--tint-line); }

/* ---- the closing slide: the title and its one line centred, references in the corner ---- */
/* Only the title grows. The running header is laid out in h2 ems — the slot, the name, the rule
   and its inset — so every one of them is multiplied by 1.3/2.8, the ratio of the usual h2 size
   to this one, and comes out at the size and place it has on every other slide. */
.reveal section[data-state="thanks"] h2 {
  text-align: center; font-size: 2.8em; padding-top: 0.8357em; margin-top: 0;
}
.reveal section[data-state="thanks"] h2::before { font-size: 0.4875em; }
.reveal section[data-state="thanks"] h2::after { font-size: 0.4643em; top: 0.1625em; }
.reveal section[data-state="thanks"] > p { text-align: center; font-size: 1.25em; color: var(--muted); }
.reveal section[data-state="thanks"] .refs { margin-top: 5.5em; text-align: left; font-size: 0.6em; }

/* ---- the matmul slide: the program and the theorem it discharges, side by side ----
   Each column is `width: fit-content` and pushed toward the gutter, so the two blocks sit
   against each other rather than against the slide edges. */
.reveal section[data-state="matmul"] .two-col {
  grid-template-columns: auto auto; justify-content: center;
  gap: 1.6em; align-items: center; margin-top: 0.4em;
}
.reveal section[data-state="matmul"] .two-col > * { justify-self: stretch; min-width: 0; }
.reveal section[data-state="matmul"] .nd.mono { width: fit-content; font-size: 0.52em; }
.reveal section[data-state="matmul"] pre.hl.lean { margin: 0; }
.reveal section[data-state="matmul"] code.hl.lean.block { font-size: 0.88em; }

/* ---- the MLIR slide: the same two-col gutter problem as the spine ---- */
.reveal section[data-state="mlir"] .two-col { gap: 0.7em; align-items: center; }
.reveal section[data-state="mlir"] .nd.mono { width: fit-content; font-size: 0.56em; }
.reveal section[data-state="mlir"] .two-col > :first-child .nd { margin-left: auto; }
.reveal section[data-state="mlir"] .two-col > :nth-child(2) .nd { margin-right: auto; }

/* ---- the sequential-spine slide: close the middle ----
   `.two-col` is a 1fr 1fr grid with a 1.5em gutter, and neither cell's content
   fills its column, so the program and the tree drift to opposite edges. Halve
   the gutter and let each panel hug the centre line. */
.reveal section[data-state="spine"] .two-col { gap: 0.7em; align-items: center; }
.reveal section[data-state="spine"] .nd.mono { width: fit-content; margin-left: auto; }
.reveal section[data-state="spine"] .figwrap { margin-right: auto; }

/* ---- the WellFormed slide: definition and bullets left, the tree right ----
   `:::hstack` wraps its children in `.r-hstack`; these two rules split that row
   into equal halves and let the SVG take the width it is given. Scoped to this
   slide's state so other hstacks keep lean.css's content-width behaviour. */
.reveal section[data-state="wf"] .r-hstack > * { flex: 1 1 0; min-width: 0; }
.reveal section[data-state="wf"] .figwrap svg { width: 100%; height: auto; }
.reveal section[data-state="wf"] .steps { font-size: 0.86em; }

/* ---- two-column tuning (lean.css provides the .two-col grid) ---- */
.reveal .two-col { gap: 25.6px; align-items: start; }

/* ---- hstack/vstack defaults for side-by-side code ---- */
.reveal .r-hstack { align-items: flex-start; justify-content: center; gap: 25.6px; width: 100%; }
.reveal .r-vstack { gap: 0.25em; align-items: stretch; }

/* ---- closing slide ---- */
.reveal .finale { font-size: 1.3em; font-weight: 700; color: var(--lean-blue); text-align: center; }

/* ---- .refs : the references slide — small, dense, unobtrusive ---- */
.reveal .refs { font-size: 0.52em; line-height: 1.45; }
.reveal .refs ul { margin: 0; }
.reveal .refs li { margin: 0.12em 0; }

/* ---- .treewrap : code on the left, its tree on the right ---- */
.reveal .treewrap { display: flex; align-items: center; justify-content: center;
                    gap: 1.6em; margin: 0.3em auto; max-width: 100%; }
.reveal .treewrap pre { margin: 0; font-size: 0.78em; line-height: 1.5;
                        border: 1px solid var(--tint-line); border-radius: 6px;
                        padding: 0.7em 0.9em; background: rgba(15,23,42,0.025); }
.reveal .treewrap svg { width: 46%; height: auto; }
.reveal .treewrap svg text { font-family: var(--mono); fill: var(--ink); }

/* ---- .shotbox : a slot for a screenshot.  The caption shows through while the
   image is absent, so the slide is still readable before the file is dropped in. ---- */
.reveal .shotbox {
  border: 2px dashed var(--tint-line); border-radius: 10px;
  padding: 0.5em; margin: 0.2em auto; text-align: center;
  display: flex; flex-direction: column; justify-content: center; min-height: 6em;
}
.reveal .shotbox img { max-width: 100%; max-height: 288px; border-radius: 6px; }
.reveal .shotbox .cap { font-size: 0.56em; color: var(--muted); margin-top: 0.3em; }

/* ---- .figwrap : a wrapper for an inline SVG figure.  Unlike .pipewrap it sets
   no font, so each figure's own font-family attributes decide mono vs sans. ---- */
.reveal .figwrap { display: flex; justify-content: center; margin: 0.35em auto; width: 100%; }
.reveal .figwrap svg { width: 92%; height: auto; max-height: 331.2px; }

/* ---- .pipewrap : the pure -> seq -> par proof pipeline ---- */
.reveal .pipewrap { display: flex; justify-content: center; margin: 0.2em auto; }
.reveal .pipewrap svg { width: 88%; height: auto; }
.reveal .pipewrap svg text { font-family: var(--sans); fill: var(--ink); }

/* ---- .bigclaim : the one statement the talk exists to make ---- */
.reveal .bigclaim {
  font-size: 1.16em; line-height: 1.42; text-align: center;
  margin: 0.3em auto 0.55em; padding: 0.7em 1.1em; max-width: 92%;
  border: 2px solid var(--lean-blue); border-radius: 10px;
  background: rgba(37,99,235,0.045);
}
.reveal .bigclaim code { font-size: 0.95em; }
.reveal .bigclaim-sub {
  display: block; margin-top: 0.45em; font-size: 0.62em;
  color: var(--muted); font-weight: 600;
}


/* ---- .qask : the question a slide poses.  A `?` rail on the left so the panel
   reads as a question at a glance, the question itself as an equation, and the
   quantifiers it has to hold under as chips beneath it. ---- */
.reveal .qask {
  display: flex; align-items: center; gap: 0.75em;
  margin: 0.45em auto 0.3em; padding: 0.55em 1em 0.6em;
  max-width: 92%; width: fit-content;
  border: 2px solid var(--lean-blue); border-radius: 12px;
  background: rgba(37,99,235,0.045);
}
.reveal .qask .qm {
  flex: 0 0 auto; width: 1.55em; height: 1.55em; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--lean-blue); color: var(--lean-blue);
  font-size: 1.05em; font-weight: 800; line-height: 1;
}
.reveal .qask .qhead { font-size: 1.1em; font-weight: 700; line-height: 1.25; }
.reveal .qask .qhead code { font-size: 0.95em; color: var(--lean-blue); }
.reveal .qask .qhead .eq { color: var(--lean-blue); padding: 0 0.1em; }
.reveal .qask .qwhen {
  display: flex; gap: 0.4em; flex-wrap: wrap;
  margin: 0.34em 0 0; padding: 0; list-style: none; font-size: 0.56em;
}
.reveal .qask .qwhen li {
  margin: 0; padding: 0.1em 0.6em; border-radius: 999px;
  background: rgba(37,99,235,0.1); color: var(--lean-blue); font-weight: 600;
}
.reveal .qask .qwhen li::before { content: "\2200  "; font-weight: 800; }

/* ---- .lineage : prior results, open typography — no cards, no fills ---- */
.reveal .lineage { margin: 0.45em auto; text-align: left; max-width: 94%; }
.reveal .lineage .le { padding: 0.30em 0 0.34em; }
.reveal .lineage .le + .le { border-top: 1px solid rgba(15,23,42,0.08); }
.reveal .lineage .who {
  font-family: var(--sans); font-weight: 700; font-size: 0.74em;
  color: var(--lean-blue); letter-spacing: 0.005em;
}
.reveal .lineage .who span {
  font-weight: 400; color: var(--muted); font-size: 0.82em;
}
.reveal .lineage .who span::before { content: " \00b7  "; }
.reveal .lineage .thm {
  font-size: 0.68em; line-height: 1.44; margin: 0.10em 0 0 1.15em;
}
.reveal .lineage .thm code { font-size: 0.95em; }
.reveal .lineage .miss {
  font-size: 0.60em; line-height: 1.35; margin: 0.10em 0 0 1.15em;
  color: var(--muted); font-style: italic;
}
.reveal .lineage .miss::before {
  content: "\2192  "; font-style: normal; color: #b91c1c; font-weight: 700;
}
/* our own row: distinguished by weight and colour, not by a container */
.reveal .lineage .le.ours .who { color: var(--lean-teal); }
.reveal .lineage .le.ours .thm { font-weight: 600; }
.reveal .lineage .le.ours .miss { color: var(--lean-teal); font-style: normal; font-weight: 600; }
.reveal .lineage .le.ours .miss::before { content: "\2713  "; color: var(--lean-teal); }

/* ---- two halves via Verso's own hstack/vstack ----
   reveal's .r-hstack has no sizing policy, so children must be told to share the row
   equally; min-width:0 is what lets a wide code block wrap instead of forcing overflow.
   List spacing inherited from lean.css is airy at full width and far too airy in a
   half-width column, so tighten it here only. */
.reveal .r-hstack > .r-vstack { flex: 1 1 0; min-width: 0; }
.reveal .r-vstack ul, .reveal .r-vstack ol { line-height: 1.45; }
.reveal .r-vstack li { margin-bottom: 0.12em; }
.reveal .r-vstack p { margin: 0.3em 0; }
.reveal .r-vstack > *:first-child { margin-top: 0; }

/* ---- autofit.js : a slide too full even at its smallest zoom gets a scrollbar
   rather than losing its last line. The box is 1280 x 720 box pixels; vh/vw are
   window units and reveal scales the box again, so they are a bug here ---- */
.reveal .slides section.autofit-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ---- .struck : a list item kept on the slide but withdrawn.  A separate <ul> because Verso's
   inline markup has no strikethrough and a list item cannot carry a class -- ref: Verso/Syntax.lean */
.reveal ul.struck { margin-bottom: 0; }
.reveal ul.struck li { text-decoration: line-through; color: #94a3b8; }

/* ---- the overview slide: the section list left, the joke right.  `paralever` is also BMW's
   shaft-drive rear end -- README.md:3 -- so the figure is that linkage and the caption is the
   README's own line, verbatim. */
.reveal section[data-state="overview"] .r-hstack { gap: 25.6px; align-items: center; }
.reveal section[data-state="overview"] .r-hstack > * { flex: 1 1 0; min-width: 0; }
.reveal section[data-state="overview"] .steps { font-size: 0.92em; }
.reveal section[data-state="overview"] .bmw svg { width: 100%; max-width: 420px; }
.reveal section[data-state="overview"] .bmw p {
  font-family: var(--sans); font-size: 1.15em; font-style: italic;
  color: #475569; line-height: 1.4; margin: 0.35em 0 0; text-align: center;
}

/* ---- the ParM slide: the four constructors left, one term drawn as a tree right.  The tree is
   taller than it is wide, so the figure cell keeps its own flex basis and the code panel is
   allowed to be the narrower of the two. */
.reveal section[data-state="parm"] .r-hstack { gap: 12.8px; align-items: center; }
.reveal section[data-state="parm"] .r-hstack > * { flex: 1 1 0; min-width: 0; }
.reveal section[data-state="parm"] .figwrap { margin: 0; }
.reveal section[data-state="parm"] .figwrap svg { width: 100%; height: auto; max-height: 560px; }
.reveal section[data-state="overview"] .bmw { display: block; width: 100%; }
.reveal section[data-state="overview"] .bmw img {
  width: auto; max-width: 100%; max-height: 300px; border-radius: 10px;
  display: block; margin: 0 auto; box-shadow: 0 2px 12px rgba(15, 23, 42, 0.2);
}
.reveal section[data-state="overview"] .bmw small {
  display: block; text-align: center; font-family: var(--sans);
  font-size: 0.4em; color: #94a3b8; margin-top: 0.25em;
}
.reveal section[data-state="overview"] .r-hstack > .figwrap.bmw { margin: 0; }
