/* CAIN-42 public truth layer: shared by cainstudio.online, mcpgate.online and clawx.click.
   One identity system across the three sites. Keep this file byte-identical in
   platform-gateway/frontend/ and clawx-site/ (tests/test_cain42_public_truth_layer.py checks). */
:root {
  --bg: #060a17;           /* deep navy */
  --bg-raised: #0d1328;
  --bg-sunken: #040711;
  --line: #1a2342;
  --line-strong: #2b3760;
  --text: #eef1f8;
  --text-dim: #a3adc8;
  --text-faint: #6e7896;
  --red: #ff3b4a;          /* the one accent: CAIN red, matches the 5-arm mark */
  --red-dim: #3a0f18;
  --accent-2: #ff8a80;
  --st-live: #3fb68b;      /* LIVE / ENFORCING / VERIFIED: evidence exists and was checked */
  --st-live-bg: #0f2a20;
  --st-partial: #d9a441;   /* SHADOW / TESTED / SIMULATED / BENCHMARKED / RUNNING */
  --st-partial-bg: #2d2412;
  --st-none: #8b929c;      /* NOT IMPLEMENTED / NOT LIVE / UNVERIFIED */
  --st-none-bg: #1b1e23;
  --st-fail: #e5484d;
  --st-fail-bg: #3a1618;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --max: 1160px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.c42 {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--sans); overflow-x: hidden;
}
.c42 a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.c42 a:hover { text-decoration-color: var(--red); }
.c42 code, .c42 pre, .c42 .mono { font-family: var(--mono); font-size: 13px; }
.c42 pre { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; overflow-x: auto; white-space: pre; }
.c42-wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.c42-skip { position: absolute; left: -9999px; }
.c42-skip:focus { left: 16px; top: 8px; background: var(--bg-raised); padding: 6px 10px; z-index: 10; }

/* Header: brand left, site nav, cross-site tabs upper right */
.c42-top { border-bottom: 1px solid var(--line); background: var(--bg-sunken); }
.c42-top .c42-wrap { display: flex; align-items: center; gap: 20px; min-height: 56px; flex-wrap: wrap; }
.c42-brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; font-weight: 600; letter-spacing: .02em; }
.c42-brand img { width: 22px; height: 22px; display: block; }
.c42-brand small { color: var(--text-faint); font-weight: 400; font-family: var(--mono); font-size: 12px; }
.c42-nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.c42-nav a { text-decoration: none; color: var(--text-dim); }
.c42-nav a:hover, .c42-nav a[aria-current="page"] { color: var(--text); }
.c42-sites { margin-left: auto; display: flex; gap: 2px; font-family: var(--mono); font-size: 12px; }
.c42-sites a { text-decoration: none; color: var(--text-dim); padding: 5px 9px; border: 1px solid var(--line); }
.c42-sites a:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.c42-sites a:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.c42-sites a[aria-current="true"] { color: var(--text); border-color: var(--red); background: var(--red-dim); }

/* Hero */
.c42-hero { padding: 56px 0 28px; border-bottom: 1px solid var(--line); }
.c42-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin: 0 0 14px; }
.c42-hero h1 { font-size: clamp(28px, 4.2vw, 44px); line-height: 1.15; margin: 0 0 16px; font-weight: 650; letter-spacing: -.01em; max-width: 22ch; }
.c42-lede { color: var(--text-dim); font-size: 17px; max-width: 70ch; margin: 0 0 20px; }
.c42-flow { font-family: var(--mono); font-size: 13px; color: var(--text-dim); display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 24px; padding: 0; list-style: none; }
.c42-flow li::after { content: "→"; margin-left: 10px; color: var(--text-faint); }
.c42-flow li:last-child::after { content: ""; }
.c42-flow b { color: var(--text); font-weight: 600; }
.c42-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.c42-btn { display: inline-block; padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); text-decoration: none !important; font-size: 14px; background: var(--bg-raised); }
.c42-btn.primary { border-color: var(--red); background: var(--red-dim); }
.c42-btn:hover { border-color: var(--red); }

/* Sections */
.c42-sec { padding: 40px 0; border-bottom: 1px solid var(--line); }
.c42-sec h2 { font-size: 20px; margin: 0 0 6px; font-weight: 600; }
.c42-sec > .c42-wrap > p.c42-sub { color: var(--text-dim); margin: 0 0 20px; max-width: 75ch; }
.c42-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.c42-card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.c42-card h3 { font-size: 14px; margin: 0 0 6px; font-weight: 600; }
.c42-card p { margin: 0; color: var(--text-dim); font-size: 14px; }
.c42-card .c42-src { margin-top: 10px; font-size: 12px; font-family: var(--mono); color: var(--text-faint); overflow-wrap: anywhere; }
.c42-card .c42-src a { color: var(--text-faint); }

/* Status badges. Every badge on these pages is rendered from a fetched source and links to it. */
.st { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; border: 1px solid currentColor; white-space: nowrap; vertical-align: 1px; }
.st-live { color: var(--st-live); background: var(--st-live-bg); }
.st-partial { color: var(--st-partial); background: var(--st-partial-bg); }
.st-none { color: var(--st-none); background: var(--st-none-bg); }
.st-fail { color: var(--st-fail); background: var(--st-fail-bg); }
.st-wait { color: var(--text-faint); border-style: dashed; }

/* Status table */
.c42-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.c42-table th, .c42-table td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.c42-table th { font-weight: 600; color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.c42-table td.src { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.c42-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.c42-table-wrap .c42-table tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .c42-table.stack thead { display: none; }
  .c42-table.stack tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .c42-table.stack td { display: block; border: 0; padding: 3px 10px; }
}

/* Architecture diagram */
.c42-diagram { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow-x: auto; }
.c42-diagram svg { display: block; width: 100%; min-width: 640px; height: auto; }
.c42-diagram text { font-family: var(--sans); fill: var(--text); }
.c42-diagram .t-dim { fill: var(--text-dim); }
.c42-diagram .t-mono { font-family: var(--mono); }
.c42-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); margin-top: 10px; }

/* Try-it chain */
.c42-try-out { margin-top: 14px; }
.c42-stage { display: grid; grid-template-columns: 120px 150px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.c42-stage .mono { color: var(--text); }
.c42-stage span:last-child { color: var(--text-dim); }
@media (max-width: 640px) { .c42-stage { grid-template-columns: 1fr; gap: 2px; } }

.c42-note { color: var(--text-dim); font-size: 13px; }
.c42-warn { border-left: 3px solid var(--st-partial); padding: 8px 12px; background: var(--bg-raised); color: var(--text-dim); font-size: 14px; margin: 16px 0 0; }
.c42-foot { padding: 28px 0 48px; color: var(--text-faint); font-size: 13px; }
.c42-foot a { color: var(--text-dim); }
.c42-foot .c42-wrap { display: flex; gap: 18px; flex-wrap: wrap; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.c42-diagram .box rect { fill: var(--bg-raised); stroke: var(--line-strong); stroke-width: 1.5; }
.c42-diagram .box.accent rect { stroke: var(--red); }
.c42-diagram .box.dashed rect { fill: none; stroke-dasharray: 6 5; }
.c42-diagram .edge line { stroke: var(--text-faint); stroke-width: 1.5; }
.c42-diagram .edge.dashed line { stroke-dasharray: 5 4; }
.c42-diagram .ah { fill: var(--text-faint); }

/* ---- Simple homepage layout, dark navy (2026-09-27) ---- */
.c42-strip { background: var(--bg-sunken); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-faint); }
.c42-strip .c42-wrap { display: flex; align-items: center; gap: 12px; min-height: 34px; flex-wrap: wrap; }
.c42-strip .c42-sites { margin-left: auto; }
.c42-strip .c42-sites a { padding: 3px 9px; }
.c42-top { position: sticky; top: 0; z-index: 20; background: rgba(6,10,23,.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.c42-top .c42-wrap { min-height: 64px; }
.c42-nav { gap: 22px; font-size: 14.5px; }
.c42-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.c42-signin { color: var(--text-dim) !important; text-decoration: none !important; font-size: 14px; }
.c42-signin:hover { color: var(--text) !important; }
.c42-btn { border-radius: 8px; padding: 10px 18px; font-weight: 550; transition: border-color .15s, background .15s; }
.c42-btn.primary { background: var(--red); border-color: var(--red); color: #fff !important; }
.c42-btn.primary:hover { background: #ff5a67; border-color: #ff5a67; }

.c42-hero { position: relative; overflow: hidden; padding: 110px 0 96px; text-align: center; border-bottom: 0;
  background: radial-gradient(60% 55% at 50% 0%, rgba(255,59,74,.26), transparent 70%), radial-gradient(40% 40% at 85% 30%, rgba(255,120,90,.08), transparent 70%); }
.c42-hero .c42-kicker { color: var(--accent-2); }
.c42-hero h1 { font-size: clamp(34px, 6vw, 64px); line-height: 1.05; letter-spacing: -.025em; max-width: 16ch; margin: 0 auto 22px; font-weight: 700; }
.c42-hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--red), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.c42-hero .c42-lede { font-size: clamp(17px, 2vw, 20px); max-width: 58ch; margin: 0 auto 32px; }
.c42-hero .c42-cta { justify-content: center; }
.c42-hero .c42-btn { padding: 13px 24px; font-size: 15px; }

.c42-eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); margin: 0 0 10px; }
.c42-h2, .c42-sec h2.c42-h2 { font-size: clamp(24px, 3.2vw, 36px); line-height: 1.15; letter-spacing: -.015em; font-weight: 680; margin: 0 0 12px; }
.c42-sec { padding: 72px 0; }

.c42-band { padding: 72px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-sunken); text-align: center; }
.c42-steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; text-align: left; }
.c42-steps li { position: relative; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; }
.c42-steps li:not(:last-child)::after { content: "→"; position: absolute; right: -16px; top: 38px; color: var(--red); font-size: 18px; z-index: 1; }
.c42-steps .n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--red-dim); color: #ffb3b8; font-weight: 700; margin-bottom: 14px; border: 1px solid var(--red); }
.c42-steps h3 { font-size: 20px; margin: 0 0 8px; }
.c42-steps p { margin: 0; color: var(--text-dim); }

.c42-simple { text-align: center; }
.c42-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; text-align: left; }
.c42-benefit { padding: 26px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-raised), var(--bg)); }
.c42-benefit h3 { font-size: 18px; margin: 0 0 8px; }
.c42-benefit p { margin: 0; color: var(--text-dim); }

.c42-final { padding: 80px 0; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: radial-gradient(50% 80% at 50% 100%, rgba(255,59,74,.20), transparent 70%); }
.c42-final h2 { font-size: clamp(26px, 3.6vw, 40px); margin: 0 0 10px; letter-spacing: -.015em; }
.c42-final p { color: var(--text-dim); margin: 0 0 26px; font-size: 17px; }
.c42-final .c42-cta { justify-content: center; }

.c42-under { padding: 64px 0 8px; margin-top: 40px; }
.c42-under h2 { font-size: 22px; margin: 0 0 6px; }
.c42-under .c42-sub { color: var(--text-dim); max-width: 70ch; margin: 0; }

.c42-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 8px 0 28px; }
.c42-stat { background: var(--bg-raised); padding: 18px 20px; text-decoration: none !important; display: block; }
.c42-stat b { display: block; font-size: 26px; letter-spacing: -.01em; }
.c42-stat span { color: var(--text-dim); font-size: 13px; }
.c42-stat:hover { background: #151c36; }

.c42-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.c42-feat { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.c42-feat svg { width: 28px; height: 28px; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 12px; }
.c42-feat h3 { font-size: 16px; margin: 0 0 6px; }
.c42-feat p { color: var(--text-dim); font-size: 14px; margin: 0 0 12px; }
.c42-more { font-size: 13px; color: #ffb3b8 !important; text-decoration: none !important; }

.c42-split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; }
.c42-code { background: var(--bg-sunken); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 20px; font-size: 13px; line-height: 1.6; color: var(--text-dim); margin: 0; }
.c42-code .c { color: var(--text); }
.c42-code .k { color: var(--accent-2); }

.c42-details { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
.c42-details > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; }
.c42-details > summary::before { content: "+"; display: inline-block; width: 18px; color: var(--red); }
.c42-details[open] > summary::before { content: "−"; }
.c42-details > :not(summary) { padding: 0 18px 18px; }
.c42-details .c42-sec { padding: 24px 0; }
details.c42-wrap.c42-details { margin: 18px auto; }

.c42-foot { border-top: 1px solid var(--line); padding: 48px 0 56px; }
.c42-foot .c42-wrap { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
.c42-foot h4 { color: var(--text); font-size: 13px; margin: 0 0 10px; }
.c42-foot .c42-wrap > div > a { display: block; text-decoration: none; margin: 0 0 7px; }
.c42-foot-brand p { margin: 10px 0 0; max-width: 32ch; }

@media (max-width: 860px) {
  .c42-steps, .c42-benefits, .c42-feats, .c42-split { grid-template-columns: 1fr; }
  .c42-steps li::after { display: none; }
  .c42-stats { grid-template-columns: repeat(2, 1fr); }
  .c42-foot .c42-wrap { grid-template-columns: 1fr 1fr; }
  .c42-nav { display: none; }
  .c42-hero { padding: 72px 0 64px; }
  .c42-sec, .c42-band { padding: 52px 0; }
}
@media (max-width: 640px) {
  .c42-strip .c42-wrap > span { display: none; }
  .c42-strip .c42-sites { margin: 0 auto; }
  .c42-strip .c42-sites a { padding: 3px 7px; font-size: 11px; }
  .c42-brand small { display: none; }
  .c42-top .c42-wrap { flex-wrap: nowrap; min-height: 58px; }
  .c42-signin { display: none; }
  .c42-hero .c42-cta .c42-btn { width: 100%; text-align: center; }
  .c42-stats { grid-template-columns: 1fr 1fr; }
  .c42-foot .c42-wrap { grid-template-columns: 1fr; }
}
.c42-mark { display: block; width: clamp(120px, 16vw, 176px); height: auto; margin: 0 auto 28px; filter: drop-shadow(0 0 36px rgba(255,59,74,.55)) drop-shadow(0 0 90px rgba(255,59,74,.25)); }
.c42-split > * { min-width: 0; }
.c42-diagram { max-width: 100%; }
/* The gateway's injected company footer, on these pages: no sideways scroll on phones */
@media (max-width: 640px) { .cain-footer .cf-top { grid-template-columns: 1fr 1fr !important; } .cain-footer .cf-mission { grid-column: 1 / -1; } .cain-footer .cf-col { min-width: 0; } }
button.c42-btn { color: var(--text); font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; }
button.c42-btn:hover { background: #151c36; }
/* Utility classes instead of style="" attributes: clawx.click's CSP (style-src 'self') ignores inline styles */
.c42-mt0 { margin-top: 0; } .c42-mt24 { margin-top: 24px; } .c42-mt12 { margin-top: 12px; } .c42-mt18 { margin-top: 18px; }
.c42-lh16 { line-height: 1.6; }
.c42-pre-box { overflow: auto; padding: 10px; border: 1px solid rgba(128,128,128,.3); border-radius: 6px; }
