:root {
  --ink: #171815;
  --muted: #757166;
  --faint: #9d978a;
  --paper: #f2eee4;
  --paper-2: #ebe5d8;
  --page: #f8f8f5;
  --line: #cec7b7;
  --line-dark: #2b2a25;
  --purple: #7771c8;
  --purple-pale: #d7d3ef;
  --blue: #75a3cc;
  --green: #7bbda8;
  --orange: #df9468;
  --yellow: #d5b55d;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--page); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; }
code, pre { font-family: var(--mono); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 86px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  padding: 0 4.5vw;
  border-bottom: 1px solid #deddd7;
  background: rgba(248,248,245,.93);
  backdrop-filter: blur(18px);
}
.brand { width: fit-content; display: flex; align-items: center; gap: 15px; text-decoration: none; }
.brand-mark { height: 34px; display: flex; align-items: end; gap: 4px; padding: 2px; }
.brand-mark i { display: block; width: 9px; border: 1px solid var(--ink); border-radius: 1px; background: var(--paper); }
.brand-mark i:nth-child(1) { height: 17px; }
.brand-mark i:nth-child(2) { height: 32px; background: var(--purple); }
.brand-mark i:nth-child(3) { height: 24px; background: var(--green); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 20px; line-height: 1.05; letter-spacing: -.035em; }
.brand small { margin-top: 5px; color: var(--muted); font-family: var(--mono); font-size: 8.5px; letter-spacing: .11em; }
.site-header nav { display: flex; gap: 26px; }
.site-header nav a { color: var(--muted); font-family: var(--mono); font-size: 9px; text-decoration: none; }
.site-header nav a:hover { color: var(--ink); }
.header-cta { justify-self: end; padding: 9px 13px; border: 1px solid var(--line-dark); border-radius: 20px; font-family: var(--mono); font-size: 9px; text-decoration: none; box-shadow: 2px 2px 0 var(--line-dark); }
.header-cta:hover { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--line-dark); }

main { padding: 0 4.5vw 80px; }
.hero { max-width: 1180px; margin: 0 auto; padding: clamp(72px,9vw,118px) 0 54px; text-align: center; }
.hero-kicker { display: flex; justify-content: center; align-items: center; gap: 8px; color: var(--muted); font-family: var(--mono); font-size: 9px; letter-spacing: .09em; }
.status-light { width: 8px; height: 8px; display: inline-block; border: 1px solid var(--ink); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(123,189,168,.18); }
.hero h1 { margin: 22px 0 8px; font-size: clamp(46px,6.2vw,84px); line-height: .96; letter-spacing: -.065em; }
.hero h1 em { color: var(--purple); font-style: normal; }
.hero-copy { max-width: 760px; margin: 22px auto 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.hero-copy code { padding: 2px 5px; border-radius: 4px; color: var(--ink); background: var(--paper-2); font-size: .88em; }
.hero-stats { width: fit-content; max-width: 100%; margin: 33px auto 0; display: flex; flex-wrap: wrap; justify-content: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.hero-stats span { padding: 11px 14px; border-right: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 9px; }
.hero-stats span:last-child { border-right: 0; }
.hero-stats b { color: var(--ink); }

.manifest-shell { max-width: 1180px; margin: 0 auto; overflow: hidden; border: 1px solid #bbb4a5; border-radius: 24px; background: var(--paper); box-shadow: 0 22px 60px rgba(35,31,22,.09), 0 2px 0 #fff inset; }
.window-bar { min-height: 43px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 19px; border-bottom: 1px solid var(--line); color: var(--faint); background: #e7e2d6; font-family: var(--mono); font-size: 8px; }
.window-bar > span:last-child { justify-self: end; }
.window-dots { display: flex; gap: 6px; }
.window-dots i { width: 8px; height: 8px; border: 1px solid var(--ink); border-radius: 50%; background: var(--orange); }
.window-dots i:nth-child(2) { background: var(--yellow); }
.window-dots i:nth-child(3) { background: var(--green); }
.manifest-header { padding: 30px 48px 18px; text-align: center; }
.manifest-title { display: flex; align-items: center; justify-content: center; gap: 15px; }
.manifest-title > span { font-size: 32px; line-height: 1; }
.manifest-title h2 { margin: 0; font-size: clamp(25px,3.7vw,45px); line-height: 1; letter-spacing: -.045em; }
.manifest-header p { margin: 9px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 13px; font-style: italic; }
.manifest-rule { height: 2px; margin: 0 48px 33px; background: var(--line-dark); }
.section-label { display: flex; align-items: center; gap: 10px; color: var(--faint); font-family: var(--mono); font-size: 8px; letter-spacing: .09em; }
.section-label > span { color: var(--faint); }

.routing-block, .specialists, .operations { margin: 0 48px; }
.routing-block { padding-bottom: 31px; border-bottom: 1px solid var(--line); }
.routing-row { display: grid; grid-template-columns: 40px minmax(230px,.8fr) minmax(280px,1.2fr) auto; align-items: center; gap: 14px; margin-top: 14px; }
.route-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; color: #fff; background: var(--purple); box-shadow: 2px 2px 0 var(--ink); font-family: var(--mono); font-size: 18px; }
.folder-icon { position: relative; width: 22px; height: 14px; display: inline-block; border: 1.5px solid var(--ink); background: var(--yellow); }
.folder-icon::before { content: ""; position: absolute; left: 1px; top: -5px; width: 9px; height: 5px; border: 1.5px solid var(--ink); border-bottom: 0; background: var(--yellow); }
.folder-icon.small { transform: scale(.78); transform-origin: left center; }
.routing-name h3 { margin: 0 0 7px; font-size: 16px; }
.routing-name code { color: var(--muted); font-size: 8px; }
.routing-row > p { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 9px; line-height: 1.65; }
.runtime-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--ink); border-radius: 20px; background: #f9f5eb; box-shadow: 2px 2px 0 var(--ink); font-family: var(--mono); font-size: 8px; white-space: nowrap; }
.runtime-chip i { width: 7px; height: 7px; border: 1px solid var(--ink); border-radius: 50%; background: var(--purple); }
.runtime-chip.amber i { background: var(--orange); }
.file-guide { display: grid; grid-template-columns: 150px 1fr 1fr; gap: 12px; margin: 22px 0 0 54px; padding: 14px; border: 1px solid var(--line); border-left: 3px solid var(--purple); background: rgba(255,255,255,.38); }
.file-guide strong { font-size: 11px; }
.file-guide > div { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 8px; }
.file-guide code { padding: 3px 6px; border: 1px solid var(--ink); border-radius: 3px; background: #fff; font-size: 8px; font-weight: 700; }
.file-guide span { color: var(--muted); font-size: 9px; line-height: 1.5; }

.specialists { padding: 31px 0; border-bottom: 1px solid var(--line); }
.specialist-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 18px; }
.specialist-head h3 { display: flex; align-items: center; gap: 5px; margin: 13px 0 0; font-family: var(--mono); font-size: 14px; }
.manifest-actions { display: flex; align-items: center; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 5px; }
.filter, .expand-button { border: 1px solid var(--line-dark); border-radius: 18px; color: var(--ink); background: transparent; font-family: var(--mono); font-size: 8px; cursor: pointer; }
.filter { padding: 6px 9px; }
.filter:hover, .filter.active { color: #fff; background: var(--ink); }
.expand-button { padding: 7px 10px; background: #fff; box-shadow: 2px 2px 0 var(--line-dark); }
.expand-button:hover { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--line-dark); }
.column-head { display: grid; grid-template-columns: minmax(280px,.95fr) 1fr 84px; gap: 18px; padding: 8px 42px 8px 62px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--faint); font-family: var(--mono); font-size: 7px; letter-spacing: .1em; }
.column-head span:last-child { text-align: right; }
.agent-list { position: relative; }
.agent-list::before { content: ""; position: absolute; z-index: 0; top: 0; bottom: 0; left: 35px; width: 1px; background: var(--line); }
.agent-node { position: relative; border-bottom: 1px solid var(--line); }
.agent-node:last-child { border-bottom: 0; }
.agent-node[hidden] { display: none; }
.agent-node summary { position: relative; z-index: 1; min-height: 58px; display: grid; grid-template-columns: 35px minmax(280px,.95fr) 1fr auto 16px; align-items: center; gap: 14px; padding: 9px 2px 9px 0; list-style: none; cursor: pointer; }
.agent-node summary::-webkit-details-marker { display: none; }
.agent-node summary:hover { background: rgba(255,255,255,.31); }
.agent-node[open] summary { background: rgba(117,163,204,.1); }
.node-index { position: relative; z-index: 2; color: var(--faint); background: var(--paper); font-family: var(--mono); font-size: 7px; }
.node-file { min-width: 0; display: flex; align-items: center; gap: 10px; }
.node-file code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 5px; border: 1px solid transparent; border-radius: 3px; font-size: 10px; font-weight: 700; }
.agent-node[open] .node-file code { border-color: var(--ink); background: #d5e1ed; box-shadow: 2px 2px 0 var(--ink); }
.file-icon, .doc-icon { position: relative; flex: 0 0 auto; width: 13px; height: 16px; display: inline-block; border: 1.4px solid var(--ink); background: #f9f6ed; }
.file-icon::after, .doc-icon::after { content: ""; position: absolute; top: -1px; right: -1px; width: 5px; height: 5px; border-left: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: var(--paper); }
.node-description { color: var(--muted); font-family: var(--mono); font-size: 8.5px; line-height: 1.55; }
.node-state { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--ink); border-radius: 16px; background: #f9f5eb; box-shadow: 2px 2px 0 var(--ink); font-family: var(--mono); font-size: 7px; }
.node-state i { width: 7px; height: 7px; border: 1px solid var(--ink); border-radius: 50%; background: var(--green); }
.node-state.new i { background: var(--blue); }
.node-toggle { font-size: 18px; transition: transform .16s ease; }
.agent-node[open] .node-toggle { transform: rotate(180deg); }
.node-contract { margin: 0 19px 16px 35px; padding: 13px 15px 15px 26px; border-left: 1px solid var(--line); background: rgba(255,255,255,.38); }
.skill-binding { display: grid; grid-template-columns: 22px 14px 1fr auto; align-items: center; gap: 9px; }
.branch { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.skill-binding code { min-width: 0; overflow: hidden; color: var(--muted); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
.skill-binding code b { color: var(--ink); }
.skill-name { padding: 5px 8px; border: 1px solid var(--purple); border-radius: 18px; color: #443f88; background: #ece9fb; font-family: var(--mono); font-size: 8px; }
.contract-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 13px 0 0 45px; }
.contract-grid > div { padding: 10px 11px; border-top: 1px solid var(--line); }
.contract-grid small { color: var(--faint); font-family: var(--mono); font-size: 7px; letter-spacing: .09em; }
.contract-grid p { margin: 7px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }

.operations { padding: 31px 0 10px; }
.operations-tree { margin-top: 16px; }
.operation-row { min-height: 46px; display: grid; grid-template-columns: 28px 180px 1fr auto; align-items: center; gap: 10px; }
.operation-row code { font-size: 11px; font-weight: 700; }
.operation-row p, .operation-child p { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 8.5px; }
.operation-child { min-height: 36px; display: grid; grid-template-columns: 28px 14px 230px 1fr; align-items: center; gap: 10px; margin-left: 9px; }
.operation-child > span { color: var(--faint); font-family: var(--mono); }
.operation-child code { font-size: 9px; }
.runtime-summary { margin: 32px 48px 0; display: grid; grid-template-columns: repeat(4,auto) 1fr; align-items: center; gap: 18px; padding: 17px 18px; border: 1px solid var(--ink); border-radius: 10px; box-shadow: 3px 3px 0 var(--ink); font-family: var(--mono); }
.runtime-summary > div { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.runtime-summary b { color: var(--ink); }
.summary-line { justify-content: flex-end; }
.summary-line span, .summary-line i { display: block; height: 7px; border-radius: 4px; }
.summary-line span { width: 36%; background: var(--purple); }
.summary-line i:nth-child(2) { width: 18%; background: var(--blue); }
.summary-line i:nth-child(3) { width: 25%; background: var(--orange); }
.summary-line i:nth-child(4) { width: 12%; background: var(--line); }
.runtime-summary small { grid-column: 1 / -1; color: var(--faint); font-size: 7px; }
.system-flow { max-width: 1180px; margin: 64px auto 0; display: grid; grid-template-columns: .72fr 1.28fr; align-items: center; gap: 5vw; padding: clamp(34px,5vw,68px); border-radius: 20px; color: #fff; background: #1b1c19; box-shadow: 0 20px 50px rgba(23,24,21,.13); }
.section-label.light { color: #a9a69c; }
.system-flow h2 { margin: 15px 0; font-size: clamp(34px,4.2vw,56px); line-height: .98; letter-spacing: -.055em; }
.system-flow > div > p { margin: 0; color: #bdb9ae; font-size: 12px; line-height: 1.75; }
.flow-steps { display: grid; grid-template-columns: repeat(3,1fr 14px) 1fr; align-items: stretch; gap: 7px; }
.flow-steps > div { min-height: 154px; display: flex; flex-direction: column; padding: 15px; border: 1px solid #4a4942; border-radius: 9px; background: #11120f; }
.flow-steps > div > span { color: var(--green); font-family: var(--mono); font-size: 8px; }
.flow-steps b { margin-top: auto; font-size: 11px; }
.flow-steps small { margin-top: 7px; color: #8f8c82; font-size: 8px; line-height: 1.55; }
.flow-steps > i { align-self: center; color: var(--orange); font-family: var(--mono); font-style: normal; }

footer { display: flex; justify-content: space-between; gap: 40px; padding: 28px 4.5vw; border-top: 1px solid #deddd7; color: var(--muted); background: #fff; font-size: 9px; line-height: 1.6; }
footer p { max-width: 820px; margin: 0; }
footer a { flex: 0 0 auto; color: var(--ink); font-family: var(--mono); text-decoration: none; }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header nav { display: none; }
  .routing-row { grid-template-columns: 40px 1fr auto; }
  .routing-row > p { grid-column: 2 / -1; }
  .file-guide { grid-template-columns: 1fr 1fr; }
  .file-guide > strong { grid-column: 1 / -1; }
  .specialist-head { align-items: flex-start; flex-direction: column; }
  .manifest-actions { width: 100%; justify-content: space-between; }
  .column-head { display: none; }
  .agent-node summary { grid-template-columns: 35px minmax(240px,.9fr) 1fr auto 16px; }
  .runtime-summary { grid-template-columns: repeat(2,1fr); }
  .summary-line { grid-column: 1 / -1; }
  .system-flow { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header { min-height: 70px; padding: 0 18px; }
  .brand { gap: 10px; }
  .brand-mark { height: 27px; }
  .brand-mark i { width: 7px; }
  .brand-mark i:nth-child(1) { height: 13px; }
  .brand-mark i:nth-child(2) { height: 25px; }
  .brand-mark i:nth-child(3) { height: 19px; }
  .brand strong { font-size: 14px; }
  .brand small { display: none; }
  .header-cta { padding: 8px 10px; }
  main { padding: 0 10px 50px; }
  .hero { padding: 58px 10px 38px; }
  .hero h1 { font-size: clamp(44px,13vw,64px); }
  .hero-copy { font-size: 12px; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-stats span { border-bottom: 1px solid var(--line); }
  .hero-stats span:nth-child(2) { border-right: 0; }
  .manifest-shell { border-radius: 16px; }
  .window-bar { grid-template-columns: 1fr auto; }
  .window-bar code { display: none; }
  .manifest-header { padding: 26px 18px 15px; }
  .manifest-title { gap: 8px; }
  .manifest-title > span { font-size: 20px; }
  .manifest-rule { margin: 0 18px 26px; }
  .routing-block, .specialists, .operations { margin-left: 18px; margin-right: 18px; }
  .routing-row { grid-template-columns: 40px 1fr; }
  .routing-row .runtime-chip { grid-column: 2; width: fit-content; }
  .routing-row > p { grid-column: 2; }
  .file-guide { grid-template-columns: 1fr; margin-left: 0; }
  .file-guide > strong { grid-column: 1; }
  .manifest-actions { align-items: flex-start; flex-direction: column; }
  .filters { gap: 4px; }
  .agent-list::before { left: 25px; }
  .agent-node summary { grid-template-columns: 25px minmax(0,1fr) auto 14px; gap: 8px; padding: 10px 0; }
  .node-description { display: none; }
  .node-file code { font-size: 8.5px; }
  .node-state { padding: 4px 6px; font-size: 0; }
  .node-contract { margin-left: 25px; margin-right: 0; padding-left: 12px; }
  .skill-binding { grid-template-columns: 18px 14px minmax(0,1fr); }
  .skill-name { grid-column: 3; width: fit-content; }
  .contract-grid { grid-template-columns: 1fr; margin-left: 0; }
  .operation-row { grid-template-columns: 25px 1fr auto; }
  .operation-row p { grid-column: 2 / -1; }
  .operation-child { grid-template-columns: 20px 14px 1fr; }
  .operation-child p { grid-column: 3; }
  .runtime-summary { margin-left: 18px; margin-right: 18px; grid-template-columns: 1fr; }
  .summary-line { grid-column: 1; }
  .system-flow { margin-top: 38px; padding: 32px 20px; }
  .flow-steps { grid-template-columns: 1fr; }
  .flow-steps > i { transform: rotate(90deg); }
  .flow-steps > div { min-height: 126px; }
  footer { flex-direction: column; padding: 24px 20px; }
}

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