:root {
  --ink: #101820;
  --muted: #5b6873;
  --paper: #f4f7f8;
  --white: #fff;
  --cyan: #0db8d0;
  --teal: #007f78;
  --red: #d9303e;
  --amber: #f0a51a;
  --line: #cad5da;
  --dark: #111b24;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, "Segoe UI", Arial, sans-serif; letter-spacing: 0; }
button, input, select { font: inherit; letter-spacing: 0; }
a { color: inherit; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 99; padding: 10px 14px; background: var(--white); }
.skip-link:focus { top: 12px; }
.topbar { height: 72px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: var(--ink); color: white; font-weight: 800; }
.brand b, .brand small { display: block; }
.brand small { color: var(--muted); margin-top: 2px; }
nav { display: flex; gap: 28px; }
nav a { text-decoration: none; font-size: 14px; font-weight: 700; }
.repo-link { text-decoration: none; border-bottom: 2px solid var(--cyan); font-weight: 700; }
.hero { height: calc(100vh - 120px); min-height: 600px; max-height: 820px; display: grid; grid-template-columns: minmax(0, .95fr) minmax(420px, 1.05fr); background: var(--white); overflow: hidden; }
.hero-copy { padding: 30px 6vw; align-self: center; }
.eyebrow { margin: 0 0 18px; color: var(--teal); font-size: 13px; font-weight: 800; text-transform: uppercase; }
h1 { margin: 0; max-width: 680px; font-size: 56px; line-height: 1; font-weight: 780; }
.lede { max-width: 690px; margin: 20px 0; font-size: 17px; line-height: 1.5; color: var(--muted); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.button { min-height: 48px; padding: 13px 20px; display: inline-flex; align-items: center; text-decoration: none; font-weight: 800; border: 1px solid var(--ink); }
.button.primary { background: var(--ink); color: white; }
.button.secondary { background: white; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 680px; margin: 26px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.metrics div { border-right: 1px solid var(--line); padding-right: 16px; }
.metrics div + div { padding-left: 16px; }
.metrics div:last-child { border: 0; }
.metrics dt { font-size: 24px; font-weight: 800; }
.metrics dd { margin: 4px 0 0; font-size: 12px; color: var(--muted); text-transform: uppercase; }
.hero-visual { min-height: 650px; position: relative; background: #9bdcf2; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; display: block; }
.hero-status { position: absolute; right: 22px; bottom: 22px; padding: 12px 16px; background: rgba(12,24,33,.88); color: white; font-size: 13px; font-weight: 700; backdrop-filter: blur(12px); }
.hero-status span { display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: var(--red); border-radius: 50%; }
section:not(.hero) { padding: 90px 6vw; }
.section-head { max-width: 820px; margin-bottom: 36px; }
.section-head h2 { margin: 0; font-size: 48px; line-height: 1.05; }
.split-head { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.split-head > p { max-width: 520px; margin: 0; color: var(--muted); line-height: 1.6; }
.origin-band { background: var(--dark); color: white; }
.origin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #43505a; }
.origin { min-height: 280px; padding: 38px; background: var(--dark); position: relative; }
.origin.internal-origin { border-top: 5px solid var(--cyan); }
.origin.external-origin { border-top: 5px solid var(--amber); }
.origin-code { font: 700 12px ui-monospace, Consolas, monospace; color: #9fb2bf; }
.origin h3 { margin: 34px 0 14px; font-size: 30px; }
.origin p { max-width: 620px; color: #bfd0da; line-height: 1.65; }
.text-action { padding: 0 0 5px; border: 0; border-bottom: 2px solid currentColor; background: none; color: white; cursor: pointer; font-weight: 800; }
.registry-section { background: #e8eff1; }
.toolbar { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.toolbar label { display: block; padding: 10px 12px; background: white; border: 1px solid var(--line); }
.toolbar label span { display: block; margin-bottom: 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 800; }
.toolbar input, .toolbar select { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.registry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.skill-card { min-height: 280px; padding: 26px; background: white; border-top: 4px solid var(--cyan); display: flex; flex-direction: column; }
.skill-card.external { border-top-color: var(--amber); }
.skill-card.quarantined { border-top-color: var(--red); }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 700 11px ui-monospace, Consolas, monospace; color: var(--muted); text-transform: uppercase; }
.risk { padding: 4px 6px; background: #eef2f3; }
.risk.high, .risk.critical { color: #9d1622; background: #fde9eb; }
.skill-card h3 { margin: 26px 0 12px; font-size: 23px; }
.skill-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.card-footer { margin-top: auto; padding-top: 24px; display: flex; justify-content: space-between; align-items: end; gap: 14px; }
.state { font: 800 12px ui-monospace, Consolas, monospace; }
.execution { color: var(--red); font-size: 11px; text-transform: uppercase; font-weight: 800; text-align: right; }
.empty-state { grid-column: 1 / -1; padding: 50px; background: white; text-align: center; color: var(--muted); }
.team-section { background: white; }
.agent-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); }
.agent-tabs button { min-width: 130px; min-height: 52px; padding: 12px 18px; border: 0; border-bottom: 4px solid transparent; background: none; cursor: pointer; font-weight: 800; }
.agent-tabs button[aria-selected="true"] { color: var(--teal); border-color: var(--cyan); }
.agent-stage { display: grid; grid-template-columns: minmax(340px, .85fr) 1.15fr; min-height: 720px; background: var(--dark); color: white; }
.agent-image { min-height: 620px; overflow: hidden; }
.agent-image img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.agent-copy { padding: 72px; align-self: center; }
.agent-index { color: var(--cyan); font: 800 13px ui-monospace, Consolas, monospace; }
.agent-copy h3 { margin: 18px 0; font-size: 58px; line-height: 1; }
.agent-mission { color: #c2d0d8; font-size: 19px; line-height: 1.65; }
.agent-contract { margin-top: 38px; }
.agent-contract div { display: grid; grid-template-columns: 90px 1fr; gap: 20px; padding: 17px 0; border-top: 1px solid #394854; }
.agent-contract dt { color: #7dddeb; font-weight: 800; }
.agent-contract dd { margin: 0; color: #e7eff3; line-height: 1.45; }
.protocol-section { background: #edf4f5; }
.pipeline { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); list-style: none; counter-reset: step; border-top: 1px solid var(--ink); }
.pipeline li { min-height: 160px; padding: 24px 16px; border-right: 1px solid var(--line); counter-increment: step; }
.pipeline li::before { content: "0" counter(step); display: block; margin-bottom: 40px; color: var(--teal); font: 800 12px ui-monospace, Consolas, monospace; }
.pipeline b, .pipeline span { display: block; }
.pipeline span { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.gate-panel { margin-top: 28px; padding: 30px; background: var(--dark); color: white; display: grid; grid-template-columns: .8fr 1.2fr 1fr; gap: 28px; align-items: center; }
.gate-panel h3 { margin: 8px 0 0; font-size: 24px; }
.gate-panel code { padding: 16px; background: #1e2b35; color: #79e3ef; line-height: 1.55; white-space: normal; }
.gate-panel p { color: #bdcbd3; line-height: 1.55; }
.lock-icon { display: block; width: 22px; height: 18px; border: 3px solid var(--red); position: relative; }
.lock-icon::before { content: ""; position: absolute; width: 12px; height: 11px; left: 2px; top: -13px; border: 3px solid var(--red); border-bottom: 0; border-radius: 8px 8px 0 0; }
footer { min-height: 78px; padding: 24px 6vw; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #0b1218; color: #9eb0bb; font-size: 13px; }
@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .registry-grid { grid-template-columns: 1fr 1fr; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .gate-panel { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { height: 64px; }
  nav { display: none; }
  .brand small { display: none; }
  .hero { height: auto; min-height: auto; max-height: none; grid-template-columns: 1fr; }
  .hero-copy { padding: 54px 6vw 44px; }
  h1 { font-size: 46px; }
  .hero-visual { min-height: 560px; }
  .metrics { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .metrics div:nth-child(2) { border: 0; }
  section:not(.hero) { padding: 68px 5vw; }
  .split-head { display: block; }
  .split-head > p { margin-top: 18px; }
  .origin-grid, .registry-grid, .toolbar, .agent-stage { grid-template-columns: 1fr; }
  .agent-stage { min-height: auto; }
  .agent-image { min-height: 580px; }
  .section-head h2 { font-size: 38px; }
  .agent-copy { padding: 44px 7vw; }
  .agent-copy h3 { font-size: 42px; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipeline li { min-height: 140px; }
  footer { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
