/* SIMARC design system — light, institutional, enterprise register.
   Reference points: a national-lab technical report and a well-built internal
   console. Dense, quiet, hairline-ruled. All quantitative content is mono. */

:root {
  --paper:   #FFFFFF;
  --surface: #F7F8FA;   /* panels, table bodies */
  --raised:  #FBFCFD;   /* cards on surface */
  --ink:     #0F172A;
  --ink-2:   #33415C;   /* body copy */
  --muted:   #5B6779;
  --faint:   #8A94A5;
  --line:    #E3E8EF;
  --line-2:  #D6DDE7;   /* stronger rules */
  --signal:  #1B5FBF;   /* institutional blue */
  --signal-bg: #EEF4FD;
  --verify:  #0F7B4F;
  --verify-bg: #ECF7F1;
  --warn:    #B45309;
  --warn-bg: #FDF4E7;
  --kill:    #B42318;
  --kill-bg: #FDF0EF;

  --font-text: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  /* One prose measure for every text element. Absolute, not ch: ch resolves
     against each element's own font-size, so headings and body would not line up. */
  --measure: 660px;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}

/* ---------- layout ---------- */
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 32px; }
section { padding: 44px 0; }
section + section { border-top: 1px solid var(--line); }

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line-2);
}
header.site .bar {
  display: flex; align-items: center; gap: 11px;
  padding: 0 32px; max-width: 1000px; margin: 0 auto; height: 56px;
}
header.site img.mark { width: 26px; height: 26px; }
header.site .word {
  font-weight: 700; font-size: 15.5px; letter-spacing: 0.13em;
  color: var(--ink); text-decoration: none; margin-right: 4px;
}
header.site nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
header.site nav a {
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius);
}
header.site nav a:hover { color: var(--ink); background: var(--surface); }
header.site nav a.active { color: var(--ink); font-weight: 600; }
header.site nav a.agents {
  font-family: var(--font-mono); font-size: 12px; color: var(--signal);
  border: 1px solid var(--line-2); padding: 5px 10px; margin-left: 8px;
  background: var(--paper);
}
header.site nav a.agents:hover { background: var(--signal-bg); border-color: var(--signal); }

/* ---------- hero (restrained: a masthead, not a splash) ---------- */
.hero { padding: 48px 0 36px; display: flex; gap: 32px; align-items: flex-start;
        justify-content: space-between; }
/* max-width, not flex-basis: the hero switches to column-reverse under 900px,
   where a basis would size the mast's height instead of its width. */
.hero .mast { flex: 1 1 auto; min-width: 0; max-width: var(--measure); }
.hero img.big-mark { width: 96px; height: 96px; flex: 0 0 auto; margin-top: 4px; }
.hero .eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.20em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -0.018em;
  color: var(--ink); margin: 0 0 12px; line-height: 1.2;
  max-width: var(--measure); text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--signal); }
.hero .sub { color: var(--muted); font-size: 15.5px; max-width: var(--measure); margin: 0; }
.hero .actions { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- rules & dividers ---------- */
.fringe {
  height: 34px; background: url("brand/fringe-strip.png") center / 100% 100% no-repeat;
  opacity: 0.75;
}
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------- stat band ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); margin-top: 34px; overflow: hidden;
}
.stats .stat {
  padding: 13px 14px; border-right: 1px solid var(--line);
  border-top: 1px solid var(--line); margin: -1px -1px 0 0;
}
.stats .stat b {
  display: block; font-family: var(--font-mono); font-weight: 700;
  font-size: 18px; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 3px;
}
.stats .stat span {
  font-size: 11px; letter-spacing: 0.045em; text-transform: uppercase;
  color: var(--faint); font-weight: 500; line-height: 1.4; display: block;
}
.stats .stat.challenge b { color: var(--warn); }

/* ---------- section headings ---------- */
.kicker {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--signal); margin-bottom: 8px; font-weight: 500;
}
h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.014em;
  color: var(--ink); margin: 0 0 12px; max-width: var(--measure);
}
h3 { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0 0 8px;
     max-width: var(--measure); }
.lede { color: var(--muted); max-width: var(--measure); font-size: 15.5px; }
strong { color: var(--ink); font-weight: 600; }
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }
p { max-width: var(--measure); }
em { color: var(--ink-2); }

/* ---------- cards ---------- */
.grid { display: grid; gap: 14px; margin-top: 26px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.four { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 8px;
}
.card:hover { border-color: var(--signal); }
.card .code {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  color: var(--faint); text-transform: uppercase;
}
.card h3 { margin: 0 0 2px; font-size: 16px; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--signal); text-decoration: none; }
.card p { color: var(--muted); font-size: 14px; margin: 0; }
.card .nums {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto;
  line-height: 1.85;
}

/* ---------- chips (the claim grammar) ---------- */
.chip {
  display: inline-block; font-family: var(--font-mono); font-size: 10px;
  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 3px; border: 1px solid; line-height: 1.6;
  vertical-align: middle; white-space: nowrap;
}
.chip.proof, .chip.null   { color: var(--verify); border-color: #B7E0CB; background: var(--verify-bg); }
.chip.exact               { color: var(--signal); border-color: #BFD6F5; background: var(--signal-bg); }
.chip.stat, .chip.anomaly { color: var(--warn);   border-color: #EBCFA6; background: var(--warn-bg); }
.chip.refuted, .chip.killed, .chip.blocked { color: var(--kill); border-color: #EFC3BE; background: var(--kill-bg); }
.chip.open, .chip.rung    { color: var(--muted);  border-color: var(--line-2); background: var(--surface); }
.chip.calib               { color: var(--ink);    border-color: var(--line-2); background: var(--surface); }

/* ---------- tables ---------- */
.tablewrap.narrow { max-width: var(--measure); }
.tablewrap {
  overflow-x: auto; border: 1px solid var(--line-2);
  border-radius: var(--radius); margin-top: 20px; background: var(--paper);
}
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); text-align: left; font-weight: 600;
  padding: 10px 16px; background: var(--surface);
  border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td, table tr:hover td { background: #FCFDFE; }
td.mono, .mono { font-family: var(--font-mono); font-size: 12.5px; }
td .why, .why { color: var(--muted); font-size: 13px; }

/* ---------- code / certificate block ---------- */
.cert {
  background: var(--surface); border: 1px solid var(--line-2);
  border-left: 3px solid var(--signal); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.75;
  padding: 14px 18px; margin: 18px 0; overflow-x: auto; white-space: pre;
  color: var(--ink);
}
.cert .c { color: var(--faint); }
.cert .g { color: var(--verify); font-weight: 600; }
.cert .y { color: var(--warn); font-weight: 600; }
.cert .b { color: var(--signal); font-weight: 600; }

/* ---------- honesty panel ---------- */
.honesty {
  border: 1px solid var(--line-2); border-left: 3px solid var(--warn);
  background: var(--surface); border-radius: var(--radius); padding: 20px 24px;
  margin-top: 30px;
}
.honesty .kicker { color: var(--warn); }
.honesty p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* ---------- ledger ---------- */
.empty-ledger {
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); padding: 15px 20px;
  font-size: 14px; color: var(--muted); margin-top: 10px;
}
.empty-ledger b { color: var(--ink); font-family: var(--font-mono); font-size: 12.5px; }

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--line-2); background: var(--surface);
  padding: 40px 0 30px; margin-top: 48px; color: var(--muted); font-size: 13.5px;
}
footer.site .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 32px; }
footer.site h4 {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--ink); margin: 0 0 10px; font-weight: 600;
}
footer.site a { color: var(--muted); display: block; margin-bottom: 6px; }
footer.site a:hover { color: var(--signal); }
footer.site p.small { margin: 0; }
footer.site .motto {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); margin-top: 10px;
}
footer.site .fine {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line-2);
  font-size: 12.5px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--faint);
}
footer.site img.mark { width: 24px; height: 24px; }

/* ---------- program page hero ---------- */
.prog-hero { padding: 44px 0 34px; border-bottom: 1px solid var(--line); }
.prog-hero .code {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--signal); text-transform: uppercase; margin-bottom: 10px;
}
.prog-hero h1 {
  font-size: clamp(24px, 3.4vw, 33px); font-weight: 700; letter-spacing: -0.016em;
  color: var(--ink); margin: 0 0 14px; max-width: var(--measure);
  line-height: 1.22; text-wrap: balance;
}
.prog-hero .statusline { margin-bottom: 16px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.prog-hero .lede { margin: 0; }

/* ---------- claim list ---------- */
.claims { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.claim {
  background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 15px 20px; display: flex; gap: 18px; align-items: flex-start;
}
.claim .chips { display: flex; flex-direction: column; gap: 5px; min-width: 104px; flex: 0 0 auto; }
.claim .body { min-width: 0; }
.claim .body b { display: block; font-size: 14.5px; color: var(--ink); margin-bottom: 3px; font-weight: 600; }
.claim .body span { color: var(--muted); font-size: 14px; }
.claim .body .src {
  display: block; font-family: var(--font-mono); font-size: 11.5px;
  color: var(--faint); margin-top: 7px;
}

/* ---------- endpoints ---------- */
.endpoints { margin-top: 20px; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.endpoint {
  display: flex; gap: 12px; align-items: baseline; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--paper); flex-wrap: wrap;
}
.endpoint:last-child { border-bottom: none; }
.endpoint:hover { background: var(--surface); }
.endpoint .verb {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; color: var(--verify);
  background: var(--verify-bg); border: 1px solid #B7E0CB; padding: 1px 6px;
  border-radius: 3px; min-width: 42px; text-align: center;
}
.endpoint .path { font-family: var(--font-mono); font-size: 13px; color: var(--ink); }
.endpoint .desc { color: var(--muted); font-size: 13px; margin-left: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; font-size: 13.5px; font-weight: 600;
  color: var(--paper); background: var(--signal); padding: 8px 16px;
  border-radius: var(--radius); border: 1px solid var(--signal);
}
.btn:hover { text-decoration: none; background: #164E9E; border-color: #164E9E; }
.btn.ghost { background: var(--paper); color: var(--signal); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--signal-bg); border-color: var(--signal); }

/* ---------- figures ---------- */
figure.fig {
  margin: 24px 0 0; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--paper); overflow: hidden;
}
figure.fig img { display: block; width: 100%; height: auto; }
figure.fig figcaption {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 9px 16px; font-size: 12.5px; color: var(--muted);
}
figure.fig figcaption b { color: var(--ink); font-weight: 600; }
figure.fig figcaption .src {
  font-family: var(--font-mono); font-size: 11px; color: var(--faint);
  display: block; margin-top: 2px;
}
.figrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.figrow figure.fig { margin-top: 0; }

/* ---------- misc ---------- */
.dim { color: var(--muted); }
.small { font-size: 13px; }
hr.hair { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }

@media (max-width: 900px) {
  .wrap { padding: 0 20px; }
  header.site .bar { padding: 0 20px; }
  .grid.two, .grid.four { grid-template-columns: 1fr; }
  footer.site .cols { grid-template-columns: 1fr 1fr; }
  .hero { flex-direction: column-reverse; align-items: flex-start; gap: 22px; }
  .hero img.big-mark { width: 78px; height: 78px; }
  header.site nav a:not(.agents) { display: none; }
  .claim { flex-direction: column; gap: 10px; }
  .claim .chips { flex-direction: row; flex-wrap: wrap; }
  .endpoint .desc { margin-left: 0; width: 100%; }
  .figrow { grid-template-columns: 1fr; }
}
