:root {
  color-scheme: light dark;
  --paper: #fafbf9;
  --surface: #ffffff;
  --ink: #1c2a2e;
  --muted: #59686c;
  --accent: #0f7f8c;
  --accent-text: #0c707c;
  --accent-soft: #eaf4f3;
  --border: #d8e1df;
  --code: #f0f3f1;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.65; }
a { color: var(--accent-text); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
::selection { background: var(--accent); color: #fff; }
.wrap { width: min(1040px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: absolute; z-index: 10; top: 12px; left: 12px; padding: 10px 18px; background: var(--surface); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 96px; border-bottom: 1px solid var(--border); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 21px; font-weight: 750; letter-spacing: -.6px; text-decoration: none; }
.brand-icon { fill: var(--accent); flex-shrink: 0; }
.brand-icon .envelope { fill: none; stroke: white; stroke-width: 1.5; stroke-linejoin: round; }
.site-header nav, .site-footer nav { display: flex; align-items: center; gap: 26px; font-size: 14px; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--accent-text); text-decoration: underline; }

.hero { padding-top: 64px; }
.eyebrow { margin: 0 0 20px; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; line-height: 1.5; text-transform: uppercase; color: var(--accent-text); }
.hero > .eyebrow { display: flex; align-items: center; gap: 9px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { max-width: 900px; margin-bottom: 26px; font-size: clamp(40px, 5.8vw, 68px); line-height: 1.04; font-weight: 680; letter-spacing: -2.4px; }
h1 span { color: var(--accent-text); }
.hero-copy { max-width: 640px; margin-bottom: 28px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 48px; padding: 11px 20px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-weight: 650; text-decoration: none; transition: transform .15s ease, background-color .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-primary:hover { background: #0b6873; border-color: #0b6873; }
.button-secondary { color: var(--ink); background: var(--surface); }
.button-secondary:hover { border-color: var(--accent); color: var(--accent-text); }
.hero-note { margin: 18px 0 0; color: var(--muted); font-size: 13px; }

/* The live route */
.route { margin: 48px 0 0; padding: 22px 26px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.route-caption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.route-caption .eyebrow { margin: 0; color: var(--muted); font-size: 10px; }
.route-aside { color: var(--muted); font-size: 12px; }
.route-svg { display: block; width: 100%; height: auto; margin: 14px 0 8px; overflow: visible; }
.route-lines { stroke: var(--border); stroke-width: 1.5; }
.senders circle { fill: var(--accent); }
.senders text { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
.node rect { fill: var(--surface); stroke: var(--border); stroke-width: 1.2; }
.node text { text-anchor: middle; font-family: var(--sans); }
.node-title { font-size: 14px; font-weight: 650; fill: var(--ink); }
.node-detail { font-size: 10.5px; fill: var(--muted); }
.node-hub rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.4; }
.node-hub .node-title { fill: var(--accent-text); font-size: 19px; }
.node-out rect { stroke-dasharray: none; }
.packet rect { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; }
.packet path { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.route-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 28px; margin: 10px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); list-style: none; counter-reset: route; }
.route-steps li { counter-increment: route; color: var(--muted); font-size: 13px; line-height: 1.6; }
.route-steps li::before { content: "0" counter(route); display: block; margin-bottom: 6px; font: 11px var(--mono); color: var(--accent-text); }
.route-steps b { color: var(--ink); font-weight: 600; }

.section { padding-block: 84px; border-bottom: 1px solid var(--border); scroll-margin-top: 28px; }
.section-heading { max-width: 680px; margin-bottom: 36px; }
.section-heading .eyebrow { margin-bottom: 13px; }
h2 { margin-bottom: 18px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; font-weight: 640; letter-spacing: -1.2px; }
.section-heading > p:not(.eyebrow) { margin-bottom: 16px; color: var(--muted); }
.section-heading > p:last-child { margin-bottom: 0; }
h3 { margin-bottom: 11px; font-size: 17px; font-weight: 650; line-height: 1.4; letter-spacing: -.25px; }

/* The inbox */
.browser { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; box-shadow: 0 20px 50px -30px rgba(28, 42, 46, .35); }
.browser-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--code); }
.browser-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.browser-bar em { margin-left: 10px; font: 11px var(--mono); color: var(--muted); font-style: normal; }
.browser img { display: block; width: 100%; height: auto; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 32px 0 0; padding: 0; list-style: none; }
.facts li { color: var(--muted); font-size: 14px; line-height: 1.7; }
.facts b { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 650; }

/* Setup */
.paste { margin-bottom: 36px; }
.code-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 16px; background: var(--code); border: 1px solid var(--border); border-radius: 8px 8px 0 0; font-size: 12px; }
.code-tag { color: var(--muted); font: 10px var(--mono); }
.copy { padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--ink); font: 600 11px var(--sans); cursor: pointer; }
.copy:hover { border-color: var(--accent); color: var(--accent-text); }
.paste pre { border-top: 0; border-radius: 0 0 8px 8px; }
.paste pre code { font-size: 14px; line-height: 1.7; }
code { font-family: var(--mono); font-size: .85em; overflow-wrap: anywhere; }
p code { color: var(--ink); background: var(--code); padding: 2px 5px; border-radius: 4px; }
pre { margin: 0; padding: 18px 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--code); white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; tab-size: 2; }
pre code { font-size: 12.5px; line-height: 1.8; }
.setup-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; }
.tight { margin: 0; padding-left: 22px; color: var(--muted); font-size: 14px; }
.tight li { padding: 5px 0 5px 4px; }
.tight li::marker { color: var(--accent-text); font-family: var(--mono); font-size: 12px; }
.aside { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

/* Agents */
.agent-grid { display: grid; grid-template-columns: 1fr 1.2fr; align-items: start; gap: 40px; }
.tools-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.tools-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tools-table th, .tools-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tools-table th:first-child { padding-left: 0; }
.tools-table th:last-child, .tools-table td:last-child { padding-right: 0; }
.tools-table thead th { padding-top: 0; color: var(--muted); font-size: 11px; font-weight: 550; letter-spacing: 1px; text-transform: uppercase; }
.tools-table tbody th { font-weight: 500; }
.tools-table th code { font-size: 12px; white-space: nowrap; }
.tools-table td { color: var(--muted); }
.frame-example, .request-example { min-width: 0; }
.frame-example pre, .request-example pre { border-top: 0; border-radius: 0 0 8px 8px; padding: 18px 17px; }
.frame-example > p { margin: 13px 0 0; color: var(--muted); font-size: 12.5px; }
.code-muted { color: var(--muted); }
.code-accent { color: var(--accent-text); }

/* Apps */
.split-section { display: grid; grid-template-columns: .85fr 1.15fr; gap: 64px; align-items: start; }
.split-section .section-heading { margin: 0; }

/* Story */
.story-body { max-width: 680px; }
.story-body p { color: var(--muted); font-size: 17px; line-height: 1.75; }
.story-status { margin: 28px 0 0; padding: 18px 20px; border-left: 2px solid var(--accent); background: var(--accent-soft); font-size: 14px !important; color: var(--ink) !important; }

.site-footer { display: flex; justify-content: space-between; gap: 32px; padding-block: 32px 44px; }
.footer-wordmark { font-size: 17px; letter-spacing: -.4px; }
.site-footer p { margin: 8px 0 0; max-width: 420px; font-size: 12.5px; color: var(--muted); }
.site-footer nav { align-self: start; flex-wrap: wrap; justify-content: flex-end; gap: 10px 22px; padding-top: 6px; font-size: 12.5px; }
.site-footer nav > span { color: var(--muted); }

@media (max-width: 900px) {
  .facts { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .setup-grid, .agent-grid, .split-section { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .route { padding-inline: 18px; }
}

@media (max-width: 700px) {
  .wrap { width: calc(100% - 40px); }
  .site-header { min-height: 78px; gap: 16px; }
  .site-header nav { gap: 14px; font-size: 12px; }
  .wordmark { font-size: 19px; }
  .hero { padding-top: 44px; }
  h1 { font-size: clamp(36px, 9vw, 52px); letter-spacing: -1.5px; line-height: 1.08; }
  .hero-copy { font-size: 16px; }
  .button { gap: 16px; padding-inline: 16px; }
  .route { margin-top: 32px; padding: 16px 14px 14px; }
  .route-svg { margin: 10px 0 6px; }
  .senders text { font-size: 15px; }
  .node-title { font-size: 19px; }
  .node-detail { font-size: 14px; }
  .node-hub .node-title { font-size: 24px; }
  .route-steps { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .section { padding-block: 60px; }
  h2 { letter-spacing: -.8px; }
  .section-heading { margin-bottom: 28px; }
  pre { padding: 15px; }
  .paste pre code { font-size: 13px; }
  .tools-table th, .tools-table td { padding-block: 13px; }
  .story-body p { font-size: 16px; }
  .site-footer { flex-direction: column; gap: 22px; padding-block: 28px 36px; }
  .site-footer nav { justify-content: flex-start; gap: 12px 20px; padding: 0; }
}

@media (max-width: 420px) {
  .site-header nav a:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:hover { transform: none; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131d21;
    --surface: #18252a;
    --ink: #e7eeec;
    --muted: #a6b6b9;
    --accent: #72cbd2;
    --accent-text: #8ad6dc;
    --accent-soft: #1b343a;
    --border: #33464b;
    --code: #1c2b30;
  }
  .button-primary { color: #13272c; }
  .button-primary:hover { background: #91d9de; border-color: #91d9de; }
  .brand-icon .envelope { stroke: #13272c; }
  ::selection { color: #13272c; }
  .browser { box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .7); }
  .browser img { filter: brightness(.96); }
}
