:root {
  --paper: #f3f2ec;
  --surface: #fbfaf6;
  --ink: #182019;
  --muted: #5e675e;
  --line: #bdc4ba;
  --green: #285f35;
  --green-soft: #e2eadf;
  --orange: #dc5833;
  --dark: #182019;
  --dark-muted: #bfc9c0;
  --page-pad: max(5vw, calc((100vw - 1240px) / 2));
  --sans: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --serif: Charter, "Bitstream Charter", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); }
a { color: inherit; text-underline-offset: 5px; }
a:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
code, pre { font-family: var(--mono); }
.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 13px; transform: translateY(-150%); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; }
.skip-link:focus { transform: translateY(0); }

.topbar {
  min-height: 72px;
  padding: 18px var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 700; text-decoration: none; }
.brand span { width: 10px; height: 10px; background: var(--orange); }
.topbar nav, footer nav { display: flex; gap: 28px; font-size: 12px; }
.dark-topbar { background: var(--dark); color: white; border-color: #3e4940; }

.hero, .problem, .how, .runtimes, .authority-callout, .closing,
.authority-hero, .agent-problem, .capability-how, .use-cases, .surfaces,
.teams, .team-access, .session-example {
  padding-left: var(--page-pad);
  padding-right: var(--page-pad);
}
.hero {
  min-height: 700px;
  padding-top: 82px;
  padding-bottom: 88px;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(520px, 1.05fr);
  gap: 5vw;
  align-items: center;
}
.home-hero { background: var(--dark); color: white; }
.home-hero .lede, .home-hero .runtime-map figcaption { color: var(--dark-muted); }
.home-hero .runtime-map svg { border-color: #465047; }
h1 { max-width: 740px; margin: 0; font-size: clamp(42px, 4.2vw, 60px); font-weight: 600; line-height: 1.02; letter-spacing: -.055em; }
h2 { max-width: 820px; margin: 0; font-size: clamp(31px, 3.25vw, 46px); font-weight: 600; line-height: 1.08; letter-spacing: -.045em; }
h3 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.02em; }
.lede { max-width: 680px; margin: 28px 0; color: var(--muted); font: 19px/1.58 var(--serif); }
.hero-actions { display: flex; align-items: center; gap: 26px; font-size: 13px; }
.button { display: inline-block; padding: 14px 17px; background: var(--green); color: white; font-size: 13px; font-weight: 700; text-decoration: none; }
.button:hover { background: var(--ink); }
.button.light { background: var(--surface); color: var(--ink); white-space: nowrap; }
.button.orange { background: var(--orange); }

.runtime-map, .authority-map { min-width: 0; margin: 0; }
.runtime-map svg, .authority-map svg { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.runtime-map figcaption, .authority-map figcaption { margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.map-field { fill: url(#paper-grid); }
.grid-line { fill: none; stroke: #e6e4dd; stroke-width: 1; }
.workspace-box, .agent-box, .application-box, .environment-values { fill: var(--surface); stroke: #9da79d; stroke-width: 1.2; }
.agent-box { fill: #f8f5ef; }
.environment-box { fill: var(--green-soft); fill-opacity: .72; stroke: #7f9a83; stroke-width: 1.4; }
.application-box { stroke: #6f8d74; }
.environment-values { fill: #edf2e9; stroke: #9bae9c; }
.map-label, .safe-label, .environment-label, .vault-label { font: 700 10px var(--mono); letter-spacing: .08em; }
.map-label { fill: #667067; }
.safe-label, .environment-label { fill: var(--green); }
.map-heading { fill: var(--ink); font: 700 16px var(--sans); }
.map-heading.small { font-size: 14px; }
.map-copy, .environment-copy { fill: var(--muted); font: 13px var(--serif); }
.map-code, .runtime-key, .runtime-value { font: 12px var(--mono); }
.map-code, .runtime-key { fill: var(--ink); }
.map-code.muted { fill: var(--muted); }
.runtime-key { font-weight: 700; }
.runtime-value { fill: var(--green); }
.map-rule { stroke: var(--line); }
.agent-dot { fill: var(--orange); }
.app-dot { fill: var(--green); }
.kimen-halo { fill: none; stroke: #76977d; stroke-width: 1.2; }
.kimen-halo.outer { opacity: .35; }
.kimen-halo.inner { opacity: .7; }
.kimen-core { fill: var(--green); }
.seed { fill: var(--orange); }
.kimen-name { fill: white; font: 700 17px var(--sans); text-anchor: middle; }
.kimen-action { fill: #dce8dd; font: 11px var(--serif); text-anchor: middle; }
.vault-box { fill: var(--dark); }
.vault-label { fill: #bdc9be; }
.vault-value { fill: white; font: 15px var(--mono); letter-spacing: .08em; }
.vault-line { fill: none; stroke: var(--green); stroke-width: 2; }
.map-arrow { fill: none; stroke: var(--orange); stroke-width: 2; }
.arrow-head { fill: var(--orange); }

.problem, .how, .runtimes, .closing,
.agent-problem, .capability-how, .use-cases, .surfaces, .teams, .team-access {
  padding-top: 96px;
  padding-bottom: 102px;
}
.problem, .agent-problem { background: var(--green-soft); }
.how, .closing, .capability-how, .surfaces { background: var(--surface); }
.section-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 9vw; align-items: end; margin-bottom: 58px; }
.section-head > p { max-width: 500px; margin: 0; color: var(--muted); font: 17px/1.6 var(--serif); }

.plain-flow { display: grid; grid-template-columns: 1fr 42px 1fr 42px 1fr; align-items: stretch; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.plain-flow article { padding: 30px 26px 32px 0; }
.plain-flow article + span + article { padding-left: 26px; }
.plain-flow > span { align-self: center; text-align: center; color: var(--orange); font-size: 23px; }
.plain-flow p { margin: 16px 0 0; color: var(--muted); font-size: 14px; line-height: 1.58; }

.code-story { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.code-story article { min-width: 0; padding: 32px 34px 36px 0; }
.code-story article + article { padding-left: 34px; border-left: 1px solid var(--line); }
.code-story p { min-height: 70px; color: var(--muted); font-size: 13px; line-height: 1.58; }
.terminal { margin: 24px 0 0; background: var(--dark); color: white; }
.terminal figcaption { padding: 13px 17px 0; color: #91a495; font: 9px/1.4 var(--mono); text-transform: uppercase; }
.terminal pre { min-height: 63px; margin: 0; padding: 9px 17px 15px; font-size: 10px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.session-line { margin-top: 28px; padding: 20px 0; display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center; border-bottom: 1px solid var(--line); }
.session-line div { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.session-line span { color: var(--muted); }
.session-line code { padding: 8px 10px; background: #e9ebe5; font-size: 10px; }

.runtime-examples { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); }
.runtime-examples article { display: grid; gap: 15px; padding: 28px 30px 30px 0; border-bottom: 1px solid var(--line); }
.runtime-examples article:nth-child(even) { padding-left: 30px; border-left: 1px solid var(--line); }
.runtime-examples code { color: var(--green); font-size: 12px; }
.boundary-note { max-width: 790px; margin: 30px 0 0; padding-left: 18px; border-left: 3px solid var(--orange); color: var(--muted); font: 15px/1.6 var(--serif); }

.authority-callout { min-height: 320px; padding-top: 72px; padding-bottom: 74px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7vw; align-items: center; background: var(--green); color: white; }
.authority-callout h2 { max-width: 770px; }
.authority-callout p { max-width: 730px; margin: 22px 0 0; color: #d4e0d5; font: 17px/1.6 var(--serif); }
.closing > p, .team-access > p { max-width: 680px; margin: 25px 0 30px; color: var(--muted); font: 18px/1.6 var(--serif); }

footer { min-height: 145px; padding: 34px var(--page-pad); display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 35px; align-items: start; border-top: 1px solid var(--line); }
footer p { max-width: 430px; margin: 0; color: var(--muted); font: 13px/1.55 var(--serif); }
footer nav { justify-content: flex-end; flex-wrap: wrap; }
.footer-company { grid-column: 1 / -1; max-width: none; font: 11px/1.5 var(--mono); }

/* Agent authority */
.authority-page { background: var(--dark); color: white; }
.authority-hero { min-height: 700px; padding-top: 86px; padding-bottom: 92px; display: grid; grid-template-columns: minmax(0, .86fr) minmax(520px, 1.14fr); gap: 6vw; align-items: center; }
.authority-hero .lede { color: var(--dark-muted); }
.handoff-map {
  min-width: 0;
  margin: 0;
  padding: 38px 30px 25px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px minmax(0, 1fr);
  align-items: center;
  background-color: #202a22;
  background-image: linear-gradient(#29352c 1px, transparent 1px), linear-gradient(90deg, #29352c 1px, transparent 1px);
  background-size: 36px 36px;
  border: 1px solid #465047;
}
.handoff-agent, .handoff-human {
  min-height: 266px;
  padding: 28px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid #8d988e;
}
.handoff-label { color: var(--muted); font: 700 9px var(--mono); letter-spacing: .08em; }
.handoff-agent strong, .handoff-human strong { display: block; margin-top: 34px; font-size: 21px; letter-spacing: -.025em; }
.handoff-agent ul { margin: 29px 0 0; padding: 0; list-style: none; }
.handoff-agent li { padding: 9px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.handoff-agent li::before { content: "\2713"; margin-right: 9px; color: var(--green); font-weight: 700; }
.credential-wall {
  position: relative;
  z-index: 1;
  padding: 19px 12px 20px;
  background: var(--orange);
  color: white;
  text-align: center;
}
.credential-wall::before, .credential-wall::after { content: ""; position: absolute; top: 50%; z-index: -1; width: 18px; border-top: 2px solid var(--orange); }
.credential-wall::before { right: 100%; }
.credential-wall::after { left: 100%; }
.credential-wall span, .credential-wall small { display: block; }
.credential-wall span { font: 700 8px var(--mono); letter-spacing: .09em; }
.credential-wall code { display: block; margin: 9px 0; font: 700 11px var(--mono); overflow-wrap: anywhere; }
.credential-wall small { color: #ffe2d9; font: 9px/1.45 var(--mono); }
.handoff-human p { margin: 27px 0 0; color: var(--muted); font: 14px/1.75 var(--serif); }
.handoff-map figcaption { grid-column: 1 / -1; margin-top: 23px; color: #aeb9af; font-size: 11px; line-height: 1.55; }

.agent-problem, .capability-how, .use-cases, .surfaces, .teams, .team-access, .session-example { color: var(--ink); }
.session-example { padding-top: 88px; padding-bottom: 94px; background: var(--surface); }
.solution-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1000px; margin: 0 0 46px; border: 1px solid var(--line); }
.solution-pair > div { padding: 25px 27px 27px; background: #f1f6ee; box-shadow: inset 5px 0 0 var(--green); }
.solution-pair > div + div { border-left: 1px solid var(--line); background: #f7f1eb; box-shadow: inset 5px 0 0 var(--orange); }
.solution-pair span { display: block; margin-bottom: 13px; color: var(--muted); font: 700 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.solution-pair code { color: var(--ink); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.session-heading { max-width: 720px; margin: 0 0 22px; font-size: 20px; }
.session-terminal { max-width: 800px; margin: 0; background: var(--dark); color: white; }
.session-terminal figcaption { padding: 14px 18px 0; color: #91a495; font: 9px/1.4 var(--mono); text-transform: uppercase; }
.session-terminal pre { margin: 0; padding: 12px 18px 20px; overflow-x: auto; font-size: 12px; line-height: 1.75; }
.session-terminal .prompt { color: var(--orange); }
.session-permissions { display: grid; grid-template-columns: repeat(2, 1fr); max-width: 1000px; margin-top: 28px; border: 1px solid var(--line); }
.session-permissions article { padding: 28px; background: #f4f7f1; box-shadow: inset 4px 0 0 var(--green); }
.session-permissions article + article { border-left: 1px solid var(--line); background: #f6f2ec; box-shadow: inset 4px 0 0 var(--orange); }
.session-permissions code { display: block; margin-top: 15px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.comparison { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid #94a196; }
.comparison article { padding: 36px; }
.comparison article + article { border-left: 1px solid #94a196; }
.comparison-broad { background: #f0eee8; }
.comparison-bounded { background: var(--surface); box-shadow: inset 5px 0 0 var(--green); }
.comparison p { color: var(--muted); font: 15px/1.55 var(--serif); }
.comparison ul, .plans ul { margin: 24px 0 0; padding: 0; list-style: none; }
.comparison li, .plans li { padding: 9px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.contract-grid { display: grid; grid-template-columns: 1fr 120px 1fr; align-items: stretch; }
.contract-grid article { padding: 34px; border: 1px solid var(--line); }
.contract-grid p { color: var(--muted); font: 15px/1.58 var(--serif); }
.contract-grid p + p { padding-top: 18px; border-top: 1px solid var(--line); }
.contract-seed { display: grid; place-items: center; position: relative; }
.contract-seed::before, .contract-seed::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--green); }
.contract-seed span { position: relative; z-index: 1; width: 18px; height: 18px; background: var(--orange); box-shadow: 0 0 0 15px var(--surface); }
.contract-result { max-width: 760px; margin: 36px auto 0; color: var(--green); font: 600 20px/1.5 var(--serif); text-align: center; }

.use-cases, .teams { background: var(--paper); }
.use-case-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.use-case-grid article { padding: 30px 28px 32px 0; }
.use-case-grid article + article { padding-left: 28px; border-left: 1px solid var(--line); }
.use-case-grid p { min-height: 68px; color: var(--muted); font: 14px/1.58 var(--serif); }
.use-case-grid dl { margin: 24px 0 0; }
.use-case-grid dt { margin-top: 15px; color: var(--green); font: 700 9px var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.use-case-grid dd { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.use-case-grid h3 code { font-size: .82em; overflow-wrap: anywhere; }

.surface-map { display: grid; grid-template-columns: 1fr 220px 1fr; gap: 70px; align-items: stretch; }
.surface-callers, .surface-targets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.surface-map span { display: grid; place-items: center; min-height: 72px; padding: 12px; border: 1px solid var(--line); color: var(--muted); font: 11px var(--mono); text-align: center; }
.surface-kimen { display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; min-height: 154px; background: var(--green); color: white; }
.surface-kimen::before, .surface-kimen::after { content: ""; position: absolute; top: 50%; width: 70px; border-top: 2px solid var(--orange); }
.surface-kimen::before { right: 100%; }
.surface-kimen::after { left: 100%; }
.surface-kimen i { width: 12px; height: 12px; margin-bottom: 13px; background: var(--orange); }
.surface-kimen strong { font-size: 20px; }
.surface-kimen small { margin-top: 8px; color: #d4e0d5; font: 9px var(--mono); }

.team-features { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.team-features article { padding: 27px 25px 30px 0; border-bottom: 1px solid var(--line); }
.team-features article + article { padding-left: 25px; border-left: 1px solid var(--line); }
.team-features p { color: var(--muted); font-size: 13px; line-height: 1.58; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 74px; border: 1px solid var(--line); background: var(--surface); }
.plans article { padding: 31px; }
.plans article + article { border-left: 1px solid var(--line); }
.plans .featured-plan { box-shadow: inset 0 5px 0 var(--orange); }
.plans .price { min-height: 48px; margin: 22px 0 7px; font-size: 28px; font-weight: 650; }
.plans .price small { font-size: 11px; font-weight: 500; color: var(--muted); }
.plans article > p:not(.price) { color: var(--muted); font: 14px var(--serif); }
.plans a { display: inline-block; margin-top: 27px; color: var(--green); font-size: 13px; font-weight: 700; }

.team-access { background: var(--green); color: white; }
.team-access > p { color: #d4e0d5; }
.access-prompts { display: flex; flex-wrap: wrap; gap: 9px; }
.access-prompts span { padding: 11px 13px; border: 1px solid #7ea086; color: #e0e9e1; font: 11px var(--mono); }
.dark-footer { background: var(--dark); color: white; border-color: #3e4940; }
.dark-footer p { color: var(--dark-muted); }

@media (max-width: 1060px) {
  .hero, .authority-hero { grid-template-columns: 1fr; }
  .runtime-map, .handoff-map { max-width: 760px; margin-top: 20px; }
  .team-features { grid-template-columns: repeat(2, 1fr); }
  .team-features article:nth-child(3) { border-left: 0; }
}

@media (max-width: 900px) {
  .topbar nav a:not(:last-child) { display: none; }
  .section-head { grid-template-columns: 1fr; gap: 24px; align-items: start; }
  .code-story, .plans { grid-template-columns: 1fr; }
  .code-story article, .code-story article + article { padding: 28px 0; border-left: 0; }
  .code-story article + article { border-top: 1px solid var(--line); }
  .code-story p { min-height: 0; }
  .terminal { max-width: 620px; }
  .session-line { grid-template-columns: 1fr; gap: 12px; }
  .session-line code { justify-self: start; }
  .surface-map { grid-template-columns: 1fr; gap: 30px; }
  .surface-kimen::before, .surface-kimen::after { display: none; }
  .plans article + article { border-left: 0; border-top: 1px solid var(--line); }
  footer { grid-template-columns: 1fr 1fr; }
  footer p { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 700px) {
  .topbar { padding-left: 20px; padding-right: 20px; }
  .hero, .problem, .how, .runtimes, .authority-callout, .closing,
  .authority-hero, .agent-problem, .capability-how, .use-cases, .surfaces,
  .teams, .team-access, .session-example { padding-left: 20px; padding-right: 20px; }
  .hero, .authority-hero { min-height: 0; padding-top: 65px; padding-bottom: 72px; }
  h1 { font-size: clamp(36px, 10vw, 44px); }
  h2 { font-size: clamp(29px, 8vw, 38px); }
  .lede { font-size: 17px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .runtime-map { width: calc(100vw - 40px); overflow-x: auto; }
  .runtime-map svg { min-width: 650px; }
  .handoff-map { width: 100%; padding: 20px; grid-template-columns: 1fr; }
  .handoff-agent, .handoff-human { min-height: 0; }
  .credential-wall { margin: -1px 22px; }
  .credential-wall::before, .credential-wall::after { display: none; }
  .handoff-map figcaption { grid-column: auto; }
  .plain-flow, .runtime-examples, .comparison, .contract-grid, .use-case-grid, .team-features, .session-permissions { grid-template-columns: 1fr; }
  .plain-flow article, .plain-flow article + span + article { padding: 25px 0; }
  .plain-flow > span { transform: rotate(90deg); }
  .runtime-examples article, .runtime-examples article:nth-child(even), .comparison article, .comparison article + article, .contract-grid article, .use-case-grid article, .use-case-grid article + article, .team-features article, .team-features article + article { padding-left: 0; padding-right: 0; border-left: 0; }
  .runtime-examples article:nth-child(even), .comparison article + article, .use-case-grid article + article { border-top: 1px solid var(--line); }
  .solution-pair { grid-template-columns: 1fr; }
  .solution-pair > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .session-permissions article + article { border-left: 0; border-top: 1px solid var(--line); }
  .contract-seed { min-height: 80px; }
  .contract-seed::before, .contract-seed::after { left: 50%; right: auto; top: 0; bottom: 0; border-left: 1px solid var(--green); border-top: 0; }
  .use-case-grid p { min-height: 0; }
  .authority-callout { grid-template-columns: 1fr; }
  .team-features article:nth-child(3) { border-top: 0; }
  footer { display: block; padding: 30px 20px; }
  footer p, footer nav { margin-top: 25px; }
  footer nav { justify-content: flex-start; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
