/* bourgain.css: styles for the Bourgain digestion, included automatically by `rsm build bourgain.rsm`.
   Colors come from BRAIID tokens; light and dark values are paired with light-dark(), as BRAIID does. */
.bgw{text-align:left}
/* Figure palette ("Earth"): teal (the accent) only for intentional highlights; muted earth hues for everything else.
   --fig-hi highlight · --fig-sec counterpart in a paired contrast · --fig-mark marks (the set A, rings, the gap note)
   --fig-mark2 second annotation and warnings · --fig-quiet de-emphasized data · --fig-s1..s5 categorical scale segments */
:root{--fig-sec:light-dark(#A65A3A,#DE9A7C);--fig-mark:light-dark(#4A6584,#9DB4D0);--fig-mark2:light-dark(#A07A2C,#D7B56A);--fig-quiet:light-dark(#7F8DA0,#7D8A9B);--fig-s1:light-dark(#4A6584,#9DB4D0);--fig-s2:light-dark(#A07A2C,#D7B56A);--fig-s3:light-dark(#7E5A86,#C0A0C8);--fig-s4:light-dark(#6F7F45,#AFC183);--fig-s5:light-dark(#A65A3A,#DE9A7C)}
[data-accent]{--fig-hi:var(--primary-700)} /* resolved where the accent palette lives */
.bgw,#eq-bounds{--bg:var(--surface-page);--fg:var(--text-body);--muted:var(--text-subtle);--env:var(--surface-primary);--rule:var(--border-primary);
  --teal:var(--fig-hi);--coral:var(--fig-sec);--accent:var(--fig-mark);--c1:var(--fig-mark);--c2:var(--fig-mark2);--warn:var(--fig-mark2)}
figure:has(.bgw-support){display:none}
.manuscriptwrapper .author-block{margin-block-end:0}
#byline .hr-content-zone>p{margin-block-start:0}
#byline{margin-block-start:-1.4rem}
#byline .hr-content-zone>p{padding-block-start:0}
#byline>.hr-content-zone{color:var(--text-subtle);font-size:.95em}
.paragraph.goal{--goal:var(--primary-700)}
.paragraph.goal>.hr-content-zone{border-top:1px solid color-mix(in srgb,var(--goal) 45%,var(--border-primary));border-bottom:1px solid color-mix(in srgb,var(--goal) 45%,var(--border-primary));background:color-mix(in srgb,var(--goal) 4%,transparent);padding:.9em 1.5em;margin:0}
/* The box's spacing sits on the block, not inside it, so a selected Question's tint is one band from the rail to the info zone, as on any block. */
.paragraph.goal.hr{margin-block:.6em}
/* the guiding questions: a run-in label, the way the manuscript sets Proof. and Sketch. */
.paragraph.goal>.hr-content-zone>p::before{content:"Question. ";font-weight:700;color:var(--primary-700)}
.bgw .tet-orn{text-align:center}
.bgw .fig{margin:1.4em 0}
.bgw .fig .panels{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-end;gap:18px 6px}
.bgw .fig svg.panel{display:block;flex:0 1 auto;max-width:100%;height:auto}
.bgw .fig svg{width:100%;height:auto;display:block}
.bgw .fig .e{stroke:var(--fg);stroke-width:1.5}
.bgw .fig .pt{fill:var(--fg)}
.bgw .fig .tri{fill:none;stroke:var(--muted);stroke-width:1;stroke-dasharray:4 3}
.bgw .fig .bad{fill:none;stroke:var(--warn);stroke-width:2}
.bgw .fig .lab{fill:var(--fg);font:italic 14px var(--font-body)}
.bgw .fig .num{fill:var(--muted);font:13px var(--font-body)}
.bgw .fig .cell{fill:none;stroke:var(--rule);stroke-width:1}
.bgw .fig .cell.st{fill:var(--teal);fill-opacity:.18;stroke:var(--teal)}
.bgw .fig .cell.sh{fill:var(--coral);fill-opacity:.18;stroke:var(--coral)}
.bgw .fig .val{fill:var(--fg);font:14px var(--font-body)}
.bgw .fig .ain{fill:var(--accent);stroke:var(--accent)}
.bgw .fig .vbox{fill:var(--bg);stroke:var(--rule);stroke-width:1}
.bgw .fig .vbox.sep{fill:var(--coral);fill-opacity:.18;stroke:var(--coral)}
.bgw .fig .vbox.same{fill:var(--muted);fill-opacity:.12;stroke:var(--muted)}
.bgw .fig .e.h1{stroke:var(--teal);stroke-width:2.5}
.bgw .fig .e.h2{stroke:var(--coral);stroke-width:2.5}
.bgw .fig .e.join{stroke:var(--fg);stroke-width:2.5}
.bgw .fig .pt.h1{fill:var(--teal)}
.bgw .fig .pt.h2{fill:var(--coral)}
.bgw .fig .aring{fill:none;stroke:var(--accent);stroke-width:2}
.bgw .fig .cap{fill:var(--muted);font:13px var(--font-body)}
.bgw .fig .g9-off{stroke:var(--muted);stroke-width:1.2;stroke-dasharray:3 4;opacity:.6}
.bgw .fig .g9-uv{stroke:var(--coral);stroke-width:2;stroke-dasharray:5 4}
.bgw .fig .g9-path{stroke:var(--teal);stroke-width:3}
.bgw .fig .pt.g9-end{fill:var(--coral)}
.bgw .fig svg.tree{display:block;width:300px;max-width:100%;height:auto;margin:0 auto}
.bgw svg.tree .e{stroke:var(--fg);stroke-width:1.5;fill:none;transition:opacity .25s,stroke-width .25s,stroke .25s}
.bgw svg.tree .e.h1{stroke:var(--teal);stroke-width:2.5}
.bgw svg.tree .e.h2{stroke:var(--coral);stroke-width:2.5}
.bgw svg.tree .e.join{stroke-width:2.5}
.bgw svg.tree .pt{fill:var(--fg);transition:opacity .25s}
.bgw svg.tree .pt.h1{fill:var(--teal)}
.bgw svg.tree .pt.h2{fill:var(--coral)}
.bgw svg.tree .aring{fill:none;stroke:var(--accent);stroke-width:2;opacity:0;transition:opacity .25s}
.bgw svg.tree .aring.on{opacity:1}
.bgw svg.tree .lab{fill:var(--fg);font:italic 15px var(--font-body)}
.bgw svg.tree .axis{stroke:var(--muted);stroke-width:1}
.bgw svg.tree .tick{fill:var(--muted);font:13px var(--font-body)}
.bgw svg.tree .guide{stroke:var(--accent);stroke-width:1;stroke-dasharray:3 3;opacity:0;transition:opacity .25s}
.bgw svg.tree .seg{stroke-width:5;stroke-linecap:round;opacity:0;transition:opacity .25s}
.bgw svg.tree .seg-dxy{stroke:var(--fg)}
.bgw svg.tree .seg-dlow{stroke:var(--c2)}
.bgw svg.tree .seg-gap{stroke:var(--c1)}
.bgw svg.tree .qlab{fill:var(--muted);font:italic 13px var(--font-body);opacity:0;transition:opacity .25s}
.bgw svg[data-mode]:not([data-mode=""]) .out{opacity:.2}
.bgw svg[data-mode="gap"] .seg-gap,.bgw svg[data-mode="gap"] .seg-dlow,.bgw svg[data-mode="gap"] .guide{opacity:1}
.bgw svg.tree[data-mode="gap"] .e.bar-xlow,.bgw svg.tree[data-mode="gap"] .e.bar-join{stroke:var(--c1);stroke-width:3.5}
.bgw svg[data-mode="p"] .qlab,.bgw svg[data-mode="p2"] .qlab{opacity:1}
.bgw svg.tree[data-mode="p"] .e.h1,.bgw svg.tree[data-mode="p"] .e.h2,.bgw svg.tree[data-mode="p2"] .e.h1,.bgw svg.tree[data-mode="p2"] .e.h2{stroke-width:3.5}
.bgw svg[data-mode="mid"] .seg-dxy,.bgw svg[data-mode="mid"] .g-join,.bgw svg[data-mode="p2"] .seg-dxy,.bgw svg[data-mode="p2"] .g-join{opacity:1}
.bgw svg.tree[data-mode="mid"] .e.bar-join,.bgw svg.tree[data-mode="p2"] .e.bar-join{stroke:var(--fg);stroke-width:3.5}
.bgw svg[data-mode="b2"] .seg-dlow,.bgw svg[data-mode="b2"] .seg-dxy,.bgw svg[data-mode="b2"] .guide{opacity:1}
.bgw svg.tree[data-mode="b2"] .e.bar-xlow,.bgw svg.tree[data-mode="b2"] .e.bar-ylow{stroke:var(--c2);stroke-width:3.5}
.bgw svg[data-mode="hi"] .seg-dlow,.bgw svg[data-mode="hi"] .seg-dxy,.bgw svg[data-mode="hi"] .guide{opacity:1}
.bgw svg.tree[data-mode="hi"] .e.bar-xlow,.bgw svg.tree[data-mode="hi"] .e.bar-ylow{stroke:var(--c2);stroke-width:3.5}
.bgw svg.tree[data-mode="hi"] .e.bar-join{stroke:var(--fg);stroke-width:3.5}
.bgw svg.tree[data-mode="gap"] .seg-dlow{stroke:var(--muted)}
.bgw svg.tree.plain .e.h1,.bgw svg.tree.plain .e.h2{stroke:var(--fg);stroke-width:1.5}
.bgw svg.tree.plain .e.join{stroke-width:1.5}
.bgw svg.tree.plain .pt.h1,.bgw svg.tree.plain .pt.h2{fill:var(--fg)}
.bgw svg.tree .lvl{fill:var(--muted);font:13px var(--font-body)}
@media (min-width:640px){
  @media (prefers-reduced-motion: reduce){.bgw .lblock{transition:none}}
}
@media (min-width:640px){
  .bgw .fig .panels{flex-wrap:nowrap}
  .bgw .fig svg.panel{flex:0 1 auto;min-width:0}
}

/* ===== Look & feel: paper background, accent-led rails and headings ===== */


/* paper */
:root{--surface-page:light-dark(#FAF7F0,#272522);--surface-primary:light-dark(#F2EDE2,#312E2A);--border-primary:light-dark(#DDD5C5,#4A453E);--handrail-default:light-dark(#D6CDBB,#625B53);--text-body:light-dark(#2E2A25,#E8E2D6);--text-subtle:light-dark(#6F675C,#A39B8E)}
body,.manuscriptwrapper{background:var(--surface-page)!important;color:var(--text-body)}

/* rails and headings: thick accent rails on results and sections, thick neutral rails elsewhere */
.manuscriptwrapper :is(.theorem,.lemma,.proposition,.corollary,.problem,.heading)>.hr-border-zone>.hr-border-rect{border-left:3px solid var(--primary-500)}
/* a folded block's foot (RSM draws it in the neutral rail colour) follows the accent rail */
.manuscriptwrapper .hr:is(.theorem,.lemma,.proposition,.corollary,.problem,.heading).hr-collapsed>.hr-spacer-zone,
.manuscriptwrapper .hr:is(.theorem,.lemma,.proposition,.corollary,.problem,.heading).hr-collapsed>.hr-border-zone>.hr-border-rect{border-bottom-color:var(--primary-500)}
.manuscriptwrapper :is(.example,.proof,.sketch)>.hr-border-zone>.hr-border-rect{border-left:3px solid var(--handrail-default)}
/* a folded block's foot is as thick as its 3px rail (RSM's foot is 4px on headings, 2px on labelled blocks) */
.manuscriptwrapper .hr:is(.theorem,.lemma,.proposition,.corollary,.problem,.heading,.example,.proof).hr-collapsed>.hr-spacer-zone,
.manuscriptwrapper .hr:is(.theorem,.lemma,.proposition,.corollary,.problem,.heading,.example,.proof).hr-collapsed>.hr-border-zone>.hr-border-rect{border-bottom-width:3px}
.manuscriptwrapper .hr.hr-labeled>.hr-content-zone>.hr-label{border-bottom:none;margin-bottom:0}
.manuscriptwrapper :is(.theorem,.lemma,.proposition,.corollary,.problem)>.hr-content-zone>.hr-label span.label{color:var(--primary-700)}
.manuscriptwrapper h2{color:var(--text-body)}

/* ===== Look & feel: structured proofs ===== */
/* keywords: small caps in the accent; the turnstile stays a symbol, in the accent */
.manuscriptwrapper .keyword{color:var(--text-keyword);text-transform:lowercase;font-variant:small-caps;font-weight:600;letter-spacing:.04em}
.manuscriptwrapper .construct.claim>.keyword{text-transform:none;font-variant:normal;font-weight:400;letter-spacing:0;margin-right:.15em}
/* sketch: no block, no rail; the label runs into the paragraph */
.manuscriptwrapper .sketch>.hr-border-zone>.hr-border-rect{border-left-color:transparent!important}
/* the label stays in the DOM for screen readers; sighted readers get a run-in lead (no extra speech) */
.manuscriptwrapper .sketch>.hr-content-zone>.hr-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.manuscriptwrapper .sketch>.hr-content-zone p:first-of-type::before{content:"Sketch. ";content:"Sketch. "/"";font-style:italic;font-weight:600;color:var(--text-body)}
.manuscriptwrapper .sketch>.hr-content-zone{color:var(--text-body)}
/* header: step count (RSM does not emit it; see Bead 21) */
/* inside: thinner rails for steps and justifications */
.manuscriptwrapper .proof .hr .hr-border-rect{border-left-width:1px!important}

/* ===== Look & feel: AI disclosure as a labeled row before the references =====
   5rem of space above its top rule and below its bottom rule, as around the
   tetrahedron. The text above brings 1rem + 1px and the Notes below 2.5rem + 2px
   of their own, so the margins make up the rest. */
.paragraph.ai-disclosure>.hr-content-zone{display:grid;grid-template-columns:8.5rem 1fr;column-gap:1.2rem;border-top:1px solid var(--border-primary);padding-top:1rem;margin-top:calc(4rem - 1px)}
/* The licence line sits under the disclosure, inside the same rules, in the text column. */
.paragraph.ai-disclosure.hr{margin-bottom:0}
.paragraph.licence.hr{margin-top:0}
.paragraph.licence>.hr-content-zone{display:grid;grid-template-columns:8.5rem 1fr;column-gap:1.2rem;border-bottom:1px solid var(--border-primary);padding-top:.5rem;padding-bottom:1rem;margin-bottom:calc(2.5rem - 2px)}
.paragraph.licence>.hr-content-zone::before{content:""}
.paragraph.licence>.hr-content-zone>p{grid-column:2;margin:0;padding:0;color:var(--text-subtle);font-size:.85em;line-height:1.55}
.paragraph.ai-disclosure>.hr-content-zone::before{content:"AI disclosure";font-size:.8rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--primary-700);padding-top:.2rem}
.paragraph.ai-disclosure>.hr-content-zone>p{margin:0;padding:0;color:var(--text-subtle);font-size:.93em;line-height:1.55}
@media (max-width:640px){.paragraph.ai-disclosure>.hr-content-zone{grid-template-columns:1fr;row-gap:.3rem}.paragraph.licence>.hr-content-zone{grid-template-columns:1fr}.paragraph.licence>.hr-content-zone::before{display:none}.paragraph.licence>.hr-content-zone>p{grid-column:1}}
/* (6.1) is the paper's only calc: indent the continuation steps so their relation signs sit under the first one. 7.32em is the width of the first step's left side at the math font size. */
#eq-onepair .step~.step>.hr-content-zone>.statement mjx-container{margin-left:7.32em;width:auto!important;min-width:0!important}
/* The tetrahedron between the abstract and the contents: 5rem of space on each
   side of the drawn shape. The abstract and the contents bring 1rem of their own
   (in rem, so the sides stay even as the type scales), the drawing sits a few
   pixels inside its box, and the ornament's padding makes up the rest. Measured
   equal at 375, 768, 1280 and 1600px wide. */
figure:has(.tet-orn){margin-block:0}
.manuscriptwrapper .tet-orn{margin:0!important;padding:calc(4rem - 3px) 0 calc(4rem - 6px)}
.manuscriptwrapper .tet-orn svg{display:block;margin-inline:auto}
/* A selected Question box is highlighted like any other selected block: its own grey fill gives way to the selection tint. */
.manuscriptwrapper .paragraph.goal.hr:is(.active,:focus)>.hr-content-zone{background:var(--primary-50)}
/* Asides and Question boxes are tinted, and on the dark tint the link teal falls under 4.5:1.
   One step lighter on the same scale, dark only. */
.manuscriptwrapper :is(.aside,.paragraph.goal) a.reference:is(:link,:visited){color:light-dark(var(--primary-700),var(--primary-800))}
.manuscriptwrapper :is(.aside,.paragraph.goal) a.reference:hover{color:light-dark(var(--primary-800),var(--primary-900))}
