/* /cashflow — the gap between the invoice and the cash, in the "One line" language.
   The opening is a wall: one day circled on the month (the invoice goes out), and one blue line that
   leaves the month and runs to the receivables note pinned beside it, ending at the wait, which is
   written there as a number. The paid day is never drawn, so no drawn span can disagree with the
   figure. The working sheet below is the same paper; the page closes on the payment record, where
   the line is written in as the next entry. */

/* ── Opening ── */
.cf-hero{padding-top:clamp(24px,2.6vw,44px);padding-bottom:clamp(20px,2vw,32px);
  /* the shared opening wash, re-centred so it has faded out before this opening ends */
  background:radial-gradient(ellipse 44% 48% at 76% 48%,rgba(250,248,243,.7) 0%,rgba(244,242,236,.36) 44%,rgba(233,231,226,0) 80%)}
.cf-hero .ph-in{grid-template-columns:minmax(0,11fr) minmax(0,12fr);align-items:center}
/* three lines that break on the sentence: "The invoice is earned. / The cash is still / somewhere else." */
.cf-hero h1.h-l{font-size:clamp(38px,3.8vw,55px);line-height:1;max-width:9.7em}
.cf-hero .lede{max-width:26em}
.cf-private{display:flex;align-items:baseline;gap:12px;margin-top:20px;color:var(--mute);font-size:15px;max-width:none}
.cf-private::before{content:"";flex:none;width:7px;height:7px;border-radius:50%;background:var(--ink);transform:translateY(-1px)}

/* the wall: the drawing, and the receivables note pinned to it */
.cf-wall{position:relative;width:100%;max-width:520px;justify-self:end}
.cf-scene{--pen:1.2px}
.ph .cf-wall .cf-scene{max-width:none}  /* the drawing is exactly as wide as the wall the note is sized against */

/* the note is paper: a shade lighter than the wall, a soft shadow, a pin, a pen outline */
.cf-slip{position:relative;z-index:1;background:var(--paper-hi);
  box-shadow:0 6px 16px -6px rgba(23,21,15,.2),0 1px 3px rgba(23,21,15,.08)}
.cf-slip::before{content:"";position:absolute;left:50%;top:9px;width:11px;height:11px;margin-left:-5.5px;border-radius:50%;
  background:var(--paper-lo);border:1.2px solid var(--ink);box-shadow:2px 3px 4px rgba(23,21,15,.18)}
.cf-note-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.cf-note-head strong{display:block;font:600 21px/1.1 var(--display);letter-spacing:-.01em;white-space:nowrap}
/* "illustrative, your figures only" is the note's rubber stamp */
.cf-note-head span{display:inline-block;flex:none;padding:3px 7px;border:1.3px solid color-mix(in srgb,var(--mute) 75%,transparent);border-radius:2px;
  font:650 12px/1.35 var(--sans);letter-spacing:.08em;color:var(--mute);transform:rotate(-2.5deg);transform-origin:0 50%}
.cf-note-row{position:relative;display:flex;justify-content:space-between;align-items:center;gap:12px}
.cf-note-row span{font:650 12px/1.2 var(--sans);letter-spacing:.07em;text-transform:uppercase;color:var(--mute)}
.cf-note-row b{font:600 22px/1 var(--display);letter-spacing:-.01em;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
/* the line's second dot sits on the wait */
.cf-note-row.t-days::before{content:"";position:absolute;top:50%;border-radius:50%;background:var(--sky);border:1.2px solid var(--ink)}
.cf-rail{position:absolute;top:0;width:2px;background:var(--blue);border-radius:1px}
/* the margin sentence, pencilled at the foot of the note */
.cf-margin{font:400 15.5px/1.4 var(--serif);color:var(--ink-2)}
/* the dot and its rail arrive once the blue line has been drawn (site.js marks is-done) */
.cf-note-row.t-days::before,.cf-rail{transition:opacity .5s ease}
.cf-scene.is-drawing:not(.is-done)~.cf-slip .t-days::before,.cf-scene.is-drawing:not(.is-done)~.cf-slip .cf-rail{opacity:0}

/* Desktop: the note hangs on the wall where the drawing left room for it. It is sized in units of
   the drawing's width (1cqw = 10.5 viewBox units), so it scales with the drawing and the blue line
   meets its "Average wait" row at every width. Geometry mirrored in pages/cashflow.py
   (SLIP_X 600, SLIP_Y 120, padding 4.4, heading 13, row 8.4). */
@media(min-width:1180px){
  .cf-hero .ph-in{grid-template-columns:minmax(0,10fr) minmax(0,13fr)}
  .cf-wall{container-type:inline-size;max-width:660px}
  .cf-scene .tie-ph{display:none}
  .cf-slip{position:absolute;left:57.143cqw;top:11.429cqw;width:40cqw;padding:4.4cqw 3.4cqw 3.2cqw;
    box-shadow:0 .9cqw 2.4cqw -.9cqw rgba(23,21,15,.22),0 .15cqw .45cqw rgba(23,21,15,.08)}
  .cf-slip::before{top:1.5cqw;width:1.7cqw;height:1.7cqw;margin-left:-.85cqw}
  .cf-rail{display:none}
  .cf-note-head{height:13cqw;flex-direction:column;justify-content:flex-start;gap:1.5cqw}
  .cf-note-head strong{font-size:3.05cqw}
  .cf-note-head span{font-size:max(12px,1.8cqw);padding:.45cqw 1cqw}
  .cf-note-row{height:8.4cqw;flex-direction:column;justify-content:center;align-items:flex-start;gap:.5cqw}
  .cf-note-row span{font-size:max(12px,1.8cqw)}
  .cf-note-row b{font-size:3.5cqw}
  .cf-note-row.t-days::before{left:-4.4cqw;width:2cqw;height:2cqw;margin-top:-1cqw}
  .cf-margin{margin-top:2.4cqw;font-size:max(14.5px,2.3cqw)}
}

/* ── The working sheet ── */
.cf-bench{padding:clamp(24px,2.4vw,44px) var(--gut) clamp(36px,4vw,60px)}
.cf-bench-in,.cf-reading-in{max-width:var(--max);margin:0 auto}
.cf-kick,.band .cf-kick{color:var(--mute);margin-bottom:14px;font:650 12.5px/1.3 var(--sans);letter-spacing:.08em;text-transform:uppercase;max-width:none}
.cf-head{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:20px 64px;align-items:end;margin-bottom:clamp(24px,2.1vw,32px)}
/* section heads sit a clear step under the opening's h1 */
.cf-head .h-l,.cf-reading-head .h-l,.cf-next .h-l{font-size:clamp(30px,3vw,43px);line-height:1.04}
.cf-formula{font:400 clamp(18px,1.5vw,21px)/1.45 var(--serif);color:var(--ink-2);max-width:34ch}

.cf-sheet{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);background:var(--paper-hi)}
.cf-inputs{padding:clamp(22px,2.6vw,40px) clamp(24px,3.6vw,56px) clamp(26px,3.4vw,48px)}
.cf-control+.cf-control{margin-top:30px;padding-top:30px}
.cf-control .row{display:flex;justify-content:space-between;align-items:baseline;gap:16px}
.cf-control label{font-weight:600;font-size:16.5px;color:var(--ink)}
.cf-control .val{font:600 clamp(26px,2.4vw,34px)/1 var(--display);letter-spacing:-.01em;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-control .hint{margin-top:2px;font-size:15px;color:var(--mute);max-width:46ch}

/* slider: the track is a pen line with a tick at each end, the part already travelled is the blue
   line, and the handle is the second dot of the logo. The input itself is 44px tall to touch. */
.cf-control input[type=range]{-webkit-appearance:none;appearance:none;display:block;width:100%;height:44px;margin:10px 0 0;cursor:pointer;
  background:
    linear-gradient(var(--blue),var(--blue)) left center/var(--fill,50%) 2.4px no-repeat,
    linear-gradient(var(--ink),var(--ink)) left center/1.35px 11px no-repeat,
    linear-gradient(var(--ink),var(--ink)) right center/1.35px 11px no-repeat,
    linear-gradient(var(--ink),var(--ink)) left center/100% 1.35px no-repeat;
  outline:none;touch-action:pan-y}
.cf-control input[type=range]::-webkit-slider-runnable-track{height:44px;background:transparent;border:0}
.cf-control input[type=range]::-moz-range-track{height:44px;background:transparent;border:0}
.cf-control input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:24px;height:24px;margin-top:10px;border-radius:50%;
  background:var(--sky);border:1.6px solid var(--ink);box-shadow:0 0 0 3px var(--paper-hi);transition:transform .2s ease,box-shadow .2s ease}
.cf-control input[type=range]::-moz-range-thumb{width:21px;height:21px;border-radius:50%;background:var(--sky);border:1.6px solid var(--ink);
  box-shadow:0 0 0 3px var(--paper-hi);transition:transform .2s ease,box-shadow .2s ease}
.cf-control input[type=range]:hover::-webkit-slider-thumb,.cf-control input[type=range]:active::-webkit-slider-thumb{transform:scale(1.14)}
.cf-control input[type=range]:hover::-moz-range-thumb,.cf-control input[type=range]:active::-moz-range-thumb{transform:scale(1.14)}
/* keyboard focus: a blue ring round the handle (on the handle, so it reads as "this one moves") */
.cf-control input[type=range]:focus-visible{outline:none}
.cf-control input[type=range]:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 3px var(--paper-hi),0 0 0 5.5px var(--blue)}
.cf-control input[type=range]:focus-visible::-moz-range-thumb{box-shadow:0 0 0 3px var(--paper-hi),0 0 0 5.5px var(--blue)}

/* the result starts level with the first input and the figure is underlined by the pen */
.result{display:flex;flex-direction:column;justify-content:flex-start;padding:clamp(22px,2.6vw,40px) clamp(24px,3.6vw,56px) clamp(26px,3.4vw,48px);border-left:1px solid var(--hair-2)}
.result .lbl{color:var(--mute)}
.result .big{width:fit-content;margin-top:16px;padding-bottom:16px;font:600 clamp(48px,5vw,78px)/.95 var(--display);letter-spacing:-.025em;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
.result .big>.pen-layer path{stroke:var(--ink);stroke-width:1.5}
.result .says{margin-top:16px;font:400 clamp(18px,1.45vw,20px)/1.42 var(--serif);color:var(--ink-2);max-width:28ch}
.result .stamp{margin-top:auto;padding-top:22px;font-size:12.5px;font-weight:650;letter-spacing:.08em;text-transform:uppercase;color:var(--mute)}

/* ── How to read it: one pen line joins the three statements; each is a tick on it, its number
   written beside the tick ── */
.cf-reading{padding:clamp(28px,3vw,44px) var(--gut) clamp(56px,6vw,88px)}
.cf-reading-in{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:32px clamp(40px,6vw,104px);align-items:start}
.cf-reading-head .h-l{max-width:17ch}
.cf-lines{position:relative;--lx:58px}
.cf-spine{position:absolute;left:calc(var(--lx) - 3px);top:15px;width:6px;height:calc(100% - 15px);max-width:none;overflow:visible}
.cf-spine path{fill:none;stroke:color-mix(in srgb,var(--ink) 78%,transparent);stroke-width:1.3;vector-effect:non-scaling-stroke;stroke-linecap:round}
.cf-lines article{position:relative;display:grid;grid-template-columns:calc(var(--lx) + 30px) minmax(0,1fr);padding-bottom:clamp(30px,3vw,42px)}
.cf-lines article:last-child{padding-bottom:4px}
.cf-lines article::before{content:"";position:absolute;left:calc(var(--lx) - 8px);top:14.5px;width:16px;height:1.5px;border-radius:1px;background:var(--ink)}
.cf-lines h3{font:600 clamp(22px,1.8vw,26px)/1.18 var(--display);letter-spacing:-.01em;color:var(--ink);text-wrap:balance}
.cf-lines p{margin-top:10px;color:var(--ink-2);max-width:54ch}

/* ── What to do with the estimate: the payment record the line ends on ── */
.cf-next{padding-bottom:clamp(64px,7vw,100px)}
.cf-next .band-in{grid-template-columns:minmax(0,6fr) minmax(0,6fr);align-items:center}
.cf-next .h-l{max-width:15ch}
.cf-next-p{margin-top:22px;font:400 17px/1.65 var(--sans)!important;color:var(--ink-2);max-width:50ch!important}
.cf-next .acts{margin-top:28px}
.cf-ledger{--pen:1.15px;width:100%;max-width:560px;justify-self:end}

/* ── Below 1180px the note leaves the wall: the drawing is cropped to the clock and the month, and the
   note is a paper pinned under it. The blue line leaves the month on the left, runs down the wall
   and into the note's margin, ending on the wait. The crop is x 70..630, y 0..621 of the drawing
   (pages/cashflow.py), so the drawing's x 112 is 7.5% across ── */
@media(max-width:1179px){
  .cf-wall{max-width:460px}
  .cf-scene{aspect-ratio:560/621;overflow:hidden}
  .cf-scene svg{width:187.5%;max-width:none;margin-left:-12.5%}
  .cf-scene>.tone{width:187.5%;left:-12.5%}
  .cf-scene .tie-wall{display:none}
  .cf-slip{padding:24px 20px 20px calc(7.5% + 22px)}
  .cf-rail{left:7.5%;margin-left:-1px;height:177px}
  .cf-note-head{height:78px;flex-direction:column;justify-content:flex-start;gap:9px}
  .cf-note-row{height:50px}
  .cf-note-row.t-days::before{left:-28px;width:12px;height:12px;margin-top:-6px}
  .cf-margin{margin-top:14px}
}

/* ── Phone ── */
@media(max-width:860px){
  .cf-hero{background:radial-gradient(ellipse 120% 28% at 60% 68%,rgba(250,248,243,.7) 0%,rgba(233,231,226,0) 80%)}
  .cf-hero .ph-in{grid-template-columns:1fr;gap:8px}
  .cf-hero h1.h-l{font-size:clamp(34px,9.4vw,44px);max-width:none}
  .cf-wall{justify-self:stretch;max-width:520px;margin:18px auto 0}
  .cf-note-head strong{font-size:20px}

  .cf-head{grid-template-columns:1fr;gap:16px}
  .cf-head .h-l,.cf-reading-head .h-l,.cf-next .h-l{font-size:30px}
  .cf-sheet{grid-template-columns:1fr}
  .cf-inputs{padding:24px 20px 28px}
  .cf-control+.cf-control{margin-top:24px;padding-top:24px}
  .cf-control .row{flex-wrap:wrap;gap:4px 12px}
  .cf-control label{font-size:16px}
  .cf-control .val{font-size:28px}
  .cf-control .hint{font-size:14.5px}
  .result{border-left:0;border-top:1px solid var(--hair-2);padding:26px 20px 30px}
  .result .big{font-size:clamp(44px,13vw,60px)}

  .cf-reading-in{grid-template-columns:1fr;gap:20px}
  .cf-reading-head .h-l{max-width:none}
  .cf-lines{--lx:34px}
  .cf-lines article{grid-template-columns:calc(var(--lx) + 20px) minmax(0,1fr);padding-bottom:28px}
  .cf-lines article::before{left:calc(var(--lx) - 6px);width:12px}
  .cf-next .band-in{grid-template-columns:1fr;gap:32px}
  .cf-ledger{justify-self:center}
}

/* round 3 (judges 25.10): the three readings are observations, not numbered steps; the stage names are pen notes;
   on a phone the calculator comes first and the wall drawing gives way to it */
.cf-lines article{grid-template-columns:minmax(0,1fr);padding-left:calc(var(--lx) + 30px)}
.cf-kick.note-mark,.band .cf-kick.note-mark{font:400 17px/1.3 var(--serif);letter-spacing:0;text-transform:none}
@media(max-width:860px){
  .cf-lines article{padding-left:calc(var(--lx) + 20px)}
  .cf-hero .cf-wall{display:none}
}
/* blue belongs to the introduction line; the wait between two days is drawn in ink */
.cf-scene .tie,.cf-ledger .tie{stroke:var(--ink-2)}
.cf-rail{background:var(--ink-2)}

/* JavaScript off: nothing would move the figures, so the sliders go and the page says so (a <noscript> sentence above the sheet);
   what stays reads as the worked example it is */
.cf-nojs{margin:0 0 clamp(20px,2vw,28px);color:var(--ink-2);max-width:62ch}
@media (scripting:none){.cf-control input[type=range]{display:none}}
