/* =========================================================================
   SIGNAL SPEC — the article design layer for carter.church technical papers
   Loaded on top of wired.css. Everything is prefixed `sig-` and scoped so
   it cannot leak into the rest of the site.

   DOCTRINE
   --------
   amber   = the SYSTEM speaking   (structure, headings, figure chrome)
   cyan    = the DATA speaking     (values, annotations, interactivity)
   blood   = failure               (warnings, deletions, negative deltas)
   green   = confirmation          (results, additions, passing states)
   violet  = the anomaly           (hypotheses, unknowns — use sparingly)

   Everything is numbered like a protocol: § 01 sections, FIG.01 figures,
   TBL.01 tables, EQ.01 equations, [01] references. The counters do it for
   you, so never hand-number anything.

   The living reference and the authoring rules (JSX whitespace, code-boxing,
   canonical casing, mobile tables, per-article OpenGraph, deploy hygiene)
   live on the spec page: /signals/spec (see the "Authoring guidance" section).
   ========================================================================= */

.sig-article {
  --sig-green: #4fe08a;
  --sig-green-dim: rgba(79, 224, 138, 0.4);
  max-width: 840px;
  margin: 0 auto;
  padding: 0 0 90px;
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--phosphor);
  counter-reset: sig-sec sig-fig sig-tbl sig-eq sig-ref sig-sn;
}
.sig-article p { margin: 0 0 1.25em; }
.sig-article a { text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================================
   TYPE — headings self-number. h2 = § section, h3 = subsection.
   ========================================================================= */
.sig-article h2 {
  margin: 2.4em 0 0.6em;
  scroll-margin-top: 96px;
  font-family: var(--term);
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--amber);
  text-shadow: 0 0 14px rgba(255, 179, 71, 0.25);
  counter-increment: sig-sec;
}
.sig-article h2::before {
  content: "\00a7 " counter(sig-sec, decimal-leading-zero);
  margin-right: 16px;
  color: var(--phosphor-faint);
  text-shadow: none;
}
.sig-article h3 {
  margin: 1.8em 0 0.5em;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--cyan-glow);
}
.sig-article h3::before { content: "// "; color: var(--phosphor-faint); }

/* opening paragraph — bigger, brighter */
.sig-lede { font-size: 1.28rem; line-height: 1.7; color: var(--phosphor); }
/* CRT drop cap for the first paragraph of a paper */
.sig-drop::first-letter {
  float: left;
  font-family: var(--term);
  font-size: 3.6em;
  line-height: 0.82;
  padding: 4px 12px 0 0;
  color: var(--amber);
  text-shadow: 0 0 18px rgba(255, 179, 71, 0.45), 2px 2px 0 rgba(181, 35, 31, 0.35);
}

/* =========================================================================
   INLINE KIT
   ========================================================================= */
/* marker highlight — amber underlay */
.sig-mark {
  background: linear-gradient(transparent 45%, rgba(255, 179, 71, 0.26) 45%, rgba(255, 179, 71, 0.26) 90%, transparent 90%);
  padding: 0 2px;
}
/* redacted — declassifies on hover */
.sig-redact {
  background: #17181c;
  box-shadow: inset 0 0 0 1px #24262b;
  color: transparent;
  padding: 0 7px;
  cursor: help;
  user-select: none;
  text-shadow: none;
  transition: color 240ms ease, background 240ms ease;
}
.sig-redact:hover { color: var(--amber); background: rgba(255, 179, 71, 0.07); }
/* defined term — dotted cyan, tooltip from data-def */
.sig-dfn {
  position: relative;
  border-bottom: 1px dotted var(--cyan-glow);
  cursor: help;
}
.sig-dfn:hover::after {
  content: attr(data-def);
  position: absolute;
  left: 0;
  bottom: 140%;
  z-index: 60;
  width: min(280px, 70vw);
  padding: 10px 13px;
  border: 1px solid var(--teal);
  background: var(--void-3);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55), 0 0 18px rgba(79, 214, 214, 0.15);
  color: var(--phosphor-dim);
  font-size: 0.78rem;
  line-height: 1.55;
  font-family: var(--mono);
}
/* key caps */
.sig-kbd {
  font-family: var(--mono);
  font-size: 0.78em;
  color: var(--cyan-glow);
  background: var(--void-3);
  border: 1px solid var(--wire-2);
  border-bottom-width: 3px;
  padding: 1px 8px;
  white-space: nowrap;
}
/* citation marker -> references list */
.sig-cite {
  font-family: var(--mono);
  font-size: 0.72em;
  vertical-align: super;
  color: var(--cyan-glow);
  text-decoration: none !important;
}
.sig-cite:hover { color: var(--amber); }

/* =========================================================================
   MASTHEAD — the paper's opening block
   ========================================================================= */
.sig-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sig-chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 10px;
  border: 1px solid var(--wire-2);
  color: var(--phosphor-dim);
  background: rgba(10, 11, 13, 0.6);
}
.sig-chip.amber  { color: var(--amber);      border-color: rgba(255, 179, 71, 0.45);  background: rgba(255, 179, 71, 0.06); }
.sig-chip.cyan   { color: var(--cyan-glow);  border-color: var(--teal);               background: rgba(79, 214, 214, 0.06); }
.sig-chip.blood  { color: #e05550;           border-color: rgba(181, 35, 31, 0.55);   background: rgba(181, 35, 31, 0.08); }
.sig-chip.green  { color: var(--sig-green);  border-color: var(--sig-green-dim);      background: rgba(79, 224, 138, 0.05); }
.sig-chip.violet { color: var(--violet);     border-color: rgba(154, 111, 208, 0.45); background: rgba(154, 111, 208, 0.07); }
.sig-chip.live::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 2.4s ease-in-out infinite;
}

/* metadata strip — checksum / wordcount / layer readouts */
.sig-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 26px 0;
  border: 1px solid var(--wire-2);
  background: linear-gradient(180deg, rgba(16, 18, 22, 0.85), rgba(10, 11, 13, 0.6));
}
.sig-meta > div { padding: 10px 16px 12px; border-right: 1px solid var(--wire); }
.sig-meta > div:last-child { border-right: 0; }
.sig-meta dt {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--phosphor-faint);
}
.sig-meta dd {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--amber);
}
.sig-meta dd.cy { color: var(--cyan-glow); }

/* abstract — vertical rail + corner brackets */
.sig-abstract {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  margin: 30px 0 6px;
  border: 1px solid var(--wire-2);
  background: linear-gradient(180deg, rgba(16, 18, 22, 0.7), rgba(10, 11, 13, 0.5));
}
.sig-abstract::before,
.sig-abstract::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--amber);
}
.sig-abstract::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.sig-abstract::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.sig-abstract-label {
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--amber);
  background: rgba(255, 179, 71, 0.06);
  border-left: 1px solid var(--wire-2);
}
.sig-abstract-body { padding: 20px 24px; color: var(--phosphor-dim); font-size: 0.98rem; line-height: 1.75; }
.sig-abstract-body p { margin: 0 0 0.9em; }
.sig-abstract-body p:last-child { margin: 0; }

/* =========================================================================
   INDEX — table of contents as a memory map
   ========================================================================= */
.sig-toc {
  position: relative;
  margin: 34px 0;
  border: 1px solid var(--wire-2);
  background: linear-gradient(180deg, rgba(16, 18, 22, 0.92), rgba(10, 11, 13, 0.72));
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  padding: 40px 22px 14px;
}
.sig-toc::before {
  content: "INDEX // TRANSMISSION";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 26px;
  padding: 4px 12px 0;
  font-family: var(--term);
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: var(--cyan-glow);
  background:
    linear-gradient(180deg, rgba(79, 214, 214, 0.12), transparent),
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(79, 214, 214, 0.05) 6px 7px);
  border-bottom: 1px solid var(--wire-2);
}
.sig-toc ol { list-style: none; margin: 0; padding: 0; }
.sig-toc li { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--wire); }
.sig-toc li:last-child { border-bottom: 0; }
.sig-toc .addr { font-family: var(--mono); font-size: 0.76rem; color: var(--cyan-glow); }
.sig-toc a { color: var(--phosphor); text-decoration: none; }
.sig-toc a:hover { color: var(--amber); text-shadow: none; }
.sig-toc .lead {
  flex: 1;
  min-width: 16px;
  height: 1px;
  align-self: center;
  background: repeating-linear-gradient(90deg, rgba(169, 159, 134, 0.3) 0 2px, transparent 2px 7px);
}
.sig-toc .pg { font-family: var(--mono); font-size: 0.72rem; color: var(--phosphor-faint); }

/* =========================================================================
   CALLOUTS — labeled from data-label; tone from the variant class
   ========================================================================= */
.sig-call {
  --c: var(--cyan-glow);
  --cbg: rgba(79, 214, 214, 0.05);
  position: relative;
  margin: 1.8em 0;
  border: 1px solid var(--wire-2);
  border-left: 2px solid var(--c);
  background: linear-gradient(90deg, var(--cbg), transparent 70%);
  padding: 34px 20px 12px;
  font-size: 0.98rem;
  color: var(--phosphor-dim);
}
.sig-call::before {
  content: attr(data-label);
  position: absolute;
  top: 9px; left: 20px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--c);
}
.sig-call p { margin: 0 0 0.8em; }
.sig-call p:last-child { margin: 0; }
.sig-call.warn { --c: var(--amber);     --cbg: rgba(255, 179, 71, 0.06); }
.sig-call.crit { --c: #e05550;          --cbg: rgba(181, 35, 31, 0.09); }
.sig-call.hyp  { --c: var(--violet);    --cbg: rgba(154, 111, 208, 0.07); }
.sig-call.res  { --c: var(--sig-green); --cbg: rgba(79, 224, 138, 0.06); }
.sig-call.crit::before { animation: pulse 1.6s ease-in-out infinite; }

/* =========================================================================
   FIGURE FRAME — every visual lives in a Copland OS window.
   Auto-numbers FIG.01; window title from data-title; caption below.
   Cyan scanline sweeps the pane on hover.
   ========================================================================= */
.sig-fig {
  position: relative;
  margin: 2.4rem 0;
  border: 1px solid var(--wire-2);
  background: linear-gradient(180deg, rgba(16, 18, 22, 0.92), rgba(10, 11, 13, 0.72));
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55), inset 0 0 40px rgba(0, 0, 0, 0.35);
  counter-increment: sig-fig;
  overflow: hidden;
}
.sig-fig::before {
  content: "FIG." counter(sig-fig, decimal-leading-zero) " // " attr(data-title);
  display: block;
  padding: 4px 14px 3px;
  font-family: var(--term);
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  text-shadow: 0 0 10px rgba(255, 179, 71, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 179, 71, 0.1), transparent),
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(255, 179, 71, 0.05) 6px 7px);
  border-bottom: 1px solid var(--wire-2);
}
.sig-fig-pane { position: relative; padding: 24px 22px; }
.sig-fig:hover .sig-fig-pane::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(79, 214, 214, 0.7), transparent);
  box-shadow: 0 0 12px rgba(79, 214, 214, 0.5);
  animation: sig-sweep 1.4s ease-in-out;
  animation-fill-mode: forwards;
  pointer-events: none;
}
@keyframes sig-sweep { from { top: 0; opacity: 1; } 85% { opacity: 1; } to { top: calc(100% - 2px); opacity: 0; } }
.sig-fig figcaption {
  padding: 8px 14px 10px;
  border-top: 1px solid var(--wire);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--phosphor-faint);
  text-align: left;
}
.sig-fig figcaption strong { color: var(--phosphor-dim); }
/* wide variant escapes the prose column */
.sig-fig.wide {
  width: min(1120px, calc(100vw - 44px));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* =========================================================================
   SVG DIAGRAM HELPERS — draw with tokens, not hex
   ========================================================================= */
.sig-svg { display: block; width: 100%; height: auto; }
.sig-svg text { font-family: var(--mono); }
.sig-node { fill: rgba(16, 18, 22, 0.95); stroke: var(--wire-2); }
.sig-node-hot { fill: rgba(255, 179, 71, 0.07); stroke: var(--amber); }
.sig-node-cold { fill: rgba(79, 214, 214, 0.06); stroke: var(--teal); }
.sig-edge { stroke: var(--wire-2); fill: none; }
.sig-flow { stroke: var(--cyan-glow); fill: none; stroke-dasharray: 6 5; animation: sig-march 1.1s linear infinite; }
.sig-flow.hot { stroke: var(--amber); }
.sig-flow.bad { stroke: var(--blood); }
@keyframes sig-march { to { stroke-dashoffset: -22; } }
.sig-svg .lbl { fill: var(--phosphor-dim); font-size: 12px; }
.sig-svg .lbl-hot { fill: var(--amber); font-size: 12px; }
.sig-svg .lbl-cold { fill: var(--cyan-glow); font-size: 12px; }
.sig-svg .lbl-faint { fill: var(--phosphor-faint); font-size: 10px; }

/* =========================================================================
   CHARTS — CSS bars, metric tiles, sparklines
   ========================================================================= */
.sig-bars { display: grid; gap: 11px; }
.sig-bar {
  display: grid;
  grid-template-columns: minmax(110px, 170px) 1fr 64px;
  gap: 14px;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.sig-bar .lbl { color: var(--phosphor-dim); text-align: right; }
.sig-bar .trk { position: relative; height: 15px; border: 1px solid var(--wire-2); background: rgba(5, 5, 6, 0.7); }
.sig-bar .fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: var(--v);
  background: linear-gradient(90deg, var(--amber-deep), var(--amber));
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.35);
  animation: sig-grow 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.sig-bar.cy .fill { background: linear-gradient(90deg, var(--teal), var(--cyan-glow)); box-shadow: 0 0 12px rgba(79, 214, 214, 0.35); }
.sig-bar.bad .fill { background: linear-gradient(90deg, var(--wired-red), var(--blood)); box-shadow: 0 0 12px rgba(181, 35, 31, 0.4); }
.sig-bar .val { color: var(--cyan-glow); }
.sig-bar.bad .val { color: #e05550; }
@keyframes sig-grow { from { width: 0; } }
/* prior-value baseline tick on a track ("then vs now") */
.sig-bar .base {
  position: absolute;
  top: -3px; bottom: -3px;
  left: var(--b);
  width: 2px;
  background: var(--blood);
  box-shadow: 0 0 7px rgba(181, 35, 31, 0.7);
  z-index: 2;
}
.sig-bar .base::after {
  content: attr(data-base);
  position: absolute;
  top: -15px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  color: #e05550;
  white-space: nowrap;
}

/* legend row for charts */
.sig-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 4px 0 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--phosphor-faint);
}
.sig-legend span { display: inline-flex; align-items: center; gap: 7px; }
.sig-legend i { width: 14px; height: 3px; display: inline-block; }
.sig-legend i.amber { background: var(--amber); box-shadow: 0 0 8px rgba(255,179,71,0.5); }
.sig-legend i.cyan { background: var(--cyan-glow); box-shadow: 0 0 8px rgba(79,214,214,0.5); }
.sig-legend i.blood { background: var(--blood); box-shadow: 0 0 8px rgba(181,35,31,0.6); }
.sig-legend i.green { background: var(--sig-green); box-shadow: 0 0 8px rgba(79,224,138,0.5); }

/* telemetry tiles */
.sig-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sig-metric {
  border: 1px solid var(--wire-2);
  background: linear-gradient(180deg, rgba(16, 18, 22, 0.9), rgba(10, 11, 13, 0.7));
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  padding: 14px 16px 12px;
}
.sig-metric .val {
  font-family: var(--term);
  font-size: 2.3rem;
  line-height: 1;
  color: var(--amber);
  text-shadow: 0 0 16px rgba(255, 179, 71, 0.4);
}
.sig-metric.cy .val { color: var(--cyan-glow); text-shadow: 0 0 16px rgba(79, 214, 214, 0.4); }
.sig-metric .lbl {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--phosphor-faint);
}
.sig-metric .delta { font-family: var(--mono); font-size: 0.74rem; margin-top: 4px; }
.sig-metric .delta.up::before { content: "\25b2 "; }
.sig-metric .delta.down::before { content: "\25bc "; }
.sig-metric .delta.up { color: var(--sig-green); }
.sig-metric .delta.down { color: #e05550; }

/* inline sparkline */
.sig-spark { display: inline-block; vertical-align: -4px; margin: 0 6px; }
.sig-spark polyline { fill: none; stroke: var(--cyan-glow); stroke-width: 1.5; }
.sig-spark.hot polyline { stroke: var(--amber); }

/* =========================================================================
   CODE — window with line numbers; diff rows; token tones:
   .tk-k keyword=amber  .tk-s string=green  .tk-n number/const=violet
   .tk-f function/type=cyan  .tk-c comment=faint italic  .tk-p punct=dim
   ========================================================================= */
.sig-code {
  margin: 2rem 0;
  border: 1px solid var(--wire-2);
  background: linear-gradient(180deg, rgba(16, 18, 22, 0.95), rgba(8, 9, 11, 0.9));
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
}
.sig-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 14px 4px;
  border-bottom: 1px solid var(--wire-2);
  background:
    linear-gradient(180deg, rgba(79, 214, 214, 0.08), transparent),
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(79, 214, 214, 0.04) 6px 7px);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan-glow);
}
.sig-code-bar .lang { color: var(--phosphor-faint); }
.sig-code pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.7;
  counter-reset: sig-line;
  color: var(--phosphor);
}
.sig-code .ln { display: block; counter-increment: sig-line; white-space: pre; }
.sig-code .ln::before {
  content: counter(sig-line, decimal-leading-zero);
  display: inline-block;
  width: 2.1em;
  margin-right: 14px;
  padding-right: 10px;
  border-right: 1px solid var(--wire);
  color: var(--phosphor-faint);
  text-align: right;
}
.sig-code .ln.hl { background: rgba(255, 179, 71, 0.07); box-shadow: inset 2px 0 0 var(--amber); }
.sig-code .ln.add { background: rgba(79, 224, 138, 0.07); }
.sig-code .ln.add::before { content: "+"; color: var(--sig-green); border-right-color: var(--sig-green-dim); }
.sig-code .ln.del { background: rgba(181, 35, 31, 0.09); }
.sig-code .ln.del::before { content: "\2212"; color: #e05550; border-right-color: rgba(181, 35, 31, 0.5); }
.tk-k { color: var(--amber); }
.tk-s { color: var(--sig-green); }
.tk-n { color: var(--violet); }
.tk-f { color: var(--cyan-glow); }
.tk-c { color: var(--phosphor-faint); font-style: italic; }
.tk-p { color: var(--phosphor-dim); }

/* terminal session */
.sig-shell {
  margin: 2rem 0;
  border: 1px solid var(--wire-2);
  background: rgba(4, 4, 5, 0.92);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55), inset 0 0 50px rgba(0, 0, 0, 0.6);
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.8;
  overflow-x: auto;
}
.sig-shell .cmd, .sig-shell .out, .sig-shell .err { display: block; white-space: pre; }
.sig-shell .cmd::before { content: "carter@wired:~$ "; color: var(--cyan-glow); }
.sig-shell .cmd { color: var(--phosphor); }
.sig-shell .out { color: var(--phosphor-dim); }
.sig-shell .err { color: #e05550; }
.sig-shell .ok { color: var(--sig-green); }
.sig-caret {
  display: inline-block;
  width: 0.55em; height: 1em;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  vertical-align: text-bottom;
  animation: caret 900ms steps(1) infinite;
}

/* =========================================================================
   TABLES — terminal grid. Auto-numbers TBL.01 from data-title.
   .num right-aligns; .pos/.neg tint deltas.
   ========================================================================= */
.sig-table {
  margin: 2.2rem 0;
  border: 1px solid var(--wire-2);
  background: linear-gradient(180deg, rgba(16, 18, 22, 0.85), rgba(10, 11, 13, 0.6));
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  overflow-x: auto;
  counter-increment: sig-tbl;
}
.sig-table::before {
  content: "TBL." counter(sig-tbl, decimal-leading-zero) " // " attr(data-title);
  display: block;
  padding: 4px 14px 3px;
  font-family: var(--term);
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan-glow);
  background:
    linear-gradient(180deg, rgba(79, 214, 214, 0.1), transparent),
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(79, 214, 214, 0.05) 6px 7px);
  border-bottom: 1px solid var(--wire-2);
  white-space: nowrap;
  /* pin the titlebar to the left so its background spans the full visible
     width while the columns scroll horizontally on mobile */
  position: sticky;
  left: 0;
  z-index: 2;
}
/* preserve canonical casing in a titlebar (e.g. the lowercase o in GPT-4o) */
.sig-table.rawcase::before { text-transform: none; }
.sig-table table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
/* compact tables (numeric / comparison): keep every cell on one line so the
   whole grid scrolls horizontally on mobile instead of wrapping */
.sig-table.compact td { white-space: nowrap; }
.sig-table th {
  padding: 9px 14px;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  border-bottom: 1px solid var(--amber-deep);
  white-space: nowrap;
}
.sig-table td { padding: 8px 14px; border-bottom: 1px solid var(--wire); color: var(--phosphor-dim); }
.sig-table tr:last-child td { border-bottom: 0; }
.sig-table tbody tr { transition: background 120ms ease; }
.sig-table tbody tr:hover { background: rgba(255, 179, 71, 0.045); }
.sig-table .num { text-align: right; font-family: var(--mono); color: var(--phosphor); }
/* vertical divider before a column (e.g. prior systems | this run) */
.sig-table .vrule { border-left: 2px solid var(--amber-deep); }
.sig-table th.vrule { border-left-color: var(--amber); }
.sig-table .pos { color: var(--sig-green); }
.sig-table .neg { color: #e05550; }
.sig-table .yes { color: var(--sig-green); }
.sig-table .yes::before { content: "\2713 "; }
.sig-table .no { color: #e05550; }
.sig-table .no::before { content: "\2717 "; }
.sig-table .dim { color: var(--phosphor-faint); }

/* =========================================================================
   EQUATIONS — auto-numbers EQ.01; <var> renders cyan italic
   ========================================================================= */
.sig-eq {
  position: relative;
  margin: 2.2em 0;
  padding: 20px 96px 20px 24px;
  border: 1px solid var(--wire-2);
  background: linear-gradient(90deg, rgba(79, 214, 214, 0.04), transparent 60%);
  font-family: var(--mono);
  font-size: 1.02rem;
  text-align: center;
  color: var(--phosphor);
  overflow-x: auto;
  counter-increment: sig-eq;
}
.sig-eq::after {
  content: "EQ." counter(sig-eq, decimal-leading-zero);
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--phosphor-faint);
}
.sig-eq var { font-style: italic; color: var(--cyan-glow); }
.sig-eq sub, .sig-eq sup { font-size: 0.7em; color: var(--phosphor-dim); }

/* =========================================================================
   PULL QUOTE + SECTION BREAK
   ========================================================================= */
.sig-pull {
  margin: 2.8em 0;
  text-align: center;
  font-family: var(--term);
  font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  line-height: 1.4;
  letter-spacing: 0.03em;
  color: var(--phosphor);
  text-shadow: 0 0 12px rgba(232, 220, 192, 0.25);
}
.sig-pull::before { content: "\00ab"; color: var(--amber); }
.sig-pull::after { content: "\00bb"; color: var(--amber); }
.sig-pull em, .sig-pull i { font-style: normal; color: var(--amber); }
.sig-pull + .sig-pull-rule { display: none; }
.sig-pull-rule {
  width: 120px;
  height: 2px;
  margin: -1.6em auto 2.8em;
  background: linear-gradient(90deg, transparent, var(--blood), transparent);
  box-shadow: 0 0 10px rgba(181, 35, 31, 0.6);
}
.sig-break { display: flex; align-items: center; gap: 16px; margin: 3.2em 0; }
.sig-break::before, .sig-break::after { content: ""; flex: 1; height: 1px; }
.sig-break::before { background: linear-gradient(90deg, transparent, var(--wire-2)); }
.sig-break::after { background: linear-gradient(90deg, var(--wire-2), transparent); }
.sig-break span { font-family: var(--mono); font-size: 0.8rem; color: var(--amber-deep); letter-spacing: 0.4em; }

/* =========================================================================
   SIDENOTES — [n] markers; notes sit in the right margin on wide screens,
   fold inline as dashed boxes below 1400px. Place the aside immediately
   after the sentence that references it.
   ========================================================================= */
.sig-sn-ref { counter-increment: sig-sn; }
.sig-sn-ref::after {
  content: "[" counter(sig-sn) "]";
  font-family: var(--mono);
  font-size: 0.68em;
  vertical-align: super;
  color: var(--cyan-glow);
  margin-left: 1px;
}
.sig-sn {
  float: right;
  clear: right;
  width: 232px;
  margin-right: -278px;
  margin-top: 5px;
  margin-bottom: 10px;
  padding: 2px 0 2px 14px;
  border-left: 1px solid var(--teal);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--phosphor-faint);
}
.sig-sn::before {
  content: "[" counter(sig-sn) "] ";
  color: var(--cyan-glow);
}
@media (max-width: 1420px) {
  .sig-sn {
    float: none;
    width: auto;
    margin: 14px 0 18px;
    padding: 10px 14px;
    border: 1px dashed var(--teal);
    border-left-width: 2px;
    background: rgba(79, 214, 214, 0.035);
  }
}

/* references */
.sig-refs { list-style: none; margin: 1.4em 0 0; padding: 0; }
.sig-refs li {
  position: relative;
  margin: 0;
  padding: 10px 0 10px 60px;
  border-bottom: 1px solid var(--wire);
  font-size: 0.9rem;
  color: var(--phosphor-dim);
  counter-increment: sig-ref;
}
.sig-refs li::before {
  content: "[" counter(sig-ref, decimal-leading-zero) "]";
  position: absolute;
  left: 4px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--cyan-glow);
}
.sig-refs cite { font-style: normal; color: var(--phosphor); }

/* =========================================================================
   BULLET LIST — amber markers, article body
   ========================================================================= */
.sig-list {
  list-style: none;
  margin: 1.3em 0;
  padding-left: 1.4rem;
}
.sig-list li {
  position: relative;
  margin: 0.55em 0;
  color: var(--phosphor);
}
.sig-list li::before {
  content: "\25b8";
  position: absolute;
  left: -1.2rem;
  color: var(--amber);
}

/* =========================================================================
   PROTOCOL STEPS — numbered procedure rows
   ========================================================================= */
.sig-steps { list-style: none; margin: 1.6em 0; padding: 0; counter-reset: sig-step; }
.sig-steps li {
  counter-increment: sig-step;
  padding: 11px 4px;
  border-bottom: 1px solid var(--wire);
  color: var(--phosphor);
  transition: background 140ms ease;
}
.sig-steps li::before {
  content: "[" counter(sig-step, decimal-leading-zero) "]";
  margin-right: 16px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--cyan-glow);
}
.sig-steps li:hover { background: rgba(255, 179, 71, 0.04); }
.sig-steps li strong { color: var(--amber); font-weight: 600; }

/* =========================================================================
   ASCII DIAGRAMS — phosphor pre, no chrome (frame it in a sig-fig if the
   piece deserves a number)
   ========================================================================= */
.sig-ascii {
  margin: 2rem 0;
  padding: 18px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.35;
  color: #8f8672;
  text-shadow: 0 0 5px rgba(232, 220, 192, 0.22);
  white-space: pre;
}
.sig-ascii .hi { color: var(--amber); text-shadow: 0 0 7px rgba(255, 179, 71, 0.5); }
.sig-ascii .cy { color: var(--cyan-glow); text-shadow: 0 0 8px rgba(79, 214, 214, 0.6); }

/* =========================================================================
   FOLD — collapsed transmissions (appendices, raw data, tangents)
   ========================================================================= */
.sig-fold {
  margin: 1.8em 0;
  border: 1px solid var(--wire-2);
  background: linear-gradient(180deg, rgba(16, 18, 22, 0.8), rgba(10, 11, 13, 0.55));
}
.sig-fold summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
  transition: background 140ms ease;
}
.sig-fold summary::-webkit-details-marker { display: none; }
.sig-fold summary::before { content: "\25b8 "; color: var(--phosphor-faint); }
.sig-fold[open] summary::before { content: "\25be "; color: var(--cyan-glow); }
.sig-fold summary:hover { background: rgba(255, 179, 71, 0.05); }
.sig-fold[open] summary { border-bottom: 1px solid var(--wire); }
.sig-fold-body { padding: 16px 18px 6px; font-size: 0.95rem; color: var(--phosphor-dim); }

/* =========================================================================
   IMAGERY — CRT treatment: curvature-ish contrast + scanlines + vignette
   ========================================================================= */
.sig-crt { position: relative; }
.sig-crt img {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  box-shadow: none;
  filter: contrast(1.12) brightness(0.9) saturate(0.82);
}
.sig-crt::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px),
    radial-gradient(120% 120% at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.5) 100%);
}

/* =========================================================================
   TABLE-OF-CONTENTS RAIL — fixed, left, tracks the section headings.
   Desktop only; a colophon carries the metadata on narrow screens.
   ========================================================================= */
.sig-toc-rail {
  position: fixed;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: 194px;
  font-family: var(--mono);
  user-select: none;
}
@media (max-width: 1300px) {
  .sig-toc-rail { display: none; }
}
.sig-toc-meta { margin-bottom: 24px; }
.sig-toc-meta > div { display: flex; flex-direction: column; margin-bottom: 11px; }
.sig-toc-meta .k {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--phosphor-faint);
}
.sig-toc-meta .v { margin-top: 3px; font-size: 0.82rem; color: var(--amber); }

.sig-toc-cap {
  margin-bottom: 10px;
  font-size: 0.6rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--phosphor-faint);
}
.sig-toc-rail ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--wire-2);
}
.sig-toc-rail a {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-left: -1px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  color: var(--phosphor-faint);
  opacity: 0.6;
  text-decoration: none;
  font-size: 0.72rem;
  line-height: 1.3;
  transition: color 220ms ease, opacity 220ms ease, border-color 220ms ease,
    transform 220ms ease, text-shadow 220ms ease;
}
.sig-toc-rail a:hover { opacity: 1; color: var(--phosphor-dim); }
.sig-toc-rail .n { flex: none; font-size: 0.66rem; color: var(--cyan-glow); opacity: 0.5; }
.sig-toc-rail li.on a {
  color: var(--amber);
  opacity: 1;
  border-left-color: var(--amber);
  transform: translateX(6px);
  text-shadow: 0 0 12px rgba(255, 179, 71, 0.75);
  box-shadow: -2px 0 12px rgba(255, 179, 71, 0.28);
}
.sig-toc-rail li.on .n {
  opacity: 1;
  color: var(--amber);
  text-shadow: 0 0 10px rgba(255, 179, 71, 0.6);
}
@media (prefers-reduced-motion: reduce) {
  .sig-toc-rail a { transition: none; }
}

/* colophon — the metadata's home on screens too narrow for the rail */
.sig-colophon {
  display: none;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--wire);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--phosphor-faint);
  text-align: center;
}
.sig-colophon b { color: var(--phosphor-faint); font-weight: 400; }
@media (max-width: 1300px) {
  .sig-colophon { display: block; }
}

/* =========================================================================
   SPEC PAGE ONLY — the labeled rails between demos (not for papers)
   ========================================================================= */
.spec-tag {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 78px 0 20px;
  padding-top: 16px;
  border-top: 1px solid var(--wire-2);
  font-family: var(--mono);
}
.spec-tag .no {
  font-family: var(--term);
  font-size: 1.5rem;
  color: var(--cyan-glow);
  text-shadow: 0 0 10px rgba(79, 214, 214, 0.4);
}
.spec-tag .name {
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
}
.spec-tag .cls {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--phosphor-faint);
  text-align: right;
}
.spec-note { margin: 0 0 22px; font-size: 0.9rem; color: var(--phosphor-faint); }
@media (max-width: 700px) {
  .spec-tag { flex-wrap: wrap; }
  .spec-tag .cls { margin-left: 0; flex-basis: 100%; text-align: left; }
}

/* =========================================================================
   REDUCED MOTION — every effect dies gracefully
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .sig-flow { animation: none; stroke-dasharray: none; }
  .sig-bar .fill { animation: none; }
  .sig-fig:hover .sig-fig-pane::after { display: none; }
  .sig-caret { animation: none; }
  .sig-chip.live::before { animation: none; }
  .sig-call.crit::before { animation: none; }
}
