/* Provenance demo. Layout, type and interaction follow design/provenance-mock.html.
   Deviations from the mock are marked and explained where they occur. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--pg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 1320px; margin: 0 auto; padding: 26px 32px 72px; }

h1 { font-size: 22px; font-weight: 500; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 500; margin: 0 0 10px; }
h3 { font-size: 14px; font-weight: 500; margin: 0 0 6px; }
p { margin: 0 0 12px; }

/* The claim the page is making about its author, stated before the machinery.
   Two columns: the claim on the left, what it does and the disclaimer on the right. A single
   stacked column left most of the page empty and pushed the actual content below the fold.
   Widths are set here rather than on the children — a max-width in ch scales with each
   element's own font size, so smaller text ended up with a narrower measure than the text
   above it and the block read as a shrinking staircase. */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 56px;
  align-items: start;
  margin: 0 0 26px;
}
/* Masthead. A title block with a spec table beside it, the way an instrument is labelled:
   what it is on the left, what it runs on to the right. A paragraph of prose next to a
   headline reads as a brochure; a key/value block reads as equipment. */
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0 64px;
  align-items: start;
  padding-bottom: 16px;
  margin-bottom: 0;
}
.eyebrow {
  grid-column: 1 / -1;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.07em;
  color: var(--sec); margin: 0 0 16px;
}
.claim {
  font-size: 26px; font-weight: 500; line-height: 1.22; letter-spacing: -0.012em;
  margin: 0 0 10px; text-wrap: balance;
}
.claim-sub { font-size: 14px; color: var(--sec); margin: 0; max-width: 480px; }

.spec {
  display: grid; grid-template-columns: 62px minmax(0, 1fr);
  gap: 7px 16px; margin: 4px 0 0; font-size: 13px; align-content: start;
}
.spec dt {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em;
  color: var(--sec); padding-top: 3px;
}
.spec dd { margin: 0; color: var(--ink); line-height: 1.45; }
.spec dd a { color: var(--ac); text-decoration: none; border-bottom: 1px solid var(--bd2); }
.spec dd a:hover { border-bottom-color: var(--ac); }

/* Focus is always visible. No shadows are allowed, so this is an outline. */
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 3px; }

/* ------------------------------------------------------------------ tabs -- */

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--bd); margin: 0 0 22px; }
.tab { padding: 12px 0 10px; }

.tab {
  font-family: var(--sans); font-size: 14px; color: var(--sec);
  padding: 0 0 10px; border: 0; border-bottom: 2px solid transparent;
  background: none; cursor: pointer; line-height: 1.6;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }

.view[hidden] { display: none; }

/* ---------------------------------------------------- banner and metrics -- */

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 14px; background: var(--wnb); border-radius: 6px; margin-bottom: 16px;
}
.bar-t { font-size: 13.5px; color: var(--wn); }
.bar-n { font-family: var(--mono); font-size: 13px; color: var(--wn); white-space: nowrap; }

/* One readout, divided — not four floating cards. Instruments group their gauges. */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--s1);
  border: 1px solid var(--bd2); border-radius: 10px; overflow: hidden;
}
.stat { padding: 12px 16px 13px; border-right: 1px solid var(--bd2); }
.stat:last-child { border-right: 0; }
.stat .l {
  font-family: var(--mono); font-size: 10.5px; color: var(--sec);
  letter-spacing: 0.04em; margin-bottom: 2px;
}
.stat .v { font-size: 26px; font-weight: 500; line-height: 1.25; letter-spacing: -0.015em; }
.stat .v.bad { color: var(--dg); }

/* The cards count the whole corpus, not the document on screen. Say so. */
.stats-note { font-family: var(--mono); font-size: 11px; color: var(--sec); margin: 9px 0 18px; }

/* ---------------------------------------------------------------- legend -- */

.lgd {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  padding: 0; margin: 0 0 14px;
}
.lg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--sec); }

.kx {
  width: 16px; height: 16px; border-radius: 3px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px;
}
.kx.a { background: var(--okb); color: var(--ok); }
.kx.b { background: var(--acb); color: var(--ac); }
.kx.c { background: var(--wnb); color: var(--wn); }
.kx.d { background: var(--dgb); color: var(--dg); }

/* Colour is never the only signal: each label also carries a distinct underline. */
.lg .kx.a, .lg .kx.b { border-bottom: 2px solid currentColor; }
.lg .kx.c { border-bottom: 2px dashed currentColor; }
.lg .kx.d { border-bottom: 2px dotted currentColor; }

/* ---------------------------------------------------- document toggle row -- */

.tgl {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-top: 14px; margin-bottom: 14px; border-top: 1px solid var(--bd);
}

.tb {
  font-size: 13.5px; padding: 6px 14px; border-radius: 6px;
  border: 1px solid var(--bd2); background: transparent; color: var(--sec);
  cursor: pointer; font-family: var(--sans);
}
.tb:hover { color: var(--ink); }
.tb[aria-pressed="true"] { background: var(--s1); color: var(--ink); font-weight: 500; }

.cnt { margin-left: auto; font-family: var(--mono); font-size: 12.5px; color: var(--sec); }

.dl {
  font-family: var(--mono); font-size: 12px; padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--bd2); background: transparent; color: var(--sec); cursor: pointer;
}
.dl:hover { color: var(--ink); border-color: var(--ink); }

/* ----------------------------------------------------------- three columns -- */

.chain {
  position: relative;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 288px;
  gap: 64px; /* the wire gutter — never below 48px */
  align-items: start;
}

#wires {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: visible; z-index: 1;
}

.railh {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px; color: var(--sec);
  letter-spacing: 0.04em; margin-bottom: 9px;
}

/* An affordance badge. Nothing about a bordered row says "clickable" on its own, and the two
   rails are where the whole interaction starts. */
.railh .hint {
  font-size: 10px; letter-spacing: 0.02em; color: var(--sec);
  border: 1px solid var(--bd2); border-radius: 3px; padding: 1px 5px;
}

.rail { display: flex; flex-direction: column; gap: 6px; position: relative; z-index: 2; }

/* Real buttons, so keyboard and Enter/Space work without extra handlers. */
.rw {
  display: block; width: 100%; text-align: left; font-family: var(--sans);
  border: 1px solid var(--bd); border-radius: 6px; padding: 9px 11px;
  cursor: pointer; background: var(--pg); color: var(--ink); line-height: 1.6;
}
.rw:hover { border-color: var(--bd2); background: var(--s1); }
.rw[aria-pressed="true"] { border-color: var(--ink); background: var(--s1); }

.rw .fn { font-family: var(--mono); font-size: 12px; color: var(--ink); word-break: break-all; }
.rw .fn.none { color: var(--sec); }
.rw .mt { font-family: var(--mono); font-size: 11px; color: var(--sec); margin-top: 3px; }
.rw .rq { font-size: 13px; color: var(--ink); line-height: 1.4; }

.pill {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  padding: 1px 6px; border-radius: 3px; vertical-align: 1px;
}
.pill.must { background: var(--dgb); color: var(--dg); }
.pill.preferred { background: var(--s1); color: var(--sec); }

/* Non-text use of muted is fine — the adjacent word carries the same information. */
.dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
  margin-right: 6px; background: var(--mut);
}
.dot.answered { background: var(--ok); }
.dot.blocked { background: var(--dg); }

.st.answered { color: var(--ok); }
.st.blocked { color: var(--dg); }
.st.unanswered { color: var(--sec); }

/* -------------------------------------------------------------- document -- */

.doc {
  background: var(--pg); border: 1px solid var(--bd); border-radius: 10px;
  padding: 22px 24px; position: relative; z-index: 2;
  font-size: 14.5px; line-height: 1.95;
}
.doc.resume { font-size: 13.5px; line-height: 1.8; }

/* Document blocks. The type of a block is the only thing that decides how it is set, so a
   letter reads as a letter and a résumé as a résumé from the same renderer. */
.b-meta {
  font-family: var(--mono); font-size: 11.5px; color: var(--sec);
  line-height: 1.65; white-space: pre-line; margin-bottom: 12px;
}
.b-name { font-size: 19px; font-weight: 500; line-height: 1.3; }
.b-contact { font-family: var(--mono); font-size: 11.5px; color: var(--sec); margin-bottom: 4px; }
.b-section {
  font-family: var(--mono); font-size: 10.5px; color: var(--sec); letter-spacing: 0.04em;
  border-bottom: 1px solid var(--bd); padding-bottom: 5px; margin: 18px 0 9px;
}
.b-role { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-top: 8px; }
.b-role-t { font-weight: 500; }
.b-role-m { font-family: var(--mono); font-size: 11px; color: var(--sec); white-space: nowrap; }
.b-bullet { padding-left: 2px; text-indent: -10px; margin-left: 10px; }
.b-para { margin-bottom: 12px; }
.b-para:last-child, .b-bullet:last-child { margin-bottom: 0; }
.b-sig { margin-top: 4px; font-weight: 500; }

/* -------------------------------------------------------------- posting -- */

.posting {
  display: block; width: 100%; text-align: left; font-family: var(--sans);
  border: 1px solid var(--bd); border-radius: 10px; padding: 12px 13px;
  background: var(--pg); color: var(--ink); cursor: pointer; line-height: 1.6;
}
.posting:hover { border-color: var(--bd2); background: var(--s1); }
.posting[aria-pressed="true"] { border-color: var(--ink); background: var(--s1); }

.p-co { font-size: 14px; font-weight: 500; line-height: 1.35; }
.p-role { font-size: 13px; color: var(--ink); }
.p-meta {
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--mono); font-size: 10.5px; color: var(--sec);
  line-height: 1.55; margin-top: 7px;
}
.p-more {
  font-family: var(--mono); font-size: 10.5px; color: var(--sec);
  margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--bd);
}
.posting:hover .p-more { color: var(--ink); }

/* Posting detail in the inspector. */
.plain-list { margin: 0; padding-left: 18px; font-size: 13.5px; }
.plain-list li { margin-bottom: 4px; }
.req-quotes { display: flex; flex-direction: column; gap: 12px; }
.req-quote .rq-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.req-quote .rq-title { font-size: 13.5px; font-weight: 500; }
.req-quote .code { margin-top: 0; }

/* A span, not a button: engines coerce a button to inline-block, which makes each claim an
   unbreakable box and forces the prose to break around it. Keyboard support is explicit in
   claimSpan() instead. */
.cl {
  cursor: pointer; border-radius: 3px; padding: 0 1px;
  text-decoration-line: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3.5px;
}
.cl.a { text-decoration-color: var(--ok); text-decoration-style: solid; }
.cl.b { text-decoration-color: var(--ac); text-decoration-style: solid; }
.cl.c { text-decoration-color: var(--wn); text-decoration-style: dashed; }
.cl.d { text-decoration-color: var(--dg); text-decoration-style: dotted; }

/* The mock set blocked claims in --mut, which fails AA at 15px. The underline style
   already distinguishes them, so only the weight of the grey changes. */
.cl.blk { color: var(--sec); }
.cl[aria-pressed="true"] { background: var(--acb); }

/* -------------------------------------------------------------- inspector -- */

.insp { margin-top: 22px; border-top: 1px solid var(--bd); padding-top: 18px; }
.ihead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ikind { font-family: var(--mono); font-size: 11px; color: var(--sec); letter-spacing: 0.04em; }
.verd { margin-left: auto; font-family: var(--mono); font-size: 12.5px; }
.verd.ships { color: var(--ok); }
.verd.blocked { color: var(--dg); }
.verd.plain { color: var(--sec); }

.iquote { font-size: 16px; line-height: 1.6; }
.iname { font-family: var(--mono); font-size: 15px; }
.imeta { font-family: var(--mono); font-size: 11.5px; color: var(--sec); margin-top: 4px; }

.code {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  background: var(--s1); border-radius: 6px; padding: 12px 14px;
  white-space: pre-wrap; color: var(--ink); overflow-x: auto; margin-top: 14px;
}

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 14px; font-size: 13.5px; margin-top: 12px; }
.kv .k { font-family: var(--mono); font-size: 11.5px; color: var(--sec); padding-top: 2px; }
.kv .empty { color: var(--sec); font-size: 13px; }

.chip {
  font-family: var(--mono); font-size: 11px; padding: 2px 7px; border-radius: 4px;
  background: var(--s1); color: var(--sec); cursor: pointer; border: 1px solid var(--bd);
  margin: 0 4px 4px 0;
}
.chip:hover { border-color: var(--bd2); color: var(--ink); }
.chip.blocked { color: var(--dg); border-color: var(--dgb); background: var(--dgb); }

.foot { font-size: 12.5px; color: var(--sec); margin-top: 14px; }

/* ------------------------------------------------------------------ gates -- */

.funnel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 8px; }

/* Flex column with the description growing, so the six numbers sit on one line across the
   row however many lines each description runs to. A row of gauges that do not align
   reads as an accident. */
.gate {
  display: flex; flex-direction: column;
  border: 1px solid var(--bd); border-radius: 10px; padding: 12px 13px;
}
.gate .ghead { display: flex; align-items: baseline; gap: 7px; margin-bottom: 8px; }
.gate .gnum {
  font-family: var(--mono); font-size: 10px; color: var(--sec);
  border: 1px solid var(--bd2); border-radius: 3px; padding: 0 4px; flex: none;
}
.gate .gname { font-size: 13px; font-weight: 500; }
.gate .grow { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--sec); }
.gate .gbig { font-size: 21px; font-weight: 500; font-family: var(--sans); line-height: 1.3; color: var(--dg); }
.gate .gbig.zero { color: var(--sec); }
.gate .glab { font-family: var(--mono); font-size: 10.5px; color: var(--sec); letter-spacing: 0.02em; }
.gate .grej {
  font-size: 12px; color: var(--sec); line-height: 1.45;
  margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--bd);
}
.gate .grej-k { font-family: var(--mono); font-size: 10.5px; }

/* The readout and the orientation share a row. The rails either side of the document are
   fixed width, so vertical space above the chain is the scarcest thing on the page. */
.readout-row {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0 48px; align-items: start; margin: 0 0 16px;
}
.readout-row .stats-note { margin: 9px 0 0; }
.orient .lede { max-width: none; margin: 0; }

/* Explanatory prose sits at reading width, not card width. The cap is in px, not ch: a ch cap
   scales with each element's own font size, so smaller text gets a narrower measure than the
   text above it and a stack of paragraphs tapers instead of aligning. */
.lede { max-width: 760px; color: var(--sec); font-size: 13.5px; margin: 0 0 18px; }

/* Two paragraphs of orientation read better side by side than stacked, and stacking them cost
   about eighty vertical pixels on every view before the reader reached anything to look at. */
.lede-pair {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px; margin: 0 0 16px; align-items: start;
}
.lede-pair .lede { max-width: none; margin: 0; }

.vocab { display: grid; grid-template-columns: 120px 1fr; gap: 7px 16px; margin: 0 0 4px; max-width: 74ch; }
.vocab dt { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.vocab dd { margin: 0; font-size: 13.5px; color: var(--sec); }

.log {
  background: var(--log-bg); color: var(--log-ink); border-radius: 10px;
  padding: 16px 18px; font-family: var(--mono); font-size: 12px; line-height: 1.85;
  overflow-x: auto; margin-top: 18px;
}
.log .run { margin-bottom: 14px; }
.log .run:last-child { margin-bottom: 0; }
.log .rhead { color: var(--log-dim); }
.log .ln { white-space: pre; }
.log .ok { color: var(--log-ok); }
.log .bad { color: var(--log-bad); }
.log .exit0 { color: var(--log-ok); }
.log .exit1 { color: var(--log-bad); }

/* ---------------------------------------------------------- pressure test -- */

/* The verdict reads like the readout strip above: the call on the left, the reasoning beside
   it, rather than a short line stranded in a full-width box. */
.call {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 0 48px; align-items: center;
  background: var(--s1); border: 1px solid var(--bd2); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 18px;
}
.call .clab { font-family: var(--mono); font-size: 10.5px; color: var(--sec); letter-spacing: 0.04em; }
.call .cval { font-size: 26px; font-weight: 500; line-height: 1.25; letter-spacing: -0.015em; }
.call .cwhy { grid-column: 2; grid-row: 1 / span 2; font-size: 13.5px; color: var(--sec); margin: 0; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--sec);
  font-family: var(--mono); letter-spacing: 0.02em;
  border-bottom: 1px solid var(--bd2); padding: 0 12px 8px 0;
}
table.grid td { border-bottom: 1px solid var(--bd); padding: 11px 12px 11px 0; vertical-align: top; }
table.grid td:last-child, table.grid th:last-child { padding-right: 0; }
table.grid .ev { color: var(--sec); font-size: 13px; }
.vd { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.vd.have { color: var(--ok); }
.vd.adjacent { color: var(--wn); }
.vd.donot { color: var(--dg); }

/* ---------------------------------------------------------- how it works -- */

.prose { max-width: 68ch; }
.prose h2 { margin-top: 26px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 4px; }
.prose code { font-family: var(--mono); font-size: 13px; background: var(--s1); padding: 1px 5px; border-radius: 3px; }

/* ------------------------------------------------------------- responsive -- */

/* The two rails are fixed, so every pixel lost below the cap came out of the document — at
   1024 it was 279px, narrower than either rail beside it. The rails give way first now. */
@media (max-width: 1200px) {
  .chain { grid-template-columns: 210px minmax(0, 1fr) 250px; gap: 48px; }
}

@media (max-width: 1100px) {
  .funnel { grid-template-columns: repeat(3, 1fr); }
  .readout-row { grid-template-columns: minmax(0, 1fr); gap: 14px 0; }
}

@media (max-width: 900px) {
  .masthead { grid-template-columns: minmax(0, 1fr); gap: 18px 0; }
  .claim { font-size: 22px; }
  .claim-sub { max-width: none; }
  .lede-pair { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .readout-row { grid-template-columns: minmax(0, 1fr); gap: 14px 0; }
  .call { grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
  .call .cwhy { grid-column: 1; grid-row: auto; }
  .lead, .sub, .disclaimer { grid-column: 1; grid-row: auto; }
  .page { padding: 24px 20px 56px; }
  .chain { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  #wires { display: none; } /* wires are decorative; the inspector carries the same links */
  .stats { grid-template-columns: repeat(2, 1fr); }
  .funnel { grid-template-columns: repeat(2, 1fr); }
  .tabs { gap: 18px; overflow-x: auto; }
  .cnt { margin-left: 0; width: 100%; }
}

/* Two weights only, per section 13. strong defaults to 700, so pull it back to 500. */
.prose strong, strong, b { font-weight: 500; }

/* Record categories. What kind of record something is decides which label it can support,
   so the category is shown wherever a record is. */
.cat {
  display: inline-block; font-family: var(--mono); font-size: 9.5px;
  padding: 1px 6px; border-radius: 3px; margin-top: 5px; vertical-align: 1px;
}
.cat.self-report { background: var(--okb); color: var(--ok); }
.cat.third-party-record { background: var(--acb); color: var(--ac); }
.cat.system-export { background: var(--s1); color: var(--sec); border: 1px solid var(--bd); }

/* Plain-language line on each gate card, for a reader who has never seen a pipeline. */
.gate .gplain { flex: 1 1 auto; font-size: 12px; color: var(--sec); line-height: 1.45; margin: 0 0 12px; }

/* ------------------------------------------------------------ site footer -- */

.site-foot {
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between;
  margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--bd);
  font-size: 12.5px; color: var(--sec);
}
.site-foot a { color: var(--ac); }
.site-foot-note { font-family: var(--mono); font-size: 11.5px; }

/* Shown only where the wire layer is hidden. */
.narrow-only { display: none; }

/* Last, so it beats the base rule above regardless of source order elsewhere. */
@media (max-width: 900px) {
  .narrow-only { display: block; }
}

/* ---------------------------------------------------------------- glance -- */
/* Static summary. Generated from the same data as the views above, so it cannot drift, and
   visible to every reader — the substance must exist in the HTML for anything that does not
   run JavaScript, and hiding it from people would be cloaking. */

.glance { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--bd); max-width: 74ch; }
.glance h2 { font-size: 16px; margin-bottom: 12px; }
.glance h3 { margin-top: 22px; }
.glance p { font-size: 13.5px; color: var(--sec); line-height: 1.65; }
.glance ul { margin: 0 0 12px; padding-left: 20px; font-size: 13.5px; color: var(--sec); }
.glance li { margin-bottom: 5px; line-height: 1.55; }
.glance strong { color: var(--ink); }
.glance code { font-family: var(--mono); font-size: 12.5px; background: var(--s1); padding: 1px 5px; border-radius: 3px; }
.glance-note { font-size: 12.5px; margin-top: 16px; }
