/* ------------------------------------------------------- article stylesheet
   The long-form articles, loaded after site.css on article pages only.

   It carries no tokens of its own. The palette, the measure and the font stacks
   are declared once in site.css; this file only spends them. Load order is what
   makes the article rules win where the two overlap (`a`, `body`, `.wrap`), so
   article.css must stay second in <head>.                                    */
*{box-sizing:border-box}
body{
  background:var(--ground); color:var(--ink);
  font-family:var(--serif);
  font-size:17px; line-height:1.68;
  -webkit-font-smoothing:antialiased;
}
.wrap{max-width:1160px; margin:0 auto; padding-left:max(20px,env(safe-area-inset-left,0px)); padding-right:max(20px,env(safe-area-inset-right,0px))}
@media (min-width:1200px){.wrap{max-width:1240px}}
@media (min-width:1460px){.wrap{max-width:1320px}}
a{color:var(--a); text-decoration:none; border-bottom:1px solid color-mix(in srgb,var(--a) 35%,transparent)}
a:hover{border-bottom-color:var(--a)}
a:focus-visible,summary:focus-visible{outline:2px solid var(--a); outline-offset:3px; border-radius:2px}

.pull{
  margin:26px 0; padding:2px 0 2px 20px; border-left:3px solid var(--sec);
  font-style:italic; color:var(--ink-2); max-width:var(--measure)
}
.pull cite{
  display:block; margin-top:9px; font-style:normal;
  font-family:var(--sans); font-size:13px; color:var(--ink-3)
}
.refs{max-width:var(--measure); padding-left:0; list-style:none; margin:0}
.refs li{
  font-family:var(--sans); font-size:14px; line-height:1.55;
  color:var(--ink-2); padding:9px 0; border-bottom:1px solid var(--rule)
}
.refs li:last-child{border-bottom:0}
td.ok{color:var(--a); font-weight:600}
td.part-ok{color:var(--b); font-weight:600}
td.open{color:var(--warn); font-weight:600}

/* ---- masthead ---- */
.mast{border-bottom:1px solid var(--rule); padding-block:26px 0}
.eyebrow{
  font-family:var(--sans); font-size:11.5px; font-weight:600;
  letter-spacing:.13em; text-transform:uppercase; color:var(--a); margin:0
}
h1{
  font-family:var(--sans);
  font-size:clamp(30px,5.4vw,46px); font-weight:600; line-height:1.12;
  letter-spacing:-.022em; margin:14px 0 0; text-wrap:balance; max-width:20ch
}
.standfirst{
  font-size:clamp(17px,2.4vw,20px); color:var(--ink-2); margin:16px 0 0;
  max-width:60ch; line-height:1.5
}
.byline{
  font-family:var(--sans); font-size:13px; color:var(--ink-3);
  margin:22px 0 26px; display:flex; flex-wrap:wrap; gap:6px 14px; align-items:baseline
}
.byline code{font-size:12px}

/* ---- layout ---- */
.layout{display:block; padding-block:40px 72px}
@media (min-width:1020px){
  .layout{display:grid; grid-template-columns:200px minmax(0,1fr); gap:60px; align-items:start}
}
article{max-width:var(--measure)}

/* ---- toc ---- */
.toc{
  font-family:var(--sans); font-size:13px; line-height:1.45;
  border:1px solid var(--rule); border-radius:3px; background:var(--surface);
  padding:16px 18px; margin-bottom:38px
}
@media (min-width:1020px){
  /* below the sticky site header, and scrollable on its own when the series is
     longer than the screen, so its last rows are never out of reach */
  .toc{position:sticky; top:calc(env(safe-area-inset-top,0px) + var(--top-h) + 24px);
       max-height:calc(100vh - var(--top-h) - 48px); overflow-y:auto; overscroll-behavior:contain;
       scrollbar-width:thin; scrollbar-color:var(--rule-2) transparent;
       border:0; background:none;
       padding:0 4px 0 18px; margin:0; border-left:1px solid var(--rule)}
}
/* ---- the folded sidebar, above the article on narrow screens ---- */
.toc-toggle{
  display:flex; align-items:center; gap:10px; min-height:44px; margin:-16px -18px;
  padding:0 18px; cursor:pointer; list-style:none; color:var(--ink)
}
.toc-toggle::-webkit-details-marker{display:none}
.toc-toggle-k{
  font-size:11px; font-weight:600; letter-spacing:.13em; text-transform:uppercase;
  color:var(--ink-3); flex:none
}
.toc-toggle-t{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.toc-toggle svg{width:12px; height:12px; flex:none; color:var(--ink-3)}
.toc-toggle:hover svg, .toc-toggle:hover .toc-toggle-t{color:var(--a)}
.toc-toggle:focus-visible{outline:2px solid var(--a); outline-offset:-2px; border-radius:3px}
.toc-fold[open] > .toc-toggle{margin-bottom:12px; border-bottom:1px solid var(--rule)}
.toc-fold[open] > .toc-toggle svg{transform:rotate(180deg)}
@media (prefers-reduced-motion:no-preference){.toc-toggle svg{transition:transform .18s ease}}
@media (max-width:1019px){
  .toc-sections a, .toc-series > li > a{padding-block:10px; min-height:44px; display:flex; align-items:center}
}
/* the sidebar is a sidebar: no fold row */
@media (min-width:1020px){.toc-toggle{display:none}}
.toc-title{
  font-size:11px; font-weight:600; letter-spacing:.13em; text-transform:uppercase;
  color:var(--ink-3); margin:0 0 12px
}
.toc ol{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:9px}
.toc a{color:var(--ink-2); border:0; display:block}
.toc a:hover{color:var(--a)}
.toc .part{
  font-size:10.5px; font-weight:600; letter-spacing:.11em; text-transform:uppercase;
  color:var(--ink-3); margin-top:8px
}
.toc .part:first-child{margin-top:0}

/* ---- the sidebar is the series, with this article opened ---- */
.toc-title a{color:var(--ink-3); border:0}
.toc-title a:hover{color:var(--a)}
.toc-series{gap:11px !important}
.toc-series > li > a{display:flex; gap:8px; align-items:baseline; color:var(--ink-2)}
.toc-n{
  font-family:var(--mono); font-size:11px; color:var(--ink-3);
  flex:none; min-width:1.1em
}
.toc-here > a{color:var(--ink); font-weight:600}
.toc-here > a .toc-n{color:var(--a)}
.toc-sections{
  gap:7px !important; margin-top:9px !important; padding-left:13px !important;
  border-left:1px solid var(--rule); font-size:12.5px
}
.toc-sections a{color:var(--ink-3)}
/* which section the reader is actually in, tracked on scroll. The marker sits on
   the rule the list already draws, so nothing moves when it changes. */
.toc-sections{position:relative}
.toc-sections a.is-here{color:var(--a); font-weight:600}
.toc-sections li{position:relative}
.toc-sections a.is-here::before{
  content:""; position:absolute; left:-14px; top:.35em; bottom:.35em;
  width:2px; border-radius:1px; background:var(--a)
}
@media (prefers-reduced-motion:no-preference){
  .toc-sections a{transition:color .18s ease}
}
.toc-sections .part{margin-top:6px}

/* ---- prose ---- */
h2{
  font-family:var(--sans);
  font-size:clamp(20px,3vw,25px); font-weight:600; line-height:1.24; letter-spacing:-.014em;
  margin:52px 0 0; padding-top:20px; border-top:1px solid var(--rule); text-wrap:balance
}
h3{
  font-family:var(--sans);
  font-size:16.5px; font-weight:600; margin:32px 0 0; letter-spacing:-.005em
}
p{margin:16px 0 0}
strong{font-weight:600}
em{font-style:italic}
ul,ol{margin:16px 0 0; padding-left:1.25em; display:flex; flex-direction:column; gap:9px}
li::marker{color:var(--ink-3)}

.lede{font-size:19px; line-height:1.6}

code{
  font-family:var(--mono);
  font-size:.855em; background:var(--code-bg); color:var(--code-ink);
  padding:.12em .36em; border-radius:2px; overflow-wrap:anywhere
}
pre{
  margin:22px 0 0; background:var(--code-bg); border:1px solid var(--rule);
  border-radius:3px; padding:15px 16px; overflow-x:auto
}
pre code{
  background:none; padding:0; font-size:12.9px; line-height:1.62; display:block;
  white-space:pre; color:var(--code-ink); overflow-wrap:normal
}
.c-key{color:var(--sec); font-weight:600}
.c-typ{color:var(--a)}
.c-com{color:var(--ink-3); font-style:italic}
.c-str{color:var(--b)}
figure{margin:28px 0 0}
figcaption{
  font-family:var(--sans); font-size:12.5px; line-height:1.5;
  color:var(--ink-3); margin-top:10px
}
.srcref{
  font-family:var(--mono); font-size:12px; color:var(--ink-3);
  display:block; margin-top:8px
}

/* ---- tables ---- */
.tablewrap{overflow-x:auto; margin:24px 0 0; border:1px solid var(--rule); border-radius:3px; background:var(--surface)}
table{border-collapse:collapse; width:100%; min-width:460px; font-family:var(--sans); font-size:13.5px}
th{
  text-align:left; font-weight:600; font-size:11px; letter-spacing:.09em; text-transform:uppercase;
  color:var(--ink-3); padding:11px 14px; border-bottom:1px solid var(--rule-2); vertical-align:bottom
}
td{padding:11px 14px; border-top:1px solid var(--rule); vertical-align:top; line-height:1.5}
td code{font-size:12px; white-space:nowrap}
tbody tr:first-child td{border-top:0}

/* ---- callouts ---- */
.note{
  margin:26px 0 0; padding:15px 17px; background:var(--surface); border:1px solid var(--rule);
  border-left:2px solid var(--a); border-radius:0 3px 3px 0
}
.note.warn{border-left-color:var(--warn); background:var(--warn-fill)}
.note p{margin:0}
.note p + p{margin-top:11px}
.note-label{
  font-family:var(--sans); font-size:10.5px; font-weight:600;
  letter-spacing:.13em; text-transform:uppercase; color:var(--a); display:block; margin-bottom:7px
}
.note.warn .note-label{color:var(--warn)}

/* ---- step strip ---- */
.steps{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; margin:26px 0 0}
.step{border:1px solid var(--rule); border-radius:3px; background:var(--surface); padding:12px 12px 14px}
.step svg{display:block; width:100%; height:auto; max-width:100%}
.step-n{
  font-family:var(--mono); font-size:11px; font-weight:600; color:var(--ink-3);
  letter-spacing:.06em
}
.step-t{
  font-family:var(--sans); font-size:12.5px; font-weight:600;
  line-height:1.35; margin:2px 0 8px
}
.diagram{
  border:1px solid var(--rule); border-radius:3px; background:var(--surface); padding:16px 14px
}
.diagram svg{display:block; width:100%; height:auto}
.sv-l{font-family:var(--sans); font-size:11px; font-weight:500}
.sv-m{font-family:var(--mono); font-size:10.5px}
/* a halo in the diagram's own background, so a label stays readable where a
   wireframe line or an angle arc passes behind it */
.sv-l,.sv-m{paint-order:stroke; stroke:var(--surface); stroke-width:3px;
  stroke-linejoin:round; stroke-linecap:round}

/* ---- legend ---- */
.legend{display:flex; flex-wrap:wrap; gap:8px 18px; margin:14px 0 0;
  font-family:var(--sans); font-size:12px; color:var(--ink-2)}
.legend span{display:inline-flex; align-items:center; gap:6px}
.sw{width:11px; height:11px; border-radius:2px; display:inline-block; flex:none}

/* ---- checklist ---- */
.check{list-style:none; padding:0; margin:18px 0 0; display:flex; flex-direction:column; gap:14px}
.check li{padding-left:26px; position:relative}
.check li::before{
  content:""; position:absolute; left:0; top:.52em; width:9px; height:9px;
  border:1.5px solid var(--a); border-radius:1px
}
.footer{border-top:1px solid var(--rule); margin-top:56px; padding-block:22px 8px;
  font-family:var(--sans); font-size:12.5px; color:var(--ink-3)}

.figgrid{display:grid; gap:12px; margin:26px 0 0}
.figgrid.four{grid-template-columns:repeat(auto-fit,minmax(132px,1fr))}
.figgrid.two{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
.panel-s strong{color:var(--ink-2); font-weight:600}
.figgrid.three{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.panel{border:1px solid var(--rule); border-radius:3px; background:var(--surface); padding:11px 11px 13px}
.panel svg{display:block; width:100%; height:auto; max-width:100%}
.panel-t{font-family:var(--sans); font-size:12.5px; font-weight:600;
  line-height:1.3; margin:0 0 8px; color:var(--ink)}
.panel-s{font-family:var(--sans); font-size:11px; line-height:1.4;
  color:var(--ink-3); margin:8px 0 0}
td.keep{color:var(--a); font-weight:600}
td.del{color:var(--warn)}
@media (prefers-reduced-motion:reduce){*{animation:none!important; transition:none!important}}

/* A displayed formula: inline inside a sentence, or a paragraph on its own
   centred line. These were seven copies of the same inline style attribute. */
.eq{font-family:var(--serif)}
p.eq{text-align:center; font-size:19px; margin:20px 0}
.eq-lg{font-size:23px; letter-spacing:.02em}
p.eq-sm{font-size:18px; margin:18px 0}  /* qualified, or p.eq outranks it */
.eq-mono{font-family:var(--mono); font-size:16px}

/* ---- mathematics ----------------------------------------------------------
   MathML, set by the browser itself. Every engine has shipped MathML Core
   since Chromium 109 (January 2023); Firefox and Safari far longer. The
   alternative was a JS typesetter and its fonts -- a few hundred KB, a build
   step and a flash of unset markup -- on a site that otherwise ships no
   script at all. The formulas stay selectable, copyable and readable aloud.

   Convention the articles follow: a point is a bare italic letter, a vector
   carries an over-arrow. So `O` and `X` with an arrow are different kinds of
   thing on sight, which is the distinction part two opens with.            */
math{font-style:normal; font-size:1.05em}
/* Never set `display` on a MathML element. The UA stylesheet gives them
   `display: block math` / `inline math`, and the `math` part is what turns on
   MathML layout. Replacing it with a plain `block` leaves the element a normal
   CSS block, and the engine then stacks every <mi> and <mo> as its own
   full-width line -- the formula renders as a vertical column of single
   letters. It looks like a font problem and it is a display problem.        */
math[display="block"]{margin:20px 0}
.eqn{
  margin:24px 0 0; padding:4px 18px; background:var(--surface);
  border:1px solid var(--rule); border-left:2px solid var(--sec); border-radius:0 3px 3px 0;
  overflow-x:auto
}
.eqn math[display="block"]{margin:14px 0}
/* a surface is given twice: the three components the figure measures, then the
   same statement as one vector equation under a rule */
.eqn-comp math[display="block"]{margin:8px 0}
.eqn-gen{margin-top:14px; padding-top:12px; border-top:1px solid var(--rule)}
.eqn-gen math[display="block"]{margin:10px 0}
/* the inverse is a second equation about the same geometry, not the same one
   written again, so it gets the rule the vector form gets and a word to say
   which direction it runs in */
.eqn-inv{margin-top:14px; padding-top:11px; border-top:1px solid var(--rule)}
.eqn-inv math[display="block"]{margin:9px 0 11px}
.inv-label{
  display:block; font-family:var(--sans); font-size:10.5px; font-weight:600;
  letter-spacing:.09em; text-transform:uppercase; color:var(--ink-3)
}
.eqn-where{
  font-family:var(--sans); font-size:12.5px; line-height:1.5; color:var(--ink-3);
  margin:0 0 14px; padding-top:2px
}
.eqn-where em{font-style:italic; color:var(--ink-2)}
/* the note carries the identity a periodic interval stands for, and MathML set
   at the note's own 12.5px is a size below legible */
.eqn-where math{font-size:1.15em; color:var(--ink-2)}
/* in a panel caption the formula is a label, so it sits at caption weight but
   must not inherit the caption's grey -- MathML at 11px goes illegible fast */
.panel-s math{font-size:1.16em; color:var(--ink-2)}
p math{font-size:1.02em}

/* A deck under the h1: the article's title is shared with its companion, and
   this line is what separates them. It is deliberately not numbered -- the
   eyebrow already carries the series part number, and a second "Part 1" on the
   same masthead reads as a contradiction. */
.deck{
  font-family:var(--sans); font-size:clamp(15px,2.1vw,17.5px); font-weight:600;
  line-height:1.35; color:var(--sec); margin:12px 0 0; max-width:46ch
}
