/* GraphSlice — slate + electric blue, enterprise dark
   Self-contained: no external fonts or assets. */

:root {
  --bg:        #0a0e17;
  --bg-2:      #0d131f;
  --panel:     #111a29;
  --panel-2:   #0f1726;
  --border:    #1e2c43;
  --border-2:  #28395a;

  --text:      #e7eef8;
  --muted:     #93a4bd;
  --muted-2:   #6c7d97;

  --accent:    #4d8bff;   /* electric blue */
  --accent-2:  #2f6dff;
  --accent-3:  #22d3ee;   /* restrained cyan, gradients only */
  --accent-soft: rgba(77, 139, 255, .14);

  --radius:    14px;
  --radius-sm: 10px;
  --maxw:      1080px;
  --ease:      cubic-bezier(.22,.61,.36,1);

  --shadow:    0 24px 60px -28px rgba(0,0,0,.75);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.grad {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-3) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Bouncing graph background ---------- */
.bouncer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 70% -10%, #101b2e 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
/* Two nested layers: outer translates (bounce), inner rotates about centre.
   Both transforms are driven per-frame by main.js. */
.bounce-x {
  position: absolute; top: 0; left: 0;
  will-change: transform;
}
.bounce-y {
  will-change: transform;
  transform-origin: 50% 50%;
}
.netgraph { display: block; overflow: visible; }
.netgraph line { stroke: rgba(206,221,247,.17); stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.netgraph circle { fill: rgba(220,231,252,.26); }
.netgraph circle.hub { fill: rgba(150,185,255,.34); }
.netgraph text {
  fill: rgba(202,219,255,.40);      /* subtle, but readable */
  font: 500 13px ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  letter-spacing: .02em;
  paint-order: stroke;              /* light halo for separation, not a dark blob */
  stroke: rgba(8,12,20,.40);
  stroke-width: 2px;
  stroke-linejoin: round;
}

/* ---------- Layout ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
}
.site-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 18px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand-mark { color: var(--accent); }
.brand-name { font-weight: 700; letter-spacing: -0.01em; font-size: 19px; }
.brand-sm .brand-name { font-size: 16px; }

.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav > a:not(.btn) { color: var(--muted); font-size: 15px; font-weight: 500; }
.site-nav > a:not(.btn):hover { color: var(--text); }

main { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.band { padding: 96px 0; border-top: 1px solid transparent; }
.band:first-of-type { padding-top: 40px; }

.section-head { max-width: 720px; margin-bottom: 40px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .16em; font-size: 12.5px;
  font-weight: 700; color: var(--accent); margin-bottom: 14px;
}
h2 { font-size: clamp(28px, 4vw, 40px); }
.prose { max-width: 720px; color: var(--muted); display: grid; gap: 18px; font-size: 18px; }
.prose strong { color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 80px;
  max-width: 760px;
}
.hero h1 { font-size: clamp(34px, 5.4vw, 60px); margin: 14px 0 22px; }
.lede { color: var(--muted); font-size: clamp(17px, 2.2vw, 21px); max-width: 46ch; }
.built-line { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 0; }
.chip {
  font-size: 13px; font-weight: 600; color: var(--text);
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--border-2);
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent);
}
.hero-cta { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

/* ---------- Steps ---------- */
.steps {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
.step {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
}
.step-no {
  font-size: 13px; font-weight: 700; letter-spacing: .12em;
  color: var(--accent); margin-bottom: 14px;
}
.step h3 { font-size: 21px; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 16px; }
.tags, .examples { list-style: none; padding: 0; margin: 16px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: 12.5px; color: var(--muted); font-weight: 500;
  padding: 5px 10px; border: 1px solid var(--border-2); border-radius: 8px;
}
.examples { display: grid; gap: 8px; }
.examples li {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 13.5px; color: var(--text);
  padding: 9px 12px; border-radius: 8px;
  background: rgba(77,139,255,.07);
  border: 1px solid var(--border);
}

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 26px; transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.card:hover { border-color: var(--border-2); transform: translateY(-3px); }
.card h3 { font-size: 19px; margin-bottom: 12px; }
.card p { color: var(--muted); font-size: 16px; }
.proof { margin-top: 28px; color: var(--muted-2); font-size: 15px; text-align: center; }
.sovereign-lead { margin-bottom: 40px; }

/* ---------- The Codebase Race (terminal demo) ---------- */
.race-task { color: var(--muted); font-size: 17px; margin-top: 14px; max-width: 62ch; }
.race-task em { font-style: normal; color: var(--text); }
.race-task code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em;
  color: var(--text); background: rgba(77,139,255,.12); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 6px;
}

.race { display: grid; gap: 18px; max-width: 880px; }

/* segmented toggle */
.race-toggle {
  display: inline-flex; gap: 4px; padding: 4px; width: fit-content;
  border: 1px solid var(--border-2); background: var(--panel-2); border-radius: 12px;
}
.race-tab {
  appearance: none; cursor: pointer; border: 0; background: transparent; color: var(--muted);
  font: 600 14px/1 ui-monospace, "Cascadia Code", Consolas, monospace;
  padding: 10px 16px; border-radius: 9px; display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s, color .2s;
}
.race-tab:hover { color: var(--text); }
.race-tab.is-active { color: #fff; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.race-tab .rec { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.race-tab:not(.is-active) .rec { color: var(--accent); }

/* terminal window */
.term {
  background: #05080e; border: 1px solid var(--border-2); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow);
}
.term-bar {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  background: #0a0f1a; border-bottom: 1px solid var(--border);
}
.term-dots { display: inline-flex; gap: 7px; }
.term-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; background: #2c3a55; }
.term-dots i:nth-child(3) { background: var(--accent); opacity: .55; }
.term-title { color: var(--muted-2); font: 500 13px ui-monospace, Consolas, monospace; }
.term-title #term-mode { color: var(--muted); }
.term-replay {
  margin-left: auto; cursor: pointer; border: 1px solid var(--border-2); background: transparent;
  color: var(--muted); font: 600 12px ui-monospace, Consolas, monospace;
  padding: 5px 11px; border-radius: 8px; transition: border-color .2s, color .2s;
}
.term-replay:hover { color: var(--text); border-color: var(--accent); }

.term-body {
  font: 13.5px/1.65 ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  padding: 18px; min-height: 440px; max-height: 440px; overflow-y: auto;
  color: #c7d2e3; white-space: pre-wrap; word-break: break-word;
  scrollbar-width: none; -ms-overflow-style: none;     /* hide scrollbar; auto-scroll handles it */
}
.term-body::-webkit-scrollbar { width: 0; height: 0; }
.term-line { margin: 0; }
.term-call .dot { margin-right: 8px; }
.term-call .dot-gs, .term-call .fn-gs { color: var(--accent); }
.term-call .dot-rg, .term-call .fn-rg { color: var(--muted); }
.term-call .fn-gs, .term-call .fn-rg { font-weight: 600; }
.term-call .args { color: #c7d2e3; }
.term-sys { color: var(--muted-2); }
.term-out { color: var(--muted-2); padding-left: 20px; }
.term-out .ok { color: var(--accent-3); } .term-out .warn { color: #ff9e9e; } .term-out .bad { color: #ff7b72; }
.term-final { color: var(--text); margin-top: 10px; font-weight: 600; }
.cursor::after { content: "▋"; color: var(--accent); animation: blink-cursor 1s steps(2) infinite; }
@keyframes blink-cursor { 50% { opacity: 0; } }

.term-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--border); background: #0a0f1a;
}
.tok-label { color: var(--muted-2); font: 600 12px ui-monospace, Consolas, monospace;
  text-transform: uppercase; letter-spacing: .08em; }
.tok-count { font: 700 21px ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--text);
  font-variant-numeric: tabular-nums; transition: color .25s; }
.tok-count.hot { color: #ff7b72; }
.tok-count.cool { color: var(--accent); }

/* cost breakdown */
.cost { border: 1px solid var(--border); background: var(--panel-2); border-radius: 14px; padding: 22px 24px; }
.cost-title { font: 700 12px ui-monospace, Consolas, monospace; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted-2); margin: 0 0 16px; }
.cost-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 14px; margin-bottom: 12px; }
.cost-name { color: var(--muted); font: 600 13.5px ui-monospace, Consolas, monospace; }
.cost-track { height: 12px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.cost-fill { display: block; height: 100%; width: 0; border-radius: 999px;
  transition: width 1.1s cubic-bezier(.22,.61,.36,1); }
.cost-rg { background: linear-gradient(90deg, var(--muted-2), #ff7b72); }
.cost-gs { background: linear-gradient(90deg, var(--accent), var(--accent-3)); }
.cost-val { font: 700 15px ui-monospace, Consolas, monospace; color: var(--text);
  font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }
.cost-save { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.cost-save strong { color: var(--accent); font-size: 17px; }

@media (max-width: 560px) {
  .cost-row { grid-template-columns: 1fr auto; }
  .cost-track { grid-column: 1 / -1; order: 3; }
  .term-body { min-height: 380px; max-height: 380px; font-size: 12.5px; }
}

/* ---------- Alpha / form ---------- */
.alpha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.alpha-copy p { color: var(--muted); margin-top: 14px; }
.alpha-copy h2 { margin-top: 8px; }
.built-for { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.built-for li { position: relative; padding-left: 22px; color: var(--muted); }
.built-for li::before { content: ""; position: absolute; left: 0; top: 10px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.alpha-form-wrap {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.alpha-form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text); }
.field .opt { color: var(--muted-2); font-weight: 400; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 15px;
  color: var(--text); background: var(--bg-2);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 12px 14px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-note { font-size: 14.5px; min-height: 1px; margin-top: 2px; }
.form-note.ok { color: #5fd39a; }
.form-note.err { color: #ff8a8a; }
.form-fine { font-size: 12.5px; color: var(--muted-2); text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px; cursor: pointer;
  padding: 12px 22px; border-radius: var(--radius-sm);
  border: 1px solid transparent; transition: transform .15s var(--ease), filter .2s var(--ease), background .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-block { width: 100%; padding: 14px; font-size: 16px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px -10px rgba(47,109,255,.8);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .6; cursor: progress; filter: none; }
.btn-ghost { color: var(--text); border-color: var(--border-2); background: rgba(255,255,255,.02); }
.btn-ghost:hover { border-color: var(--accent); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 40px 24px;
  display: grid; gap: 8px; text-align: center; justify-items: center;
}
.footer-tag { color: var(--muted); font-size: 15px; }
.footer-legal { color: var(--muted-2); font-size: 13px; }
.footer-link {
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  color: var(--muted-2); font: inherit; font-size: 13px;
  text-decoration: underline; text-underline-offset: 2px;
}
.footer-link:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .steps, .cards { grid-template-columns: 1fr; }
  .alpha-grid { grid-template-columns: 1fr; gap: 32px; }
  .band { padding: 72px 0; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .site-nav > a:not(.btn) { display: none; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
}

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
