/* ==========================================================================
   /research/: both papers, figure by figure, and the three school projects.

   Built on site.css, in its clean light theme: every figure stands on a
   neutral tile, the one blue marks a result that clears its bar, and the
   e-value figures share one axis (Fig.gx, 0.01 to 1,680 on a log scale),
   so 20 and 1,680 sit in the same place wherever they appear.
   Pre-animation states are gated behind html.js and, where a script runs
   the motion, behind .rs-anim, which research.js adds only when motion is
   allowed. Without either, every figure sits in its final state.
   ========================================================================== */

/* ------------------------------------------------------------ header */
.rs-toc { margin-top: 8px; display: grid; gap: 4px; justify-items: start; }
.rs-toc a { color: var(--ink); font-weight: 500; letter-spacing: -0.01em; }

/* ------------------------------------------------------------ paper heads */
.rs-sec { position: relative; padding-top: clamp(112px, 10.4vw, 184px); }
/* the first paper starts close enough under the facts to show in the first screen */
.case-hero + .rs-sec { padding-top: clamp(72px, 6.4vw, 112px); }
.rs-ph { margin-top: 0; align-items: start; }
.rs-pv { grid-column: 1 / 3; font-size: var(--fs-fine); line-height: 1.5; color: var(--ink-3); padding-top: 0.9em; max-width: 40ch; }
.rs-pv .chip { margin-bottom: 14px; }
.rs-pv p + p { margin-top: 4px; }
.rs-pv b { color: var(--ink); font-weight: 600; }
.rs-pt { grid-column: 3 / 6; padding-right: 0; }
.rs-h {
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: clamp(2.625rem, 0.9rem + 4.2vw, 5.5rem);
  line-height: 0.96;
  letter-spacing: -0.052em;
  margin-left: -0.05em;
  padding-bottom: 0.04em;
  text-wrap: balance;
}
html.js .rs-h { opacity: 0; transform: translateY(0.14em); filter: blur(10px); transition: opacity 900ms var(--eo), transform 1200ms var(--eo), filter 900ms var(--eo); }
html.js .rs-pt.in .rs-h { opacity: 1; transform: none; filter: none; }
.rs-sub { margin-top: 18px; font-size: var(--fs-lead); line-height: 1.36; letter-spacing: -0.014em; color: var(--ink-2); max-width: 36ch; text-wrap: pretty; }
.rs-read { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.rs-read .rs-alt { margin-left: 22px; font-weight: 600; letter-spacing: -0.01em; }
.rs-kb { font-size: var(--fs-fine); color: var(--ink-3); }

/* ------------------------------------------------------------ figure tiles */
.rs-tile { position: relative; background: var(--tile); border-radius: var(--r-tile); padding: clamp(20px, 2.4vw, 34px) clamp(18px, 2.4vw, 34px) clamp(18px, 2.2vw, 30px); }
.rs-tile.is-wide { border-radius: var(--r-stage); padding: clamp(24px, 3vw, 48px) clamp(18px, 4.4vw, 64px) clamp(20px, 2.4vw, 34px); }
.rs-tile .fig-k { color: var(--ink); }

/* shared figure type */
.rs-sc-svg, .rs-wt-svg, .rs-ld-svg, .rs-bu-svg, .rs-cr-svg, .rs-bk-svg, .rs-p4-svg { overflow: visible; font-family: var(--f-sans); }
.rs-axis { stroke: var(--ink); stroke-width: 1.25; shape-rendering: crispEdges; }
.rs-axis.is-thin { stroke-width: 1; }
.rs-tk { stroke: var(--ink-3); stroke-width: 1; shape-rendering: crispEdges; }
.rs-tk.is-0 { stroke: var(--ink); stroke-width: 1.25; }
.rs-xn { font-size: 12.5px; fill: var(--ink-3); text-anchor: middle; }
.rs-xn.is-first { text-anchor: start; }
.rs-xn.is-end { text-anchor: end; }
.rs-xn.is-bar { fill: var(--ink); font-weight: 600; font-size: 13px; }
.rs-yn { font-size: 12.5px; fill: var(--ink-3); }
.rs-yn.is-l { font-size: 12px; text-anchor: start; }
.rs-cap { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; fill: var(--ink); }
.rs-ax { font-size: 12px; fill: var(--ink-3); }
.rs-lab { font-size: 15px; font-weight: 600; letter-spacing: -0.012em; fill: var(--ink); }
.rs-lab.is-s { font-size: 14px; }
text.rs-sub { font-size: 12px; fill: var(--ink-3); letter-spacing: 0; }
.rs-hl { stroke: var(--ink); stroke-opacity: 0.12; stroke-width: 1.2; }
.rs-bar { stroke: var(--ink); stroke-width: 2; }
.rs-ann { font-size: 12.5px; font-weight: 600; letter-spacing: -0.005em; fill: var(--ink); paint-order: stroke; stroke: var(--tile); stroke-width: 4px; stroke-linejoin: round; }
.rs-v { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; fill: var(--ink); }
.rs-v.is-hit { fill: var(--signal-t); }
.rs-v.is-real { fill: var(--ink-3); font-weight: 500; }
.rs-v.is-s { font-size: 13.5px; }
.rs-nl { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.rs-nh.is-fill { fill: var(--ink); stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.rs-nh.is-hollow { fill: var(--tile); stroke: var(--ink-3); stroke-width: 1.5; stroke-linejoin: round; }
.rs-nd.is-real .rs-nl { stroke: var(--ink-3); stroke-width: 1.5; }
.rs-nd.is-hit .rs-nl { stroke: var(--signal); }
.rs-nd.is-hit .rs-nh.is-fill { fill: var(--signal); stroke: var(--signal); }
.rs-fk { margin-bottom: clamp(14px, 1.6vw, 22px); }
.rs-fk .fig-k { grid-column: 1 / 6; }

/* ------------------------------------------------------------ the 84 */
.rs-sc {
  position: relative;
  margin-top: clamp(72px, 7vw, 120px);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  column-gap: clamp(28px, 3.4vw, 56px);
  padding: clamp(24px, 3vw, 48px) clamp(18px, 4.4vw, 64px) clamp(22px, 2.6vw, 40px);
  background: var(--tile);
  border-radius: var(--r-stage);
}
.rs-sc-head { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: end; margin-bottom: clamp(26px, 3vw, 44px); }
.rs-sc-k { font-family: var(--f-sans); font-weight: 600; font-size: clamp(1.5rem, 1rem + 1.3vw, 2.375rem); line-height: 1.08; letter-spacing: -0.04em; max-width: 16ch; text-wrap: balance; }
.rs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
html:not(.js) .rs-chips { display: none; }
.rs-chip {
  font: 500 0.84375rem/1.2 var(--f-sans);
  letter-spacing: -0.008em;
  color: var(--ink-2);
  background: var(--bg);
  border: 0;
  border-radius: 999px;
  padding: 7px 13px 7px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 0 0.5px oklch(0.2 0.02 262 / 0.1), 0 1px 2px oklch(0.2 0.02 262 / 0.06);
  transition: color 200ms ease, background-color 240ms var(--eo), box-shadow 240ms var(--eo), transform 160ms var(--eo);
}
.rs-chip i { font-style: normal; color: var(--ink-3); margin-left: 4px; transition: color 200ms ease; }
.rs-chip:hover { color: var(--ink); box-shadow: 0 0 0 0.5px oklch(0.2 0.02 262 / 0.16), 0 2px 6px -2px oklch(0.2 0.02 262 / 0.18); }
.rs-chip:active { transform: scale(0.97); }
.rs-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.rs-chip[aria-pressed="true"] i { color: oklch(0.74 0.01 262); }

.rs-sc-plot { grid-column: 1 / -1; position: relative; }
.rs-sc-svg { touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.rs-sc-svg:focus { outline: none; }
.rs-sc-svg:focus-visible { outline: 2px solid var(--ink); outline-offset: 10px; border-radius: 4px; }
.rs-gv, .rs-gh { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.rs-gv.is-1, .rs-gh.is-1 { stroke: color-mix(in oklab, var(--ink-3) 55%, var(--tile)); }
.rs-b20 { stroke: var(--ink); stroke-width: 1.5; shape-rendering: crispEdges; }
.rs-ge { stroke: var(--ink); stroke-width: 1.5; shape-rendering: crispEdges; }
.rs-off { font-size: 12px; fill: var(--ink-3); text-anchor: end; }
.rs-off.is-count { text-anchor: start; }
.rs-m { fill: var(--dot); fill-opacity: 0.84; stroke: var(--tile); stroke-width: 1; transition: fill 220ms ease, fill-opacity 220ms ease, opacity 320ms ease; }
.rs-m.is-fair { stroke: var(--signal); stroke-width: 2; }
.rs-m.is-up { fill: var(--signal); fill-opacity: 1; }
.rs-m.is-off { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.rs-m.is-on { fill-opacity: 1; }
.rs-m.is-dim { opacity: 0.12; }
.rs-gx, .rs-gy { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; shape-rendering: crispEdges; }
.rs-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.rs-guide.is-off .rs-gx, .rs-guide.is-off .rs-gy { display: none; }
.rs-guide { transition: opacity 300ms ease; }
.rs-sc.rs-anim:not(.is-settled) .rs-guide { opacity: 0; }
html.js .rs-sc.rs-anim .rs-m.is-off { transition: opacity 600ms ease 400ms; }
html.js .rs-sc.rs-anim:not(.in) .rs-m.is-off { opacity: 0; }

/* the readout: a white card under the plot, beside the notes */
.rs-ro {
  grid-column: 1;
  align-self: start;
  min-height: 13rem;
  margin-top: clamp(26px, 2.8vw, 40px);
  padding: 18px 20px 18px;
  background: var(--bg);
  border-radius: var(--r-tile);
  box-shadow: 0 0 0 0.5px oklch(0.2 0.02 262 / 0.08), 0 1px 2px oklch(0.2 0.02 262 / 0.05), 0 16px 36px -22px oklch(0.2 0.02 262 / 0.3);
}
.rs-ro-s { font-family: var(--f-sans); font-weight: 600; font-size: 1.375rem; line-height: 1.12; letter-spacing: -0.032em; }
.rs-ro-f, .rs-ro-r { margin-top: 4px; font-size: var(--fs-fine); line-height: 1.4; color: var(--ink-3); }
.rs-ro-e { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 2px 20px; align-items: baseline; font-size: var(--fs-fine); color: var(--ink-3); }
.rs-ro-e b { font-family: var(--f-sans); font-weight: 600; font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.035em; color: var(--ink); margin-right: 4px; }
.rs-ro-e b.is-hit { color: var(--signal-t); }
.rs-ro-t { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: var(--fs-small); line-height: 1.45; color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }
.rs-sc-foot { grid-column: 2; margin-top: clamp(26px, 2.8vw, 40px); font-size: var(--fs-fine); line-height: 1.55; color: var(--ink-2); }
.rs-sc-lg { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.rs-sc-lg .legend { margin-top: 0; }
.rs-sc-note { margin-top: 16px; max-width: 68ch; text-wrap: pretty; }
.rs-hint { margin-top: 12px; color: var(--ink-3); }
html:not(.js) .rs-hint { display: none; }
.legend .l-ring { width: 11px; height: 11px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 2px var(--signal); margin: 0 3px; }
.legend .l-hit { width: 11px; height: 11px; border-radius: 50%; background: var(--signal); margin: 0 3px; }
.legend .l-sz { border-radius: 50%; background: var(--dot); opacity: 0.84; }
.legend .l-sz.is-s { width: 9px; height: 9px; margin: 0 4px; }
.legend .l-sz.is-l { width: 18px; height: 18px; }

/* ------------------------------------------------------------ the findings */
.rs-find .chapter-b > p { max-width: 62ch; }
.rs-find .chapter-b > p i { font-style: italic; }

/* 4 -> 0 */
.rs-cr { max-width: 480px; margin-top: 18px; }
.rs-cr .fig-s { margin: 0 0 4px; color: var(--ink-3); }
.rs-cr-r { fill: var(--ink-2); transform-box: fill-box; }
.rs-cr-r.is-neg { transform-origin: 100% 50%; }
.rs-cr-r.is-pos { transform-origin: 0 50%; }
.rs-rt { width: 100%; margin-top: 24px; border-collapse: collapse; }
.rs-rt th, .rs-rt td { text-align: left; vertical-align: middle; padding: 13px 14px 14px 0; border-top: 1px solid var(--line-2); }
.rs-rt tr:last-child > * { border-bottom: 1px solid var(--line-2); }
.rs-rt th { font-weight: 600; font-size: 0.96875rem; line-height: 1.3; letter-spacing: -0.01em; }
.rs-rt th small { display: block; margin-top: 2px; font-weight: 400; font-size: var(--fs-fine); letter-spacing: 0; color: var(--ink-3); }
.rs-rt-m { white-space: nowrap; width: 92px; }
.rs-rt-m i { display: inline-block; width: 13px; height: 12px; margin-right: 6px; background: var(--ink); vertical-align: middle; }
.rs-up, .legend .l-up { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.rs-dn, .legend .l-dn { clip-path: polygon(0 0, 100% 0, 50% 100%); }
.legend .l-up, .legend .l-dn { width: 11px; height: 10px; background: var(--ink); }
.rs-rt-m.is-none i { width: 56px; height: 0; margin: 0; background: none; border-top: 1.5px dashed var(--ink-3); opacity: 0.5; }
.rs-rt-n { width: 3.2em; padding-right: 0 !important; text-align: right !important; font-family: var(--f-sans); font-weight: 300; font-size: clamp(2rem, 1.4rem + 1.2vw, 2.75rem); line-height: 1; letter-spacing: -0.04em; }
.rs-rt-n span { position: relative; display: inline-block; padding: 0 0.1em; color: var(--ink-3); }
.rs-rt-n span::after { content: ""; position: absolute; left: -0.16em; right: -0.16em; top: 50%; height: 2px; margin-top: -1px; border-radius: 1px; background: var(--ink); transform: rotate(-38deg); }
.rs-rej .legend { margin-top: 14px; }
html.js .rs-cr-r { transition: transform 1000ms var(--eo) 250ms; }
html.js .rs-rej:not(.in) .rs-cr-r { transform: scaleX(0); }
html.js .rs-rt-m .rs-up, html.js .rs-rt-m .rs-dn { transition: opacity 400ms ease, transform 700ms var(--eo); transition-delay: calc(700ms + var(--i) * 110ms); }
html.js .rs-rej:not(.in) .rs-rt-m .rs-up, html.js .rs-rej:not(.in) .rs-rt-m .rs-dn { opacity: 0; transform: translateY(-10px); }
html.js .rs-rt-n span { transition: color 500ms ease 1900ms; }
html.js .rs-rt-n span::after { transition: transform 600ms var(--eio) 1500ms; }
html.js .rs-rej:not(.in) .rs-rt-n span { color: var(--ink); }
html.js .rs-rej:not(.in) .rs-rt-n span::after { transform: rotate(-38deg) scaleX(0); }

/* 4.81 against 20, and the ladder: full width, on the e-axis */
.rs-wt, .rs-ld { margin-top: clamp(34px, 3.6vw, 56px); }
.rs-gap { stroke: none; }
.rs-ghost { stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 3 3; opacity: 0; transition: opacity 400ms ease; }
.rs-ghost.is-on { opacity: 1; }
.rs-wbase { stroke: var(--tile-2); stroke-width: 8; stroke-linecap: round; }
.rs-wb { stroke: var(--ink); stroke-width: 8; stroke-linecap: round; }
.rs-wend { stroke: var(--ink); stroke-width: 1.5; }
.rs-wt-t { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; fill: var(--ink); paint-order: stroke; stroke: var(--tile); stroke-width: 4px; stroke-linejoin: round; }
.rs-lab .rs-wt-t { font-weight: 500; fill: var(--ink-3); stroke: none; }
.rs-wcount { font-size: 13px; font-weight: 600; fill: var(--ink-3); }
html.js .rs-wt.rs-anim [data-wt-t], html.js .rs-wt.rs-anim [data-wt-end] { opacity: 0; transition: opacity 400ms ease; }
html.js .rs-wt.rs-anim [data-wt-t].is-on, html.js .rs-wt.rs-anim [data-wt-end].is-on { opacity: 1; }
html.js .rs-wt.rs-anim [data-wt-v] { opacity: 0; transition: opacity 500ms ease 900ms; }
html.js .rs-wt.rs-anim.in [data-wt-v] { opacity: 1; }
.rs-ld-svg .rs-lab { paint-order: stroke; stroke: var(--tile); stroke-width: 6px; stroke-linejoin: round; }
.rs-lb { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.rs-lb.is-last { stroke: var(--ink); stroke-width: 1.25; }
.rs-mg { stroke: var(--ink-3); stroke-width: 6; stroke-opacity: 0.22; stroke-linecap: round; }
html.js .rs-ld.rs-anim .rs-mg { opacity: 0; transition: opacity 600ms ease; }
html.js .rs-ld.rs-anim.is-real .rs-mg { opacity: 1; }
html.js .rs-ld.rs-anim [data-ld-v] { opacity: 0; transition: opacity 500ms ease calc(var(--i) * 120ms); }
html.js .rs-ld.rs-anim.is-fair [data-ld-v]:not(.is-real), html.js .rs-ld.rs-anim.is-done [data-ld-v] { opacity: 1; }
html.js .rs-ld.rs-anim .rs-nd.is-real { opacity: 0; transition: opacity 300ms ease; }
html.js .rs-ld.rs-anim.is-real .rs-nd.is-real { opacity: 1; }
.rs-ld-foot { margin-top: 18px; font-size: var(--fs-fine); line-height: 1.5; color: var(--ink-2); align-items: start; }
.rs-ld-foot .legend { grid-column: 1 / 3; margin-top: 2px; }
.rs-ld-note { grid-column: 3 / 6; padding-right: 0; max-width: 62ch; }

/* the instrument, and the result */
.rs-val .chapter-b > p { max-width: 62ch; }
.rs-neg {
  margin-top: clamp(30px, 3.2vw, 48px) !important;
  max-width: 30ch !important;
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: clamp(1.625rem, 1rem + 1.6vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--ink) !important;
  text-wrap: balance;
}
.rs-neg sup { font-size: 0.55em; letter-spacing: -0.01em; position: relative; top: -0.05em; }

/* files */
.rs-files { border-top: 1px solid var(--line-2); }
.rs-files li { border-bottom: 1px solid var(--line); }
.rs-files a {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto;
  gap: 2px var(--gut);
  align-items: baseline;
  margin-inline: -14px;
  padding: 15px 14px 16px;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 220ms ease;
}
.rs-files a:hover { background: var(--tile); }
.rs-files b { font-family: var(--f-sans); font-weight: 600; font-size: 1.25rem; line-height: 1.2; letter-spacing: -0.028em; justify-self: start; }
.rs-files span { font-size: var(--fs-fine); color: var(--ink-2); }
.rs-files .rs-kb { color: var(--ink-3); white-space: nowrap; }

/* ------------------------------------------------------------ paper two */
.rs-echo {
  margin-top: clamp(44px, 4.8vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  column-gap: clamp(28px, 3.4vw, 56px);
  align-items: center;
  padding: clamp(28px, 3.6vw, 60px) clamp(20px, 4.4vw, 64px) clamp(28px, 3.4vw, 56px);
  background: var(--tile);
  border-radius: var(--r-stage);
}
.rs-echo-n { font-family: var(--f-sans); font-weight: 300; font-size: clamp(6rem, 2.8rem + 8vw, 12.5rem); line-height: 0.8; letter-spacing: -0.065em; margin-left: -0.06em; white-space: nowrap; }
.rs-echo-b { min-width: 0; }
.rs-echo-t { font-size: var(--fs-lead); line-height: 1.38; letter-spacing: -0.014em; max-width: 38ch; text-wrap: pretty; }
.rs-eb { position: relative; margin-top: 30px; max-width: 760px; padding-bottom: 24px; }
.rs-eb-r + .rs-eb-r { margin-top: 18px; }
.rs-eb-r p { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 8px; font-size: var(--fs-fine); color: var(--ink-2); }
.rs-eb-r p b { font-family: var(--f-sans); font-weight: 600; font-size: 1.1875rem; letter-spacing: -0.03em; color: var(--ink); white-space: nowrap; }
.rs-eb-r i { display: block; height: 18px; width: var(--w); border-radius: 5px; background: var(--ink); transform-origin: left center; }
.rs-eb-r.is-echo p { width: var(--w); }
.rs-eb-r.is-echo i { background: oklch(0.74 0.01 262); }
.rs-eb-m { position: absolute; top: 26px; bottom: 0; left: var(--w); border-left: 1.5px dashed var(--ink-2); font-style: normal; }
.rs-eb-m span { position: absolute; bottom: -4px; left: 7px; font-size: 0.8125rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
html.js .rs-echo.rs-anim .rs-eb-r i { transition: transform 900ms var(--eo); }
html.js .rs-echo.rs-anim .rs-eb-r.is-echo i { transition: transform 1400ms var(--eo) 700ms; }
html.js .rs-echo.rs-anim:not(.in) .rs-eb-r i { transform: scaleX(0); }
html.js .rs-echo.rs-anim .rs-eb-m, html.js .rs-echo.rs-anim .rs-eb-r.is-echo p b { transition: opacity 500ms ease 2000ms; }
html.js .rs-echo.rs-anim:not(.in) .rs-eb-m, html.js .rs-echo.rs-anim:not(.in) .rs-eb-r.is-echo p b { opacity: 0; }

.rs-fl-k { margin-bottom: 16px; }
.rs-fl .fl-cap-t { max-width: 80ch; }

/* the seed budget */
.rs-bu .fig-k { margin-bottom: 12px; }
.rs-bg { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.rs-bg.is-lab { stroke: var(--line-2); }
.rs-band { opacity: 0.9; }
.rs-asym { stroke: var(--ink); stroke-width: 1.25; stroke-dasharray: 5 4; }
.rs-bu-line path { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rs-bd { fill: var(--ink); stroke: var(--tile); stroke-width: 1.5; transition: r 200ms ease; }
.rs-bd.is-k { fill: var(--bg); stroke: var(--ink); stroke-width: 2; }
.rs-bd.is-hov { stroke: var(--ink); stroke-width: 3; }
.rs-k15 { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; }
.rs-bhit { fill: transparent; }
.rs-bro-b { fill: oklch(0.2 0.012 262 / 0.94); }
.rs-bro-t { fill: var(--bg); font-size: 12.5px; font-weight: 500; }
html.js .rs-bu-line { clip-path: inset(-10px 0 -10px 0); transition: clip-path 1500ms var(--eio) 250ms; }
html.js .rs-bu:not(.in) .rs-bu-line { clip-path: inset(-10px 100% -10px 0); }
html.js .rs-bd { transition: opacity 250ms ease calc(250ms + var(--i) * 72ms); }
html.js .rs-bu:not(.in) .rs-bd { opacity: 0; }
html.js .rs-bu .rs-ann, html.js .rs-bu .rs-k15 { transition: opacity 600ms ease 1700ms; }
html.js .rs-bu:not(.in) .rs-ann, html.js .rs-bu:not(.in) .rs-k15 { opacity: 0; }

/* one win, counted in floors: the win clears its floor, so it is blue */
.rs-tl-r { display: grid; grid-template-columns: minmax(0, 1fr) 3.4em; column-gap: 14px; align-items: end; margin-top: 14px; }
.rs-tl .fig-k + .rs-tl-r { margin-top: 14px; }
.rs-tl-k { grid-column: 1 / 3; margin-bottom: 6px; font-size: var(--fs-fine); color: var(--ink-2); }
.rs-tl-t { grid-column: 1; display: flex; height: 18px; }
.rs-tl-t i { position: relative; display: block; flex: none; height: 100%; }
.rs-tl-t i::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: 3px; border-radius: 4px; background: var(--ink); }
.rs-tl-r.is-thin .rs-tl-t i::before { right: 2px; border-radius: 3px; }
.rs-tl-r.is-win .rs-tl-t i::before { right: 0; border-radius: 5px; background: var(--signal); }
.rs-tl-x { grid-column: 2; align-self: center; font-weight: 600; font-size: 1.375rem; line-height: 1; letter-spacing: -0.03em; text-align: left; }
html.js .rs-tl .rs-tl-t i { transition: opacity 160ms ease calc(400ms + var(--i) * 150ms); }
html.js .rs-tl .rs-tl-r.is-thin .rs-tl-t i { transition-delay: calc(1200ms + var(--i) * 60ms); }
html.js .rs-tl:not(.in) .rs-tl-t i { opacity: 0; }
html.js .rs-tl .rs-tl-r.is-win .rs-tl-t i { transition: transform 900ms var(--eo) 100ms; transform-origin: left center; opacity: 1; }
html.js .rs-tl:not(.in) .rs-tl-r.is-win .rs-tl-t i { transform: scaleX(0); }
html.js .rs-tl .rs-tl-x { transition: opacity 400ms ease 1000ms; }
html.js .rs-tl .rs-tl-r.is-thin .rs-tl-x { transition-delay: 2100ms; }
html.js .rs-tl:not(.in) .rs-tl-x { opacity: 0; }

/* 2.9 points: the classifier's floor, and what twenty reruns moved */
.rs-p4 .fig-k { margin-bottom: 8px; }
.rs-p4-edge { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 3; }
.rs-p4-h { fill: var(--ink); }
.rs-p4 .fig-s { margin-top: 8px; color: var(--ink-3); }
html.js .rs-p4-band { transform-box: fill-box; transform-origin: 0 50%; transition: transform 1100ms var(--eo) 200ms; }
html.js .rs-p4:not(.in) .rs-p4-band { transform: scaleX(0); }
html.js .rs-p4-edge, html.js .rs-p4 .rs-cap { transition: opacity 500ms ease 1000ms; }
html.js .rs-p4:not(.in) .rs-p4-edge, html.js .rs-p4:not(.in) .rs-cap { opacity: 0; }
html.js .rs-p4-n, html.js .rs-p4-v { transition: opacity 400ms ease 1400ms, transform 700ms var(--eo) 1400ms; }
html.js .rs-p4:not(.in) .rs-p4-n, html.js .rs-p4:not(.in) .rs-p4-v { opacity: 0; transform: translateY(-10px); }

/* ------------------------------------------------------------ before the papers */
.rs-eh { margin-top: 0; }
.rs-eh .sec-t { grid-column: 1 / 4; }
.rs-early { margin-top: clamp(56px, 5.4vw, 92px); align-items: start; }
.rs-early + .rs-early { margin-top: clamp(96px, 9vw, 160px); }
.rs-early-t { grid-column: 1 / 3; padding-top: clamp(4px, 1vw, 16px); }
.rs-eh3 { font-family: var(--f-sans); font-weight: 600; font-size: clamp(1.875rem, 1.1rem + 1.6vw, 2.75rem); line-height: 1.02; letter-spacing: -0.045em; margin-left: -0.03em; max-width: 13ch; text-wrap: balance; }
.rs-when { margin-top: 10px; font-size: var(--fs-fine); color: var(--ink-3); }
.rs-early-t > p:not(.rs-when):not(.rs-file) { margin-top: 14px; max-width: 46ch; color: var(--ink-2); text-wrap: pretty; }
.rs-early-t > .rs-when + p { margin-top: 20px !important; }
.rs-file { margin-top: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.rs-file span { font-size: var(--fs-fine); color: var(--ink-3); }

/* the newspaper's edge, on a light tile: the paper is white, the misfit under it */
.rs-wave {
  grid-column: 3 / 6;
  padding: clamp(22px, 2.8vw, 44px) clamp(18px, 3vw, 48px) clamp(20px, 2.4vw, 36px);
  background: var(--tile);
  border-radius: var(--r-stage);
}
.rs-wave-pick { margin-bottom: clamp(22px, 2.6vw, 38px); }
html:not(.js) .rs-wave-pick { display: none; }
.rs-wave .seg-b i { font-style: normal; font-weight: 500; color: var(--ink-2); margin-left: 4px; }
.rs-wave svg { display: block; width: 100%; height: auto; overflow: visible; }
.wave__paper { fill: var(--bg); }
.wave__edge { fill: none; stroke: var(--ink); stroke-width: 1.75px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.wave__fit { fill: none; stroke: var(--ink-3); stroke-width: 2px; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.wave__miss { fill: none; stroke: var(--ink-2); stroke-width: 1.25px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.wave__zero { stroke: var(--line-2); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.wave.is-tri .wave__fit { stroke-dasharray: 2 4; stroke-width: 2.25px; }
.rs-wave-cap { margin-top: 20px; max-width: 66ch; color: var(--ink-3); }
.rs-wave-cap span { color: var(--ink); font-weight: 500; }
@media screen and (prefers-reduced-motion: no-preference) {
  .wave.is-scrub .wave__draw { clip-path: inset(-4px calc((1 - clamp(0, var(--p, 0) / 0.8, 1)) * 100%) -4px 0); }
  .wave.is-scrub .wave__draw--fit { clip-path: inset(-4px calc((1 - clamp(0, (var(--p, 0) - 0.2) / 0.8, 1)) * 100%) -4px 0); }
}

/* the tea glass, on a light tile: the drawing, and the instrument beside it */
.rs-glass {
  grid-column: 3 / 6;
  display: grid;
  grid-template-columns: minmax(0, 31%) minmax(0, 1fr);
  column-gap: clamp(24px, 3.4vw, 56px);
  align-items: center;
  padding: clamp(26px, 3.2vw, 52px) clamp(20px, 3.4vw, 56px);
  background: var(--tile);
  border-radius: var(--r-stage);
}
.rs-glass-d { min-width: 0; }
.discs__svg { display: block; width: 100%; height: auto; max-height: 460px; overflow: visible; }
.discs__axis { stroke: var(--ink-3); stroke-opacity: 0.45; stroke-width: 1px; stroke-dasharray: 5 6; vector-effect: non-scaling-stroke; }
.discs__g rect { fill: var(--bg); stroke: color-mix(in oklab, var(--ink-3) 55%, var(--bg)); stroke-width: 0.75px; vector-effect: non-scaling-stroke; }
.discs__outline { fill: none; stroke: var(--ink); stroke-width: 1.75px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.rs-glass-c { max-width: 420px; }
.discs__n { display: flex; align-items: baseline; justify-content: space-between; font-size: var(--fs-fine); color: var(--ink-3); }
.discs__n output { font-family: var(--f-sans); font-weight: 600; font-size: 2.25rem; line-height: 1; letter-spacing: -0.045em; color: var(--ink); }

/* the slider: a track that fills to the thumb, and a white thumb that lifts */
.discs__range { --p: 0.5833; display: block; width: 100%; margin: 14px 0 20px; height: 28px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: pan-y; }
.discs__range:focus { outline: none; }
/* keyboard focus rings the thumb, not the whole track */
.discs__range:focus-visible { outline: none; }
.discs__range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(var(--ink), var(--ink)) 0 0 / calc(11px + (100% - 22px) * var(--p)) 100% no-repeat, var(--line-2);
}
.discs__range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line-2); }
.discs__range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--ink); }
.discs__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--bg);
  border: 0;
  box-shadow: 0 0 0 0.5px oklch(0.2 0.02 262 / 0.18), 0 1px 2px oklch(0.2 0.02 262 / 0.14), 0 4px 12px -3px oklch(0.2 0.02 262 / 0.3);
  transition: transform 220ms var(--eo), box-shadow 220ms var(--eo);
}
.discs__range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 0; box-shadow: 0 0 0 0.5px oklch(0.2 0.02 262 / 0.18), 0 4px 12px -3px oklch(0.2 0.02 262 / 0.3); }
.discs__range:hover::-webkit-slider-thumb, .discs__range:active::-webkit-slider-thumb { transform: scale(1.1); box-shadow: 0 0 0 0.5px oklch(0.2 0.02 262 / 0.18), 0 1px 2px oklch(0.2 0.02 262 / 0.14), 0 6px 16px -4px oklch(0.2 0.02 262 / 0.36); }
.discs__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink), 0 4px 12px -3px oklch(0.2 0.02 262 / 0.3); }
.discs__range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
html:not(.js) .discs__range { display: none; }

.discs__vals div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 10px 0 11px; border-top: 1px solid var(--line-2); }
.discs__vals div:last-child { border-bottom: 1px solid var(--line-2); }
.discs__vals dt { font-size: var(--fs-fine); color: var(--ink-2); line-height: 1.35; }
.discs__vals dd { font-size: var(--fs-fine); color: var(--ink-3); white-space: nowrap; }
.discs__vals b { font-family: var(--f-sans); font-weight: 300; font-size: 2rem; line-height: 1; letter-spacing: -0.045em; color: var(--ink); }
.discs__vals div:last-child b { font-weight: 600; }
.beaker { position: relative; margin-top: 30px; }
.rs-bk-we { stroke: var(--ink-3); stroke-width: 1; shape-rendering: crispEdges; }
.rs-bk-lim { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 2; }
/* the sum, as a playhead with a knob: the home page's rule cursor, small */
.beaker__dot { position: absolute; top: 4px; left: var(--at); width: 2px; height: 22px; margin-left: -1px; border-radius: 1px; background: var(--ink); transition: left 420ms var(--eo); }
.beaker__dot::before { content: ""; position: absolute; top: -6px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 3px var(--tile); }
.beaker__k { margin-top: 12px; font-size: var(--fs-fine); line-height: 1.45; color: var(--ink-3); max-width: 40ch; }

/* ------------------------------------------------------------ out */
.rs-out-in { margin-top: 0; align-items: baseline; }
.rs-out-h { grid-column: 1 / 3; font-family: var(--f-sans); font-weight: 600; font-size: clamp(1.875rem, 1.1rem + 1.8vw, 3rem); line-height: 1.02; letter-spacing: -0.045em; max-width: 14ch; text-wrap: balance; }
.rs-out-l { grid-column: 3 / 6; padding-right: 0; }
.rs-mail { display: inline-block; font-family: var(--f-sans); font-weight: 400; font-size: clamp(1.75rem, 0.9rem + 2.6vw, 3.5rem); line-height: 1.05; letter-spacing: -0.045em; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1.5px no-repeat; padding-bottom: 0.1em; transition: background-size 500ms var(--eo); overflow-wrap: anywhere; }
.rs-mail:hover { background-size: 100% 3px; }
.rs-out-l .links { margin-top: 18px; }
html.js .rs-out-in .rs-mail { opacity: 0; transform: translateY(18px); transition: opacity 900ms var(--eo) 150ms, transform 1100ms var(--eo) 150ms, background-size 500ms var(--eo); }
html.js .rs-out-in.in .rs-mail { opacity: 1; transform: none; }

/* ==========================================================================
   Widths
   ========================================================================== */
@media (max-width: 1100px) {
  .rs-fl .fl-wide { display: none; }
  .rs-fl .fl-narrow { display: block; }
  .rs-early-t { grid-column: 1 / 6; max-width: 640px; }
  .rs-wave, .rs-glass { grid-column: 1 / 6; margin-top: 36px; }
  .rs-glass { grid-template-columns: minmax(0, 34%) minmax(0, 1fr); }
  .rs-files a { grid-template-columns: minmax(0, 1fr) auto; }
  .rs-files a > span:not(.rs-kb) { grid-row: 2; }
  .rs-sc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rs-echo { grid-template-columns: minmax(0, 1fr); }
  .rs-echo-n { margin-bottom: 24px; }
}

@media (max-width: 760px) {
  .rs-sec { padding-top: 104px; }
  .case-hero + .rs-sec { padding-top: 72px; }
  .rs .case-a .case-line { margin-top: 20px; }
  .rs-pv { margin-bottom: 18px; padding-top: 0; }
  .rs-h { font-size: clamp(2.5rem, 11.4vw, 3.375rem); max-width: none; }
  .rs-sub { font-size: 1.1875rem; }
  .rs-read .rs-alt { margin-left: 0; }
  .rs-read { gap: 4px 10px; }
  .rs-tile, .rs-tile.is-wide { padding: 20px 14px 18px; }
  .rs-sc { display: block; padding: 22px 14px 20px; }
  .rs-sc-head { display: block; margin-bottom: 22px; }
  .rs-sc-k { margin-bottom: 16px; }
  .rs-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -14px; padding: 2px 14px 6px; scroll-padding-inline: 14px; }
  .rs-chips::-webkit-scrollbar { display: none; }
  .rs-chip { font-size: 0.8125rem; }
  .rs-ro { min-height: 0; margin-top: 22px; padding: 16px 16px 16px; }
  .rs-ro-e b { font-size: 1.3125rem; }
  .rs-sc-foot { margin-top: 20px; }
  .rs-rt th { font-size: 0.9375rem; }
  .rs-rt-m { width: 70px; }
  .rs-rt-m i { width: 11px; height: 10px; margin-right: 4px; }
  .rs-rt-m.is-none i { width: 40px; }
  .rs-ld-foot .rs-ld-note { margin-top: 10px; }
  .rs-echo { padding: 26px 16px 22px; }
  .rs-echo-n { font-size: 7rem; margin-bottom: 18px; }
  .rs-eb-r p { font-size: 0.8125rem; }
  .rs-eh .sec-t { font-size: clamp(2.5rem, 12vw, 3.25rem); }
  .rs-wave { padding: 20px 14px 18px; }
  .rs-wave-pick { flex-wrap: wrap; gap: 8px 12px; }
  .rs-glass { grid-template-columns: minmax(0, 36%) minmax(0, 1fr); column-gap: 16px; padding: 22px 16px 20px; align-items: start; }
  .discs__n output { font-size: 1.875rem; }
  .discs__vals b { font-size: 1.625rem; }
  .discs__vals div { grid-template-columns: 1fr; gap: 2px; }
  .rs-out-l { margin-top: 18px; }
  .rs-files a { grid-template-columns: 1fr; margin-inline: -10px; padding-inline: 10px; }
  .rs-files a > span:not(.rs-kb) { grid-row: auto; }
}

/* ==========================================================================
   Motion off: every figure in its final state
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html.js .rs-h { opacity: 1; transform: none; filter: none; transition: none; }
  html.js .rs-cr-r, html.js .rs-rt-m .rs-up, html.js .rs-rt-m .rs-dn, html.js .rs-rt-n span { transition: none; }
  html.js .rs-rej:not(.in) .rs-cr-r { transform: none; }
  html.js .rs-rej:not(.in) .rs-rt-m .rs-up, html.js .rs-rej:not(.in) .rs-rt-m .rs-dn { opacity: 1; transform: none; }
  html.js .rs-rej:not(.in) .rs-rt-n span { color: var(--ink-3); }
  html.js .rs-rt-n span::after { transition: none; }
  html.js .rs-rej:not(.in) .rs-rt-n span::after { transform: rotate(-38deg); }
  html.js .rs-bu-line, html.js .rs-bd, html.js .rs-bu .rs-ann, html.js .rs-bu .rs-k15 { transition: none; }
  html.js .rs-bu:not(.in) .rs-bu-line { clip-path: none; }
  html.js .rs-bu:not(.in) .rs-bd, html.js .rs-bu:not(.in) .rs-ann, html.js .rs-bu:not(.in) .rs-k15 { opacity: 1; }
  html.js .rs-tl .rs-tl-t i, html.js .rs-tl .rs-tl-x { transition: none; }
  html.js .rs-tl:not(.in) .rs-tl-t i, html.js .rs-tl:not(.in) .rs-tl-x { opacity: 1; transform: none; }
  html.js .rs-tl .rs-tl-r.is-win .rs-tl-t i { transition: none; }
  html.js .rs-tl:not(.in) .rs-tl-r.is-win .rs-tl-t i { transform: none; }
  html.js .rs-p4-band, html.js .rs-p4-edge, html.js .rs-p4 .rs-cap, html.js .rs-p4-n, html.js .rs-p4-v { transition: none; }
  html.js .rs-p4:not(.in) .rs-p4-band, html.js .rs-p4:not(.in) .rs-p4-n, html.js .rs-p4:not(.in) .rs-p4-v { transform: none; }
  html.js .rs-p4:not(.in) .rs-p4-edge, html.js .rs-p4:not(.in) .rs-cap, html.js .rs-p4:not(.in) .rs-p4-n, html.js .rs-p4:not(.in) .rs-p4-v { opacity: 1; }
  html.js .rs-out-in .rs-mail { opacity: 1; transform: none; transition: none; }
  .beaker__dot, .rs-chip, .rs-files a, .rs-toc a { transition: none; }
  .discs__range::-webkit-slider-thumb { transition: none; }
  .rs-m, .rs-guide, .rs-ghost { transition: none; }
}

@media print {
  .rs-tile, .rs-sc, .rs-echo, .rs-wave, .rs-glass, .rs-ro { background: none !important; box-shadow: none !important; }
}


/* the Collatz article: a starting number's path down to 1, on a tile */
.rs-cz { grid-column: 3 / 6; padding: clamp(22px, 2.8vw, 44px) clamp(18px, 3vw, 48px) clamp(20px, 2.4vw, 36px); background: var(--tile); border-radius: var(--r-stage); }
.rs-cz-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: clamp(18px, 2.2vw, 30px); }
.rs-cz-ctl[hidden] { display: none; }
.rs-cz-k { font-size: 0.875rem; color: var(--ink-3); white-space: nowrap; }
.rs-cz-k b { color: var(--ink); font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.02em; display: inline-block; min-width: 3.2ch; }
.rs-cz-range { flex: 1 1 180px; accent-color: var(--ink); }
.rs-cz-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--f-sans); }
.cz-grid line { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.cz-grid text { font-size: 13px; fill: var(--ink-3); text-anchor: end; }
.cz-ax { font-size: 13px; fill: var(--ink-3); text-anchor: end; }
.cz-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cz-dot { fill: var(--ink); }
.cz-pk { font-size: 14px; font-weight: 600; fill: var(--ink); }
.is-collatz .rs-file span a { color: inherit; }
@media (max-width: 1100px) { .rs-cz { grid-column: 1 / 6; margin-top: 28px; } }
/* two drawings for readers without JavaScript, a laptop's and a phone's, so
   the labels stay near their 13px; collatz.js keeps the first and redraws it
   at the figure's own width in pixels */
.cz-n { display: none; }
.cz-n .rs-cz-svg { max-width: 440px; }
@media (max-width: 760px) {
  .rs-cz:not(.is-live) .cz-w { display: none; }
  .rs-cz:not(.is-live) .cz-n { display: block; }
}
.rs-cz.is-live .cz-n { display: none; }
