/* ft-analyzer – public website. One page, no build step.
   The page is neutral charcoal, an invoice is a white sheet of paper, and
   what the service says about it is a panel a shade lighter than the page. Colour carries
   meaning: the only hues are the three decisions (approve, review, reject). */

@font-face { font-family: "Geist Serif"; src: url("fonts/GeistSerif-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #171717;
  --bg-1: #1f1f1f;
  --bg-2: #282828;
  --fg: #ededed;
  --fg-2: #a3a3a3;
  --fg-3: #737373;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);
  --ok: #46d995;
  --warn: #f3b33d;
  --bad: #ff5a4c;
  --brand: #c8102e;
  /* a verdict mark: a white tick on green or a white cross on red */
  --pass: #1e9e8c; --fail: #f02547;
  --paper: #fcfcfb;
  --serif: "Geist Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 16px/1.6 var(--sans); letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
i, em { font-style: normal; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 6px; font-weight: 500; }
.skip:focus { top: 12px; }

.wrap { max-width: 1280px; margin: 0 auto; padding-inline: var(--gutter); }

/* ── type ── */
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.028em; text-wrap: balance; }
h1 { font-size: clamp(44px, 6vw, 88px); line-height: 1; }
h2 { font-size: clamp(34px, 4.5vw, 64px); line-height: 1.03; }
h1 .soft { color: var(--fg-2); }
.lead { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: var(--fg-2); max-width: 60ch; text-wrap: pretty; }
.fine { font-size: 13px; color: var(--fg-3); }

.label, .ledger-foot {
  font: 500 12px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2);
}

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 7px;
  font: 500 14px/1 var(--sans); white-space: nowrap; border: 1px solid transparent;
  transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease);
}
.btn-lg { height: 48px; padding: 0 20px; font-size: 15.5px; border-radius: 9px; }
.btn-solid { background: var(--fg); color: var(--bg); }
.btn-solid:hover { background: #fff; }
.btn-line { border-color: var(--line-2); color: var(--fg); }
.btn-line:hover { border-color: var(--fg-2); background: rgba(255, 255, 255, .05); }
.btn-ghost { color: var(--fg-2); }
.btn-ghost:hover { color: var(--fg); }
.btn span { transition: transform .2s var(--ease); }
.btn:hover span { transform: translateX(3px); }

/* ── nav ── */
/* The top bar and the footer carry the brand red. Grey text does not hold on
   it, so what sits on the red is white. */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; background: var(--brand); transition: box-shadow .3s; }
.nav.stuck { box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .7); }
.nav .brand { color: #fff; }
/* The dot over the i is drawn in --bad, which disappears on the red. */
.nav .wordmark, .foot .wordmark { --bad: #fff; }
.nav .btn-ghost { color: rgba(255, 255, 255, .86); }
.nav .btn-ghost:hover { color: #fff; }
.nav .btn-solid { background: #111; color: #fff; }
.nav .btn-solid:hover { background: #000; }
.nav-in { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; color: var(--fg); }
.wordmark { display: block; flex: none; height: 27px; width: auto; aspect-ratio: 2844 / 820; }
.wordmark.small { height: 21px; }
/* the mark: the same lamp as on the invoices, white on a half-clear plate,
   in front of the word and centred on the height of its F (the F runs from
   the baseline, 790/820 down the word's box, up to 80/820, so its middle is
   435/820 down) */
.brand .lamp {
  flex: none; width: 34px; height: 34px; margin: -8px 2px -8px -6px;
  --lamp: 255, 255, 255; --plate-a: .5; --r: 6px; --p: 11px;
  transform: translateY(calc(27px * 435 / 820 - 27px / 2));
  animation: led-calm 3.2s ease-in-out infinite;
}
.foot .brand .lamp {
  width: 28px; height: 28px; margin: -7px 1px -7px -5px; --r: 5px; --p: 9px;
  transform: translateY(calc(21px * 435 / 820 - 21px / 2));
}
.nav-cta { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ── hero ── */
.hero { position: relative; padding-top: 64px; }
/* the backdrop: a landscape drawn in characters that keep changing while the
   picture holds. Faded towards the copy and the next section. */
.field {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .55;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 45%), linear-gradient(transparent 0, #000 22%, #000 70%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 45%), linear-gradient(transparent 0, #000 22%, #000 70%, transparent 100%);
  mask-composite: intersect;
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(32px, 4vw, 64px); align-items: center; padding-block: clamp(40px, 5vw, 72px) clamp(56px, 6vw, 88px); }
.hero-copy > * + * { margin-top: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* the case: one real invoice is read top to bottom, and each field is
   marked as the line passes it. Without script the finished state shows. */
.case { position: relative; justify-self: end; width: min(100%, 520px); margin: 0; }
.paper {
  --ink: #17171a; --ink-2: #5f5c55; --rule: rgba(23, 23, 26, .14); --bad: #c4301e;
  position: relative; isolation: isolate; overflow: hidden; padding: 26px 28px 20px; border-radius: 3px;
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
  font: 400 12px/1.45 var(--sans); letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.paper strong { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
.paper span { display: block; color: var(--ink-2); }
.paper em, .paper dt, .paper th { font: 500 9.5px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.paper em { display: block; margin-bottom: 3px; }
.paper-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--ink); }
.paper-meta { flex: none; display: grid; gap: 2px; align-content: start; }
.paper-meta div, .paper-sum dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.paper-meta dd { font-weight: 500; }
.paper-to { margin: 18px 0 24px; }
.rows { width: 100%; border-collapse: collapse; }
.rows th { padding: 0 0 5px; text-align: left; border-bottom: 1px solid var(--rule); }
.rows td { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.rows th + th, .rows td + td { text-align: right; padding-left: 14px; white-space: nowrap; }
.paper-sum { padding-top: 10px; }
.paper-sum dl { width: 210px; margin-left: auto; display: grid; gap: 2px; }
.paper-sum dl div:last-child { margin-top: 5px; padding-top: 7px; border-top: 1px solid var(--ink); font-weight: 600; }
.paper-sum dl div:last-child dt { color: var(--ink); }
.paper-pay { margin-top: 3cm; padding-top: 20px; border-top: 1px solid var(--rule); }
.paper mark { color: var(--bad); font-weight: 600; background: none; }
/* the row that does not hold: a red frame around it, the red lamp on its top right corner */
.paper-meta .miss { position: relative; }
.paper-meta .miss::after {
  content: ""; position: absolute; inset: -3px -6px; z-index: -1; border-radius: 3px; pointer-events: none;
  border: 1px dashed rgba(240, 37, 71, .75);
  background: repeating-linear-gradient(-45deg, rgba(240, 37, 71, .05) 0 3px, rgba(240, 37, 71, .016) 3px 8px);
  transition: opacity .35s var(--ease);
}
.paper-meta .miss::before {
  content: ""; position: absolute; top: -15px; right: -18px; width: 24px; height: 24px;
  --lamp: 240, 37, 71; --r: 4px; --p: 7px;
  animation: led 1.8s ease-in-out infinite .9s;
}
/* the reviewer's marks: a blinking green lamp on the top right corner of
   each field that holds, a red one on the row that does not, the way the
   verdict sits on each invoice in the portfolio further down */
.fld { position: relative; }
.fld::before {
  content: ""; position: absolute; top: -18px; right: -20px; width: 24px; height: 24px;
  --lamp: 30, 158, 140; --r: 4px; --p: 7px;
  animation: led 1.8s ease-in-out infinite;
}
/* A lamp is a dot on a plate, drawn as two circles whose radii are --r and
   --p times --d and --s. The dot blinks quickly; the plate is hung on it as
   if on a spring: it reacts a moment later, swings past and settles.
   --lamp is the colour as an r, g, b triplet. */
@property --d { syntax: "<number>"; inherits: false; initial-value: 1; }
@property --s { syntax: "<number>"; inherits: false; initial-value: 1; }
.fld::before, .paper-meta .miss::before, .badge, .cmp-ok::before, .cmp-bad::before, .brand .lamp, .alert .lamp {
  pointer-events: none; transition: opacity .3s;
  background:
    radial-gradient(circle, rgb(var(--core, var(--lamp))) calc(var(--r) * var(--d)), transparent calc(var(--r) * var(--d) + .6px)),
    radial-gradient(circle, rgba(var(--lamp), var(--plate-a, .22)) calc(var(--p) * var(--s)), transparent calc(var(--p) * var(--s) + .6px));
}
@keyframes led {
  0%   { --d: 1;    --s: 1; }
  5%   { --d: 1.35; --s: 1; }
  11%  { --d: 1;    --s: 1.45; }
  19%  { --s: .9; }
  27%  { --s: 1.13; }
  35%  { --s: .96; }
  43%  { --s: 1.03; }
  51%, 100% { --d: 1; --s: 1; }
}
.fld.quiet::before { display: none; }
/* the area each passing field was read from: a dashed frame with faint
   hatching, drawn as the line passes it */
.fld:not(.quiet)::after {
  content: ""; position: absolute; inset: -6px -8px; z-index: -1; border-radius: 3px; pointer-events: none;
  border: 1px dashed rgba(30, 158, 140, .7);
  background: repeating-linear-gradient(-45deg, rgba(30, 158, 140, .031) 0 3px, transparent 3px 8px);
  transition: opacity .35s var(--ease);
}
.fld.paper-pay::after { top: 14px; }
.paper-pay::before { top: 2px; }
.fld.flag::before { content: "!"; left: -23px; width: auto; height: auto; border-radius: 0; background: none; margin-top: -4px; font: 700 14px/1.3 var(--mono); color: #a35f00; }
.case.armed .fld:not(.on)::before { opacity: 0; }
.case.armed .fld:not(.on)::after { opacity: 0; }
.case.settled .fld::before, .case.settled .fld::after { opacity: 0; transition: opacity 2s var(--ease); }
.case.armed .fld:not(.on) .miss::before, .case.armed .fld:not(.on) .miss::after { opacity: 0; }
.scanline { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--ink); opacity: 0; pointer-events: none; }
.case.run .scanline { animation: scan 2.6s linear .3s forwards; }
/* the light of the scan line passing over each letter, left to right */
x-w { white-space: nowrap; }
.case.run x-ch { animation: lit .1s ease-out var(--d, 0s); }
@keyframes lit {
  8% { color: #000; text-shadow: 0 0 1px rgba(0, 0, 0, .7), 0 0 5px rgba(0, 0, 0, .35); }
}
@keyframes scan { 0% { top: 0; opacity: .5; } 96% { opacity: .5; } 100% { top: 100%; opacity: 0; } }

/* the finding: unreadable while the invoice is being read, then plain words */
.alert { display: flex; align-items: flex-start; gap: 12px; margin-top: 20px; }
/* the same red lamp as on the invoice, in front of the finding; it lights
   once the words are there */
.alert .lamp {
  flex: none; width: 28px; height: 28px; margin: -1px -3px 0 -3px;
  --lamp: 240, 37, 71; --r: 5px; --p: 9px;
  animation: led 1.8s ease-in-out infinite;
}
.alert.wait .lamp { opacity: 0; transition: none; }
.case .alert .lamp { width: 34px; height: 34px; margin: -4px -6px 0 -6px; --r: 6px; --p: 11px; }
.finding { min-height: 48px; font-size: 15.5px; line-height: 1.5; color: var(--fg); }
.finding code { font: 400 12.5px/1.5 var(--mono); letter-spacing: .02em; color: var(--fg-3); }


.facts { position: relative; padding-bottom: 20px; }
.facts dl { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.facts dl div { padding: 28px 24px 26px 0; }
.facts dl div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.facts dt { font: 400 clamp(22px, 1.95vw, 28px)/1.12 var(--serif); letter-spacing: -.022em; text-wrap: balance; }
.facts dd { margin-top: 12px; font-size: 14.5px; line-height: 1.5; color: var(--fg-2); max-width: 30ch; }

/* ── sections ── */
.sec { position: relative; border-top: 1px solid var(--line); padding-block: clamp(72px, 9vw, 136px); }
.sec-head { display: grid; gap: 22px; margin-bottom: clamp(40px, 5vw, 72px); max-width: 900px; }
.sec h3 { font: 500 17px/1.3 var(--sans); letter-spacing: -.012em; }
.sec h3 + p { margin-top: 8px; color: var(--fg-2); font-size: 15px; line-height: 1.55; }
.split { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.split .sec-head { margin-bottom: 0; }

.panel { border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-1); overflow: hidden; }
.panel-bar { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); font: 400 12.5px/1 var(--mono); color: var(--fg-2); }
.panel-bar.mid { border-top: 1px solid var(--line); }
.panel-bar b { font-weight: 600; color: var(--fg); }
.panel-bar .ms { margin-left: auto; color: var(--fg-3); }
.code { padding: 18px 20px; font: 400 12.5px/1.7 var(--mono); color: var(--fg-2); overflow-x: auto; tab-size: 2; }
.code .k { color: var(--fg); }
.code .s, .code .n { color: #cfcfcf; }
.code .p { color: var(--fg-3); }
.code .warn { color: var(--warn); }
.code .bad { color: var(--bad); }

/* ── the stream: a running log of decisions. One row is stopped and stays
   pinned at the top while the rest keep coming. ── */
.stream { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: clamp(24px, 3vw, 40px); align-items: start; }
/* The log moves all the time, so it must never move the page: the browser is
   told not to hold on to anything in it when it keeps the scroll position,
   and nothing in it changes height (the log has a fixed height, and the
   finding always has room for its longest text). */
.stream { overflow-anchor: none; }
.ledger { border-top: 1px solid var(--line-2); font: 400 12.5px/1 var(--mono); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.ledger-head, .ledger li { display: grid; grid-template-columns: 90px 56px minmax(0, 1fr) 96px 30px 80px 62px; gap: 12px; align-items: center; height: 34px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ledger-head { height: 38px; border-bottom-color: var(--line-2); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.ledger .r, .ledger li span:nth-child(n+4):not(:nth-child(6)) { text-align: right; }
.ledger li span:nth-child(1) { color: var(--fg-3); }
.ledger li span:nth-child(3) { overflow: hidden; text-overflow: ellipsis; font: 400 13.5px/1.2 var(--sans); color: var(--fg); }
.ledger li.warn span:nth-child(5), .ledger li.warn span:nth-child(6) { color: var(--warn); }
.ledger li.bad { color: var(--fg); background: color-mix(in srgb, var(--bad) 8%, transparent); box-shadow: inset 2px 0 0 var(--bad); }
.ledger li.bad span:nth-child(5), .ledger li.bad span:nth-child(6) { color: var(--bad); }
.ledger-body { position: relative; height: 442px; overflow: hidden; }
.ledger-body::after { content: ""; position: absolute; inset: auto 0 0 0; height: 96px; pointer-events: none; background: linear-gradient(transparent, var(--bg)); }
.ledger-foot { padding-top: 6px; }
.ledger-foot strong { margin-right: 6px; font-weight: 500; color: var(--fg); }

/* the invoice that was stopped, and what the further sources say about it */
.probe { --c: var(--bad); opacity: 0; transform: translateY(8px); transition: opacity .3s var(--ease), transform .4s var(--ease); }
.probe.on { opacity: 1; transform: none; }
.probe { padding-top: 46px; }
.probe .alert { margin: 0; }
.probe .finding { min-height: 4.5em; }


/* ── cross analysis: your own portfolio on its own, then beside those of
   other financiers. Their invoices are never shown, only that one matches. ── */
.compare { display: grid; grid-template-columns: 294px minmax(0, 1fr); gap: 20px; }
.cmp { display: flex; flex-direction: column; gap: 26px; margin: 0; padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); }
.cmp figcaption { max-width: 46ch; min-height: 96px; font-size: 16px; line-height: 1.45; color: var(--fg); }
.cmp figcaption .label { display: block; margin-bottom: 10px; }
/* the verdict under each panel, in the colour of its lamp and with the same
   lamp in front, blinking in step with the ones on the invoices */
.cmp-ok, .cmp-bad { display: flex; align-items: center; gap: 4px; margin-top: auto; }
.cmp-ok { --lamp: 30, 158, 140; color: var(--pass); }
.cmp-bad { --lamp: 240, 37, 71; color: var(--fail); }
.cmp-ok::before, .cmp-bad::before {
  content: ""; flex: none; width: 24px; height: 24px; margin: -6px 0 -6px -5px;
  --r: 4px; --p: 7px; animation: led-calm 3.2s ease-in-out infinite;
}
/* The portfolios are laid out after the room they have, not the size of the
   screen: the panel is narrower beside the first one on a wide screen. */
.folios { display: flex; flex-wrap: wrap; gap: 28px; container-type: inline-size; }
.folio { display: grid; grid-template-columns: repeat(3, 74px); gap: 10px 8px; }
.folio .label { grid-column: 1 / -1; margin-bottom: 4px; }
/* a real invoice at a quarter of its size */
.thumb { position: relative; width: 74px; height: 98px; border-radius: 2px; background: var(--paper); box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .8); }
.thumb > div {
  --ink: #17171a; --ink-2: #5f5c55;
  display: flex; flex-direction: column; width: 296px; height: 392px; padding: 28px 26px 24px; overflow: hidden;
  transform: scale(.25); transform-origin: 0 0; color: var(--ink); font: 400 14px/1.35 var(--sans); font-variant-numeric: tabular-nums;
}
.thumb b { font-size: 23px; font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
.thumb i { margin-top: 5px; font-size: 14px; color: var(--ink-2); }
.thumb em { margin-top: 16px; padding-top: 14px; border-top: 2px solid var(--ink); font: 500 13px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.thumb p { margin: 4px 0 14px; font-size: 17px; font-weight: 500; }
.thumb u { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid rgba(23, 23, 26, .16); text-decoration: none; white-space: nowrap; }
.thumb strong { margin-top: auto; padding-top: 12px; border-top: 2px solid var(--ink); text-align: right; font-size: 24px; font-weight: 600; }
/* Another financier's invoice: the same sheet with every value blacked out.
   The markup holds no text at all, only the bars. */
.thumb.hid b, .thumb.hid i, .thumb.hid p, .thumb.hid u::before, .thumb.hid u::after, .thumb.hid strong::after { background: var(--ink); border-radius: 1px; }
.thumb.hid b { width: 72%; height: 24px; }
.thumb.hid i { width: 46%; height: 12px; margin-top: 8px; }
.thumb.hid em { padding-top: 0; }
.thumb.hid p { width: 58%; height: 15px; margin: 16px 0 16px; }
.thumb.hid u { align-items: center; height: 34px; }
.thumb.hid u::before { content: ""; width: 44%; height: 11px; }
.thumb.hid u::after { content: ""; width: 17%; height: 11px; }
.thumb.hid u:nth-of-type(2)::before { width: 31%; }
.thumb.hid u:nth-of-type(3)::before { width: 38%; }
.thumb.hid u:nth-of-type(3)::after { width: 12%; }
.thumb.hid strong::after { content: ""; display: block; width: 42%; height: 21px; margin-left: auto; }
.thumb.hid:nth-child(odd) b { width: 54%; }
.thumb.hid:nth-child(3n) i { width: 38%; }
.thumb.hid:nth-child(3n + 1) p { width: 74%; }
.thumb.hid:nth-child(odd) strong::after { width: 36%; }
/* With the other sources beside it, the other financiers' invoices step back
   except the one that matches. */
.cmp-x .thumb:not(.hit) { opacity: .38; }
/* The verdict on each of your own invoices, a lamp on the top right corner:
   green for one that holds, red for one that does not. */
.badge {
  position: absolute; top: -19px; right: -19px; z-index: 1; width: 38px; height: 38px;
  --lamp: 30, 158, 140; --r: 8.5px; --p: 13.5px;
  animation: led-calm 3.2s ease-in-out infinite;
}
/* many lamps together: all in step, the same blink as on the invoice above
   but a longer rest between blinks (the timings are led's, scaled 1.8/3.2) */
@keyframes led-calm {
  0%     { --d: 1;    --s: 1; }
  2.8%   { --d: 1.35; --s: 1; }
  6.2%   { --d: 1;    --s: 1.45; }
  10.7%  { --s: .9; }
  15.2%  { --s: 1.13; }
  19.7%  { --s: .96; }
  24.2%  { --s: 1.03; }
  28.7%, 100% { --d: 1; --s: 1; }
}
/* the failing invoice and its match at the other financier */
.badge.bad, .badge.mark { --lamp: 240, 37, 71; }

/* The line between the pair leaves the invoice from the middle of its right
   side, turns up in the space between the two portfolios, runs across in the
   gap between the two rows and goes up into the match in the top row. --run is
   the distance from that turn to the centre of the match: three columns, one
   folio gap and the rest of this one here. */
.thumb.link::after, .thumb.link::before, .thumb.hid.hit::after {
  --dash-x: linear-gradient(90deg, var(--bad) 50%, transparent 50%);
  --dash-y: linear-gradient(0deg, var(--bad) 50%, transparent 50%);
  content: ""; position: absolute; background-repeat: repeat-x, repeat-y; background-size: 8px 1px, 1px 8px;
}
/* The dashes travel along the line towards the match, one dash length per cycle. */
.thumb.link::after { left: 100%; top: -5px; width: 14px; height: calc(50% + 5px); background-image: var(--dash-x), var(--dash-y); background-position: 0 100%, 100% 0; animation: dash-turn .7s linear infinite; }
.thumb.link::before { --run: 400px; left: calc(100% + 13px); top: -5px; width: var(--run); height: 1px; background-image: var(--dash-x); animation: dash-right .7s linear infinite; }
.thumb.hid.hit::after { left: 50%; top: 100%; width: 1px; height: 5px; background-image: var(--dash-y); background-repeat: repeat-y; background-size: 1px 8px; animation: dash-up .7s linear infinite; }
@keyframes dash-turn { to { background-position: 8px 100%, 100% -8px; } }
@keyframes dash-right { to { background-position: 8px 0; } }
@keyframes dash-up { to { background-position: 0 -8px; } }

.sources { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); margin-top: clamp(48px, 6vw, 80px); }
.sources li { padding-top: 20px; border-top: 1px solid var(--line-2); }

/* ── confidentiality ── */
.points li { padding: 20px 0 22px; border-top: 1px solid var(--line); }
.points li:first-child { border-top-color: var(--line-2); }
.points p { max-width: 56ch; }

/* ── capabilities: an index, not a wall of cards ── */
.group { padding-bottom: 16px; font: 400 26px/1.2 var(--serif) !important; letter-spacing: -.02em !important; }
.terms { columns: 2; column-gap: clamp(32px, 5vw, 80px); border-top: 1px solid var(--line-2); }
.terms div { break-inside: avoid; display: grid; grid-template-columns: minmax(0, .62fr) minmax(0, 1fr); gap: 20px; padding: 14px 0 15px; border-bottom: 1px solid var(--line); }
.terms dt { font: 500 15.5px/1.4 var(--sans); letter-spacing: -.01em; }
.terms dd { font-size: 14.5px; line-height: 1.5; color: var(--fg-2); }
.terms + .group { margin-top: clamp(48px, 6vw, 80px); }

/* ── compliance ── */
.rules div { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, .9fr) minmax(0, 1.7fr); gap: 8px clamp(20px, 3vw, 40px); align-items: baseline; padding: 22px 0; border-top: 1px solid var(--line); }
.rules div:first-child { border-top-color: var(--line-2); }
.rules dt { font: 500 12px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.rules dd { font-size: 15px; line-height: 1.55; color: var(--fg-2); max-width: 62ch; }
.rules dd.v { font: 400 24px/1.2 var(--serif); letter-spacing: -.02em; color: var(--fg); }

/* ── integration ── */
.integ { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.integ .sec-head { margin-bottom: 0; }
.integ .btn { justify-self: start; margin-top: 8px; }
.ticks { display: grid; gap: 12px; color: var(--fg-2); font-size: 15.5px; }
.ticks li { display: flex; gap: 12px; align-items: baseline; }
.ticks li::before { content: ""; flex: none; width: 10px; height: 6px; border-left: 1.5px solid var(--fg-2); border-bottom: 1.5px solid var(--fg-2); transform: translateY(-3px) rotate(-45deg); }
.term { background: #111; }

/* ── closing, footer ── */
.closing { text-align: center; padding-block: clamp(96px, 12vw, 176px); }
.closing h2 { max-width: 22ch; margin: 0 auto; font-size: clamp(38px, 5.6vw, 84px); }
.closing .hero-actions { justify-content: center; }
.foot { padding: 32px 0 40px; background: var(--brand); color: rgba(255, 255, 255, .86); font-size: 14px; }
.foot .brand, .foot nav a:hover { color: #fff; }
.foot .fine { color: rgba(255, 255, 255, .86); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px; }
.foot nav { display: flex; gap: 22px; margin-left: auto; }

/* ── smaller screens ── */
@media (max-width: 1240px) {
  .compare { grid-template-columns: 1fr; }
  .cmp figcaption { min-height: 0; }
}
/* Room for two portfolios but not three (one is 238px wide, with 28px
   between): the financier without the match steps out, so the two that
   matter stay side by side and the line has one portfolio less to cross. */
@container (width < 770px) {
  .folio.spare { display: none; }
  .thumb.link::before { --run: 134px; }
}
/* Room for one: the portfolios one under the other, the invoices as wide as
   the panel allows. --k is the scale of an invoice (296 × 392 at full size),
   set by the script from the width available; without it they stay at a
   quarter. The match moves to the third column, straight under the invoice
   it matches, and the line drops from the one into the other: across the
   gap between the portfolios, the label and the space under it. */
@container (width < 504px) {
  .folio { grid-template-columns: repeat(3, calc(var(--k, .25) * 296px)); }
  .thumb { width: calc(var(--k, .25) * 296px); height: calc(var(--k, .25) * 392px); }
  .thumb > div { transform: scale(var(--k, .25)); }
  .folio .label { order: -2; }
  .thumb.hid.hit + .thumb { order: -1; }
  .thumb.link::before, .thumb.hid.hit::after { display: none; }
  .thumb.link::after {
    left: 50%; top: 100%; width: 1px; height: calc(28px + 12px * 1.2 + 14px);
    background-image: var(--dash-y); background-repeat: repeat-y; background-size: 1px 8px; background-position: 0 0;
    animation: dash-down .7s linear infinite;
  }
}
@media (max-width: 640px) {
  .cmp { padding: 24px 20px; }
}
@keyframes dash-down { to { background-position: 0 8px; } }
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; }
  .case { justify-self: start; }
  .sources { grid-template-columns: repeat(2, 1fr); }
  .integ, .split, .stream { grid-template-columns: 1fr; }
  .probe { padding-top: 0; }
  .terms { columns: 1; }
}
@media (max-width: 720px) {
  br.wide { display: none; }
  .btn-ghost { display: none; }
  .paper { padding: 20px 34px 16px; font-size: 11px; }
  .paper strong { font-size: 12.5px; }
  .rows th:nth-child(3), .rows td:nth-child(3) { display: none; }
  .facts dl { grid-template-columns: 1fr 1fr; }
  .facts dl div { padding: 22px 16px 22px 0; }
  .facts dl div + div { padding-left: 0; border-left: 0; }
  .facts dl div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
  .facts dl div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .sources { grid-template-columns: 1fr; }
  .terms div, .rules div { grid-template-columns: 1fr; gap: 4px; }
  .rules dd.v { font-size: 22px; margin-bottom: 4px; }
  .ledger-head, .ledger li { grid-template-columns: 48px minmax(0, 1fr) 88px 84px; gap: 12px; }
  .ledger-head span:nth-child(1), .ledger-head span:nth-child(5), .ledger-head span:nth-child(7),
  .ledger li span:nth-child(1), .ledger li span:nth-child(5), .ledger li span:nth-child(7) { display: none; }
  .ledger-body { height: 306px; }
  .probe .finding { min-height: 6em; }
  .foot nav { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
