/* Toolgate dev portal — industrial spec-sheet. Archivo + IBM Plex Mono on graphite,
   one signal accent. The page presents itself as a verified audit chain. */

:root {
  --bg: #0c0e11;
  --bg-raise: #12151a;
  --bg-panel: #14181e;
  --line: #232a33;
  --line-soft: #1a2028;
  --text: #e8ebee;
  --muted: #8b96a1;
  --faint: #5b6673;
  --accent: #c8f169;
  --accent-dim: #94b944;
  --allow: #7fd77f;
  --deny: #f07866;
  --approve: #e5b567;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Archivo", sans-serif;
  --maxw: 1140px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
}
.mono { font-family: var(--mono); }
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; color: var(--accent); }

/* --- nav ------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--mono); font-weight: 600; letter-spacing: 0.14em;
  text-decoration: none; font-size: 15px;
}
.wordmark-cursor { color: var(--accent); animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.nav-links { display: flex; gap: 26px; align-items: center; font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--muted); transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.nav-cta { color: var(--text) !important; border: 1px solid var(--line); padding: 6px 12px; }
.nav-cta:hover { border-color: var(--accent); }

/* --- hero ------------------------------------------------------------ */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 96px 28px 72px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
}
.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 20px;
}
.seq {
  color: var(--accent); border: 1px solid var(--line);
  padding: 2px 8px; margin-right: 10px; background: var(--bg-raise);
}
h1 {
  font-size: clamp(40px, 5.4vw, 64px); font-weight: 800; line-height: 1.02;
  letter-spacing: -0.02em; margin-bottom: 22px;
}
.lede { color: var(--muted); font-size: 18px; max-width: 34em; margin-bottom: 30px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em;
  color: var(--text); background: transparent; text-decoration: none;
  border: 1px solid var(--line); padding: 12px 20px; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--accent-dim); }
.btn-primary { background: var(--accent); color: #0d1105; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.hero-stats { display: flex; gap: 40px; margin-top: 44px; }
.hero-stats dt { font-family: var(--mono); font-size: 26px; color: var(--accent); font-weight: 600; }
.hero-stats dd { font-size: 13px; color: var(--faint); max-width: 11em; }

/* terminal */
.term { border: 1px solid var(--line); background: #0a0c0f; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.term-bar {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.term-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.term-bar em { margin-left: auto; font-family: var(--mono); font-style: normal; font-size: 11px; color: var(--faint); }
.term-body {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  padding: 18px; min-height: 340px; white-space: pre-wrap; color: var(--muted);
}
.term-body .t-ok { color: var(--allow); }
.term-body .t-deny { color: var(--deny); }
.term-body .t-park { color: var(--approve); }
.term-body .t-dim { color: var(--faint); }
.term-body .t-hl { color: var(--text); }

/* --- pipeline band ---------------------------------------------------- */
.pipeline-band {
  border-block: 1px solid var(--line); background: var(--bg-raise);
  padding: 26px 28px;
}
.band-label {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .14em; color: var(--faint); text-align: center; margin-bottom: 16px;
}
.pipeline {
  list-style: none; display: flex; justify-content: center; gap: 0;
  max-width: var(--maxw); margin: 0 auto; flex-wrap: wrap;
}
.pipeline li {
  display: flex; flex-direction: column; padding: 0 26px; position: relative;
}
.pipeline li + li::before {
  content: "→"; position: absolute; left: -8px; top: 2px;
  color: var(--accent); font-family: var(--mono);
}
.pipeline b { font-family: var(--mono); font-size: 14px; letter-spacing: .04em; }
.pipeline i { font-style: normal; font-size: 12px; color: var(--faint); }

/* --- sections ---------------------------------------------------------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 96px 28px 40px; }
.section-head { margin-bottom: 40px; }
h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 800; letter-spacing: -0.015em; line-height: 1.05; }
.section-lede { color: var(--muted); margin-top: 14px; max-width: 40em; }

/* --- simulation --------------------------------------------------------- */
.sim {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
}
.sim-left, .sim-right { background: var(--bg-panel); padding: 26px; }
.panel-label {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .13em; color: var(--faint); margin-bottom: 14px;
}
.scenarios { display: grid; gap: 8px; margin-bottom: 26px; }
.scenario {
  text-align: left; font-family: var(--mono); font-size: 12.5px;
  background: var(--bg-raise); color: var(--muted);
  border: 1px solid var(--line); padding: 11px 14px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.scenario:hover { border-color: var(--accent-dim); color: var(--text); }
.scenario.active { border-color: var(--accent); color: var(--text); }
.scenario .sc-args { color: var(--faint); display: block; font-size: 11.5px; }

.sim-budget { margin-bottom: 26px; }
.budget-track { height: 8px; background: var(--bg-raise); border: 1px solid var(--line); }
.budget-fill { height: 100%; background: var(--accent); width: 100%; transition: width .4s ease; }
.budget-num { font-size: 12px; color: var(--muted); margin: 8px 0; }

.policy-rules { list-style: none; display: grid; gap: 6px; }
.policy-rules li {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  padding: 8px 10px; border: 1px solid transparent; transition: all .2s;
}
.policy-rules li.hit { border-color: var(--accent); background: var(--bg-raise); color: var(--text); }
.fx { display: inline-block; width: 72px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.fx.allow { color: var(--allow); } .fx.deny { color: var(--deny); } .fx.approve { color: var(--approve); }

.stages { list-style: none; display: grid; gap: 10px; margin-bottom: 22px; }
.stages li {
  display: flex; align-items: baseline; gap: 14px;
  font-family: var(--mono); font-size: 13px;
  border: 1px solid var(--line-soft); padding: 12px 14px; color: var(--faint);
  transition: all .2s;
}
.stages li b { font-weight: 500; min-width: 120px; }
.stages li.run { border-color: var(--accent); color: var(--text); }
.stages li.pass { border-color: var(--line); color: var(--muted); }
.stages li.pass b::after { content: " ✓"; color: var(--allow); }
.stages li.fail { border-color: var(--deny); color: var(--text); }
.stages li.fail b::after { content: " ✕"; color: var(--deny); }
.stages li.park { border-color: var(--approve); color: var(--text); }
.stages li.park b::after { content: " ⏸"; color: var(--approve); }
.stage-note { font-size: 11.5px; color: var(--faint); }

.verdict {
  font-size: 13px; padding: 14px 16px; border: 1px solid var(--line);
  background: var(--bg-raise);
}
.verdict.v-allow { border-color: var(--allow); color: var(--allow); }
.verdict.v-deny { border-color: var(--deny); color: var(--deny); }
.verdict.v-park { border-color: var(--approve); color: var(--approve); }

.approval-box { border: 1px solid var(--approve); padding: 16px; margin-top: 14px; }
.approval-box p { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.approval-box em { color: var(--approve); font-style: normal; }

/* --- audit chain -------------------------------------------------------- */
.chain { border: 1px solid var(--line); border-top: 0; background: var(--bg-panel); padding: 26px; }
.chain-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.chain-actions { display: flex; gap: 8px; }
.chain-body { margin-top: 18px; display: grid; gap: 0; }
.chain-empty { color: var(--faint); font-size: 12.5px; padding: 18px 0; }
.chain-rec {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: baseline;
  padding: 10px 12px; border-left: 2px solid var(--line);
  position: relative; animation: recIn .3s ease both;
}
@keyframes recIn { from { opacity: 0; transform: translateY(4px); } }
.chain-rec::before {
  content: "prev " attr(data-prev); position: absolute; right: 12px; bottom: -7px;
  font-size: 9.5px; color: var(--faint); background: var(--bg-panel); padding: 0 6px; z-index: 1;
}
.chain-rec .r-seq { color: var(--accent); }
.chain-rec .r-what b { color: var(--text); font-weight: 500; }
.chain-rec .r-hash { color: var(--faint); font-size: 10.5px; }
.chain-rec.r-deny .r-what b { color: var(--deny); }
.chain-rec.r-park .r-what b { color: var(--approve); }
.chain-rec.tampered { border-left-color: var(--deny); background: rgba(240,120,102,.05); }
.chain-rec.broken { opacity: .45; }
.chain-verdict { margin-top: 16px; font-size: 12.5px; min-height: 1.5em; }
.chain-verdict.ok { color: var(--allow); }
.chain-verdict.bad { color: var(--deny); }

/* --- code cards ---------------------------------------------------------- */
.code-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.code-card { border: 1px solid var(--line); background: var(--bg-panel); }
.code-card figcaption {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted);
}
.step-n { color: var(--accent); margin-right: 10px; }
.code-card pre { padding: 16px; overflow-x: auto; }
.code-card code { font-size: 12px; line-height: 1.7; color: var(--text); display: block; }
.code-card .c { color: var(--faint); } .code-card .k { color: var(--muted); }
.code-card .s { color: var(--accent); } .code-card .n { color: var(--approve); }

/* --- token anatomy -------------------------------------------------------- */
.token-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 32px; align-items: start; }
.token-json {
  border: 1px solid var(--line); background: var(--bg-panel);
  padding: 22px; font-size: 13px; line-height: 1.9; overflow-x: auto;
}
.token-json span[data-claim] { display: block; cursor: default; padding: 0 8px; margin: 0 -8px; transition: background .12s; }
.token-json span[data-claim]:hover, .token-json span[data-claim].lit { background: #1b2410; color: var(--accent); }
.claim-notes p {
  font-size: 14px; color: var(--faint); padding: 10px 14px;
  border-left: 2px solid var(--line); margin-bottom: 8px; transition: all .12s;
}
.claim-notes p.lit { color: var(--text); border-left-color: var(--accent); }
.claim-notes b { font-family: var(--mono); font-weight: 600; }

/* --- guarantees ------------------------------------------------------------ */
.g-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.g-cards article { border: 1px solid var(--line); background: var(--bg-panel); padding: 26px; }
.g-cards h3 { font-size: 19px; font-weight: 700; margin-bottom: 12px; }
.g-cards p { font-size: 14px; color: var(--muted); }
.g-tag { margin-top: 16px; font-size: 11.5px; color: var(--deny); }

/* --- footer ----------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); margin-top: 96px; padding: 40px 28px 60px; text-align: center; }
.foot-chain { font-size: 11.5px; color: var(--accent-dim); margin-bottom: 22px; letter-spacing: .04em; }
.foot-links { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; font-size: 13px; margin-bottom: 18px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--text); }
.foot-note { font-size: 12px; color: var(--faint); }

/* --- reveal ------------------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.reveal-2 { transition-delay: .12s; }

/* --- responsive ---------------------------------------------------------------- */
@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; padding-top: 60px; }
  .sim, .token-grid, .code-cols, .g-cards { grid-template-columns: 1fr; }
  .pipeline { justify-content: flex-start; row-gap: 14px; }
  .hero-stats { flex-wrap: wrap; gap: 24px; }
}
