/* Blog (/blog/ and each essay). Tokens, type, header and the phone menu come from home.css, as on /results/.
   This file adds no colours. Everything inside .b-body styles plain Markdown output. */

/* The same warm dark neutrals results.css sets from 641px, so the two pages match in the dark. */
@media (min-width:641px){
  :root{--bg:light-dark(oklch(98.6% .002 265),oklch(17.5% .006 75));--surf:light-dark(oklch(100% 0 0),oklch(20.5% .006 75));--sunk:light-dark(oklch(96.7% .003 265),oklch(15.5% .005 75));
    --line:light-dark(oklch(92.6% .004 265),oklch(27.5% .006 75));--line2:light-dark(oklch(87.5% .005 265),oklch(35% .007 75));
    --ink:light-dark(oklch(20% .006 265),oklch(93% .008 85));--ink2:light-dark(oklch(42% .008 265),oklch(79% .008 80));--ink3:light-dark(oklch(53% .008 265),oklch(67% .008 80));
    --on-ink:light-dark(oklch(99% 0 0),oklch(17.5% .006 75))}
}

/* Frame: the same box as .r-main, so the left edge does not move between results and blog. */
.b-main{max-width:1080px;margin:0 auto;padding:0 clamp(16px,4vw,40px) 88px}
.b-main h1,.b-main h2,.b-main h3{text-wrap:balance}
.b-main p,.b-main li{text-wrap:pretty}
.b-col{max-width:620px}

/* Opening */
.b-head{padding:72px 0 48px}
.b-meta{margin:0;font-size:13px;line-height:1.5;font-weight:500;color:var(--acc-ink);font-variant-numeric:tabular-nums}
.b-meta a{color:inherit;text-decoration:none}
.b-meta a:hover{text-decoration:underline}
.b-head h1{margin:16px 0 0;max-width:20em;font-size:clamp(34px,4.2vw,48px);line-height:1.08;font-weight:650;letter-spacing:-.03em}
.b-dek{margin:20px 0 0;max-width:620px;font-size:20px;line-height:1.5;color:var(--ink2)}
.b-dek-s{font-size:18px;line-height:1.62}

/* Reading column and rail. The rail appears only when there is room for it beside 620px. */
.b-grid{display:grid;grid-template-columns:minmax(0,620px)}
.b-rail{display:none}
@media (min-width:1100px){
  .b-grid{grid-template-columns:620px 208px;justify-content:space-between}
  .b-rail{display:block;grid-column:2;grid-row:1;position:sticky;top:88px;align-self:start}
  .b-grid>.b-body,.b-grid>.b-list{grid-column:1;grid-row:1}
}
.b-rail-t{margin:0 0 8px;font-size:13px;font-weight:500;color:var(--ink3)}
.b-rail ol{margin:0;padding:0;list-style:none}
.b-rail a{display:block;padding:5px 0;font-size:13.5px;line-height:1.4;color:var(--ink3);text-decoration:none}
.b-rail a:hover{color:var(--ink2)}
.b-rail a[aria-current]{color:var(--ink)}

/* The essay */
.b-body{min-width:0;font-size:18px;line-height:1.7;color:var(--ink2)}
.b-body>*{margin:0}
.b-body>*+*{margin-top:20px}
.b-body h2{margin-top:56px;font-size:25px;line-height:1.24;font-weight:640;letter-spacing:-.02em;color:var(--ink);scroll-margin-top:88px}
.b-body h3{margin-top:36px;font-size:20px;line-height:1.3;font-weight:620;letter-spacing:-.012em;color:var(--ink);scroll-margin-top:88px}
.b-body h2+*,.b-body h3+*{margin-top:14px}
.b-body>:first-child{margin-top:0}
.b-body strong{font-weight:600;color:var(--ink)}
.b-body ul,.b-body ol{padding-left:1.25em}
.b-body li+li{margin-top:10px}
.b-body li::marker{color:var(--ink3)}
.b-body blockquote{padding:0 1.25em;color:var(--ink)}
.b-body blockquote>*{margin:0}
.b-body blockquote>*+*{margin-top:14px}

/* Code */
.b-body code{font-family:var(--mono);font-size:.86em;padding:.12em .36em;border-radius:4px;background:var(--sunk);color:var(--ink)}
.b-body pre{overflow-x:auto;padding:16px 20px;border:1px solid var(--line);border-radius:12px;background:var(--sunk);font-size:14px;line-height:1.65}
.b-body pre code{padding:0;border-radius:0;background:none;font-size:inherit}

/* Tables. .b-table is the one wrapper the generator adds, so a wide table scrolls inside the column. */
.b-body .b-table{margin-top:28px;margin-bottom:28px;overflow-x:auto}
.b-body table{width:100%;border-collapse:collapse;font-size:15px;line-height:1.45;font-variant-numeric:tabular-nums}
.b-body th,.b-body td{padding:9px 20px 9px 0;text-align:left;vertical-align:baseline;border-bottom:1px solid var(--line)}
.b-body th:last-child,.b-body td:last-child{padding-right:0}
.b-body th{font-size:13px;font-weight:500;color:var(--ink3);white-space:nowrap;border-bottom-color:var(--line2)}
.b-body td{color:var(--ink)}
.b-body th.num,.b-body td.num{text-align:right}

/* Figures */
.b-body figure{margin-top:32px;margin-bottom:32px}
.b-body figure img,.b-body figure svg{display:block;width:100%;height:auto;border-radius:8px}
.b-body figure svg{height:214px;border-radius:0;overflow:visible}
.b-body figure svg text{font-family:inherit;font-size:13px;font-variant-numeric:tabular-nums}
.b-body figcaption{margin-top:12px;font-size:14px;line-height:1.5;color:var(--ink3)}

/* A section with the heading "Limits" reads as a note: same column, smaller, under a hairline. */
.b-body #limits{margin-top:56px;padding-top:28px;border-top:1px solid var(--line);font-size:16px;line-height:1.5;font-weight:600;letter-spacing:0}
.b-body #limits~p:not(.b-sign){font-size:15.5px;line-height:1.65}
.b-body #limits+*{margin-top:8px}
/* The signature is the essay's last line. */
.b-body>p.b-sign{margin-top:32px;font-size:16px;font-weight:600;color:var(--ink)}

/* After the essay */
.b-end{max-width:620px;margin-top:48px;padding-top:28px;border-top:1px solid var(--line2)}
.b-pager{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.b-pager span{display:block}
.b-pager .k{font-size:13px;font-weight:500;color:var(--ink3)}
.b-pager .v{margin-top:4px;font-size:15px;line-height:1.45;color:var(--ink3)}
.b-pager a.v{display:block;color:var(--ink);font-weight:500;text-decoration:none}
.b-pager a.v:hover{color:var(--acc-ink)}
.b-end .b-sub{margin-top:36px}
#email{scroll-margin-top:88px}

/* Index */
.b-list{margin:0;padding:0;list-style:none;border-bottom:1px solid var(--line)}
.b-row{display:grid;grid-template-columns:112px minmax(0,1fr);column-gap:28px;padding:26px 0 28px;border-top:1px solid var(--line)}
.b-date{margin:0;padding-top:6px;font-size:13px;line-height:1.5;color:var(--ink3);font-variant-numeric:tabular-nums}
.b-date span{display:block}
.b-row h2{margin:0;font-size:22px;line-height:1.26;font-weight:620;letter-spacing:-.018em}
.b-row h2 a{color:var(--ink);text-decoration:none}
.b-row h2 a:hover{color:var(--acc-ink)}
.b-row p.b-sum{margin:10px 0 0;font-size:16px;line-height:1.6;color:var(--ink2)}

/* Sign-up and feed: below the list until there is room for the rail. */
.b-side{max-width:620px;margin-top:44px}
@media (min-width:1100px){
  .b-side{grid-column:2;grid-row:1;position:sticky;top:88px;align-self:start;margin-top:0}
}
.b-sub label{display:block;font-size:14px;font-weight:600;line-height:1.4;color:var(--ink)}
.b-sub-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.b-sub input{flex:1 1 200px;min-width:0;box-sizing:border-box;height:36px;padding:0 12px;border:1px solid var(--line2);border-radius:8px;background:var(--surf);color:var(--ink);font:inherit;font-size:14px}
.b-sub input::placeholder{color:var(--ink3);opacity:1}
.b-sub button{height:36px;padding:0 12px;border:1px solid var(--line2);border-radius:8px;background:var(--surf);color:var(--ink);font-size:13px;font-weight:500;white-space:nowrap}
.b-sub button.q{border-color:transparent;background:none;color:var(--ink3)}
.b-sub button.q:hover{color:var(--ink)}
.b-sub p{margin:10px 0 0;font-size:13px;line-height:1.5;color:var(--ink3)}
.b-sub p.b-status{margin-top:4px;color:var(--ink)}
.b-sub p.b-status:empty{margin:0}
.b-feed{margin:10px 0 0;font-size:13px;line-height:1.5}

@media (max-width:640px){
  .b-main{padding-bottom:56px}
  .b-head{padding:28px 0 28px}
  .b-meta{font-size:14px}
  .b-crumb{display:none}
  .b-sub details button.q{min-height:44px}
  .b-head h1{margin-top:12px}
  .b-dek,.b-dek-s{margin-top:14px;font-size:17px;line-height:1.55}
  .b-body{font-size:17px;line-height:1.65}
  .b-body>*+*{margin-top:18px}
  .b-body h2{margin-top:44px;font-size:22px;line-height:1.27}
  .b-body h2+*,.b-body h3+*{margin-top:12px}
  .b-body h3{margin-top:30px;font-size:19px}
  .b-body table{font-size:14px}
  .b-body th{font-size:13px}
  .b-body th,.b-body td{padding:8px 16px 8px 0}
  .b-body pre{padding:14px 16px;font-size:13px}
  .b-body #limits{margin-top:44px;padding-top:24px}
  .b-body #limits~p:not(.b-sign){font-size:15.5px}
  .b-end{margin-top:40px}
  .b-row{display:block;padding:20px 0 22px}
  .b-date{padding-top:0;font-size:14px}
  .b-date span{display:inline}
  .b-date span+span::before{content:" · "}
  .b-row h2{margin-top:6px;font-size:20px;line-height:1.3}
  .b-row p.b-sum{margin-top:8px}
  .b-side{margin-top:36px}
  .b-sub label{font-size:15px}
  .b-sub input{flex-basis:100%;height:44px;font-size:16px}
  .b-sub button{height:44px;padding:0 16px;font-size:15px}
  .b-sub button.q{padding:0 8px}
  .b-sub p,.b-feed{font-size:14px}
  .b-feed a{display:inline-flex;align-items:center;min-height:44px}
  .b-pager a.v{font-size:16px}
}

.b-nb{white-space:nowrap}
.b-sub details{margin-top:6px;font-size:13px;line-height:1.5;color:var(--ink3)}
.b-sub summary{cursor:pointer}
.b-sub summary:hover{color:var(--ink)}
.b-sub details button.q{height:auto;padding:0;font-size:inherit;font-weight:400;text-decoration:underline;white-space:normal;text-align:left}
.b-body p.b-correction{padding:14px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);font-size:.92em;line-height:1.55}
