
  :root {
    --paper: #fff; --ink: #000; --graphite: #5c5c5c; --muted: #9a9a9a; --hair: #e6e6e6;
    --blue: #2a78d6; --orange: #eb6834; --aqua: #1baf7a; --yellow: #eda100; --red: #e34948; --mid: #f0efec; --gray: #b3b3b3;
    --page: 880px; --read: 640px; --gut: 48px; --side: 232px;
    --ease: cubic-bezier(.2, .7, .1, 1);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { background: var(--paper); }
  body { font-family: "STIX Two Text", Georgia, serif; font-size: 18px; line-height: 1.6; color: var(--ink); background: var(--paper); font-variant-numeric: oldstyle-nums proportional-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
  ::selection { background: var(--ink); color: var(--paper); }
  p, li { text-wrap: pretty; }
  a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-thickness .2s; }
  a:hover { text-decoration-thickness: 2px; }
  a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
  button { font: inherit; color: inherit; }
  .page { width: min(var(--page), calc(100% - 48px)); margin: 0 auto; padding: 92px 0 110px; }
  .m { font-style: italic; }
  .qed { float: right; margin-left: 12px; }
  svg text { font-family: "STIX Two Text", Georgia, serif; fill: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
  svg .t2 { fill: var(--graphite); }
  .katex { font-size: 1.06em; }
  .katex-display { margin: 20px 0; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

  .bar { position: fixed; inset: 0 0 auto 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--hair); transform: translateY(-101%); transition: transform .45s var(--ease); }
  .bar.show { transform: none; }
  .bar-in { width: min(var(--page), calc(100% - 48px)); margin: 0 auto; height: 52px; display: flex; align-items: center; justify-content: space-between; font-size: 16px; }
  .bar-in nav { display: flex; gap: 22px; }
  .bar-name { text-decoration: none; font-weight: 500; }
  .prog { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); }

  .head { text-align: center; }
  .name { font-size: 48px; font-weight: 500; line-height: 1.06; letter-spacing: -0.008em; }
  .affil { font-style: italic; color: var(--graphite); margin-top: 8px; }
  .lead { font-size: 21px; line-height: 1.45; margin: 24px auto 0; max-width: 30em; text-wrap: balance; }
  .links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 26px; margin-top: 16px; }
  .rule { height: 1px; background: var(--ink); margin-top: 40px; transform-origin: center; }
  h2.sec { font-size: 19px; font-weight: 600; margin-top: 60px; }
  .row { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-top: 14px; }
  .row .when { color: var(--graphite); font-size: 16px; white-space: nowrap; }
  .sub { color: var(--graphite); }
  .course { margin-top: 10px; font-size: 16.5px; line-height: 1.55; }
  .course .lab { font-style: italic; }

  .rv { opacity: 0; transition: opacity .9s var(--ease); }
  .rv.in { opacity: 1; }

  .res { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--side); column-gap: var(--gut); margin-top: 34px; }
  .t { font-weight: 600; font-size: 19px; text-decoration: none; display: inline-block; background-image: linear-gradient(var(--ink), var(--ink)); background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 94%; transition: background-size .4s var(--ease); }
  .t::after { content: ""; position: absolute; inset: -12px -16px; z-index: 0; }
  .res:hover .t, .t:focus-visible { background-size: 100% 1px; }
  .res p { margin-top: 6px; }
  .meta { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 8px; font-size: 15.5px; position: relative; z-index: 1; }
  .meta .st { color: var(--graphite); }
  .meta .more { text-decoration: none; }
  .meta .more:hover { text-decoration: underline; }
  .mini { padding-top: 6px; }
  .mini svg { width: 100%; height: auto; display: block; overflow: visible; }
  .mini .cap { font-size: 12.5px; line-height: 1.35; color: var(--graphite); margin-top: 8px; transition: color .2s; }
  .res:hover .mini .cap { color: var(--ink); }
  .comp p { margin-top: 12px; }
  footer { margin-top: 96px; padding-top: 16px; border-top: 1px solid var(--hair); font-size: 15px; color: var(--graphite); display: flex; justify-content: space-between; gap: 24px; }

  .mn-ax { stroke: var(--hair); stroke-width: 1; }
  .mn-b { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .mn-o { fill: none; stroke: var(--orange); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .mn-od { fill: none; stroke: var(--orange); stroke-width: 2; stroke-dasharray: 1 5; stroke-linecap: round; }
  .mn-flip { transform-box: view-box; transform-origin: 0 40px; transform: scaleY(-1); transition: transform .7s var(--ease); }
  .res:hover .mn-flip { transform: scaleY(1); }
  .mn-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .res.in .mn-draw { animation: redraw 1.2s var(--ease) .2s both; }
  .res.in:hover .mn-draw { animation: redraw2 .9s var(--ease) both; }
  @keyframes redraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  @keyframes redraw2 { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  .mn-cell { opacity: 0; transition: opacity .5s var(--ease); }
  .res.in .mn-cell { opacity: 1; }
  .res.in:hover .mn-cell { animation: fillin .8s var(--ease) both; }
  @keyframes fillin { from { opacity: 0; } to { opacity: 1; } }
  .mn-slide { transition: transform .8s var(--ease), opacity .8s var(--ease); transform: translateX(40px); opacity: 0; }
  .res.in .mn-slide { transform: none; opacity: 1; transition-delay: .5s; }
  .res.in:hover .mn-slide { animation: slidein .8s var(--ease) both; }
  @keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .sq { fill: var(--paper); stroke: var(--gray); stroke-width: 1; transition: fill .35s, stroke .35s; }
  .sq.on { fill: var(--blue); stroke: var(--blue); }
  .sq.was { fill: #cde2fb; stroke: #cde2fb; }
  .res.in:hover .sq.cw { animation: drop1 2.6s steps(1, end) both; }
  .res.in:hover .sq.fdr { animation: drop2 2.6s steps(1, end) both; }
  @keyframes drop1 { 0% { fill: var(--blue); } 30% { fill: #cde2fb; } }
  @keyframes drop2 { 0% { fill: var(--blue); } 62% { fill: #cde2fb; } }

  /* article pages */
  .a-head { text-align: center; }
  .a-h1 { font-size: 44px; font-weight: 500; line-height: 1.1; letter-spacing: -0.008em; display: inline-block; text-wrap: balance; }
  .a-sub { font-style: italic; font-size: 20px; line-height: 1.4; margin: 14px auto 0; max-width: 32em; text-wrap: balance; }
  .a-meta { color: var(--graphite); font-size: 16px; margin-top: 10px; }
  .a-links { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; margin-top: 12px; font-size: 16px; }
  .read { width: min(var(--read), 100%); margin: 0 auto; }
  .read > p { margin-top: 12px; }
  .abstract { margin-top: 40px; font-size: 17.5px; line-height: 1.6; }
  .abstract b { font-weight: 600; }
  .a-h2 { font-size: 20px; font-weight: 600; margin-top: 60px; }
  .thm { margin: 26px 0 8px; }
  .thm-h { font-weight: 600; }
  .thm-note { color: var(--graphite); font-size: 16px; margin-top: -4px; }
  .did { list-style: none; margin-top: 8px; }
  .did li { margin-top: 14px; }
  .did b { font-weight: 600; }
  .tools { margin-top: 12px; color: var(--graphite); }
  .next { margin-top: 80px; padding-top: 18px; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; gap: 24px; font-size: 16px; }

  .scrolly { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 48px; margin-top: 56px; }
  .sc-fig { position: sticky; top: 16vh; align-self: start; min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }
  .sc-fig svg { width: 100%; height: auto; display: block; overflow: visible; }
  .legend { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; font-size: 14.5px; color: var(--graphite); margin: 0 0 12px; }
  .key { display: inline-flex; align-items: center; gap: 8px; }
  .key i { display: inline-block; width: 18px; height: 2px; }
  .key i.dash { background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 6px); }
  .key i.sw { width: 11px; height: 11px; border-radius: 2px; }
  .key i.dot { width: 10px; height: 10px; border-radius: 50%; }
  .sc-steps { padding: 18vh 0 24vh; }
  .step { min-height: 58vh; display: flex; align-items: center; }
  .step p { color: var(--muted); transition: color .35s var(--ease); font-size: 17.5px; }
  .step.on p { color: var(--ink); }

  figure.fig { margin: 44px auto 8px; width: min(var(--page), 100%); }
  figure.fig svg { width: 100%; height: auto; display: block; overflow: visible; }
  figure.fig figcaption { width: min(var(--read), 100%); margin: 12px auto 0; font-size: 15px; line-height: 1.5; color: var(--graphite); }
  figure.fig figcaption b { color: var(--ink); font-weight: 600; }
  .fig .drawn { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .fig.in .drawn { animation: redraw 1.4s var(--ease) .15s both; }
  .fig .grow { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); }
  .fig.in .grow { transform: scaleX(1); transition: transform 1.1s var(--ease) .15s; }
  .fig .late { opacity: 0; }
  .fig.in .late { opacity: 1; transition: opacity .6s ease .9s; }
  .ctl { width: min(var(--read), 100%); margin: 18px auto 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px 28px; font-size: 16px; }
  .ctl label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
  .ctl .nw { white-space: nowrap; }
  .verdict { font-style: italic; color: var(--graphite); }
  .fig.same .verdict { color: var(--ink); font-style: normal; font-weight: 600; }
  input[type=range] { -webkit-appearance: none; appearance: none; width: 190px; height: 22px; background: transparent; cursor: pointer; }
  input[type=range]::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
  input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink); margin-top: -6px; }
  input[type=range]::-moz-range-track { height: 1px; background: var(--ink); }
  input[type=range]::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink); }
  input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 13px; height: 13px; border: 1.5px solid var(--ink); cursor: pointer; transition: background-color .15s; }
  input[type=checkbox]:checked { background: var(--ink); }
  output { display: inline-block; min-width: 3.2em; font-variant-numeric: lining-nums tabular-nums; }
  .ln-b { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke-width .4s var(--ease); }
  .ln-o { fill: none; stroke: var(--orange); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .ln-od { fill: none; stroke: var(--orange); stroke-width: 2.2; stroke-dasharray: 1 6; stroke-linecap: round; }
  .fig.same .ln-b { stroke-width: 4; }
  .grid { stroke: var(--hair); stroke-width: 1; }
  .thr { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 4; }
  table.bk { border-collapse: collapse; margin: 22px auto 0; font-variant-numeric: lining-nums tabular-nums; font-size: 16px; }
  .bk caption { caption-side: bottom; text-align: left; font-size: 15px; color: var(--graphite); padding-top: 10px; }
  .bk caption b { color: var(--ink); font-weight: 600; }
  .bk th, .bk td { padding: 6px 0 6px 28px; text-align: right; }
  .bk th:first-child, .bk td:first-child { text-align: left; padding-left: 0; }
  .bk thead th { border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--ink); font-weight: 600; padding-top: 9px; padding-bottom: 9px; }
  .bk tbody tr:last-child td { border-bottom: 1.5px solid var(--ink); }
  .bk tr.total td { border-top: 1px solid var(--ink); font-weight: 600; }
  code, pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14.5px; }
  pre.install { margin-top: 14px; padding: 12px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); overflow-x: auto; }

  #tip { position: fixed; z-index: 30; pointer-events: none; background: var(--paper); border: 1px solid var(--ink); padding: 6px 10px; font-size: 14px; line-height: 1.35; opacity: 0; transition: opacity .12s; max-width: 280px; }
  #tip.show { opacity: 1; }
  #tip b { display: block; font-weight: 600; font-variant-numeric: lining-nums; }
  #tip span { color: var(--graphite); }

  @media (prefers-reduced-motion: no-preference) {
    body.intro .name { animation: settle 1.15s var(--ease) both; }
    body.intro .rule { animation: draw 1s var(--ease) .3s both; }
    body.intro .after { animation: appear .9s ease .6s both; }
  }
  @keyframes settle { from { letter-spacing: .18em; opacity: 0; } to { letter-spacing: -0.008em; opacity: 1; } }
  @keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes appear { from { opacity: 0; } to { opacity: 1; } }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .26s; }
  ::view-transition-group(*) { animation-duration: .52s; animation-timing-function: cubic-bezier(.2, .7, .1, 1); }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .rv, .mn-cell, .mn-slide, .fig .late { opacity: 1 !important; transform: none !important; }
    .mn-draw, .fig .drawn { stroke-dashoffset: 0 !important; }
    .fig .grow { transform: none !important; }
  }
  @media (max-width: 820px) {
    .res { grid-template-columns: minmax(0, 1fr); }
    .mini { max-width: 280px; margin-top: 14px; }
    .name { font-size: 38px; }
    .a-h1 { font-size: 34px; }
    .scrolly { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .sc-fig { top: 52px; min-height: 0; background: var(--paper); z-index: 2; padding: 12px 0; }
    .sc-steps { padding-top: 6vh; }
    .step { min-height: 50vh; }
  }

/* ---------- v6 additions ---------- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-field { position: relative; width: min(760px, 100%); margin: 0 auto; }
.hero-field canvas { width: 100%; height: auto; display: block; }
.hero-fallback { display: none; font-size: 48px; font-weight: 500; text-align: center; }
html:not(.js) .hero-fallback { display: block; }
html:not(.js) .hero-field canvas { display: none; }
.hero-cap { font-size: 14.5px; line-height: 1.5; color: var(--graphite); max-width: 36em; margin: 10px auto 0; text-wrap: balance; }
.hero-ctl { margin-top: 12px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.hero-out { font-size: 14.5px; min-height: 1.5em; margin-top: 8px; color: var(--ink); font-variant-numeric: lining-nums; }
.hero-w { display: flex; justify-content: center; gap: 22px; margin-top: 10px; }
.hero-w figure { text-align: center; }
.hero-w canvas { width: 96px; height: 96px; image-rendering: pixelated; border: 1px solid var(--hair); display: block; }
.hero-w figcaption { font-size: 13px; color: var(--graphite); margin-top: 4px; }
.btn { font: inherit; font-size: 15px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); padding: 5px 14px; cursor: pointer; transition: background-color .2s, color .2s; }
.btn:hover:not([disabled]) { background: var(--ink); color: var(--paper); }
.btn[disabled] { opacity: .4; cursor: default; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.intro-note { margin-top: 12px; color: var(--graphite); font-size: 16.5px; }
h3.grp { font-size: 17px; font-weight: 600; font-style: italic; margin-top: 40px; }
.eng { display: flex; flex-wrap: wrap; gap: 2px 20px; margin-top: 6px; font-size: 14px; color: var(--graphite); font-variant-numeric: lining-nums; position: relative; z-index: 1; }
dl.tools-dl { display: grid; grid-template-columns: 11em 1fr; gap: 8px 20px; margin-top: 14px; font-size: 16.5px; }
dl.tools-dl dt { font-style: italic; color: var(--graphite); }
.stats { width: min(var(--read), 100%); margin: 28px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.stats div { padding: 10px 0 10px 14px; border-left: 1px solid var(--hair); }
.stats div:first-child { border-left: 0; padding-left: 0; }
.stats i { display: block; font-size: 13.5px; color: var(--graphite); }
.stats b { font-weight: 500; font-size: 17px; font-variant-numeric: lining-nums; }
.live { width: min(var(--page), 100%); margin: 40px auto 8px; }
.live .ctl { margin-top: 14px; }
.live .live-out { width: min(var(--read), 100%); margin: 10px auto 0; text-align: center; font-size: 15px; font-variant-numeric: lining-nums tabular-nums; min-height: 1.5em; }
.live figcaption, .live .cap { width: min(var(--read), 100%); margin: 10px auto 0; font-size: 15px; line-height: 1.5; color: var(--graphite); }
.live .cap b { color: var(--ink); font-weight: 600; }
.live svg { width: 100%; height: auto; display: block; overflow: visible; }
.arch { width: min(var(--page), 100%); margin: 30px auto 6px; }
.arch svg { width: 100%; height: auto; display: block; overflow: visible; }
.arch .box { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.arch .box.key { fill: var(--ink); }
.arch .lbl { font-size: 13px; }
.arch .box.key + .lbl, .arch .lbl.inv { fill: var(--paper); }
.arch .wire { fill: none; stroke: var(--ink); stroke-width: 1; }
.arch .pulse { fill: var(--blue); }
.arch-cap { width: min(var(--read), 100%); margin: 8px auto 0; font-size: 15px; color: var(--graphite); }
.arch .wire { stroke-dasharray: 1; stroke-dashoffset: 1; }
.arch.in .wire { animation: redraw 1s var(--ease) both; }
pre.code { width: min(var(--read), 100%); margin: 18px auto 0; padding: 14px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
pre.code .k { font-weight: 700; }
pre.code .c { color: var(--graphite); font-style: italic; }
pre.code .s { color: #1d5aa6; } /* chart blue fails AA contrast at code size */
.practice { margin-top: 10px; }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, 1fr); } .stats div:nth-child(3) { border-left: 0; padding-left: 0; } dl.tools-dl { grid-template-columns: minmax(0, 1fr); } }

/* ---------- v7: Brownian page furniture and per-project layouts ---------- */
.sep { height: 1px; background: var(--hair); }
footer { border-top: 0; padding-top: 0; flex-wrap: wrap; }
.next { border-top: 0; padding-top: 0; flex-wrap: wrap; }
footer > .sep, .next > .sep { flex-basis: 100%; margin-bottom: 10px; }
.page > .sep { width: min(var(--page), 100%); margin: 34px auto 0; }
.hero-live { margin-top: 30px; }

.tufte { width: min(var(--page), 100%); margin: 0 auto; }
.tufte .r2 { display: grid; grid-template-columns: minmax(0, 600px) 232px; column-gap: 48px; align-items: start; }
.tufte .sn { font-size: 14px; line-height: 1.5; color: var(--graphite); border-top: 1px solid var(--ink); padding-top: 8px; margin-top: 18px; }
.tufte .sn b { color: var(--ink); font-weight: 600; }
.tufte .sn svg { width: 100%; height: auto; display: block; margin-top: 8px; overflow: visible; }
.tufte p { margin-top: 12px; }
.tufte .abstract { margin-top: 40px; }
.theorem-card { width: min(var(--read), 100%); margin: 34px 0 10px; padding: 18px 22px 16px; border: 1px solid var(--ink); position: relative; background: var(--paper); }
.theorem-card::after { content: ""; position: absolute; left: 6px; top: 6px; right: -7px; bottom: -7px; border: 1px solid var(--ink); z-index: -1; }
.theorem-card .tc-h { font-weight: 600; }
.theorem-card .tc-h span { font-weight: 400; font-style: italic; }
.theorem-card .tc-n { color: var(--graphite); font-size: 16px; margin-top: 4px; }

.report { width: min(var(--page), 100%); margin: 44px auto 0; display: grid; grid-template-columns: 180px minmax(0, 1fr); column-gap: 44px; }
.report .idx { position: sticky; top: 76px; align-self: start; font-size: 14.5px; }
.report .idx a { display: block; text-decoration: none; color: var(--graphite); padding: 5px 0 5px 12px; border-left: 2px solid var(--hair); transition: color .2s, border-color .2s; }
.report .idx a.on { color: var(--ink); border-left-color: var(--ink); }
.report .idx .kv { margin-top: 14px; font-size: 13px; color: var(--graphite); }
.report .idx .kv:first-of-type { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--hair); }
.report .idx .kv b { display: block; color: var(--ink); font-size: 19px; font-weight: 500; font-variant-numeric: lining-nums; }
.report .main > .read, .report .main .read { width: 100%; margin: 0; }
.report figure.fig, .report .arch, .report pre.code { width: 100%; }

.deriv { width: min(var(--page), 100%); margin: 34px auto 0; border-top: 1.5px solid var(--ink); }
.deriv .dr { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 36px; padding: 16px 0; border-bottom: 1px solid var(--hair); align-items: center; }
.deriv .dr .katex-display { margin: 0; }
.deriv .gl { font-size: 15.5px; line-height: 1.55; color: var(--graphite); }
.deriv .gl b { color: var(--ink); font-weight: 600; }
.deriv .tag { font-style: italic; color: var(--ink); }

.counters { width: min(var(--page), 100%); margin: 30px auto 0; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--ink); }
.counters div { padding: 14px 0 12px 16px; border-left: 1px solid var(--hair); }
.counters div:first-child { border-left: 0; padding-left: 0; }
.counters b { display: block; font-size: 28px; font-weight: 500; font-variant-numeric: lining-nums; letter-spacing: -0.01em; }
.counters i { font-size: 13.5px; color: var(--graphite); }
.ledger { width: min(var(--read), 100%); margin: 18px auto 0; border-collapse: collapse; font-size: 16px; }
.ledger th { text-align: left; font-weight: 600; font-size: 14px; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--ink); }
.ledger td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
.ledger td.naive { color: var(--graphite); width: 38%; text-decoration: line-through; text-decoration-color: var(--orange); text-decoration-thickness: 1.5px; }
.ledger td.fix b { font-weight: 600; }

.audit { width: min(var(--page), 100%); margin: 34px auto 0; border-top: 1.5px solid var(--ink); }
.audit details { border-bottom: 1px solid var(--hair); }
.audit summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) 300px 210px; column-gap: 22px; align-items: center; padding: 12px 0; }
.audit summary::-webkit-details-marker { display: none; }
.audit summary .nm { font-size: 16px; }
.audit summary .nm::before { content: "+"; display: inline-block; width: 1.2em; color: var(--graphite); }
.audit details[open] summary .nm::before { content: "−"; }
.audit summary:hover .nm { text-decoration: underline; text-underline-offset: 3px; }
.audit summary svg { width: 100%; height: 26px; display: block; overflow: visible; }
.audit summary .vd { font-size: 14px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-variant-numeric: lining-nums; }
.vm { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.vm.bad { background: var(--orange); }
.vm.good { background: var(--blue); }
.audit .body { width: min(var(--read), 100%); padding: 0 0 18px 1.2em; }
.audit .body p { margin-top: 8px; }
.audit-key { width: min(var(--page), 100%); margin: 8px auto 0; font-size: 14px; color: var(--graphite); }

.timeline, .funnel { width: min(var(--page), 100%); margin: 30px auto 0; }
.timeline svg, .funnel svg { width: 100%; height: auto; display: block; overflow: visible; }

.part { width: min(var(--page), 100%); margin: 64px auto 0; font-style: italic; color: var(--graphite); font-size: 15px; border-bottom: 1px solid var(--ink); padding-bottom: 6px; }
.plate { width: min(var(--page), 100%); margin: 34px auto 0; }
.pl-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); column-gap: 40px; align-items: center; }
.pl-no { font-size: 13px; color: var(--graphite); font-variant-numeric: lining-nums; letter-spacing: .02em; }
.pl-t h3 { font-size: 21px; font-weight: 600; margin-top: 2px; line-height: 1.25; }
.pl-t p { margin-top: 8px; font-size: 16.5px; line-height: 1.55; }
.pl-eq { border-left: 1px solid var(--ink); padding: 8px 0 8px 22px; overflow-x: auto; }
.pl-eq .katex-display { margin: 0; }
.pl-fig { margin-top: 16px; }
.pl-fig svg { width: 100%; height: auto; display: block; overflow: visible; }
.plate .ctl { width: 100%; margin-top: 12px; }
.plate .live-out { width: min(var(--read), 100%); margin: 8px auto 0; text-align: center; font-size: 15px; font-variant-numeric: lining-nums tabular-nums; min-height: 1.5em; }
.plate .legend { margin-top: 16px; }
@media (max-width: 860px) {
  .tufte .r2, .deriv .dr, .pl-head { grid-template-columns: minmax(0, 1fr); }
  .report { grid-template-columns: minmax(0, 1fr); }
  .report .idx { display: none; }
  .counters { grid-template-columns: repeat(2, 1fr); }
  .audit summary { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
  .audit summary .vd { justify-content: flex-start; }
  .pl-eq { border-left: 0; padding-left: 0; border-top: 1px solid var(--ink); margin-top: 10px; }
}


.hero-w[hidden] { display: none; }

/* legal footer, on every view */
.site-foot { display: block; border-top: 0; width: min(var(--page), calc(100% - 48px)); margin: -30px auto 0; padding: 0 0 56px; font-size: 13.5px; line-height: 1.55; color: var(--graphite); }
.site-foot .sep { margin-bottom: 12px; }
.site-foot .sf-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--ink); font-size: 14.5px; }
.site-foot p { margin-top: 6px; max-width: 60em; }
.legal p { margin-top: 10px; font-size: 16.5px; }
.legal .a-h2 { margin-top: 40px; font-size: 18px; }

/* connections: intuition beyond the repository, framed by a standing Brownian bridge */
.lens { width: min(var(--read), 100%); margin: 72px auto 0; position: relative; padding-left: 28px; border-left: 1px solid var(--hair); }
.report .lens { width: 100%; margin: 56px 0 0; }
.lens h2 { font-size: 20px; font-weight: 600; }
.lens .lens-sub { font-style: italic; color: var(--graphite); font-size: 15.5px; margin-top: 4px; }
.lens h3 { font-size: 17px; font-weight: 600; margin-top: 28px; }
.lens p { margin-top: 6px; font-size: 16.5px; line-height: 1.6; }
.lens .katex-display { margin: 12px 0 6px; }

/* Grid and flex children default to min-width: auto, so one wide equation or figure would
   widen its column and, on phones, the whole page. Let them shrink; wide maths scrolls inside
   .katex-display instead. */
.art :where(.r2, .report, .deriv .dr, .pl-head, .scrolly, .audit summary) > * { min-width: 0; }
.art p, .art figure, .art aside, .art .gl { min-width: 0; overflow-wrap: break-word; }

/* Phone chart frames (see fit.js): swipe sideways, with scroll shadows as the cue. */
.fig-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px 6px;
  background: linear-gradient(to right, var(--paper) 30%, rgba(255,255,255,0)) left / 28px 100% no-repeat local,
              linear-gradient(to left, var(--paper) 30%, rgba(255,255,255,0)) right / 28px 100% no-repeat local,
              radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.16), transparent) left / 10px 100% no-repeat scroll,
              radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.16), transparent) right / 10px 100% no-repeat scroll; }
.fig-scroll > svg { max-width: none; }
.fig-scroll::before { content: "Swipe sideways to see the whole figure."; display: block; position: sticky; left: 0; width: max-content; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.fig-scroll:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (max-width: 640px) {
  .bar-in { width: calc(100% - 32px); font-size: 15px; }
  .bar-in > a, .bar-in nav a { white-space: nowrap; }
  .bar-in nav { gap: 14px; }
}

/* Equations too wide for their column (marked by fit.js): the number follows the equation
   instead of being pinned on top of it at the right edge. */
.page .katex-display.eq-wide > .katex { text-align: left; }
.page .katex-display.eq-wide > .katex > .katex-html { white-space: nowrap; }
.page .katex-display.eq-wide > .katex > .katex-html > .katex-tag { position: static; display: inline-block; margin-left: 1.2em; }

/* Wide equations scroll inside .katex-display; the shadows show there is more. */
.page .katex-display {
  background: linear-gradient(to right, var(--paper) 30%, rgba(255,255,255,0)) left / 28px 100% no-repeat local,
              linear-gradient(to left, var(--paper) 30%, rgba(255,255,255,0)) right / 28px 100% no-repeat local,
              radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.16), transparent) left / 10px 100% no-repeat scroll,
              radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.16), transparent) right / 10px 100% no-repeat scroll;
}

