:root {
  --ink: #07090c;
  --panel: #10141a;
  --panel-2: #161b22;
  --line: #343a44;
  --paper: #eceff2;
  --muted: #9ba3ad;
  --red: #f04b4b;
  --cyan: #42d9e8;
  --gold: #e7bd62;
  --white: #ffffff;
  --max: 1540px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, textarea { font: inherit; }
button { color: inherit; }

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(20px, 4vw, 68px);
  background: rgba(7, 9, 12, 0.86);
  border-bottom: 1px solid rgba(255,255,255,.13);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; width: fit-content; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  color: var(--ink); background: var(--paper); clip-path: polygon(0 0,100% 0,82% 100%,0 100%);
}
.topbar nav { display: flex; gap: 34px; color: #c4cad1; font-size: 12px; font-weight: 700; }
.topbar nav a:hover { color: var(--white); }
.status { justify-self: end; font-size: 11px; font-weight: 700; color: #aeb5bd; }
.status i, .console-live i { display: inline-block; width: 7px; height: 7px; background: #53df90; border-radius: 50%; margin-right: 7px; box-shadow: 0 0 12px #53df90; }

.hero {
  position: relative;
  min-height: 780px;
  height: min(920px, 100vh);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; z-index: 2; inset: 0;
  background: linear-gradient(90deg, rgba(7,9,12,.96) 0%, rgba(7,9,12,.72) 34%, rgba(7,9,12,.05) 62%),
              linear-gradient(0deg, rgba(7,9,12,.92) 0%, transparent 38%);
  pointer-events: none;
}
.hero-grid {
  position: absolute; z-index: 3; inset: 0; opacity: .2; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.15) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(90deg, black, transparent 80%);
}
.hero-copy {
  position: absolute; z-index: 5; left: max(28px, calc((100vw - var(--max)) / 2)); top: 50%;
  width: min(680px, 48vw); transform: translateY(-46%);
}
.eyebrow { margin: 0 0 18px; color: var(--cyan); font-size: 12px; font-weight: 800; }
.hero h1 {
  margin: 0; max-width: 760px; color: var(--white); font-size: clamp(62px, 7.2vw, 132px);
  line-height: .82; font-weight: 900;
}
.hero h1 span { color: transparent; -webkit-text-stroke: 1.5px var(--paper); }
.hero-summary { max-width: 560px; margin: 30px 0; color: #c7cdd4; font-size: 17px; line-height: 1.65; }
.hero-actions { display: flex; gap: 12px; }
.button {
  display: inline-flex; min-height: 48px; align-items: center; justify-content: center;
  padding: 0 24px; border: 1px solid transparent; border-radius: 2px;
  font-size: 12px; font-weight: 800; text-transform: uppercase; cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button.primary { color: var(--ink); background: var(--red); }
.button.secondary { color: var(--paper); border-color: #727a84; background: rgba(7,9,12,.55); }

.agent-triptych { position: absolute; inset: 0 0 0 36%; display: grid; grid-template-columns: repeat(3, 1fr); }
.portrait { position: relative; overflow: hidden; border-left: 1px solid rgba(255,255,255,.12); }
.portrait:nth-child(2) { transform: skewX(-3deg); transform-origin: bottom; }
.portrait:nth-child(2) img { transform: scale(1.08) skewX(3deg); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; filter: saturate(.86) contrast(1.08); }
.portrait::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7,9,12,.92), transparent 48%); }
.portrait-ai::before, .portrait-quant::before, .portrait-academic::before { content: ""; position: absolute; z-index: 2; inset: 0; mix-blend-mode: color; opacity: .16; }
.portrait-ai::before { background: var(--cyan); }
.portrait-quant::before { background: var(--red); }
.portrait-academic::before { background: var(--gold); }
.portrait-label { position: absolute; z-index: 4; left: 22px; right: 18px; bottom: 30px; border-top: 1px solid rgba(255,255,255,.65); padding-top: 12px; }
.portrait-label span { display: block; margin-bottom: 5px; font-size: 10px; color: #c6ccd3; }
.portrait-label strong { font-size: 13px; }
.hero-index { position: absolute; z-index: 6; right: 24px; top: 94px; writing-mode: vertical-rl; font-size: 10px; color: #aeb4bb; }

.ticker {
  min-height: 54px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: clamp(12px, 3vw, 48px); padding: 12px 20px; color: #aab1b9; background: var(--panel);
  border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800;
}
.ticker b { color: var(--red); }

.section { max-width: var(--max); margin: 0 auto; padding: 120px clamp(24px, 5vw, 80px); }
.section-heading { display: grid; grid-template-columns: 1fr 1.3fr; column-gap: 70px; align-items: end; margin-bottom: 74px; }
.section-heading .eyebrow { grid-column: 1 / -1; }
.section-heading h2, .governance-title h2 { margin: 0; color: var(--white); font-size: clamp(42px, 5vw, 82px); line-height: .95; }
.section-heading > p:last-child { max-width: 570px; margin: 0; color: var(--muted); line-height: 1.75; }
.section-heading.compact { grid-template-columns: .8fr 1fr; }

.system-section { max-width: none; background: #0c0f13; }
.system-section > * { max-width: calc(var(--max) - 160px); margin-left: auto; margin-right: auto; }
.system-map { display: flex; flex-direction: column; align-items: center; }
.system-node { position: relative; width: min(100%, 410px); padding: 20px 24px; border: 1px solid var(--line); background: var(--panel); }
.system-node span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 800; }
.system-node strong { display: block; font-size: 22px; }
.system-node small { display: block; margin-top: 8px; color: var(--muted); }
.pbct-node { border-color: var(--red); box-shadow: inset 4px 0 0 var(--red); }
.gate-node { border-color: var(--gold); box-shadow: inset 4px 0 0 var(--gold); }
.flow-line { height: 44px; width: 1px; background: var(--line); }
.flow-line i { display: block; width: 7px; height: 7px; border-right: 1px solid var(--paper); border-bottom: 1px solid var(--paper); transform: translate(-3px, 35px) rotate(45deg); }
.pat-rail { width: min(100%, 930px); display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 15px; border: 1px solid #2d5360; background: #10191e; }
.pat-rail span { margin-right: 12px; color: var(--cyan); font-size: 10px; font-weight: 800; }
.pat-rail b { padding: 7px 10px; color: #b8cbd0; border-left: 1px solid #35535c; font-size: 9px; }
.route-lines { position: relative; width: min(66%, 800px); height: 50px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-right: 1px solid var(--line); margin-top: 46px; }
.route-lines::before { content: ""; position: absolute; width: 1px; height: 50px; left: 50%; top: 0; background: var(--line); }
.domain-nodes { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.domain-nodes .system-node { width: 100%; }
.ai-node { box-shadow: inset 0 3px var(--cyan); }
.quant-node { box-shadow: inset 0 3px var(--red); }
.academic-node { box-shadow: inset 0 3px var(--gold); }

.agents-section { padding-bottom: 80px; }
.agent-tabs { display: flex; border-bottom: 1px solid var(--line); }
.agent-tab { min-width: 150px; padding: 18px 22px; border: 0; border-top: 2px solid transparent; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; }
.agent-tab.active { color: var(--white); border-color: var(--red); background: var(--panel); }
.agent-detail { min-height: 630px; display: grid; grid-template-columns: minmax(320px, .85fr) 1.15fr; background: var(--panel); }
.agent-detail-image { position: relative; overflow: hidden; min-height: 620px; }
.agent-detail-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 65%, var(--panel)); }
.agent-detail-image img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.agent-detail-copy { align-self: center; padding: clamp(34px, 6vw, 90px); }
.agent-code { color: var(--red); font-size: 11px; font-weight: 800; }
.agent-detail-copy h3 { margin: 14px 0 20px; color: var(--white); font-size: clamp(38px, 4vw, 66px); line-height: 1; }
.agent-detail-copy > p:not(.agent-code) { max-width: 650px; color: #b7bec6; line-height: 1.7; }
.agent-detail-copy dl { margin-top: 36px; }
.agent-detail-copy dl div { display: grid; grid-template-columns: 140px 1fr; gap: 20px; padding: 15px 0; border-top: 1px solid var(--line); }
.agent-detail-copy dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.agent-detail-copy dd { margin: 0; color: #d6dbe0; font-size: 13px; line-height: 1.5; }

.router-section { max-width: none; background: var(--paper); color: var(--ink); }
.router-section > * { max-width: calc(var(--max) - 160px); margin-left: auto; margin-right: auto; }
.router-section .section-heading h2 { color: var(--ink); }
.router-section .section-heading > p:last-child { color: #606871; }
.router-console { border: 1px solid #858c94; background: #f7f8f9; box-shadow: 12px 12px 0 #cfd3d7; }
.console-head { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; color: var(--paper); background: var(--ink); font-size: 10px; font-weight: 800; }
.console-live { color: #aeb6be; }
#route-form { padding: 28px; border-bottom: 1px solid #b7bdc3; }
#route-form label { display: block; margin-bottom: 10px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
textarea { width: 100%; resize: vertical; min-height: 94px; padding: 16px; color: var(--ink); border: 1px solid #8d949b; border-radius: 0; background: white; line-height: 1.55; outline: none; }
textarea:focus { border-color: var(--red); box-shadow: 0 0 0 2px rgba(240,75,75,.16); }
.input-row .button { align-self: stretch; min-width: 150px; }
.sample-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 15px 28px; border-bottom: 1px solid #c6cbd0; }
.sample-row button { padding: 8px 10px; border: 1px solid #a2a8ae; background: transparent; color: #4b535b; font-size: 9px; font-weight: 800; cursor: pointer; }
.sample-row button:hover { color: var(--ink); border-color: var(--ink); }
.route-output { min-height: 260px; padding: 28px; }
.route-empty { height: 190px; display: grid; place-items: center; align-content: center; border: 1px dashed #a7adb3; color: #777f87; text-align: center; }
.route-empty span { font-size: 11px; font-weight: 800; }
.route-empty p { margin: 10px 0 0; font-size: 13px; }
.route-result { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; }
.route-result h3 { margin: 8px 0 10px; font-size: 34px; }
.route-result .label { color: #747c84; font-size: 9px; font-weight: 800; }
.route-team { padding: 24px; color: var(--paper); background: var(--ink); box-shadow: inset 4px 0 var(--red); }
.route-team p { color: #afb6bd; line-height: 1.6; }
.route-plan { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.route-block { padding: 18px; border: 1px solid #b0b6bc; background: #fff; }
.route-block strong { display: block; margin: 7px 0; font-size: 13px; }
.route-block p { margin: 0; color: #5d656d; font-size: 12px; line-height: 1.5; }
.capability-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.capability-list span { padding: 5px 7px; color: #31404a; background: #dceff1; font-size: 8px; font-weight: 800; }
.gate-strip { grid-column: 1 / -1; padding: 14px 18px; color: #4f3a0b; border: 1px solid #d0ad5a; background: #fff4d7; font-size: 11px; font-weight: 700; }

.governance-section { display: grid; grid-template-columns: .85fr 1.15fr; gap: 70px; }
.governance-title { position: sticky; top: 120px; align-self: start; }
.governance-grid article { position: relative; min-height: 210px; padding: 30px 30px 30px 100px; border-top: 1px solid var(--line); }
.governance-grid article > span { position: absolute; left: 0; top: 28px; color: var(--red); font-size: 12px; font-weight: 800; }
.governance-grid h3 { margin: 0 0 14px; color: var(--white); font-size: 25px; }
.governance-grid p { margin: 0; max-width: 560px; color: var(--muted); line-height: 1.7; }

footer { min-height: 150px; display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 24px; padding: 30px clamp(24px, 5vw, 80px); color: #8f979f; border-top: 1px solid var(--line); background: #050608; font-size: 11px; }
footer div { display: flex; align-items: center; gap: 16px; }
footer strong { color: var(--white); font-size: 24px; }
footer a { color: var(--paper); font-weight: 800; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar nav { display: none; }
  .hero { min-height: 850px; height: 100svh; }
  .hero-copy { left: 28px; top: 43%; width: min(660px, 76vw); }
  .agent-triptych { inset: 0 0 0 20%; opacity: .72; }
  .section-heading, .section-heading.compact, .governance-section { grid-template-columns: 1fr; gap: 28px; }
  .agent-detail { grid-template-columns: .8fr 1.2fr; }
  .route-result { grid-template-columns: 1fr; }
  .governance-title { position: static; }
}

@media (max-width: 700px) {
  .topbar { height: 60px; padding: 0 16px; }
  .status { width: 8px; overflow: hidden; white-space: nowrap; font-size: 0; }
  .status i { margin-right: 0; }
  .hero { min-height: 760px; height: 100svh; }
  .hero::before { background: linear-gradient(0deg, rgba(7,9,12,.96) 0%, rgba(7,9,12,.52) 72%, rgba(7,9,12,.15)); }
  .hero-copy { left: 20px; right: 20px; top: auto; bottom: 60px; width: auto; transform: none; }
  .hero h1 { max-width: 100%; font-size: clamp(44px, 12vw, 60px); line-height: .9; overflow-wrap: anywhere; }
  .hero-summary { max-width: 100%; margin: 20px 0; font-size: 14px; }
  .agent-triptych { inset: 60px 0 190px; opacity: .82; }
  .portrait:nth-child(2), .portrait:nth-child(2) img { transform: none; }
  .portrait-label { display: none; }
  .hero-actions { flex-wrap: wrap; }
  .button { min-height: 44px; }
  .section { padding: 80px 20px; }
  .section-heading { margin-bottom: 45px; }
  .section-heading h2, .governance-title h2 { font-size: 44px; }
  .system-section > *, .router-section > * { max-width: none; }
  .domain-nodes { grid-template-columns: 1fr; }
  .route-lines { display: none; }
  .pat-rail { margin-bottom: 24px; }
  .agent-tabs { overflow-x: auto; }
  .agent-tab { min-width: 120px; }
  .agent-detail { min-height: 0; grid-template-columns: 1fr; }
  .agent-detail-image { min-height: 470px; max-height: 530px; }
  .agent-detail-image::after { background: linear-gradient(0deg, var(--panel), transparent 35%); }
  .agent-detail-copy { padding: 30px 22px 42px; }
  .agent-detail-copy dl div { grid-template-columns: 1fr; gap: 6px; }
  .input-row { grid-template-columns: 1fr; }
  .input-row .button { min-height: 48px; }
  .route-output, #route-form, .sample-row { padding-left: 16px; padding-right: 16px; }
  .route-plan { grid-template-columns: 1fr; }
  .gate-strip { grid-column: auto; }
  .governance-grid article { padding-left: 54px; }
  footer { grid-template-columns: 1fr; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
