/* ==========================================================
   COUNFIELD — RESEARCH SURFACE
   Loaded only by pages under /research/. Inherits every token
   from style.css; adds nothing to the rest of the site.

   Design intent: research laboratory + technical instrument +
   editorial science communication. Data first, typography
   first, quiet surfaces. No glow, no gradient, no glass, no
   oversized cards.

   ACCESSIBILITY CONTRACT
   Colour never carries information alone. Every encoded
   distinction is also carried by a shape (filled vs hollow),
   an authority glyph, and a text label.
========================================================== */

:root{
  /* Restrained accents, all >= 4.5:1 against --bg (#0d0d0c). */
  --sci-stop:#e8705c;          /* threshold, chance, stop, negative */
  --sci-grid:rgba(255,255,255,0.09);
  --sci-zero:rgba(255,255,255,0.28);
  --sci-panel:#141413;

  /* Evidence-authority hues. Always paired with glyph + label. */
  --auth-official:#ededE8;
  --auth-official-calibration:#b9bdc4;
  --auth-forensic:#c8a96a;
  --auth-diagnostic:#7fa8c9;
  --auth-adapter:#a98fc0;
  --auth-retrospective:#8c8c86;
}

/* ==========================================================
   STRUCTURE
========================================================== */
/* Scientific prose carries long unbreakable literals -- class names like
   RETROSPECTIVE_NONCANONICAL_OBSERVATION_V1, flags, hashes. break-word wraps
   those only when they would otherwise push the page sideways, and leaves
   ordinary text alone. */
.sci-section{padding-block:clamp(28px,5vh,52px);border-top:1px solid var(--line);overflow-wrap:break-word}
.sci-section:first-of-type{border-top:0}
.sci-section h2{
  font-family:var(--serif);font-weight:500;
  font-size:clamp(23px,2.9vw,34px);line-height:1.2;
  letter-spacing:-.01em;max-width:26ch;margin-bottom:var(--space-3);
}
.sci-section h3{
  font-size:clamp(16px,1.7vw,19px);font-weight:600;
  margin-top:var(--space-4);margin-bottom:var(--space-2);
}
.sci-section h4{font-size:15px;font-weight:600;margin-top:var(--space-3);margin-bottom:8px}
.sci-section p{color:var(--text-2);max-width:68ch;margin-bottom:14px;font-size:15px;line-height:1.7}
.sci-section p:last-child{margin-bottom:0}
.sci-section strong{color:var(--text);font-weight:600}
.sci-section a{color:var(--text)}

.page-intro p + p{margin-top:14px}

/* Breadcrumbs */
.sci-crumbs{padding-top:20px}
.sci-crumbs ol{list-style:none;display:flex;flex-wrap:wrap;gap:8px;font-size:13px;color:var(--text-2)}
.sci-crumbs li + li::before{content:"/";margin-right:8px;color:var(--text-2);opacity:.6}
.sci-crumbs a{color:var(--text-2)}
.sci-crumbs a:hover,.sci-crumbs a:focus-visible{color:var(--text)}

/* ==========================================================
   TWO READING DEPTHS (plain language / technical evidence)
   Plain language never replaces a caveat; it sits beside the
   technical block, never instead of it.
========================================================== */
.sci-layers{
  display:grid;grid-template-columns:1fr 1fr;
  gap:clamp(20px,3vw,44px);
  border-top:1px solid var(--line);padding-top:var(--space-3);
}
.sci-layer-label{
  font-family:var(--serif);font-style:italic;
  font-size:15px;color:var(--text-2);margin-bottom:10px !important;
}
.sci-plain p{color:var(--text);font-size:16px;line-height:1.7}
.sci-technical p,.sci-technical li{font-size:14px}

/* ==========================================================
   FACT LISTS
========================================================== */
.sci-facts{border-top:1px solid var(--line);margin-top:var(--space-3)}
.sci-facts > div{
  display:grid;grid-template-columns:minmax(160px,240px) 1fr;
  gap:var(--space-2);padding:12px 0;border-bottom:1px solid var(--line);
}
.sci-facts dt{font-size:13px;color:var(--text-2)}
.sci-facts dd{font-size:15px;color:var(--text);font-variant-numeric:tabular-nums}
/* A SHA-256 is 64 unbreakable characters. Left alone it pushes the page
   sideways on a phone, so hashes and other long literals are allowed to wrap
   mid-string. They stay selectable and copyable as one value. */
.sci-facts dd code,.sci-table code,code.sci-hash{
  font-size:13px;overflow-wrap:anywhere;word-break:break-all;
}
.sci-facts dd .sci-sub{display:block;font-size:13px;color:var(--text-2);margin-top:4px}

/* ==========================================================
   LISTS
========================================================== */
.sci-list{margin:var(--space-2) 0 0;padding-left:20px;max-width:68ch}
.sci-list li{color:var(--text-2);font-size:15px;line-height:1.7;margin-bottom:10px}
.sci-list li::marker{color:var(--text-2)}
.sci-list strong{color:var(--text)}

.sci-claims{list-style:none;padding-left:0;max-width:72ch;border-top:1px solid var(--line)}
.sci-claims li{
  border-bottom:1px solid var(--line);padding:14px 0;margin:0;
  display:grid;grid-template-columns:28px 1fr;gap:12px;align-items:start;
}
.sci-claims li::before{
  content:attr(data-n);font-size:12px;color:var(--text-2);
  font-variant-numeric:tabular-nums;padding-top:3px;
}

/* ==========================================================
   EVIDENCE AUTHORITY — colour + symbol + text, never colour
========================================================== */
.sci-authority{
  display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;
  font-size:13px;color:var(--text-2) !important;
  border-left:2px solid var(--line);padding-left:12px;
  margin-bottom:var(--space-3) !important;
}
.sci-mark{font-size:11px;line-height:1}
.sci-auth-label{letter-spacing:.01em}

.sci-chip{
  display:inline-flex;align-items:baseline;gap:6px;
  font-size:11.5px;letter-spacing:.02em;white-space:nowrap;
  border:1px solid var(--line);padding:2px 7px;
}

.auth-official{--auth:var(--auth-official)}
.auth-official-calibration{--auth:var(--auth-official-calibration)}
.auth-forensic{--auth:var(--auth-forensic)}
.auth-diagnostic{--auth:var(--auth-diagnostic)}
.auth-adapter{--auth:var(--auth-adapter)}
.auth-retrospective{--auth:var(--auth-retrospective)}

.sci-authority .sci-mark,.sci-chip .sci-mark{color:var(--auth,var(--text-2))}
.sci-authority{border-left-color:var(--auth,var(--line))}
.sci-chip{color:var(--text-2)}

/* Authority reference grid on the methods page */
.sci-auth-card{
  border-top:1px solid var(--line);padding:var(--space-3) 0;
}
.sci-auth-card h3{
  margin-top:0;display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;
}
.sci-auth-card h3 .sci-mark{color:var(--auth,var(--text))}
.sci-auth-grid{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-2) clamp(20px,3vw,44px);margin-top:10px}
.sci-auth-grid p{margin-bottom:0}
.sci-auth-grid .k{font-size:12px;color:var(--text-2);display:block;margin-bottom:4px}

/* ==========================================================
   CALLOUTS — used for STOP, continuation warning, unmeasured
========================================================== */
.sci-callout{
  border:1px solid var(--line);border-left-width:3px;
  padding:var(--space-3);margin-block:var(--space-3);
  background:var(--bg-2);max-width:74ch;
}
.sci-callout p{margin-bottom:10px;font-size:14.5px}
.sci-callout p:last-child{margin-bottom:0}
.sci-callout-head{
  color:var(--text) !important;font-weight:600;font-size:15px !important;
  letter-spacing:.01em;
}
.sci-callout-stop{border-left-color:var(--sci-stop)}
.sci-callout-stop .sci-callout-head{color:var(--sci-stop) !important}
.sci-callout-warn{border-left-color:var(--sci-stop)}
.sci-callout-note{border-left-color:var(--text-2)}
.sci-callout-unmeasured{border-left-color:var(--text-2);border-left-style:dashed}

/* The 193,440 caveat. Always visible, never a tooltip. */
.sci-caveat{
  border:1px solid var(--sci-stop);
  padding:var(--space-3);margin-block:var(--space-3);max-width:74ch;
}
.sci-caveat p{margin-bottom:8px;font-size:14.5px}
.sci-caveat p:last-child{margin-bottom:0}
.sci-caveat-head{
  color:var(--sci-stop) !important;font-weight:600;
  font-variant-numeric:tabular-nums;
}

/* The dominant result banner (Model-0 STOP). Must not be
   possible to scroll past without seeing it. */
.sci-verdict-banner{
  border:1px solid var(--sci-stop);padding:clamp(20px,3vw,32px);
  margin-block:var(--space-3);
}
.sci-verdict-banner .v-decision{
  font-family:var(--serif);font-size:clamp(34px,6vw,56px);
  line-height:1;color:var(--sci-stop);letter-spacing:-.01em;
}
.sci-verdict-banner .v-axes{
  font-size:clamp(17px,2.2vw,21px);color:var(--text);margin-top:10px;
  font-variant-numeric:tabular-nums;
}
.sci-verdict-banner .v-note{font-size:14px;color:var(--text-2);margin-top:12px;max-width:60ch}

/* ==========================================================
   FIGURES
========================================================== */
.sci-fig{margin-block:var(--space-4)}
.sci-fig figcaption{
  font-size:13.5px;color:var(--text-2);line-height:1.65;
  max-width:74ch;margin-top:var(--space-2);
  border-left:2px solid var(--line);padding-left:12px;
}
.sci-svg{display:block;width:100%;height:auto;overflow:visible}
.sci-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.sci-scroll > .sci-svg{min-width:600px}

/* small multiples: a grid that becomes one column on mobile */
.sci-multiples{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(268px,1fr));
  gap:var(--space-2);
}
.sci-panel{background:var(--sci-panel);border:1px solid var(--line);padding:10px 8px 4px}
.sci-panel .sci-svg{min-width:0}

/* ---- SVG element styling (all figures) ---- */
.sci-grid{stroke:var(--sci-grid);stroke-width:1}
.sci-zero{stroke:var(--sci-zero)}
.sci-line{fill:none;stroke:var(--text-2);stroke-width:1.4}
.sci-dot{fill:var(--text);stroke:none}
.sci-dot.sci-hollow{fill:var(--bg);stroke:var(--text-2);stroke-width:1.3}
.sci-dot.sci-origin{fill:var(--sci-stop)}
.sci-ci{stroke:var(--text-2);stroke-width:1.3}
.sci-cicap{stroke:var(--text-2);stroke-width:1.3}
.sci-chance{stroke:var(--sci-stop);stroke-width:1.6}
.sci-threshold{stroke:var(--sci-stop);stroke-width:1.4;stroke-dasharray:4 3}
.sci-droprule{stroke:var(--text-2);stroke-width:1.2}
.sci-restart{stroke:var(--sci-stop);stroke-width:1.2;stroke-dasharray:3 3}
.sci-leader{stroke:var(--line);stroke-width:1}

.sci-tick{fill:var(--text-2);font-size:10.5px;font-family:var(--sans)}
.sci-tick.sci-dim{opacity:.75}
.sci-axis-name{fill:var(--text);font-size:12px;font-weight:600;font-family:var(--sans)}
.sci-rowlab{fill:var(--text);font-size:11.5px;font-family:var(--sans)}
.sci-rowsub{fill:var(--text-2);font-size:10px;font-family:var(--sans)}
.sci-rowaxis{fill:var(--text);font-size:15px;font-weight:600;font-family:var(--sans)}
.sci-rowval{fill:var(--text-2);font-size:11px;font-family:var(--sans);font-variant-numeric:tabular-nums}
.sci-verdict{fill:var(--text-2);font-size:10.5px;font-family:var(--sans)}
.sci-serieslab{fill:var(--text-2);font-size:10.5px;font-family:var(--sans)}
.sci-thrlab{fill:var(--sci-stop);font-size:10.5px;font-family:var(--sans)}
.sci-restartlab{fill:var(--sci-stop);font-size:10.5px;font-family:var(--sans)}

/* unmeasured region: an explicit labelled gap, not a pattern
   and never a zero value */
.sci-unmeasured{
  fill:var(--bg);stroke:var(--text-2);stroke-width:1;
  stroke-dasharray:5 4;
}
.sci-unmeasured-lab{
  fill:var(--text-2);font-size:11px;font-weight:600;
  font-family:var(--sans);letter-spacing:.04em;
}

/* stop box inside the confirmation figure */
.sci-stopbox{fill:none;stroke:var(--sci-stop);stroke-width:1}
.sci-stoptitle{fill:var(--sci-stop);font-size:13px;font-weight:600;font-family:var(--sans)}
.sci-stopsub{fill:var(--text-2);font-size:11px;font-family:var(--sans)}

/* lineage */
.sci-node{fill:var(--sci-panel);stroke:var(--line);stroke-width:1}
.sci-node-title{fill:var(--text);font-size:15px;font-weight:600;font-family:var(--sans)}
.sci-node-sub{fill:var(--text-2);font-size:11.5px;font-family:var(--sans)}
.sci-node-line{fill:var(--text-2);font-size:11px;font-family:var(--sans);font-variant-numeric:tabular-nums}
.sci-node-note{fill:var(--text-2);font-size:10.5px;font-family:var(--sans)}
.sci-edge{stroke:var(--text-2);stroke-width:1.3}
.sci-edge-head{fill:var(--text-2)}
.sci-edge-lab{fill:var(--text);font-size:11.5px;font-family:var(--sans)}
.sci-ghost{fill:none;stroke:var(--text-2);stroke-width:1;stroke-dasharray:6 4;opacity:.85}
.sci-ghost-title{fill:var(--text-2);font-size:13px;font-weight:600;font-family:var(--sans);letter-spacing:.02em}
.sci-ghost-line{fill:var(--text-2);font-size:11.5px;font-family:var(--sans)}

/* inventory bars */
.sci-bar{fill:var(--auth,var(--text-2));opacity:.85}

/* ==========================================================
   TABLES — structural text equivalents. Every data-centric
   figure has one; they are the accessible representation of
   the exact values, not a decorative extra.
========================================================== */
.sci-table{
  border-collapse:collapse;width:100%;min-width:560px;
  font-size:13px;font-variant-numeric:tabular-nums;
  margin-top:var(--space-3);
}
.sci-table caption{
  text-align:left;color:var(--text-2);font-size:13px;line-height:1.6;
  padding-bottom:10px;max-width:80ch;
}
.sci-table th,.sci-table td{
  border-bottom:1px solid var(--line);
  padding:7px 10px 7px 0;text-align:left;vertical-align:top;
}
.sci-table thead th{
  color:var(--text);font-weight:600;font-size:12px;
  border-bottom-color:var(--text-2);white-space:nowrap;
}
.sci-table tbody th{color:var(--text);font-weight:600;white-space:nowrap}
.sci-table td{color:var(--text-2)}
.sci-table .sci-norm{color:var(--text);font-size:12px}
.sci-table .sci-unmeasured-cell{
  color:var(--text);border-left:2px dashed var(--text-2);padding-left:10px;
}

/* ==========================================================
   RESEARCH INDEX — extends .editorial-item with authority
========================================================== */
.editorial-item .sci-entry-meta{
  grid-column:1 / -1;margin-top:12px;
  display:flex;gap:12px;flex-wrap:wrap;align-items:center;
}
.editorial-item .sci-entry-role{font-size:12.5px;color:var(--text-2)}
.sci-index-note{
  border-top:1px solid var(--line);margin-top:var(--space-4);
  padding-top:var(--space-3);max-width:72ch;
}

/* Route map on section landing pages */
.sci-routes{list-style:none;padding-left:0;border-top:1px solid var(--line);margin-top:var(--space-3)}
.sci-routes li{border-bottom:1px solid var(--line);padding:16px 0}
.sci-routes a{font-size:16px;font-weight:600;color:var(--text)}
.sci-routes p{margin:6px 0 0;font-size:14px;max-width:66ch}

.sci-source{
  font-size:12.5px;color:var(--text-2) !important;
  border-top:1px solid var(--line);padding-top:12px;margin-top:var(--space-3) !important;
}

/* ==========================================================
   RESPONSIVE
   Verified at 390, 500, 768, 1024 and 1440 CSS pixels.
   No body-level horizontal overflow at any width: wide
   figures and tables scroll inside their own container.
========================================================== */
@media (max-width:900px){
  .sci-layers{grid-template-columns:1fr;gap:var(--space-3)}
  .sci-auth-grid{grid-template-columns:1fr}
}

@media (max-width:767px){
  .sci-facts > div{grid-template-columns:1fr;gap:4px;padding:10px 0}
  .sci-multiples{grid-template-columns:1fr}
  .sci-section p{font-size:14.5px}
  .sci-verdict-banner{padding:18px}
  .sci-claims li{grid-template-columns:24px 1fr;gap:8px}
  .sci-callout,.sci-caveat{padding:var(--space-2)}
}

@media (prefers-reduced-motion: reduce){
  .sci-crumbs a{transition:none}
}
