/* ==========================================================================
   exp35 . section stylesheet owned by the evidence builder.
   Scope: #evidence only. Loaded AFTER assets/evidence.css and assets/exp33.css,
   so every rule here is a deliberate override or a new component.

   Contract:
     - tokens only, no colour literals, so all themes follow;
     - state colour is semantic:
         verified / passing            var(--pass)
         violated / failing            var(--fail)
         structural, or stated but not
         yet proven                    var(--unknown, var(--muted))
       var(--signal) is NEVER used for a state in this section. It stays an
       affordance (the kicker square, link hover) and nothing else;
     - motion reuses the shell's arrival system: site.js adds .in to .fig and
       to [data-reveal]; strokes are pathLength="1" + .dr with --d / --dur,
       text is .fx with --td. No script of its own.
   New classes are all .rx-* so they can never collide with .ev-* upstream.
   ========================================================================== */

/* ---------- head ---------------------------------------------------------
   The repository line is a citation, not a boast: the name, nothing else.
   Star counts and install counts are vanity numbers and stay off the page. */
#evidence .rx-repo{margin-top:0;}

/* The publication sentence is the strongest trust move in the section, so it
   is set above lead weight and given its own rule. It is never a caption. */
#evidence .rx-publish{
  margin:clamp(1.2rem,2vw,1.6rem) 0 0;
  padding-left:clamp(.8rem,1.4vw,1.1rem);
  border-left:2px solid var(--hair-strong);
  max-width:46ch;
  font-family:var(--prose);font-weight:600;
  font-size:clamp(1.18rem,1.9vw,1.5rem);line-height:1.34;letter-spacing:-.02em;
  color:var(--ink);text-wrap:pretty;
}
html[data-theme="riso"] #evidence .rx-publish,
html[data-theme="brutal"] #evidence .rx-publish{font-family:"Bricolage Grotesque",var(--sans);font-weight:700;}
html[data-theme="brutal"] #evidence .rx-publish{border-left-width:4px;border-left-color:var(--ink);}

/* ---------- the three numbers -------------------------------------------
   Upstream evidence.css frames these in a ruled band with vertical dividers.
   That reads as a SaaS stats bar. Here they are large and quiet: no band, no
   dividers, lowercase mono labels, and they sit above the register they
   summarize rather than standing in for it. The per-theme colour treatment in
   evidence.css is left untouched on purpose. */
#evidence .ev-nums{
  border:0;
  margin:clamp(2.2rem,4.2vw,3.4rem) 0 0;
  gap:clamp(1.8rem,3vw,2.4rem) clamp(2rem,5vw,5.5rem);
}
#evidence .ev-cell{padding:0;}
#evidence .ev-cell + .ev-cell{border:0;padding-left:0;}
#evidence .ev-num{
  font-size:clamp(3.8rem,7.6vw,6.8rem);
  font-weight:500;line-height:.88;letter-spacing:-.045em;
}
#evidence .ev-num-lab{
  margin-top:clamp(.7rem,1.2vw,1rem);max-width:26ch;
  font-size:.8rem;letter-spacing:.03em;text-transform:none;
}

/* ---------- a small mono label that titles one artifact ------------------ */
#evidence .rx-tag{
  display:flex;align-items:center;gap:.55em;
  margin:clamp(2.6rem,5vw,4rem) 0 .9rem;max-width:740px;
  font-family:var(--mono);font-size:.72rem;font-weight:500;
  letter-spacing:.09em;text-transform:uppercase;color:var(--muted);
}
#evidence .rx-tag.is-wide{max-width:none;}
#evidence .rx-tag::after{content:"";flex:1 1 auto;height:1px;background:var(--hair);}

/* ==========================================================================
   THE RECEIPT
   One finding travelling requirement -> defect -> reproducer -> affected
   revision -> fix -> new evidence -> re-approved requirement. The arrows are
   the ink: they draw once, top to bottom, on arrival.
   ========================================================================== */
#evidence .rx-fig{margin:0;}
#evidence .rx-chain{max-width:740px;}

#evidence .rx-step{
  display:grid;
  grid-template-columns:minmax(0,13rem) minmax(0,1fr);
  gap:.3rem clamp(1rem,2.4vw,1.9rem);
  align-items:baseline;
  padding:.8rem clamp(.9rem,1.8vw,1.15rem) .85rem;
  border:1px solid var(--hair);border-radius:var(--radius);
}
#evidence .rx-step.is-end{border-color:var(--hair-strong);}

#evidence .rx-stage{
  margin:0;display:flex;align-items:baseline;gap:.6rem;
  font-family:var(--mono);font-size:.72rem;font-weight:500;line-height:1.5;
  letter-spacing:.09em;text-transform:uppercase;color:var(--muted);
}
#evidence .rx-n{
  flex:0 0 auto;color:var(--ink-40,var(--muted));
  font-variant-numeric:tabular-nums;letter-spacing:.04em;
}

#evidence .rx-rec{min-width:0;}
#evidence .rx-meta{
  margin:0 0 .3rem;display:flex;flex-wrap:wrap;align-items:baseline;gap:.35rem .9rem;
  font-family:var(--mono);font-size:.76rem;font-weight:500;line-height:1.5;
  letter-spacing:.02em;color:var(--ink);
}
#evidence .rx-idc{color:var(--ink);}
/* a location or a file range is a field, not a state: no semantic square */
#evidence .rx-field{color:var(--muted);}

/* the state chip: a semantic square, then the word */
#evidence .rx-st{display:inline-flex;align-items:baseline;gap:.45em;}
#evidence .rx-st::before{
  content:"";flex:0 0 auto;width:6px;height:6px;
  background:currentColor;transform:translateY(-1px);
}
#evidence .rx-st.is-pass{color:var(--pass);}
#evidence .rx-st.is-fail{color:var(--fail);}
#evidence .rx-st.is-idle{color:var(--unknown,var(--muted));}
/* the closing step carries a drawn tick instead of the square */
#evidence .rx-st-ck::before{display:none;}
#evidence .rx-ck{width:14px;height:14px;flex:0 0 auto;transform:translateY(2px);}
#evidence .rx-ck path{fill:none;stroke:var(--pass);stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round;}

#evidence .rx-txt{
  margin:0;max-width:54ch;
  font-family:var(--prose);font-size:1.05rem;line-height:1.6;color:var(--ink);
}
#evidence .rx-txt code{font-family:var(--mono);font-size:.93em;}

/* the connector. .fig svg is 100%-wide by default; these are glyphs, not
   diagrams, so they take a fixed box and sit under the stage column. */
#evidence .rx-arrow{
  display:block;width:16px;height:34px;
  margin:0 0 0 clamp(.9rem,1.8vw,1.15rem);
}
#evidence .rx-arrow .st{stroke:var(--unknown,var(--muted));stroke-width:1.2;}

#evidence .rx-fig .fig-cap{margin-top:1.1rem;}

/* ---------- the register ------------------------------------------------- */
#evidence .rx-flag{
  margin-left:.75rem;white-space:nowrap;
  font-family:var(--mono);font-size:.66rem;font-weight:500;
  letter-spacing:.08em;text-transform:uppercase;color:var(--unknown,var(--muted));
}
#evidence .ev-row.is-shown .ev-id{color:var(--ink);}

/* ---------- the three actions -------------------------------------------- */
#evidence .rx-links{gap:.9rem 2.1rem;}

/* ==========================================================================
   EVIDENCE INTEGRITY: the route to the artifact
   Plan §9 rule 4 - "verified" never appears without a route to the evidence.
   Every step of the receipt and every row of the register names a file in the
   public repository and links to it. These links are the only place --signal
   is allowed in this section: a link is an affordance, never a state.
   ========================================================================== */

/* the artifact line under a record: mono, quiet, one file per step */
#evidence .rx-art{
  margin:.5rem 0 0;max-width:none;
  font-family:var(--mono);font-size:.72rem;line-height:1.6;
  letter-spacing:.01em;color:var(--muted);
  overflow-wrap:anywhere;
}
#evidence .rx-art a,
#evidence .rx-src a,
#evidence .rx-nums-note a,
#evidence .ev-cap a{
  color:var(--signal);text-decoration:none;
  border-bottom:1px solid rgba(var(--signal-rgb),.35);
}
#evidence .rx-art a:hover,
#evidence .rx-src a:hover,
#evidence .rx-nums-note a:hover,
#evidence .ev-cap a:hover{border-bottom-color:var(--signal);}
#evidence .rx-dim{color:var(--unknown,var(--muted));padding:0 .15em;}

/* the repository line in the head is now the door it always claimed to be */
#evidence a.ev-repo{text-decoration:none;}
#evidence a.ev-repo:hover{color:var(--signal);border-bottom-color:var(--signal);}

/* the counts note. The house convention for anything the page cannot prove
   (audit.html: "Example, hand drawn" / "Counts are illustrative") is a visible
   caption, not a source comment. 123 is checkable in specs/; the other two are
   the campaign's tally and say so here, in the rendered page. */
#evidence .rx-nums-note{
  margin:clamp(1rem,1.8vw,1.4rem) 0 0;max-width:70ch;
  font-family:var(--mono);font-size:.74rem;line-height:1.7;color:var(--muted);
  text-wrap:pretty;
}

/* 7 bugs / 4 records. Plan §9 rule 5: never print two counts a reader cannot
   line up. The relationship is a sentence a human reads, so it is set in the
   prose face at body weight, directly under the register heading and above the
   rows it explains. It is not a caption and it is not fine print. */
#evidence .rx-reconcile{
  margin:0;max-width:62ch;
  font-family:var(--prose);font-size:1.05rem;line-height:1.6;color:var(--ink);
  text-wrap:pretty;
}
#evidence .rx-reconcile + .ev-table{margin-top:clamp(1.5rem,2.8vw,2.2rem);}

/* register rows: the promise, then the record it came from */
#evidence .rx-cell{min-width:0;}
#evidence .rx-src{
  margin:.4rem 0 0;
  font-family:var(--mono);font-size:.7rem;line-height:1.5;
  letter-spacing:.02em;color:var(--muted);
}
#evidence .ev-cap{max-width:78ch;}
#evidence .ev-cap code{font-family:var(--mono);font-size:.96em;color:var(--ink);}

/* the miss keeps its own route out */
#evidence .ev-miss-l{margin:1rem 0 0;}

/* ==========================================================================
   responsive
   ========================================================================== */
@media (max-width:760px){
  #evidence .rx-step{grid-template-columns:minmax(0,1fr);gap:.5rem 0;}
  #evidence .rx-txt{max-width:none;}
}
/* upstream evidence.css re-lays the register with grid-template-areas below
   700px; the promise is now wrapped so the wrapper takes the area. */
@media (max-width:700px){
  #evidence .rx-cell{grid-area:promise;}
  #evidence .rx-nums-note{max-width:none;}
  #evidence .rx-reconcile{max-width:none;}
  #evidence .ev-cap{max-width:none;}
}
@media (max-width:640px){
  #evidence .ev-nums{grid-template-columns:minmax(0,1fr);}
  #evidence .rx-tag{max-width:none;}
  #evidence .ev-num{font-size:clamp(3.4rem,16vw,4.6rem);}
  #evidence .ev-num-lab{max-width:none;}
  #evidence .rx-publish{max-width:none;}
  #evidence .rx-chain{max-width:none;}
}

/* ==========================================================================
   theme corrections
   ========================================================================== */
/* terminal draws line-work in low-alpha green; a 1px --hair plate dissolves. */
html[data-theme="terminal"] #evidence .rx-step{border-color:var(--hair-strong);}
html[data-theme="terminal"] #evidence .rx-tag::after{background:var(--hair-strong);}
html[data-theme="terminal"] #evidence .rx-publish{border-left-color:var(--hair-strong);}

/* brutal: hairlines vanish next to the theme's plates. */
html[data-theme="brutal"] #evidence .rx-step{border-width:2px;border-color:var(--ink);}
html[data-theme="brutal"] #evidence .rx-arrow .st{stroke:var(--ink);stroke-width:1.8;}

/* riso and acid run hot grounds; keep the plate edge readable. */
html[data-theme="riso"] #evidence .rx-step,
html[data-theme="acid"] #evidence .rx-step{border-color:var(--hair-strong);}

/* ==========================================================================
   reduced motion: the chain holds one legible frame, fully drawn.
   ========================================================================== */
@media (prefers-reduced-motion:reduce){
  #evidence .rx-arrow .dr,#evidence .rx-ck .dr{
    stroke-dasharray:none !important;stroke-dashoffset:0 !important;transition:none !important;
  }
  #evidence .fx{opacity:1 !important;transition:none !important;}
}

/* the 7-vs-4 bridge: the one phrase in the caption that must be read */
.ev-cap-em{font-weight:600;color:var(--ink,inherit);}

/* plan §4.1: the shortened "file tree in your repo" line at the close. */
.cl-tree{font-family:var(--mono);font-size:.92rem;letter-spacing:.01em;
  color:var(--label-text);margin:0 0 .9rem;
  overflow-wrap:anywhere;text-wrap:pretty;max-width:100%;}
@media (max-width:520px){ .cl-tree{font-size:.8rem;letter-spacing:0;} }

/* The closing CTA label grew when prove.html became an application rather than
   a paste-and-run ("Apply for an open-source audit"). The shared .btn is
   white-space:nowrap, so at 390 it pushed the document 17px sideways. Scoped
   to this one control: the shared button keeps its nowrap everywhere else. */
.cl-cta .btn{white-space:normal;text-wrap:balance;max-width:100%;}
@media (max-width:430px){ .cl-cta .btn{font-size:.94em;padding-left:1rem;padding-right:1rem;} }

/* The landing routes readers to the live portal; that portal is the seeded branch. */
.ev-branchnote{margin:.6rem 0 1.1rem;font-size:.84rem;line-height:1.55;
  color:var(--label-text);max-width:64ch;}
