:root {
  --black: #151919;
  --panel: #1d2222;
  --raised: #252b2b;
  --steel: #9b9e98;
  --rule: #434948;
  --paper: #eee9dc;
  --muted: #b9bbb4;
  --orange: #e4572e;
  --white: #f8f5ec;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--black); color: var(--white); font: 16px/1.55 var(--sans); }
a { color: inherit; }
button { font: inherit; }
.shell { width: min(1320px, calc(100% - 56px)); margin: auto; }
.eyebrow { color: var(--steel); font: 700 12px/1.2 var(--mono); letter-spacing: .15em; text-transform: uppercase; }
.signal { color: var(--orange); }
.rule-label { display: flex; align-items: center; gap: 12px; }
.rule-label::after { content: ""; height: 1px; background: var(--rule); flex: 1; }

.topbar { height: 72px; border-bottom: 1px solid var(--rule); background: rgb(21 25 25 / 94%); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.nav { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; font-size: 20px; font-weight: 700; text-decoration: none; }
.brand img { width: 31px; height: 31px; }
.navlinks { display: flex; gap: 24px; }
.navlinks a { color: var(--muted); font: 600 13px var(--mono); text-decoration: none; }
.navlinks a:hover, .navlinks a:focus-visible { color: var(--white); }
.github { border-left: 1px solid var(--rule); padding-left: 24px; }

.hero { min-height: calc(100vh - 72px); padding: 54px 0 36px; display: grid; grid-template-rows: auto 1fr auto; }
.hero-head { display: grid; grid-template-columns: 1.25fr .75fr; gap: 64px; align-items: end; }
.hero h1 { max-width: 900px; margin: 18px 0 22px; font-size: clamp(45px, 4.9vw, 72px); line-height: .98; letter-spacing: -.055em; text-wrap: balance; }
.hero h1 span { display: block; }
.hero h1 .signal { margin-top: .16em; }
.hero-copy { max-width: 760px; color: var(--muted); font-size: 18px; }
.hero-copy p { margin: 0; }
.hero-copy p + p { margin-top: 8px; }
.action-row { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.copy-primary, .text-link { min-height: 48px; }
.copy-primary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 18px; border: 0; background: var(--orange); color: var(--black); cursor: pointer; font: 700 13px var(--mono); text-decoration: none; }
.copy-primary:hover, .copy-primary.done { background: #f1673c; }
.copy-primary > span:last-child { border-left: 1px solid rgb(0 0 0 / 25%); padding-left: 16px; }
.text-link { display: inline-flex; align-items: center; padding: 0 16px; border: 1px solid var(--rule); font: 700 13px var(--mono); text-decoration: none; }
.text-link:hover { border-color: var(--steel); }
.live-terminal { min-width: 0; border: 1px solid var(--rule); background: #101414; box-shadow: 0 20px 60px rgb(0 0 0 / 22%); font-family: var(--mono); }
.live-terminal-head, .live-terminal-foot { display: flex; align-items: center; justify-content: space-between; color: var(--steel); font: 700 10px var(--mono); letter-spacing: .09em; }
.live-terminal-head { height: 38px; padding: 0 13px; border-bottom: 1px solid var(--rule); }
.live-terminal-head span:first-child { display: flex; align-items: center; gap: 8px; color: var(--white); }
.terminal-status { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgb(228 87 46 / 12%); animation: pulse 2s infinite; }
.live-terminal-body { height: 340px; padding: 17px 8px 14px 14px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; scroll-behavior: smooth; }
.live-terminal-body::-webkit-scrollbar { width: 4px; }
.live-terminal-body::-webkit-scrollbar-thumb { background: var(--rule); }
.live-terminal-stream { padding-right: 6px; }
.terminal-group { padding: 14px 0 16px; border-bottom: 1px solid #292f2f; }
.terminal-group:first-child { padding-top: 0; }
.terminal-group:last-child { padding-bottom: 0; border-bottom: 0; }
.controller-group { border-bottom-color: rgb(228 87 46 / 42%); }
.live-terminal-line { min-height: 22px; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; color: #d8dad4; font: 10.5px/1.65 var(--mono); opacity: 0; clip-path: inset(0 100% 0 0); }
.live-terminal-line b { color: var(--steel); font-size: 9.5px; letter-spacing: .04em; }
.live-terminal-line span { min-width: 0; overflow-wrap: anywhere; }
.live-terminal-line.is-visible { animation: terminal-reveal 420ms steps(8, end) forwards; }
.live-terminal-line.is-current::after { content: ""; width: 6px; height: 12px; margin: 2px 0 0 3px; display: inline-block; background: var(--orange); vertical-align: text-bottom; animation: cursor-blink .8s step-end infinite; }
.terminal-detail span { color: #8f9490; }
.terminal-outcome span { color: var(--white); }
.controller-group .live-terminal-line b, .terminal-results .live-terminal-line b { color: var(--orange); }
.terminal-response span { color: #ff7950; font-weight: 700; }
.terminal-response.denied span { color: #f0b4a4; }
.live-terminal-foot { min-height: 34px; padding: 8px 13px; border-top: 1px solid var(--rule); }
.live-terminal-foot span:last-child { color: var(--orange); }

.bench { position: relative; margin-top: 46px; border: 1px solid var(--rule); background: var(--panel); box-shadow: 0 24px 80px rgb(0 0 0 / 25%); }
.bench::before { content: "LIVE INTEGRATION BENCH · KIMI / SHELL-POLICY"; position: absolute; top: -25px; left: 0; color: var(--steel); font: 700 11px var(--mono); letter-spacing: .12em; }
.bench-top { height: 42px; padding: 0 16px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 9px; color: var(--steel); font: 700 11px var(--mono); }
.bench-top span:last-child { margin-left: auto; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgb(228 87 46 / 12%); animation: pulse 2s infinite; }
.flow { min-height: 310px; display: grid; grid-template-columns: .72fr 1fr 1.65fr; }
.module { padding: 24px; border-right: 1px solid var(--rule); }
.module:last-child { border: 0; }
.module-title { margin-bottom: 22px; color: var(--steel); font: 700 12px var(--mono); letter-spacing: .12em; }
.host-list { display: flex; flex-wrap: wrap; gap: 8px; }
.host-chip { padding: 7px 9px; border: 1px solid var(--rule); color: var(--muted); font: 600 12px var(--mono); }
.host-chip.live { position: relative; border-color: var(--orange); color: var(--white); }
.host-chip.live::before { content: ""; position: absolute; top: -1px; bottom: -1px; left: -1px; width: 3px; background: var(--orange); }
.adapter { height: calc(100% - 36px); display: grid; place-items: center; }
.pitot-core { position: relative; width: min(260px, 100%); padding: 22px; border: 1px solid var(--steel); background: #191d1d; }
.pitot-core::after { content: ""; position: absolute; inset: 8px; border: 1px dashed var(--rule); pointer-events: none; }
.core-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; font-size: 27px; font-weight: 700; }
.core-head img { width: 36px; }
.core-lines { position: relative; z-index: 1; margin-top: 22px; color: var(--muted); font: 12px/2 var(--mono); }
.channels { display: grid; grid-template-rows: auto 1fr 1fr; gap: 12px; }
.channels > .module-title { margin-bottom: 10px; }
.channel { position: relative; overflow: hidden; padding: 15px 17px; border: 1px solid var(--rule); display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: center; }
.channel::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--steel); }
.channel.control::before { background: var(--orange); }
.channel h2 { margin: 0; font: 700 13px var(--mono); letter-spacing: .08em; }
.channel p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.trace { color: #dadbd5; font: 12px/1.6 var(--mono); }
.trace .dim { color: #7f8582; }
.trace .hot { color: #ff7950; }
.decision-trace { display: inline-block; margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--rule); color: var(--white); }
.bench-foot { padding: 12px 16px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; color: var(--steel); font: 11px var(--mono); letter-spacing: .08em; }
.scroll-cue { margin-top: 24px; color: var(--steel); font: 11px var(--mono); }

section.content { padding: 100px 0; border-top: 1px solid var(--rule); }
.section-grid { display: grid; grid-template-columns: 320px 1fr; gap: 80px; }
.section-grid h2 { margin: 16px 0; font-size: 40px; line-height: 1.05; letter-spacing: -.04em; }
.section-grid .lead { max-width: 300px; color: var(--muted); font-size: 20px; }
.role-index { color: var(--orange); font: 700 12px var(--mono); }
.roles { border: 1px solid var(--rule); display: grid; grid-template-columns: 1fr 1fr; }
.role { min-height: 350px; padding: 30px; display: flex; flex-direction: column; }
.role + .role { border-left: 1px solid var(--rule); }
.role h3 { max-width: 350px; margin: 66px 0 14px; font-size: 28px; line-height: 1.1; letter-spacing: -.03em; }
.role p { max-width: 440px; margin: 0; color: var(--muted); font-size: 17px; }
.role-contract { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--steel); font: 700 11px var(--mono); letter-spacing: .08em; }
.controller-role { position: relative; background: var(--raised); }
.controller-role::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--orange); }

.build-section { background: #191d1d; }
.uses { border: 1px solid var(--rule); display: grid; grid-template-columns: repeat(6, 1fr); }
.use-card { min-height: 250px; padding: 25px; border-right: 1px solid var(--rule); grid-column: span 2; display: flex; flex-direction: column; }
.use-card:nth-child(3) { border-right: 0; }
.use-card:nth-child(n + 4) { grid-column: span 3; border-top: 1px solid var(--rule); }
.use-card:last-child { border-right: 0; }
.use-card > span { color: var(--orange); font: 700 11px var(--mono); }
.use-card h3 { margin: auto 0 12px; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; }
.use-card p { margin: 0; color: var(--muted); }

.interventions { border-block: 1px solid var(--rule); }
.intervention { min-height: 76px; padding: 18px 20px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 210px 36px 1fr; align-items: center; }
.intervention:last-child { border-bottom: 0; }
.intervention span { color: var(--steel); font: 700 12px var(--mono); letter-spacing: .08em; }
.intervention i { color: var(--steel); font-style: normal; }
.intervention p { margin: 0; font-size: 19px; }
.pitot-intervention { position: relative; background: var(--raised); }
.pitot-intervention::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--orange); }
.pitot-intervention span, .pitot-intervention i { color: var(--orange); }

.quickstart { background: var(--paper); color: #182224; }
.quickstart .eyebrow { color: #5e6665; }
.quickstart .section-grid .lead { color: #4e5859; }
.codebox { border: 1px solid #182224; background: #182224; color: var(--white); }
.code-row { min-height: 66px; padding: 18px 12px; border-bottom: 1px solid #3c4545; display: grid; grid-template-columns: 42px 1fr 72px; align-items: start; }
.code-row:last-child { border: 0; }
.num { color: #7d8582; font: 12px var(--mono); }
.code-row code { overflow-wrap: anywhere; font: 13px/1.6 var(--mono); white-space: pre-wrap; }
.copy-line { padding: 7px; border: 1px solid #4d5655; background: transparent; color: var(--muted); cursor: pointer; font: 700 11px var(--mono); }
.copy-line:hover, .copy-line.done { border-color: var(--orange); color: var(--white); }

.proof-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 80px; }
.proof h2 { margin: 18px 0 24px; font-size: clamp(38px, 5vw, 64px); line-height: 1; letter-spacing: -.05em; }
.proof .statement { max-width: 700px; color: var(--muted); font-size: 20px; }
.proof-path { max-width: 700px; margin: 18px 0; color: var(--white); font: 13px/1.7 var(--mono); }
.proof-contrast { color: var(--muted); font-size: 16px; }
.proof-contrast strong { color: var(--white); }
.loop { padding: 28px; border: 1px solid var(--rule); }
.loop-row { padding: 13px 0; border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 18px; }
.loop-row:last-child { border: 0; }
.loop-n { width: 24px; color: var(--orange); font: 700 11px var(--mono); }
.loop span:last-child { font: 13px var(--mono); }
.platforms { margin-top: 20px; color: var(--steel); font: 12px var(--mono); letter-spacing: .08em; }
.scope { padding-top: 70px; }
.scope-box { padding: 28px 0; border-block: 1px solid var(--rule); display: flex; align-items: flex-start; gap: 30px; }
.scope-box b { min-width: 130px; color: var(--orange); font: 700 12px var(--mono); }
.scope-box p { max-width: 840px; margin: 0; font-size: 19px; }
.scope-box p span { color: var(--orange); }
footer { padding: 42px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; color: var(--steel); font: 12px var(--mono); }
.footer-inner img { width: 25px; }

@keyframes pulse { 50% { opacity: .45; } }
@keyframes terminal-reveal {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}
@keyframes cursor-blink { 50% { opacity: 0; } }
@media (max-width: 900px) {
  .shell { width: min(calc(100% - 32px), 700px); }
  .navlinks a:not(.github) { display: none; }
  .hero { padding-top: 40px; }
  .hero-head, .section-grid, .proof-layout { grid-template-columns: 1fr; gap: 36px; }
  .live-terminal { width: 100%; max-width: 700px; }
  .flow { grid-template-columns: 1fr; }
  .module { border-right: 0; border-bottom: 1px solid var(--rule); }
  .channels { min-height: 330px; }
  .section-grid .lead { max-width: 620px; }
  .uses { grid-template-columns: 1fr 1fr; }
  .use-card, .use-card:nth-child(n + 4) { grid-column: span 1; border: 0; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); }
  .use-card:nth-child(even) { border-right: 0; }
  .use-card:last-child { grid-column: 1 / -1; border-bottom: 0; border-right: 0; }
  section.content { padding: 72px 0; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 24px); }
  .topbar { height: 64px; }
  .brand span { display: none; }
  .github { padding-left: 14px; }
  .hero { min-height: auto; padding-bottom: 54px; }
  .hero h1 { font-size: 42px; }
  .action-row { align-items: stretch; flex-direction: column; }
  .bench { margin-top: 54px; }
  .live-terminal-body { height: 320px; }
  .live-terminal-line { grid-template-columns: 78px minmax(0, 1fr); font-size: 10px; }
  .module { padding: 18px; }
  .flow { min-height: 0; }
  .channel { grid-template-columns: 1fr; }
  .bench-foot { display: none; }
  .roles { grid-template-columns: 1fr; }
  .role { min-height: 300px; padding: 24px; }
  .role + .role { border-top: 1px solid var(--rule); border-left: 0; }
  .role h3 { margin-top: 46px; }
  .uses { grid-template-columns: 1fr; }
  .use-card, .use-card:nth-child(n + 4), .use-card:last-child { min-height: 220px; grid-column: 1; border-right: 0; border-bottom: 1px solid var(--rule); }
  .use-card:last-child { border-bottom: 0; }
  .intervention { grid-template-columns: 1fr 24px; gap: 4px 10px; }
  .intervention p { grid-column: 1 / -1; padding-top: 8px; font-size: 17px; }
  .code-row { grid-template-columns: 28px 1fr; }
  .copy-line { grid-column: 2; width: 72px; margin-top: 10px; }
  .scope-box { display: block; }
  .scope-box p { margin-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .led, .terminal-status, .live-terminal-line.is-current::after { animation: none; }
  .live-terminal-line { opacity: 1; clip-path: none; }
  .live-terminal-line.is-visible { animation: none; }
  .live-terminal-body { scroll-behavior: auto; }
}
