/* How it works: a normal scrolling page that shares the site's colors and type */
body.doc { min-height: 100vh; }
.hud.solid { position: sticky; background: rgba(255, 255, 255, 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid #eceef1; }
.hud.solid .pill { display: inline-block; }

.page { width: min(760px, 100% - 40px); margin: 0 auto; padding: 40px 0 120px; }
.page section { padding: 64px 0 8px; scroll-margin-top: 70px; }
.page h1, .page h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.page h1 { font-size: clamp(64px, 11vw, 132px); line-height: 0.92; }
.page h2 { font-size: clamp(36px, 5vw, 54px); line-height: 1.02; margin-bottom: 20px; }
.page h3 { font-weight: 500; font-size: 18px; margin: 30px 0 8px; }
.page em { font-style: italic; color: var(--blue); }
.page p { color: var(--ink-2); font-size: 17px; line-height: 1.65; margin: 0 0 16px; }
.page a { color: var(--ink); text-decoration-color: #c3c8d0; text-underline-offset: 3px; }
.page a:hover { text-decoration-color: var(--blue); }

.intro { padding-top: 70px !important; }
.lede { font-size: 20px !important; color: var(--ink-2); max-width: 36em; margin-top: 26px !important; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.toc a { padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 14px; color: var(--ink-2); }
.toc a:hover { color: var(--ink); border-color: #c3c8d0; }

/* diagrams */
.dia { margin: 30px 0; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: #f8f9fb; }
.node {
  display: flex; flex-direction: column; gap: 3px; align-items: center;
  padding: 14px 16px; border-radius: 14px; border: 1px solid #e1e4e9; background: var(--raise); text-align: center;
}
.node b { font-weight: 500; font-size: 15px; }
.node span { font-size: 13px; color: var(--muted); }
.node.strong { border-color: rgba(37, 99, 235, 0.55); box-shadow: 0 0 40px -12px rgba(37, 99, 235, 0.3); width: max-content; margin: 0 auto; }
.node.ghost { border-style: dashed; background: transparent; }
.agents .row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fan { display: grid; grid-template-columns: repeat(4, 1fr); height: 34px; position: relative; }
.fan i { display: none; }
.fan::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 50%; border-top: 1px solid #d5d9e0; }
.fan::after { content: ""; position: absolute; left: 50%; top: 0; height: 50%; border-left: 1px solid #d5d9e0; }
.agents .row .node { position: relative; }
.agents .row .node::before { content: ""; position: absolute; left: 50%; top: -18px; height: 18px; border-left: 1px solid #d5d9e0; }
.agents .row { margin-top: 0; }
.agents .fan { margin-bottom: 18px; }

.spec { display: grid; grid-template-columns: 180px 1fr; gap: 14px 24px; margin: 26px 0 0; }
.spec dt { font-weight: 500; font-size: 15px; padding-top: 3px; }
.spec dd { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.6; }

.loop ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; }
.loop li {
  font: 13.5px var(--mono); color: var(--ink-2);
  padding: 9px 12px; border-radius: 10px; border: 1px solid #e1e4e9; background: var(--raise);
}
.loop li { position: relative; }
.loop li + li::before { content: "\2192"; position: absolute; left: -19px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.loop li.ev { color: var(--bg); background: var(--glow); border-color: var(--glow); }
.loop li.idle { color: var(--muted); border-style: dashed; background: transparent; }
.loop li.idle::after { content: " \21BA"; color: var(--blue); }

.tbl { width: 100%; border-collapse: collapse; margin: 8px 0 22px; font-size: 15px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 0 0 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 0; border-bottom: 1px solid #eceef1; color: var(--ink-2); vertical-align: top; }
.tbl td:first-child { color: var(--ink); width: 42%; }

.arch { display: grid; grid-template-columns: 1fr 22px 1.25fr 22px 1fr; align-items: center; gap: 8px; }
.arch .col { display: flex; flex-direction: column; gap: 8px; }
.arch .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.box {
  padding: 11px 12px; border-radius: 10px; border: 1px solid #e1e4e9; background: var(--raise);
  font-size: 13.5px; text-align: center; line-height: 1.3;
}
.box span { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.box.hot { border-color: rgba(37, 99, 235, 0.55); box-shadow: 0 0 40px -12px rgba(37, 99, 235, 0.3); padding: 16px 12px; font-weight: 500; }
.box.dashed { border-style: dashed; background: transparent; }
.arrow { height: 1px; background: #c3c8d0; position: relative; }
.arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 4.5px solid transparent; border-left: 6px solid #c3c8d0; border-right: 0; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 26px 0; }
.cards .c { padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: #f8f9fb; }
.cards .c b { font-weight: 500; }
.cards .c p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; }
.callout { border-left: 2px solid var(--glow); padding: 4px 0 4px 18px; color: var(--ink) !important; }
.note { font-size: 14.5px !important; color: var(--muted) !important; }

.code {
  margin: 22px 0 14px; padding: 20px 22px; border-radius: 14px; border: 1px solid var(--line); background: #f6f7f9;
  font: 13.5px/1.7 var(--mono); color: var(--ink); overflow-x: auto; white-space: pre;
}
.code .dim { color: var(--muted); }
.code .k { color: var(--blue); }
.code .s { color: #15803d; }
.code .ok { color: var(--green); }

.seq { list-style: none; counter-reset: s; margin: 24px 0; padding: 0; }
.seq li { counter-increment: s; position: relative; padding: 0 0 18px 46px; color: var(--ink-2); font-size: 16px; line-height: 1.55; }
.seq li::before {
  content: counter(s); position: absolute; left: 0; top: -2px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 13px var(--mono); color: var(--ink); border: 1px solid #d5d9e0; background: var(--raise);
}
.seq li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 28px; bottom: 2px; border-left: 1px solid #e5e7eb; }
.seq li b { color: var(--ink); font-weight: 500; }
.seq li:nth-child(3)::before { color: var(--muted); border-style: dashed; background: transparent; }
.seq li:nth-child(4)::before { color: var(--bg); background: var(--glow); border-color: var(--glow); }

.limits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.limits li { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: #f8f9fb; color: var(--ink-2); font-size: 16px; line-height: 1.55; }
.limits li b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }
.limits li.open { border-style: dashed; border-color: rgba(37, 99, 235, 0.5); }

.refs ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.end { text-align: center; padding-top: 110px !important; }
.end h2 { font-size: clamp(40px, 6vw, 68px); }
.pill.big { display: inline-block; margin-top: 18px; padding: 14px 22px; font-size: 13px; color: var(--bg); text-decoration: none; }

@media (max-width: 720px) {
  .hud.solid .spacer { display: none; }
  .hud.solid .nav { display: inline; }
  .hud.solid .pill { padding: 9px 12px; }
  .page section { padding-top: 52px; }
  .page p { font-size: 16px; }
  .dia { padding: 18px; }
  .agents .row { grid-template-columns: 1fr 1fr; }
  .agents .row .node::before, .fan { display: none; }
  .agents .node.strong { margin-bottom: 14px; }
  .spec { grid-template-columns: 1fr; gap: 4px; }
  .spec dd { margin-bottom: 12px; }
  .arch { grid-template-columns: 1fr; }
  .arrow { width: 1px; height: 18px; margin: 0 auto; }
  .arrow::after { right: auto; left: -4px; top: auto; bottom: -1px; border: 4.5px solid transparent; border-top: 6px solid #c3c8d0; border-bottom: 0; }
  .cards { grid-template-columns: 1fr; }
  .code { font-size: 12px; padding: 16px; }
}
