:root {
  color-scheme: light;
  --paper: #f5f7fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #526175;
  --soft: #eef1f6;
  --line: #dce2eb;
  --route: #b45309;
  --route-deep: #090a0f;
  --route-soft: #fff4d6;
  --fail: #b42318;
  --fail-strong: #7a271a;
  --fail-on-dark: #ffb4ab;
  --fail-soft: #fef3f2;
  --success: #087f5b;
  --success-soft: #e5f7f0;
  --code: #101827;
  --code-muted: #93a4bb;
  --shadow: 0 18px 48px rgba(9, 10, 15, 0.12);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--route-deep); text-underline-offset: 3px; }
button, input { font: inherit; }
button, .button { min-height: 44px; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: .9em; }
img, svg { max-width: 100%; }

.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; background: var(--ink); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid var(--route); outline-offset: 3px; }
pre:focus-visible, .copy-button:focus-visible { outline-color: #f59e0b; outline-offset: -3px; }
html:not(.js) .nav-search, html:not(.js) .copy-button { display: none; }
.js .nav-search { display: inline-flex; }
.js .copy-button { display: inline-block; }
.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.measure { max-width: 72ch; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 12px; color: var(--route); font: 700 .75rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font: 700 .72rem/1.2 var(--mono); }
.tag[data-tone="success"] { border-color: #a6dac7; background: var(--success-soft); color: var(--success); }
.tag[data-tone="warning"] { border-color: var(--fail); background: var(--fail-soft); color: var(--fail); }

.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.nav-shell { display: flex; align-items: center; min-height: 68px; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; letter-spacing: -.025em; text-decoration: none; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a, .nav-search { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); font-weight: 650; text-decoration: none; cursor: pointer; }
.site-nav a:hover, .site-nav a[aria-current="page"], .nav-search:hover { color: var(--route-deep); background: var(--route-soft); }
.nav-search { border: 1px solid var(--line); background: var(--panel); gap: 8px; }
.nav-search kbd { color: var(--muted); font: 600 .7rem var(--mono); }
.menu-button { display: none; margin-left: auto; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 0 12px; cursor: pointer; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--route-deep); border-radius: 6px; background: var(--route-deep); color: white; font-weight: 750; text-decoration: none; cursor: pointer; }
.button:hover { color: white; background: var(--route); border-color: var(--route); }
.button.secondary { background: var(--panel); color: var(--route-deep); border-color: var(--line); }
.button.secondary:hover { color: var(--route); background: var(--route-soft); border-color: #d6a05b; }

.hero { position: relative; padding: clamp(64px, 9vw, 118px) 0 76px; border-bottom: 1px solid var(--line); overflow: clip; }
.hero-grid { display: grid; grid-template-columns: minmax(0, .86fr) minmax(480px, 1.14fr); gap: clamp(36px, 7vw, 90px); align-items: center; }
.hero h1 { max-width: 13ch; margin: 0; font-size: clamp(2.7rem, 5.2vw, 4.5rem); line-height: 1.04; letter-spacing: -.04em; text-wrap: balance; }
.hero .lead { max-width: 59ch; margin: 24px 0 0; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }

.route-board { position: relative; min-height: 510px; padding: 24px; border: 1px solid #e0b76c; background: #fff8e8; box-shadow: var(--shadow); overflow: hidden; }
.route-board::before { content: "synthetic route trace"; position: absolute; top: 14px; right: 16px; color: #6f5222; font: 700 .65rem var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.route-label { position: absolute; left: 24px; top: 20px; color: var(--route-deep); font: 700 .75rem var(--mono); }
.rail { background: var(--route-deep); }
.node { padding: 14px; border: 1px solid #d8c7a7; background: var(--panel); box-shadow: 5px 5px 0 rgba(9,10,15,.08); }
.node strong { display: block; font-size: .9rem; }
.node small { display: block; margin-top: 4px; color: var(--muted); font: .72rem/1.35 var(--mono); }
.node.request { background: var(--route-deep); color: white; border-color: var(--route-deep); }
.node.endpoint { border-color: var(--route); }
.node.provider-a { border-color: var(--fail); background: var(--fail-soft); }
.node.provider-b { border-color: #81c8ae; background: var(--success-soft); }
.trace-log { padding: 16px; border: 1px solid #24324b; background: var(--code); color: #e7edf7; font: .74rem/1.65 var(--mono); }
.trace-log span { display: block; }
.trace-log .fail { color: var(--fail-on-dark); }
.trace-log .success { color: #70e1b9; }

.proof-bar { border-bottom: 1px solid var(--line); background: var(--panel); }
.proof-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.proof { padding: 22px 24px; border-left: 1px solid var(--line); }
.proof:first-child { border-left: 0; }
.proof strong { display: block; font-size: .88rem; }
.proof span { display: block; margin-top: 4px; color: var(--muted); font-size: .83rem; }

.section { padding: clamp(64px, 8vw, 104px) 0; border-bottom: 1px solid var(--line); }
.section.alt { background: var(--panel); }
.section-heading { display: flex; justify-content: space-between; gap: 32px; align-items: end; margin-bottom: 38px; }
.section h2, .page-hero h1, .doc-article h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1.05; letter-spacing: -.04em; }
.section-heading p { max-width: 58ch; margin: 0; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 76px); align-items: start; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { min-height: 220px; padding: 22px; border: 1px solid var(--line); background: var(--panel); }
.feature .feature-index { color: var(--route); font: 700 .72rem var(--mono); }
.feature h3 { margin: 42px 0 8px; font-size: 1.1rem; }
.feature p { margin: 0; color: var(--muted); font-size: .92rem; }
.feature code { display: block; margin-top: 24px; color: var(--route); overflow-wrap: anywhere; }
.provider-band { display: flex; flex-wrap: wrap; gap: 8px; }

.code-panel { position: relative; overflow: hidden; border: 1px solid #25324a; background: var(--code); color: #e7edf7; }
.code-panel .code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 0 14px; border-bottom: 1px solid #26344e; color: var(--code-muted); font: .72rem var(--mono); }
.copy-button { min-height: 44px; padding: 4px 9px; border: 1px solid #42516c; background: #17233a; color: #d9e2f0; font: 700 .75rem var(--mono); cursor: pointer; }
.code-panel pre { margin: 0; padding: 18px; overflow-x: auto; font-size: .78rem; line-height: 1.7; }
.code-panel .comment { color: #8192aa; }
.code-panel .value { color: #70e1b9; }
.code-panel .key { color: #f59e0b; }

.callout { padding: 16px 18px; border: 1px solid #e0b76c; background: var(--route-soft); color: #573100; }
.callout.warning { border-color: var(--fail); background: var(--fail-soft); color: var(--fail-strong); }
.callout.success { border-color: #81c8ae; background: var(--success-soft); color: #065f46; }
.callout strong { display: block; margin-bottom: 4px; }

.page-hero { padding: 70px 0 46px; border-bottom: 1px solid var(--line); }
.page-hero p { max-width: 68ch; margin: 18px 0 0; color: var(--muted); font-size: 1.08rem; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; color: var(--muted); font: .75rem var(--mono); }
.breadcrumbs a { color: inherit; }

.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 56px; padding: 48px 0 90px; align-items: start; }
.doc-nav { position: sticky; top: 92px; }
.doc-nav strong { display: block; margin-bottom: 12px; font-size: .78rem; }
.doc-nav a { display: block; min-height: 44px; padding: 10px; border-left: 2px solid var(--line); color: var(--muted); font-size: .88rem; text-decoration: none; }
.doc-nav a:hover, .doc-nav a[aria-current="page"] { border-color: var(--route); background: var(--route-soft); color: var(--route-deep); }
.doc-article { max-width: 820px; min-width: 0; }
.doc-article h1 { margin-bottom: 18px; }
.doc-article > p:first-of-type { color: var(--muted); font-size: 1.08rem; }
.doc-article h2 { margin: 54px 0 14px; padding-top: 8px; font-size: 1.65rem; letter-spacing: -.025em; }
.doc-article h3 { margin: 32px 0 10px; font-size: 1.15rem; }
.doc-article p, .doc-article li { max-width: 72ch; }
.doc-article li + li { margin-top: 6px; }
.doc-article .code-panel, .doc-article .table-wrap, .doc-article .callout { margin: 20px 0; }
.doc-article code:not(pre code) { padding: 2px 5px; background: #e9edf3; color: #2d3760; overflow-wrap: anywhere; }

.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: #39465a; background: #edf0f5; font-size: .78rem; letter-spacing: .025em; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td { font-size: .9rem; }
.status { display: inline-block; padding: 2px 6px; border: 1px solid var(--line); font: 700 .68rem var(--mono); white-space: nowrap; }
.status.ok { color: var(--success); border-color: #81c8ae; background: var(--success-soft); }
.status.caution { color: var(--fail); border-color: var(--fail); background: var(--fail-soft); }

.docs-index { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.docs-index a { display: block; min-height: 170px; padding: 22px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; }
.docs-index a:hover { border-color: var(--route); box-shadow: 5px 5px 0 var(--route-soft); }
.docs-index strong { display: block; font-size: 1.05rem; }
.docs-index span { display: block; margin-top: 10px; color: var(--muted); }
.docs-index code { display: block; margin-top: 24px; color: var(--route); }

.site-footer { padding: 44px 0; background: var(--ink); color: #dce4ef; }
.site-footer a { color: #b8c5d6; }
.site-footer a:hover { color: white; }
.site-footer :focus-visible { outline-color: #f59e0b; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 34px; }
.footer-grid strong { display: block; margin-bottom: 10px; color: white; }
.footer-grid a { display: block; margin: 5px 0; color: #b8c5d6; text-decoration: none; }
.footer-grid p { max-width: 44ch; color: #a9b7c8; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 34px; padding-top: 22px; border-top: 1px solid #334058; color: #91a0b5; font-size: .82rem; }

.search-dialog { width: min(680px, calc(100% - 24px)); padding: 0; border: 1px solid var(--line); box-shadow: var(--shadow); }
.search-dialog::backdrop { background: rgba(17,24,39,.58); }
.search-head { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.search-head input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); }
.search-head button { border: 1px solid var(--line); background: var(--panel); padding: 0 12px; cursor: pointer; }
.search-meta { padding: 8px 14px; color: var(--muted); font-size: .78rem; }
.search-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.search-results a { display: block; padding: 12px; color: var(--ink); text-decoration: none; }
.search-results a:hover, .search-results a:focus { background: var(--route-soft); }
.search-results strong, .search-results span { display: block; }
.search-results span { margin-top: 3px; color: var(--muted); font-size: .86rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.governance-board { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 50px 24px 24px; min-height: 0; }
.governance-board .node { position: static; min-width: 0; }
.governance-board .node:last-child { grid-column: 1 / -1; }
.route-board:not(.governance-board) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.4fr); grid-template-rows: repeat(3, 1fr) auto; gap: 24px; padding: 54px 22px 22px; }
.route-board:not(.governance-board) .node { position: relative; inset: auto; min-width: 0; align-self: center; padding: 12px; }
.node.request { grid-column: 1; grid-row: 2; }
.node.request small { color: #d7dae0; }
.node.endpoint { grid-column: 2; grid-row: 2; }
.node.provider-a { grid-column: 3; grid-row: 1; }
.node.provider-b { grid-column: 3; grid-row: 2; }
.node.provider-c { grid-column: 3; grid-row: 3; }
.node.endpoint::before, .node.provider-a::before, .node.provider-b::before, .node.provider-c::before { content: ""; position: absolute; left: -25px; top: 50%; width: 24px; height: 2px; background: var(--route-deep); }
.node.endpoint::after { content: ""; position: absolute; right: -13px; top: 50%; width: 12px; height: 2px; background: var(--route-deep); }
.route-board .rail { display: none; }
.route-board .r2 { display: block; position: relative; inset: auto; grid-column: 3; grid-row: 1 / 4; align-self: stretch; width: 2px; height: auto; margin: 38px 0 38px -13px; transform: none; }
.route-board .trace-log { position: static; grid-column: 1 / -1; grid-row: 4; }
.node.provider-b { animation: served 1.6s ease-out 1; }
@keyframes served { from { border-color: var(--route); } to { border-color: #81c8ae; } }
.node small, .trace-log { overflow-wrap: anywhere; }
.section-heading > *, .split > *, .feature-grid > *, .footer-grid > * { min-width: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .nav-shell { flex-wrap: wrap; gap: 0; padding-block: 12px; }
  .site-nav { width: 100%; flex-wrap: wrap; margin: 0; }
  .site-header { position: relative; }
  .js .site-header { position: sticky; }
  .js .menu-button { display: inline-flex; align-items: center; }
  .js .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100dvh - 68px); overflow-y: auto; padding: 12px 16px 18px; border-bottom: 1px solid var(--line); background: var(--panel); flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .js .site-nav[data-open] { display: flex; }
  .site-nav a, .nav-search { justify-content: flex-start; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 13ch; }
  .route-board { min-height: 470px; }
  .governance-board { min-height: 0; }
  .proof-grid { grid-template-columns: repeat(2, 1fr); }
  .proof:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .proof:nth-child(4) { border-top: 1px solid var(--line); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .doc-nav { position: static; display: grid; grid-template-columns: repeat(2, 1fr); }
  .doc-nav strong { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1180px); }
  .hero { padding-top: 54px; }
  .hero h1 { font-size: clamp(2.6rem, 14vw, 4.3rem); }
  .route-board { display: flex; flex-direction: column; gap: 16px; min-height: 0; padding: 64px 16px 16px; }
  .route-label { top: 36px; left: 16px; }
  .route-board .node { position: static; min-width: 0; }
  .route-board:not(.governance-board) { display: flex; padding: 64px 16px 16px; }
  .route-board:not(.governance-board) .node { align-self: stretch; }
  .route-board .r2, .node::before, .node::after { display: none; }
  .rail { display: none; }
  .trace-log { position: static; }
  .proof-grid, .feature-grid, .split, .docs-index, .footer-grid { grid-template-columns: 1fr; }
  .proof, .proof:first-child, .proof:nth-child(3), .proof:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); }
  .proof:first-child { border-top: 0; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 12px; }
  .doc-nav { grid-template-columns: 1fr; }
  .footer-bottom { display: block; }
  th, td { min-width: 150px; }
  .governance-board { padding-top: 48px; }
}

@media (min-width: 901px) {
  .error-nav { width: auto; flex-wrap: wrap; margin-left: auto; }
}

@media (max-width: 620px) {
  .error-nav { display: none; }
}

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