/* Reading layout and motion, loaded after site.css.
   The right-hand column is the margin: after the article's details it carries side notes, not empty space. */

.post-info { position: static; }
.prose { max-width: 40rem; }
.article-body h3 { margin-top: 72px; }
.article-body h3 b { display: block; margin-bottom: 10px; font: 400 10px/1 var(--mono); letter-spacing: .16em; color: var(--ink-3); }

/* ---------- a looser page ----------
   Everything lives on one page, so the page has to breathe: the title gets the first screen to itself,
   chapters are set well apart, text is larger and more open, and figures stand clear of the prose. */
body { font-size: 17px; }
.post-head {
  min-height: min(88vh, 860px);
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--top) + 32px) 0 clamp(56px, 9vh, 104px);
}
.post-head h1 { margin: 34px auto 34px; }
.section { position: relative; padding-top: clamp(120px, 21vh, 232px); }
.article-body h2 { margin: 20px 0 34px; }
.article-body h3 { margin-top: clamp(84px, 13vh, 128px); margin-bottom: 22px; }
.lead { margin-bottom: 36px; line-height: 1.42; }
.prose p { margin-bottom: 28px; line-height: 1.72; }
.prose .lead { line-height: 1.42; }
figure, .chart { margin: clamp(52px, 8vh, 84px) 0; }
.reveal[data-tabs] { margin: clamp(52px, 8vh, 84px) 0; }
figcaption, .caption { margin-top: 18px; font-size: 13px; line-height: 1.55; }
.summary-list, .request-grid, .stats, .pair { margin: clamp(44px, 7vh, 68px) 0; }
.summary-list, .request-grid { gap: 0 36px; }
.summary-list > div, .request-grid > div, .pair > div { padding-top: 16px; }
.summary-list h4, .request-grid h4, .pair h4 { margin-bottom: 9px; font-size: 15px; }
.summary-list p, .request-grid p, .pair p { font-size: 14px; line-height: 1.6; }
.stat { padding-top: 28px; padding-bottom: 28px; }
.stat p { margin-top: 16px; font-size: 13px; line-height: 1.5; }
.request { margin: clamp(52px, 8vh, 84px) 0; padding-top: 32px; }
.request .order { margin: 12px 0 34px; }
.pullquote { margin: clamp(60px, 10vh, 104px) 0; padding-left: 28px; }
.note { margin: 52px 0; padding: 26px 28px; font-size: 15px; line-height: 1.65; }
.steps, .questions { margin: clamp(44px, 7vh, 68px) 0; }
.step { padding: 28px 0 30px; gap: 0 28px; }
.step h4 { margin-bottom: 10px; font-size: 20px; }
.step p { font-size: 14.5px; line-height: 1.65; }
.step .output p { font-size: 13.5px; }
.pics { gap: 0 36px; }
.pic { margin-bottom: 20px; padding: 14px 12px; }
.panel { gap: 0 44px; padding-top: 34px; }
.panel p { font-size: 14.5px; line-height: 1.65; }
.panel .detail-rule { margin-top: 18px; padding-top: 16px; font-size: 13.5px; }
.tabs { margin-top: 22px; }
.tab { padding: 14px 12px 15px 0; font-size: 14px; }
.figure-label { padding-bottom: 14px; }
.dg { padding: 14px 0 6px; }
.n { padding: 12px 16px; font-size: 13.5px; }
.n small { margin-bottom: 5px; }
.stack { gap: 9px; }
.group { padding: 14px 16px 16px; }
.rail { margin-top: 12px; margin-bottom: 12px; height: 26px; }
.eva-grid { padding: 22px 0 10px; gap: 10px 40px; }
.tax-row { padding: 18px 0 19px; }
.tax-cell { gap: 6px 6px; }
.tax-cell span { padding: 3px 9px 4px; font-size: 12.5px; }
details { margin: 44px 0; }
summary { padding: 18px 0; font-size: 14px; }
.toc a { padding: 11px 0 12px; font-size: 13px; }
.toc-bottom { display: none; }
.post-info { gap: 22px; font-size: 13px; }
.cta-row { margin-top: 44px; }
footer { padding: 56px 0 80px; }

/* side notes: one concrete case or number beside the paragraph it belongs to */
.mn {
  float: right; clear: right;
  width: var(--side);
  margin: 4px calc(-1 * (var(--side) + var(--colgap))) 18px 0;
  padding-top: 10px;
  border-top: 1px solid var(--ink);
}
.mn .kicker { display: block; margin-bottom: 7px; font-size: 9px; }
.mn p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-2); }

/* ---------- figures that move ---------- */

/* a signal passing through a flow diagram (site.js adds .live to one element at a time) */
.n.live, [data-step].live .n { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.n.k.live { box-shadow: 0 0 0 4px rgba(29, 29, 31, .16); }
.n.out.live { background: #dcdce0; }
.a .dot, .rail .dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); opacity: 0; pointer-events: none; }
.a .dot { top: -3px; left: 0; }
.a.live .dot { animation: run-x .42s linear both; }
.a.v .dot { top: 0; left: -3px; }
.a.v.live .dot { animation: run-y .42s linear both; }
@keyframes run-x { from { left: 0; opacity: 1; } to { left: calc(100% - 7px); opacity: 1; } }
@keyframes run-y { from { top: 0; opacity: 1; } to { top: calc(100% - 7px); opacity: 1; } }
/* round the loop: down the right side, back along the bottom, up into the box it returns to */
.rail .dot { margin: -3.5px 0 0 -3.5px; }
.rail.live .dot { animation: run-back 1.3s linear both; }
@keyframes run-back {
  0% { left: 100%; top: 0; opacity: 1; }
  10% { left: 100%; top: 100%; opacity: 1; }
  90% { left: 0; top: 100%; opacity: 1; }
  100% { left: 0; top: 0; opacity: 1; }
}
.rail.live { border-color: var(--ink); }
.rail.live span { color: var(--ink); }

/* the arm lifts on its post and carries a block along; the wireframe twin does the same, in step */
.iso-lift, .iso-slide { transform-box: view-box; }
.iso-lift { animation: iso-lift 7s ease-in-out infinite; }
.iso-slide { animation: iso-slide 7s ease-in-out infinite; }
@keyframes iso-lift {
  0%, 8%, 54%, 62%, 100% { transform: translate(0, 0); }
  20%, 42%, 74%, 92% { transform: translate(0, var(--hz)); }
}
@keyframes iso-slide {
  0%, 20%, 92%, 100% { transform: translate(0, 0); }
  42%, 74% { transform: translate(var(--hx), var(--hy)); }
}
/* the opening picture: the arm brings one more block, and the tower comes down */
.t-lift, .t-slide { transform-box: view-box; }
.t-lift { animation: t-lift 6s ease-in-out infinite; }
.t-slide { animation: t-slide 6s ease-in-out infinite; }
.t-fall { transform-box: fill-box; transform-origin: 80% 100%; animation: t-fall 6s ease-in infinite; }
@keyframes t-lift {
  0%, 6%, 96%, 100% { transform: translate(0, 0); }
  20%, 84% { transform: translate(0, var(--hz)); }
}
@keyframes t-slide {
  0%, 20%, 84%, 100% { transform: translate(0, 0); }
  42%, 66% { transform: translate(var(--hx), var(--hy)); }
}
@keyframes t-fall {
  0%, 41% { transform: translate(0, 0) rotate(0); opacity: 1; }
  47% { transform: translate(5px, 1px) rotate(13deg); opacity: 1; }
  60% { transform: translate(44px, 58px) rotate(86deg); opacity: 1; }
  66%, 88% { transform: translate(46px, 62px) rotate(90deg); opacity: 0; }
  89% { transform: translate(0, 0) rotate(0); opacity: 0; }
  98%, 100% { transform: translate(0, 0) rotate(0); opacity: 1; }
}
.hook-fig { max-width: 30rem; margin-left: auto; margin-right: auto; }
.hook-fig .pic { margin-bottom: 0; padding: 18px 16px; }

/* the screen: lines are written one after another, the pointer wanders, the window clears */
.iso-type { stroke-dasharray: 1; stroke-dashoffset: 1; animation: iso-type 6s linear infinite; animation-delay: calc(var(--d) * .7s); }
@keyframes iso-type { 0% { stroke-dashoffset: 1; } 14%, 78% { stroke-dashoffset: 0; } 86%, 100% { stroke-dashoffset: 1; } }
.iso-pointer { animation: iso-point 6s ease-in-out infinite; }
@keyframes iso-point { 0%, 100% { transform: translate(0, 0); } 30% { transform: translate(-22px, -6px); } 55% { transform: translate(-8px, 9px); } 80% { transform: translate(-30px, 12px); } }
/* the unanswered step */
.a.q span { animation: ask 2.4s ease-in-out infinite; }
@keyframes ask { 0%, 100% { box-shadow: 0 0 0 0 rgba(29, 29, 31, .28); } 60% { box-shadow: 0 0 0 9px rgba(29, 29, 31, 0); } }

/* the pathway: data flowing along the dashed arcs, the agent crossing over */
.eva-svg .march { animation: march 1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -12; } }
.eva-svg .agent-run { animation: agent-run 2.8s ease-in-out infinite; }
@keyframes agent-run { 0%, 12% { transform: translateX(0); } 70%, 100% { transform: translateX(132px); } }
.eva-svg .orbit { animation: march 1.6s linear infinite; }
.auto { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; font: 400 9px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.auto:hover { color: var(--ink); border-color: var(--ink); }

/* the trend replays: a playhead sweeps the months, the lines are drawn behind it and the numbers count along
   (site.js drives it; pointing at the chart takes the playhead over) */
.chart-svg[data-series] { cursor: crosshair; touch-action: pan-y; }
.trend-head { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; opacity: .55; }
.trend-date { font: 400 9.5px/1 var(--mono); letter-spacing: .08em; fill: var(--ink); }
.chart-svg .lead { transition: opacity .3s; }
.chart-svg.sweeping .lead { opacity: 0; }
.chart-svg .dot { transition: r .2s; }
/* the taxonomy: names arrive in order when a trunk is opened */
.tax:not([hidden]) .tax-cell span { animation: rise .5s var(--ease) both; }
.tax-row:nth-child(3) .tax-cell span { animation-delay: .06s; }
.tax-row:nth-child(4) .tax-cell span { animation-delay: .12s; }
.tax-row:nth-child(5) .tax-cell span { animation-delay: .18s; }
.tax-row:nth-child(6) .tax-cell span { animation-delay: .24s; }

/* ---------- no top band: the page starts with its title ---------- */
:root { --top: 0px; }
.toc, .post-info { top: 48px; }

/* ---------- diagrams that never overflow their boxes ----------
   A box is at least as wide as its longest word; arrows give way first; rows share width evenly. */
.n { min-width: min-content; padding-left: 14px; padding-right: 14px; }
.n.grow { flex: 1 1 auto; }
.a { flex: 1 1 20px; min-width: 14px; max-width: 46px; margin: 0 5px; }
.flow > .a[style] { max-width: none; }
.group { min-width: min-content; padding: 14px; }
.group > .flow > .n { flex: 1 1 auto; }
.rail span { max-width: calc(100% - 28px); }
.parts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 10px; margin-top: 30px; }
.parts > div:last-child { grid-column: span 3; }
.parts .row { gap: 10px; }
.parts .n { padding: 12px 8px; white-space: nowrap; }

/* ---------- diagrams on a common line ----------
   Boxes in a row are the same height and share the width evenly, text sits in the middle of its box,
   and a box outside a dashed group lines up with the boxes inside it. */
.flow { align-items: stretch; }
.flow > .n { flex: 1 1 0; }
.dg { --nh: 64px; }                 /* one box height for the whole page: room for two lines */
.n {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  min-height: var(--nh); padding-top: 10px; padding-bottom: 10px;
}
.n small { margin-bottom: 4px; }
.n[style*="display:block"] { display: flex !important; width: 100%; }   /* full-width bars keep their text centred too */
.n.ic svg { flex: 0 0 auto; }
.n.pic { justify-content: flex-end; margin: 0; padding: 4px 6px 12px; border: 1px solid var(--line-soft); }
.n.pic svg { flex: 0 0 auto; }
.a { align-self: center; }
.stack .n { min-height: 54px; }
.cols3 .n { width: 100%; }
/* a row that ends in a loop: the lone box in front stays on the row, not on the loop's middle */
.flow:has(> .loop) { align-items: flex-start; }
.flow:has(> .loop) > .a { align-self: flex-start; margin-top: calc(var(--nh) / 2); }
/* a row that holds a dashed group: boxes outside it drop to the level of the boxes inside it */
.flow:has(> .group) { align-items: flex-start; --drop: 37px; }
.flow:has(> .group) > .n { margin-top: var(--drop); }
.flow:has(> .group) > .a { align-self: flex-start; margin-top: calc(var(--drop) + var(--nh) / 2); }
.group > small { margin-bottom: 0; height: 22px; line-height: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group { padding: 14px 14px 14px; }
.group > .flow > .n, .group .loop .flow > .n { flex: 1 1 0; }
/* a row of three-part stacks: single boxes sit level with the middle part */
.dg .flow.mid { align-items: center; }
.dg .flow.mid > .n { margin-top: 22px; flex: 0 1 auto; }
.dg .flow.mid > .a { align-self: center; margin-top: 22px; }

/* Figure 6: three columns flush at top and bottom */
.grid-env { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1.3fr) 44px minmax(0, 1.3fr); gap: 10px 0; align-items: stretch; }
.grid-env .ge { grid-column: 1; grid-row: 1 / 4; }
.grid-env .g1 { grid-column: 2; grid-row: 1 / 4; }
.grid-env .g2 { grid-column: 4; grid-row: 1 / 4; }
.grid-env .c2 { grid-column: 3; }
.grid-env .c3 { grid-column: 5; }
.grid-env .r1 { grid-row: 1; }
.grid-env .r2 { grid-row: 2; }
.grid-env .r3 { grid-row: 3; }
.grid-env > .a { width: auto; max-width: none; align-self: center; }
.grid-env > .a.v { width: 1px; height: auto; align-self: stretch; justify-self: center; margin: 4px 0 8px; }

/* on a large display the whole article steps up a size instead of sitting small in the middle */
@media (min-width: 1600px) {
  :root { --side: 224px; --colgap: 76px; }
  body { font-size: 18.5px; }
  .article-layout { max-width: calc(51rem + 2 * (var(--side) + var(--colgap))); }
  .prose { max-width: 44rem; }
  .lead { font-size: 23px; }
  .article-body h2 { font-size: 56px; }
  .article-body h3 { font-size: 30px; }
  .toc a { font-size: 14px; }
  .post-info, .mn p { font-size: 13.5px; }
  .dg { --nh: 70px; }
  .n { font-size: 14.5px; }
  .panel p, .step p { font-size: 15.5px; }
  .summary-list p, .request-grid p, .pair p { font-size: 15px; }
  figcaption, .caption, .stat p { font-size: 14px; }
}

@media (max-width: 1180px) {
  .mn { float: none; width: auto; max-width: 40rem; margin: 0 0 22px; padding: 2px 0 2px 14px; border-top: 0; border-left: 2px solid var(--ink); }
}
@media (max-width: 820px) {
  /* on a phone every diagram is one column, so the row offsets above are undone */
  .flow, .flow:has(> .loop), .flow:has(> .group), .dg .flow.mid { align-items: stretch; }
  .flow > .n, .flow:has(> .group) > .n, .dg .flow.mid > .n { flex: 0 0 auto !important; margin-top: 0; white-space: normal !important; }
  .parts { grid-template-columns: 1fr; gap: 14px; }
  .parts > div:last-child { grid-column: auto; }
  .parts .row { grid-auto-flow: row; }
  .grid-env > .a, .grid-env > .a.v { min-width: 0; }
  .flow > .a:not(.v), .flow:has(> .loop) > .a, .flow:has(> .group) > .a, .dg .flow.mid > .a { align-self: center; margin: 4px auto; max-width: none; }
  .grid-env { grid-template-columns: 1fr; gap: 0; }
  .grid-env > * { grid-column: 1 !important; grid-row: auto !important; }
  .grid-env > .n { margin: 4px 0; }
  .grid-env > .a, .grid-env > .a.v { width: 1px; height: 16px; justify-self: center; align-self: center; margin: 2px 0 6px; }
  .grid-env > .a:not(.v)::after { right: auto; left: -3px; top: auto; bottom: -2px; border: 3.5px solid transparent; border-top: 6px solid var(--ink-3); border-bottom: 0; }
  .grid-env > .a span { display: none; }
  /* flows run downwards on a phone, so the signal does too */
  .flow > .a:not(.v) .dot { top: 0; left: -3px; }
  .flow > .a:not(.v).live .dot { animation-name: run-y; }
  .rail .dot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .t-lift, .t-slide, .t-fall, .iso-lift, .iso-slide, .iso-type, .iso-pointer, .a.q span, .eva-svg .march, .eva-svg .agent-run, .eva-svg .orbit, .tax-cell span { animation: none; }
  .iso-type { stroke-dashoffset: 0; }
}
