/* =====================================================================
   Rubikn · studies family restyle (rubikn-legacy-studies.css)
   ---------------------------------------------------------------------
   The 8 case studies (/case-study/<slug>/) and the studies listing
   (/case-studies/) in the new pages' look. Loads last, after
   styles.css, case-study.css or studies-listing.css, rubikn-frame.css
   and rubikn-legacy.css (one <link> after the rk-frame:family-css hook).

   Look (How it works / About Abdullah): paper, ink, cobalt; Geist 18 px
   body, Geist 500 headings, Instrument Serif italic only as an accent;
   one left-aligned reading line (46ch) on the page's left edge; wider
   blocks (tables, evidence, findings) on one 880 px measure; 8-point
   spacing; 16 px minimum text; 44 px targets; sentence-case labels.
   Amber only marks a warning (a gap or a legend); cobalt marks what
   holds up. Ink panels are used as on the new pages.

   What it switches off, visually only (no text or markup changes):
   the lime reading-progress scan line (the header already shows
   progress), the CSS-drawn "FIELD TESTIMONY" label and "//" rule marks,
   dot-grid textures, corner marks, lime glows, the listing's aria-hidden
   network art, and the tiny labels inside the flagship's aria-hidden
   drawing. The inline verdict chips (GAP / HOLDS / LEGEND / FACT) keep
   their words and become plain bold words with a colour dot.

   Scoped to html[data-rk-frame], which only the older pages carry.
   ===================================================================== */

html[data-rk-frame] {
  --st-read: 46ch;       /* the reading line, resolved on 18 px text = 549 px */
  --st-line: 549px;      /* the same line in px, for blocks with other font sizes */
  --st-wide: 880px;      /* tables, evidence, findings, takeaways */
}

/* =====================================================================
   A. CASE STUDY PAGES (/case-study/<slug>/)
   ===================================================================== */

/* ---------- decoration off ---------- */
html[data-rk-frame] .cs-progress { display: none; }

/* ---------- hero ---------- */
html[data-rk-frame] .cs-hero { padding: 128px 0 64px; }
html[data-rk-frame] .cs-hero > .container { max-width: none; }
html[data-rk-frame] :is(.cs-hero, .studies-hero) .breadcrumbs { flex-wrap: wrap; }
html[data-rk-frame] :is(.cs-hero, .studies-hero) .breadcrumbs a { min-width: 44px; justify-content: center; }
html[data-rk-frame] .cs-stamp { display: flex; width: max-content; max-width: 100%; margin: 32px 0 24px; }
html[data-rk-frame] .cs-hero__title {
  font-family: var(--sans); font-weight: 500;
  font-size: clamp(40px, 4.45vw, 66px); line-height: 1.04; letter-spacing: -.043em;
  color: var(--ink); max-width: 18ch; text-wrap: balance;
}
html[data-rk-frame] .cs-hero__title em {
  font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.08em; letter-spacing: -.015em;
  padding-right: .04em;
  background-image: linear-gradient(var(--acc), var(--acc)); background-repeat: no-repeat; background-position: 0 94%; background-size: 100% 1.5px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
html[data-rk-frame] .cs-hero__lede {
  margin-top: 32px; padding: 0; border: 0;
  font-size: clamp(19px, 1.45vw, 23px); line-height: 1.5; letter-spacing: -.01em;
  color: var(--ink2); max-width: 44ch;
}
/* the meta row: quiet 16 px text on one rule, as the new pages' "On this page" row */
html[data-rk-frame] .cs-meta {
  margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line);
  gap: 8px 16px; max-width: 720px;
}
html[data-rk-frame] .cs-meta__item {
  font-family: var(--sans); font-size: 16px; line-height: 1.5; letter-spacing: -.005em; text-transform: none;
  color: var(--ink3);
}
html[data-rk-frame] .cs-meta__item strong { color: var(--ink); font-weight: 500; }
html[data-rk-frame] .cs-meta__sep { width: 4px; height: 4px; background: var(--rule); opacity: 1; }

/* ---------- attached reports: a quiet list of rows ---------- */
html[data-rk-frame] .cs-reports { padding: 0 0 32px; }
html[data-rk-frame] .cs-reports .container { max-width: none; }
html[data-rk-frame] .cs-reports__label,
html[data-rk-frame] .cs-toc__label {
  margin: 0; padding: 0 0 16px; border-bottom: 1px solid var(--line2);
  font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: -.005em; text-transform: none;
  color: var(--ink); max-width: var(--st-line);
}
/* sentence case for the plain labels whose words carry no proper nouns ("Attached Reports" reads "Attached reports") */
html[data-rk-frame] :is(.cs-reports__label, .cs-toc__label, .cs-findings__label) { text-transform: lowercase; }
html[data-rk-frame] :is(.cs-reports__label, .cs-toc__label, .cs-findings__label)::first-letter { text-transform: uppercase; }
html[data-rk-frame] .cs-reports__grid { max-width: var(--st-line); }
html[data-rk-frame] .cs-report-card {
  gap: 16px; min-height: 80px; padding: 16px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); transition: color .3s var(--out);
}
html[data-rk-frame] .cs-report-card:hover,
html[data-rk-frame] .cs-report-card:active { opacity: 1; }
html[data-rk-frame] .cs-report-card__icon { width: 44px; height: 52px; border-radius: 2px; background: var(--hl); color: var(--acc); }
html[data-rk-frame] .cs-report-card__body { gap: 2px; }
html[data-rk-frame] .cs-report-card__tag { font-family: var(--sans); font-size: 16px; font-weight: 400; line-height: 1.4; letter-spacing: -.005em; text-transform: none; color: var(--ink3); }
html[data-rk-frame] .cs-report-card__title { font-family: var(--sans); font-size: 18px; font-weight: 500; line-height: 1.35; letter-spacing: -.012em; color: var(--ink); transition: color .3s var(--out); }
html[data-rk-frame] .cs-report-card__subtitle { font-size: 16px; line-height: 1.45; color: var(--ink2); }
html[data-rk-frame] .cs-report-card__action { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 99px; background: rgba(10, 15, 31, .06); color: var(--ink); transition: transform .55s var(--spring), background .35s var(--out), color .3s var(--out); }
html[data-rk-frame] .cs-report-card__action svg { width: 16px; height: 16px; }
html[data-rk-frame] .cs-report-card:hover .cs-report-card__title { color: var(--acc2); }
html[data-rk-frame] .cs-report-card:hover .cs-report-card__action { background: var(--acc); color: #fff; transform: rotate(-8deg); }

/* the report viewer (opens on a report row): same dark sheet, 16 px text, 44 px controls */
html[data-rk-frame] .cs-pdf-viewer { background: rgba(6, 10, 21, .9); }
html[data-rk-frame] .cs-pdf-viewer__chrome { border-radius: 2px; background: var(--navy2); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .7); }
html[data-rk-frame] .cs-pdf-viewer__header { min-height: 64px; padding: 8px 8px 8px 20px; background: var(--navy); border-bottom: 1px solid rgba(255, 255, 255, .09); }
html[data-rk-frame] .cs-pdf-viewer__title { font-family: var(--sans); font-size: 16px; font-weight: 500; letter-spacing: -.005em; color: #eef0f6; }
html[data-rk-frame] .cs-pdf-viewer__page { font-family: var(--sans); font-size: 16px; font-weight: 400; color: #b3b9c9; }
html[data-rk-frame] :is(.cs-pdf-viewer__btn, .cs-pdf-viewer__close) { width: 44px; height: 44px; border-radius: 2px; color: #b3b9c9; }
html[data-rk-frame] :is(.cs-pdf-viewer__btn, .cs-pdf-viewer__close):hover { background: rgba(255, 255, 255, .08); color: #fff; }
html[data-rk-frame] .cs-pdf-viewer__loading { font-family: var(--sans); font-size: 16px; letter-spacing: 0; color: #b3b9c9; }

/* ---------- body: one reading column on the page's left edge ---------- */
html[data-rk-frame] .cs-body {
  display: block; width: var(--container); max-width: none; margin: 0 auto;
  padding: 48px 0 96px;
}
html[data-rk-frame] .cs-toc-col { position: static; }

/* the case file index: a quiet list above the text (no sticky side column) */
html[data-rk-frame] .cs-toc,
html[data-rk-frame] .cs-toc.is-stuck,
html[data-rk-frame] .cs-toc.is-bottomed {
  display: block; position: static !important; top: auto !important; bottom: auto !important; width: auto !important;
  max-width: var(--st-wide); margin: 0 0 80px; padding: 0; border: 0;
}
html[data-rk-frame] .cs-toc__label { max-width: none; }
html[data-rk-frame] .cs-toc__list { display: block; columns: 2; column-gap: 40px; }
html[data-rk-frame] .cs-toc__item { break-inside: avoid; }
html[data-rk-frame] .cs-toc__item a,
html[data-rk-frame] .cs-toc__item.is-active a {
  display: flex; align-items: baseline; gap: 16px; min-height: 48px; margin: 0; padding: 12px 0;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none;
  font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.4; letter-spacing: -.005em;
  color: var(--ink2); text-decoration: none;
  transition: color .3s var(--out);
}
html[data-rk-frame] .cs-toc__item a::before,
html[data-rk-frame] .cs-toc__item.is-active a::before {
  display: block; min-width: 24px; padding: 0;
  font-family: var(--sans); font-size: 16px; font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums;
  color: var(--ink3); opacity: 1;
}
html[data-rk-frame] .cs-toc__item a:hover { color: var(--ink); }
html[data-rk-frame] .cs-toc__item a:hover::before,
html[data-rk-frame] .cs-toc__item.is-active a::before { color: var(--acc); }
html[data-rk-frame] .cs-toc__item.is-active a { color: var(--ink); }

/* ---------- prose ---------- */
html[data-rk-frame] .cs-prose { max-width: var(--st-wide); font-size: 18px; line-height: 1.6; color: var(--ink2); }
html[data-rk-frame] .cs-prose > * + * { margin-top: 24px; }
html[data-rk-frame] .cs-prose > :where(p, ul, ol, h3) { max-width: var(--st-line); }
html[data-rk-frame] .cs-prose > p:first-of-type { font-size: 20px; line-height: 1.55; letter-spacing: -.01em; color: var(--ink); }
html[data-rk-frame] .cs-prose :is(p, li) { color: var(--ink2); }
html[data-rk-frame] .cs-prose > p:first-of-type { color: var(--ink); }
html[data-rk-frame] .cs-prose strong { color: var(--ink); font-weight: 600; }

html[data-rk-frame] .cs-prose h2 {
  margin-top: 80px; margin-bottom: 0; max-width: 20ch;
  font-family: var(--sans); font-weight: 500; font-size: clamp(30px, 2.8vw, 42px); line-height: 1.1; letter-spacing: -.035em;
  color: var(--ink); text-wrap: balance;
}
html[data-rk-frame] .cs-prose > h2:first-child,
html[data-rk-frame] .cs-prose > hr + h2 { margin-top: 0; }
html[data-rk-frame] .cs-prose > h2 + * { margin-top: 24px; }
html[data-rk-frame] .cs-prose h3 { margin-top: 48px; font-size: 24px; font-weight: 500; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); }

/* running-text links: the new pages' underline */
html[data-rk-frame] .cs-prose a:not([class]) {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px;
  text-decoration-color: var(--acc); transition: color .2s var(--out);
}
html[data-rk-frame] .cs-prose a:not([class]):hover { color: var(--acc2); text-decoration-color: var(--acc2); }

/* lists: the new pages' cobalt dash; numbered lists keep their numbers */
html[data-rk-frame] .cs-prose > ul { padding: 0; list-style: none; }
html[data-rk-frame] .cs-prose > ul > li { position: relative; padding-inline-start: 26px; }
html[data-rk-frame] .cs-prose > ul > li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .8em; width: 10px; height: 2px; background: var(--acc); }
html[data-rk-frame] .cs-prose > ol { padding-inline-start: 28px; }
html[data-rk-frame] .cs-prose > ol > li { padding-inline-start: 4px; }
html[data-rk-frame] .cs-prose > ol > li::marker { font-family: var(--sans); font-size: 1em; font-weight: 600; color: var(--acc); }
html[data-rk-frame] .cs-prose > :is(ul, ol) > li + li { margin-top: 16px; }

/* section break: one plain rule (the "//" mark is gone) */
html[data-rk-frame] .cs-prose hr { display: block; height: 1px; margin: 80px 0; border: 0; background: var(--line); }
html[data-rk-frame] .cs-prose hr::before,
html[data-rk-frame] .cs-prose hr::after { content: none; display: none; }

/* pull quote: no dark panel, no CSS-drawn label; a large line on a cobalt rule */
html[data-rk-frame] .cs-prose blockquote {
  margin: 48px 0; padding: 4px 0 4px 24px; max-width: 34ch;
  background: none; border: 0; border-inline-start: 2px solid var(--acc); border-radius: 0;
  font-family: var(--sans); font-style: normal; font-weight: 400;
  font-size: clamp(21px, 1.7vw, 25px); line-height: 1.42; letter-spacing: -.018em;
  color: var(--ink);
}
html[data-rk-frame] .cs-prose blockquote::before,
html[data-rk-frame] .cs-prose blockquote::after { content: none; display: none; }

/* key takeaways (.art-tldr): the new pages' quiet note */
html[data-rk-frame] .cs-prose .art-tldr {
  margin: 48px 0; padding: 24px 28px 28px; max-width: var(--st-wide);
  border: 1px solid var(--line); border-radius: 2px; background: var(--card2);
}
html[data-rk-frame] .cs-prose > .art-tldr:first-child { margin-top: 0; }
html[data-rk-frame] .cs-prose > hr + .art-tldr { margin-top: 0; }
html[data-rk-frame] .art-tldr__label {
  margin: 0 0 16px; font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: -.005em; text-transform: none; color: var(--ink);
}
html[data-rk-frame] .art-tldr ul { padding: 0; gap: 12px; }
html[data-rk-frame] .art-tldr ul li { padding-inline-start: 26px; font-size: 17px; line-height: 1.55; color: var(--ink2); max-width: 64ch; }
html[data-rk-frame] .art-tldr ul li::before { content: ""; left: 2px; top: .78em; width: 10px; height: 2px; background: var(--acc); }

/* ---------- evidence panel: two white facets on one hairline grid ---------- */
html[data-rk-frame] .cs-evidence {
  margin: 48px 0; max-width: var(--st-wide);
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 2px;
}
html[data-rk-frame] :is(.cs-evidence__cell, .cs-evidence__col) { padding: 24px 24px 28px; background: #fff; }
html[data-rk-frame] :is(.cs-evidence__cell, .cs-evidence__col)::before { content: none; display: none; }
html[data-rk-frame] .cs-evidence__label {
  display: flex; align-items: center; gap: 12px; margin: 0 0 16px;
  font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: -.005em; text-transform: none;
  color: var(--ink);
}
html[data-rk-frame] .cs-evidence__label::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 99px; background: var(--ink3); }
html[data-rk-frame] :is(.cs-evidence__label--reality, .cs-evidence__label--positive) { color: var(--ink); }
html[data-rk-frame] :is(.cs-evidence__label--reality, .cs-evidence__label--positive)::before { background: var(--acc); }
html[data-rk-frame] .cs-evidence__label--negative { color: var(--ink); }
html[data-rk-frame] .cs-evidence__label--negative::before { background: var(--amber); }
html[data-rk-frame] :is(.cs-evidence__cell, .cs-evidence__col) p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--ink2); }
html[data-rk-frame] :is(.cs-evidence__cell, .cs-evidence__col) p + p { margin-top: 12px; }
html[data-rk-frame] :is(.cs-evidence__cell, .cs-evidence__col) strong { color: var(--ink); }
html[data-rk-frame] :is(.cs-evidence__cell, .cs-evidence__col) > em { display: block; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.55; color: var(--ink3); }
html[data-rk-frame] :is(.cs-evidence__cell, .cs-evidence__col) :is(ul, ol) { padding: 0; list-style: none; }
html[data-rk-frame] :is(.cs-evidence__cell, .cs-evidence__col) li { position: relative; padding-inline-start: 22px; font-size: 17px; line-height: 1.55; color: var(--ink2); }
html[data-rk-frame] :is(.cs-evidence__cell, .cs-evidence__col) li + li { margin-top: 8px; }
html[data-rk-frame] :is(.cs-evidence__cell, .cs-evidence__col) li::before { content: ""; position: absolute; inset-inline-start: 0; top: .8em; width: 10px; height: 2px; background: var(--rule); }
html[data-rk-frame] :is(.cs-evidence__label--reality, .cs-evidence__label--positive) ~ :is(ul, ol) li::before { background: var(--acc); }

/* ---------- tables (the Reality vs. Rhetoric matrix and the comparison grids) ---------- */
html[data-rk-frame] :is(.cs-table-wrap, .cs-intel-table) {
  margin: 48px 0; max-width: var(--st-wide); overflow-x: auto;
  border: 1px solid var(--line); border-radius: 2px; background: #fff;
}
html[data-rk-frame] .cs-prose > table.cs-table { margin: 48px 0; max-width: var(--st-wide); border: 1px solid var(--line); background: #fff; }
html[data-rk-frame] :is(.cs-table, .cs-intel-table table) { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.55; }
html[data-rk-frame] :is(.cs-table, .cs-intel-table table) thead th {
  padding: 16px 20px; text-align: start; vertical-align: bottom;
  font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; text-transform: none;
  color: var(--ink); background: var(--card2); border-bottom: 1px solid var(--line2);
}
html[data-rk-frame] :is(.cs-table, .cs-intel-table table) tbody td {
  padding: 16px 20px; vertical-align: top; font-size: 16px; line-height: 1.55;
  color: var(--ink2); border-bottom: 1px solid var(--line);
}
html[data-rk-frame] :is(.cs-table, .cs-intel-table table) tbody td:first-child { color: var(--ink); font-weight: 500; }
html[data-rk-frame] :is(.cs-table, .cs-intel-table table) tbody tr:last-child td { border-bottom: 0; }
html[data-rk-frame] :is(.cs-table, .cs-intel-table table) td strong { color: var(--ink); }
html[data-rk-frame] :is(.cs-table, .cs-intel-table table) td em { color: inherit; }
/* the matrix: claims stay ink, the evidence column reads as quoted evidence */
html[data-rk-frame] .cs-table td > span[style*="opacity"] { opacity: 1 !important; color: var(--ink3); }

/* verdict chips (inline-styled in the page) → a plain 16 px bold word with a colour dot.
   GAP and LEGEND carried the old lime "evidence" colour: amber, a warning. HOLDS and FACT: cobalt. */
html[data-rk-frame] .cs-table td > span[style*="font-size:10px"] {
  display: inline-flex !important; align-items: center; gap: 8px;
  padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important;
  font-family: var(--sans) !important; font-size: 16px !important; font-weight: 600 !important; line-height: 1.4;
  letter-spacing: .02em !important; white-space: nowrap;
  color: var(--ink) !important;
}
html[data-rk-frame] .cs-table td > span[style*="font-size:10px"]::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 99px; background: var(--acc); }
html[data-rk-frame] .cs-table td > span[style*="var(--evidence)"] { color: var(--amberink) !important; }
html[data-rk-frame] .cs-table td > span[style*="var(--evidence)"]::before { background: var(--amber); }

/* ---------- key findings: an ink panel, as on the new pages ---------- */
html[data-rk-frame] .cs-findings {
  margin: 48px 0; padding: 32px 32px 36px; max-width: var(--st-wide);
  background: var(--ink); border: 0; border-radius: 2px; color: #c9cedb; overflow: visible;
}
html[data-rk-frame] .cs-findings::before,
html[data-rk-frame] .cs-findings::after { content: none; display: none; }
html[data-rk-frame] .cs-findings__label {
  display: block; margin: 0 0 24px; padding-inline-start: 20px;
  background: radial-gradient(circle at 4px 50%, var(--acc3) 3.5px, rgba(116, 151, 255, 0) 4.5px) no-repeat;
  font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: -.005em;
  color: #fff;
}
html[data-rk-frame] .cs-findings :is(p, li) { font-size: 17px; line-height: 1.6; color: #c9cedb; max-width: 64ch; }
html[data-rk-frame] .cs-findings strong { color: #fff; }
html[data-rk-frame] .cs-findings :is(ol, ul) { padding-inline-start: 28px; }
html[data-rk-frame] .cs-findings li { padding-inline-start: 4px; }
html[data-rk-frame] .cs-findings li + li { margin-top: 16px; }
html[data-rk-frame] .cs-findings li::marker { font-family: var(--sans); font-size: 1em; font-weight: 600; color: var(--acc3); }

/* inline code */
html[data-rk-frame] .cs-prose code { font-size: .9em; padding: .1em .35em; border: 0; border-radius: 2px; background: var(--paper2); }

/* ---------- study footer: quiet meta + topic links ---------- */
html[data-rk-frame] :is(.cs-footer, .cs-file-footer) {
  display: block; max-width: var(--st-wide); margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--line2);
}
html[data-rk-frame] .cs-footer__filed {
  display: block; margin: 0; max-width: none;
  font-family: var(--sans); font-size: 16px; line-height: 1.5; letter-spacing: -.005em; text-transform: none; color: var(--ink3);
}
html[data-rk-frame] .cs-footer__filed::before { content: none; display: none; }
html[data-rk-frame] .cs-footer__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
html[data-rk-frame] .cs-prose .cs-tag {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.2; letter-spacing: -.005em; text-transform: none;
  color: var(--ink2); text-decoration: none;
  border: 1px solid var(--line2); border-radius: 2px; background: #fff;
  transition: border-color .3s var(--out), color .3s var(--out);
}
html[data-rk-frame] .cs-prose .cs-tag:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- closing call to action ---------- */
html[data-rk-frame] .cs-closing { padding-block: 120px 128px; border-top: 1px solid var(--line); background: none; }
html[data-rk-frame] .cs-closing .container { max-width: none; }
html[data-rk-frame] .cs-closing__label {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
  font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.45; letter-spacing: -.005em; text-transform: none;
  color: var(--ink);
}
html[data-rk-frame] .cs-closing__label::before {
  content: ""; width: 8px; height: 8px; flex: none; border-radius: 99px; background: var(--acc); opacity: 1;
  animation: rk-legacy-pulse 2.4s var(--out) infinite;
}
html[data-rk-frame] .cs-closing h2 {
  max-width: 16ch;
  font-family: var(--sans); font-weight: 500; font-size: clamp(40px, 5vw, 76px); line-height: 1.02; letter-spacing: -.045em;
  color: var(--ink);
}
html[data-rk-frame] .cs-closing h2 em {
  font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.08em; letter-spacing: -.015em;
  padding-right: .04em;
  background-image: linear-gradient(var(--acc), var(--acc)); background-repeat: no-repeat; background-position: 0 94%; background-size: 100% 1.5px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
html[data-rk-frame] .cs-closing p { margin-top: 32px; max-width: 44ch; font-size: clamp(19px, 1.45vw, 22px); line-height: 1.5; letter-spacing: -.01em; color: var(--ink2); }
html[data-rk-frame] .cs-closing__actions { margin-top: 40px; gap: 16px; }

/* =====================================================================
   B. STUDIES LISTING (/case-studies/)
   ===================================================================== */

/* ---------- hero ---------- */
html[data-rk-frame] .studies-hero { padding: 128px 0 64px; overflow: visible; }
html[data-rk-frame] .studies-hero__bg { display: none; }
html[data-rk-frame] .studies-hero__stamp { display: flex; width: max-content; max-width: 100%; margin: 32px 0 24px; }
html[data-rk-frame] .studies-hero .hero-headline {
  margin-top: 0; max-width: 16ch;
  font-size: clamp(40px, 4.45vw, 66px); line-height: 1.04; letter-spacing: -.043em;
}
html[data-rk-frame] .studies-hero .lede { margin-top: 32px; max-width: 44ch; font-size: clamp(19px, 1.45vw, 23px); line-height: 1.5; color: var(--ink2); }

/* the count: a plain figure and label on a rule, no dark readout */
html[data-rk-frame] .studies-counter {
  display: flex; flex-direction: row; align-items: baseline; margin-top: 40px; padding-top: 16px; max-width: var(--st-line);
  background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; overflow: visible;
}
html[data-rk-frame] .studies-counter::before { content: none; display: none; }
html[data-rk-frame] .studies-counter__stat { flex: none; flex-direction: row; align-items: baseline; gap: 12px; min-width: 0; padding: 0; }
html[data-rk-frame] .studies-counter__num {
  font-family: var(--sans); font-size: 44px; font-weight: 500; line-height: 1; letter-spacing: -.04em;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
html[data-rk-frame] .studies-counter__label {
  font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.4; letter-spacing: -.005em; text-transform: none; color: var(--ink2);
}

/* ---------- flagship: one ink card (the new pages' ink panels), no dot grid, no glow ---------- */
html[data-rk-frame] .study-flagship {
  padding: clamp(32px, 4.4vw, 64px);
  background: var(--ink); border: 0; border-radius: 2px; color: #eef0f6;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 40px 80px -48px rgba(10, 15, 31, .65);
  transition: transform .6s var(--spring), box-shadow .5s var(--out);
}
html[data-rk-frame] .study-flagship:hover { transform: translateY(-4px); border-color: transparent; box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 50px 90px -46px rgba(59, 99, 212, .6); }
html[data-rk-frame] .study-flagship::after { content: none; display: none; }
html[data-rk-frame] .study-flagship__dots { display: none; }
html[data-rk-frame] .study-flagship__num {
  font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.4; letter-spacing: -.005em; color: var(--acc3);
}
html[data-rk-frame] .study-flagship__tags {
  flex-wrap: wrap; gap: 4px 16px; margin-top: 8px;
  font-family: var(--sans); font-size: 16px; line-height: 1.4; letter-spacing: -.005em; text-transform: none; color: #b3b9c9;
}
html[data-rk-frame] .study-flagship__tags span { display: inline-flex; align-items: center; gap: 16px; }
html[data-rk-frame] .study-flagship__tags span + span::before { content: ""; width: 4px; height: 4px; border-radius: 99px; background: #858da3; }
html[data-rk-frame] .study-flagship__title {
  margin-top: 24px; max-width: 20ch;
  font-family: var(--sans); font-size: clamp(30px, 3vw, 46px); font-weight: 500; line-height: 1.08; letter-spacing: -.035em;
  color: #fff;
}
html[data-rk-frame] .study-flagship__excerpt { margin-top: 24px; max-width: 44ch; font-size: 18px; line-height: 1.55; color: #b3b9c9; }
html[data-rk-frame] .study-flagship__metric {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  margin-top: 32px; padding: 24px 0 0; max-width: 44ch;
  background: none; border: 0; border-top: 1px solid rgba(255, 255, 255, .12); border-radius: 0;
}
html[data-rk-frame] .study-flagship__metric-num {
  font-family: var(--sans); font-size: clamp(32px, 3vw, 44px); font-weight: 500; line-height: 1; letter-spacing: -.04em;
  color: #fff; font-variant-numeric: tabular-nums;
}
html[data-rk-frame] .study-flagship__metric-label { font-family: var(--sans); font-size: 16px; line-height: 1.45; letter-spacing: -.005em; text-transform: none; color: #b3b9c9; }
html[data-rk-frame] .study-flagship__read,
html[data-rk-frame] .study-flagship:hover .study-flagship__read {
  display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; margin-top: 24px;
  font-family: var(--sans); font-size: 16px; font-weight: 500; letter-spacing: -.005em;
  color: #fff;
  background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-size: 100% 1px; background-position: 0 calc(50% + 12px);
  transition: color .3s var(--out), background-size .5s var(--out);
}
html[data-rk-frame] .study-flagship:hover .study-flagship__read { color: var(--acc3); }
/* the drawing (aria-hidden): cobalt line work only; its lime marks turn cobalt, its tiny mono labels and corner marks go */
html[data-rk-frame] .study-flagship__art text,
html[data-rk-frame] .study-flagship__art > path { display: none; }
html[data-rk-frame] .study-flagship__art [stroke="#7ed957"] { stroke: var(--acc3); }
html[data-rk-frame] .study-flagship__art [stroke="#3b63d4"] { stroke: var(--acc3); }
html[data-rk-frame] .study-flagship__art [fill="#3b63d4"] { fill: var(--acc3); }
html[data-rk-frame] .study-flagship__art [stroke="white"] { stroke: rgba(255, 255, 255, .5); }

/* ---------- the grid of studies ---------- */
html[data-rk-frame] .studies-section-header { align-items: end; gap: 24px 48px; }
html[data-rk-frame] .studies-section-header h2 { font-size: clamp(36px, 4.3vw, 60px); }
html[data-rk-frame] .studies-section-sub { max-width: 36ch; font-size: 18px; line-height: 1.55; color: var(--ink2); }
html[data-rk-frame] .studies-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 56px; }

/* one card = the new pages' white card: figure first, no side bar, no chips, no black metric bar */
html[data-rk-frame] .study-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto;
  align-items: start; column-gap: 12px; row-gap: 16px;
  padding: 28px 28px 24px;
  border: 1px solid var(--line); border-radius: 2px; background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 24px 48px -40px rgba(10, 15, 31, .4);
  transition: transform .6s var(--spring), box-shadow .5s var(--out), border-color .4s var(--out);
}
html[data-rk-frame] .study-card > * { grid-column: 1 / -1; margin: 0; }
html[data-rk-frame] .study-card > .study-card__num,
html[data-rk-frame] .study-card > .study-card__badge { grid-column: auto; }
html[data-rk-frame] .study-card:hover { transform: translateY(-4px); border-color: var(--line2); box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 34px 60px -40px rgba(59, 99, 212, .55); }
html[data-rk-frame] .study-card__bar { display: none; }
html[data-rk-frame] .study-card__num {
  font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.4; letter-spacing: -.005em; color: var(--ink3); font-variant-numeric: tabular-nums;
}
html[data-rk-frame] .study-card__badge {
  display: inline-flex; align-items: center; gap: 12px; width: auto; padding: 0;
  background: none; border: 0; border-radius: 0;
  font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.4; letter-spacing: -.005em; text-transform: none;
  color: var(--acc2);
}
html[data-rk-frame] .study-card__badge::before { content: ""; width: 4px; height: 4px; flex: none; border-radius: 99px; background: var(--rule); }
html[data-rk-frame] .study-card__title {
  font-family: var(--sans); font-size: clamp(22px, 1.7vw, 26px); font-weight: 500; line-height: 1.18; letter-spacing: -.025em; color: var(--ink);
}
html[data-rk-frame] .study-card__metric {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px 0 0; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0;
}
html[data-rk-frame] .study-card__metric-num {
  font-family: var(--sans); font-size: 32px; font-weight: 500; line-height: 1.1; letter-spacing: -.035em; color: var(--ink); font-variant-numeric: tabular-nums;
}
html[data-rk-frame] .study-card__metric-label {
  font-family: var(--sans); font-size: 16px; line-height: 1.45; letter-spacing: -.005em; text-transform: none; color: var(--ink2);
}
html[data-rk-frame] .study-card__excerpt {
  display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; max-width: none;
  font-size: 16px; line-height: 1.55; color: var(--ink2);
}
html[data-rk-frame] .study-card__read,
html[data-rk-frame] .study-card:hover .study-card__read {
  justify-self: start; margin-top: 8px;
  font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1.4; letter-spacing: -.005em;
  color: var(--ink);
  background-image: linear-gradient(var(--acc), var(--acc)); background-repeat: no-repeat; background-size: 100% 1.5px; background-position: 0 100%;
  padding-bottom: 2px; transition: color .3s var(--out);
}
html[data-rk-frame] .study-card:hover .study-card__read { color: var(--acc2); }

/* =====================================================================
   C. SMALLER SCREENS
   ===================================================================== */
@media (max-width: 1100px) {
  html[data-rk-frame] .studies-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  html[data-rk-frame] .cs-evidence { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  html[data-rk-frame] .cs-hero,
  html[data-rk-frame] .studies-hero { padding: 112px 0 48px; }
  html[data-rk-frame] .cs-hero__title,
  html[data-rk-frame] .studies-hero .hero-headline { font-size: 38px; line-height: 1.07; letter-spacing: -.045em; }
  html[data-rk-frame] .cs-stamp,
  html[data-rk-frame] .studies-hero__stamp { width: auto; margin-top: 24px; }
  html[data-rk-frame] .cs-hero__lede,
  html[data-rk-frame] .studies-hero .lede { margin-top: 24px; font-size: 19px; }
  html[data-rk-frame] .cs-meta { margin-top: 32px; }

  html[data-rk-frame] .cs-body { padding: 32px 0 80px; }
  html[data-rk-frame] :is(.cs-toc, .cs-toc.is-stuck, .cs-toc.is-bottomed) { margin-bottom: 64px; }
  html[data-rk-frame] .cs-toc__list { columns: 1; }
  html[data-rk-frame] .cs-prose > p:first-of-type { font-size: 19px; }
  html[data-rk-frame] .cs-prose h2 { margin-top: 64px; font-size: 30px; line-height: 1.12; }
  html[data-rk-frame] .cs-prose hr { margin: 64px 0; }
  html[data-rk-frame] .cs-prose blockquote { margin: 40px 0; padding-inline-start: 20px; font-size: 21px; }
  html[data-rk-frame] .cs-prose .art-tldr { padding: 20px 20px 24px; }
  html[data-rk-frame] :is(.cs-evidence__cell, .cs-evidence__col) { padding: 20px 20px 24px; }
  html[data-rk-frame] .cs-findings { padding: 24px 20px 28px; }

  /* tables: full-bleed and scrolled sideways inside their own box, never the page */
  html[data-rk-frame] :is(.cs-table-wrap, .cs-intel-table) { margin-inline: -20px; border-inline: 0; border-radius: 0; }
  html[data-rk-frame] .cs-prose > table.cs-table { display: block; width: calc(100% + 40px); overflow-x: auto; margin-inline: -20px; border-inline: 0; }
  /* a soft edge shadow shows there is more of the table to the side (scroll-shadow backgrounds, no markup) */
  html[data-rk-frame] :is(.cs-table-wrap, .cs-intel-table, .cs-prose > table.cs-table) {
    background:
      linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)) left center / 32px 100% no-repeat local,
      linear-gradient(270deg, #fff 30%, rgba(255, 255, 255, 0)) right center / 32px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(10, 15, 31, .16), rgba(10, 15, 31, 0)) left center / 12px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(10, 15, 31, .16), rgba(10, 15, 31, 0)) right center / 12px 100% no-repeat scroll,
      #fff;
  }
  html[data-rk-frame] :is(.cs-table-wrap .cs-table, .cs-intel-table table):has(th:nth-child(4)) { min-width: 640px; }
  /* wide tables keep their first column (the claim, the row name) in view while the rest scrolls under it */
  html[data-rk-frame] :is(.cs-table, .cs-intel-table table):has(th:nth-child(4)) :is(th, td):first-child {
    position: sticky; left: 0; z-index: 1; width: 136px; min-width: 136px; max-width: 136px;
    background: #fff; box-shadow: 1px 0 0 var(--line2), 8px 0 12px -10px rgba(10, 15, 31, .25);
  }
  html[data-rk-frame] :is(.cs-table, .cs-intel-table table):has(th:nth-child(4)) thead th:first-child { background: var(--card2); }
  html[data-rk-frame] :is(.cs-table, .cs-intel-table table) :is(thead th, tbody td) { padding: 14px 16px; }
  html[data-rk-frame] :is(.cs-table, .cs-intel-table table) :is(thead th, tbody td):first-child { padding-inline-start: 20px; }

  html[data-rk-frame] :is(.cs-footer, .cs-file-footer) { margin-top: 64px; }
  html[data-rk-frame] .cs-closing { padding-block: 80px 96px; }
  html[data-rk-frame] .cs-closing h2 { font-size: 38px; line-height: 1.06; }
  html[data-rk-frame] .cs-closing p { font-size: 19px; }

  html[data-rk-frame] .studies-counter__num { font-size: 40px; }
  html[data-rk-frame] .study-flagship { padding: 28px 20px 24px; }
  html[data-rk-frame] .study-flagship__title { font-size: 30px; }
  html[data-rk-frame] .study-flagship__visual { max-height: 220px; }
  html[data-rk-frame] .studies-section-header h2 { font-size: 34px; }
  html[data-rk-frame] .studies-grid { grid-template-columns: minmax(0, 1fr); margin-top: 40px; }
  html[data-rk-frame] .study-card { padding: 24px 20px 20px; }
}

/* =====================================================================
   D. DARK MODE (html.dark, set before first paint by rubikn-theme.js)
   ---------------------------------------------------------------------
   rubikn-frame.css re-points the tokens (--ink, --ink2, --ink3, --acc,
   --acc2, --amber, --amberink, --line, --line2, --card2, --paper2, --hl)
   at the shared dark palette (rubikn-brand.css --rk-d-*), so every rule
   above that reads a token as TEXT already follows. This block covers
   what does not follow:
   - surfaces hard-coded white in the light look (evidence facets, the
     tables and their phone scroll shadows and sticky first column, the
     topic tags, the study cards): raised dark surfaces with a hairline;
   - the ink panels (key findings, the flagship study) whose --ink
     background turns light: they stay dark, as a raised panel with a
     hairline, their light text unchanged;
   - the old html.dark rules of case-study.css that switch back on now
     that html.dark is back (the hero's dark gradient band).
   Cobalt text uses the light accent, amber stays on the GAP / LEGEND
   warnings, shadows are darker and quieter, cobalt glows at half
   strength. Light mode is untouched: every rule here is under .dark.
   ===================================================================== */

/* ---------- case study: hero sits on the page, as in light (old dark gradient band off) ---------- */
html[data-rk-frame].dark .cs-hero,
html[data-rk-frame].dark .cs-hero::before { background: none; }

/* attached reports: the round action chip reads on dark; hover = cobalt fill, white arrow */
html[data-rk-frame].dark .cs-report-card__action { background: rgba(255, 255, 255, .08); color: var(--rk-d-text); }
html[data-rk-frame].dark .cs-report-card:hover .cs-report-card__action { background: var(--rk-d-accent-strong); color: #fff; }
/* the report viewer is a dark sheet in both themes; on the dark page it gets a hairline edge */
html[data-rk-frame].dark .cs-pdf-viewer__chrome { box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 40px 100px -30px rgba(0, 0, 0, .85); }

/* key takeaways: the quiet note on a raised tone */
html[data-rk-frame].dark .cs-prose .art-tldr { background: var(--rk-d-raised); border-color: var(--rk-d-line); }

/* evidence panel: two raised facets on one hairline grid */
html[data-rk-frame].dark .cs-evidence { background: var(--rk-d-line); border-color: var(--rk-d-line); }
html[data-rk-frame].dark :is(.cs-evidence__cell, .cs-evidence__col) { background: var(--rk-d-raised); }

/* tables: a raised box, the header row one step up (--card2 = raised-2), hairlines */
html[data-rk-frame].dark :is(.cs-table-wrap, .cs-intel-table),
html[data-rk-frame].dark .cs-prose > table.cs-table { background: var(--rk-d-raised); border-color: var(--rk-d-line); }

/* key findings: the ink panel stays dark, as a raised panel with a hairline (no layout shift) */
html[data-rk-frame].dark .cs-findings { background: var(--rk-d-raised); box-shadow: inset 0 0 0 1px var(--rk-d-line); }

/* topic tags: raised chips on the hairline border */
html[data-rk-frame].dark .cs-prose .cs-tag { background: var(--rk-d-raised); }

/* ---------- studies listing: the flagship stays a dark panel; cards are raised surfaces ---------- */
html[data-rk-frame].dark .study-flagship {
  background: var(--rk-d-raised);
  box-shadow: inset 0 0 0 1px var(--rk-d-line), 0 40px 80px -48px rgba(0, 0, 0, .85);
}
html[data-rk-frame].dark .study-flagship:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 50px 90px -46px rgba(66, 112, 218, .3); }
html[data-rk-frame].dark .study-card {
  background: var(--rk-d-raised); border-color: var(--rk-d-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 48px -40px rgba(0, 0, 0, .8);
}
html[data-rk-frame].dark .study-card:hover {
  border-color: var(--rk-d-line-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 34px 60px -40px rgba(66, 112, 218, .3);
}
html[data-rk-frame].dark .study-card__badge { color: var(--rk-d-accent); }

@media (max-width: 760px) {
  /* phone tables: the scroll-shadow edges on the raised tone (dark shadows instead of white fades) */
  html[data-rk-frame].dark :is(.cs-table-wrap, .cs-intel-table, .cs-prose > table.cs-table) {
    background:
      linear-gradient(90deg, var(--rk-d-raised) 30%, rgba(17, 22, 32, 0)) left center / 32px 100% no-repeat local,
      linear-gradient(270deg, var(--rk-d-raised) 30%, rgba(17, 22, 32, 0)) right center / 32px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0)) left center / 12px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .6), rgba(0, 0, 0, 0)) right center / 12px 100% no-repeat scroll,
      var(--rk-d-raised);
  }
  /* the sticky first column keeps an opaque raised background so the scrolled cells pass under it */
  html[data-rk-frame].dark :is(.cs-table, .cs-intel-table table):has(th:nth-child(4)) :is(th, td):first-child {
    background: var(--rk-d-raised); box-shadow: 1px 0 0 var(--line2), 8px 0 12px -10px rgba(0, 0, 0, .75);
  }
  html[data-rk-frame].dark :is(.cs-table, .cs-intel-table table):has(th:nth-child(4)) thead th:first-child { background: var(--rk-d-raised-2); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html[data-rk-frame] :is(.study-card, .study-flagship, .cs-report-card__action, .cs-toc__item a) { transition: none; }
  html[data-rk-frame] :is(.study-card, .study-flagship):hover { transform: none; }
  html[data-rk-frame] .cs-closing__label::before { animation: none; }
}
