/* Steerpost site. Same visual language as the app: Onest, neutral palette, one teal accent. */
/* Fonts: assets/fonts/onest.css (and <locale>.css for ar, ja, zh-CN), written by build.mjs from the same packages the app
   bundles (D-024). */

/* Colour, radius, shadow, z-index and motion tokens: assets/tokens.css (derived from frontend/src/styles/tokens.css by build.mjs).
   Code highlighting below is landing-page only. */
:root {
  color-scheme: light;
  --hl-keyword: hsl(191 85% 26%);
  --hl-string: hsl(152 55% 27%);
  --hl-number: hsl(32 85% 33%);
  --hl-comment: hsl(220 9% 48%);
  --hl-title: hsl(280 45% 42%);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --hl-keyword: hsl(187 72% 66%);
    --hl-string: hsl(152 50% 62%);
    --hl-number: hsl(38 85% 66%);
    --hl-comment: hsl(220 9% 58%);
    --hl-title: hsl(280 60% 76%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Onest Variable', var(--font-script), ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg, picture { display: block; max-width: 100%; }
a { color: hsl(var(--accent)); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid hsl(var(--accent)); outline-offset: 2px; border-radius: 3px; }
code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; background: hsl(var(--foreground)); color: hsl(var(--background)); padding: 0.5rem 0.75rem; border-radius: 6px; z-index: 100; }
.skip:focus { top: 0.75rem; }

.wrap { width: 100%; max-width: 68rem; margin-inline: auto; padding-inline: 1.25rem; }

/* ---------- header / footer ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, hsl(var(--background)) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid hsl(var(--border)); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 3.5rem; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: hsl(var(--foreground)); font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.brand .mark { flex: none; width: 1.625rem; height: 1.625rem; color: hsl(var(--accent)); }
.nav { display: flex; align-items: center; gap: 0.25rem; font-size: 0.9rem; }
.nav > a:not(.btn) { white-space: nowrap; color: hsl(var(--muted-foreground)); text-decoration: none; padding: 0.35rem 0.65rem; border-radius: 6px; }
.nav > a:not(.btn):hover { color: hsl(var(--foreground)); background: hsl(var(--muted)); }
.nav > a[aria-current="page"] { color: hsl(var(--foreground)); font-weight: 500; }
.nav .btn { margin-inline-start: 0.5rem; }

.site-footer { border-top: 1px solid hsl(var(--border)); margin-top: 6rem; padding-block: 2.5rem; color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer a { color: hsl(var(--muted-foreground)); }
.site-footer a:hover { color: hsl(var(--foreground)); }

/* ---------- buttons, badges ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; height: 2.5rem; padding-inline: 1.1rem; border-radius: 6px; border: 1px solid transparent; font: inherit; font-size: 0.9rem; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-primary { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.btn-primary:hover { background: color-mix(in srgb, hsl(var(--accent)) 90%, hsl(var(--foreground))); text-decoration: none; }
.btn-secondary { background: hsl(var(--background)); color: hsl(var(--foreground)); border-color: hsl(var(--input)); }
.btn-secondary:hover { background: hsl(var(--muted)); text-decoration: none; }
.btn-sm { height: 2rem; padding-inline: 0.8rem; font-size: 0.8125rem; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 0.05rem 0.55rem; font-size: 0.75rem; font-weight: 500; line-height: 1.5; white-space: nowrap; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.badge-live { background: hsl(var(--success-soft)); color: hsl(var(--success)); }
.badge-dev { background: hsl(var(--accent-soft)); color: hsl(var(--accent)); }
.badge-off { background: hsl(var(--warning-soft)); color: hsl(var(--warning)); }
.badge-danger { background: hsl(var(--danger-soft)); color: hsl(var(--danger)); }

/* ---------- landing ---------- */
.hero { padding-block: 4.5rem 2rem; }
.eyebrow { margin: 0 0 1rem; font-size: 0.875rem; font-weight: 500; color: hsl(var(--accent)); letter-spacing: 0.01em; }
h1 { margin: 0; font-size: clamp(2.1rem, 4.6vw, 3.25rem); line-height: 1.1; font-weight: 650; letter-spacing: -0.03em; max-width: 18ch; text-wrap: balance; }
.lead { margin: 1.25rem 0 0; max-width: 40rem; font-size: 1.125rem; color: hsl(var(--muted-foreground)); text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.fine { margin: 1rem 0 0; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }

.shot { margin: 0; }
.shot .frame { border: 1px solid hsl(var(--border)); border-radius: 10px; overflow: hidden; background: hsl(var(--surface)); box-shadow: var(--shadow-pop); }
.shot img { width: 100%; height: auto; }
.shot figcaption { margin-top: 0.75rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.shot figcaption strong { color: hsl(var(--foreground)); font-weight: 600; }
.hero .shot { margin-top: 3.5rem; }

section.block { padding-top: 6rem; }
.block h2 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 1.875rem); line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; text-wrap: balance; }
.block .sub { margin: 0.75rem 0 0; max-width: 42rem; color: hsl(var(--muted-foreground)); text-wrap: pretty; }

.steps { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; gap: 2rem; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: step; }
.steps li { position: relative; padding-top: 2.75rem; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 0; display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 999px; background: hsl(var(--accent-soft)); color: hsl(var(--accent)); font-size: 0.8125rem; font-weight: 600; }
.steps h3 { margin: 0 0 0.4rem; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.steps p { margin: 0; color: hsl(var(--muted-foreground)); font-size: 0.9375rem; }

.shots { display: grid; gap: 2.5rem 2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 2.5rem; }

.table-wrap { overflow-x: auto; border: 1px solid hsl(var(--border)); border-radius: 8px; margin: 1.5rem 0; }
.table-wrap table { margin: 0; border: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; text-align: start; }
th, td { padding: 0.65rem 0.9rem; vertical-align: top; border-bottom: 1px solid hsl(var(--border)); }
thead th { background: color-mix(in srgb, hsl(var(--muted)) 60%, transparent); color: hsl(var(--muted-foreground)); font-size: 0.78rem; font-weight: 500; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.networks td:first-child { font-weight: 550; white-space: nowrap; }
.networks td:nth-child(2) { white-space: nowrap; }
.note { margin: 0.75rem 0 0; font-size: 0.875rem; color: hsl(var(--muted-foreground)); max-width: 46rem; }

.two { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 2.5rem; align-items: start; }
.two h3 { margin: 0 0 0.75rem; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.facts li { padding-inline-start: 1rem; border-inline-start: 2px solid hsl(var(--border)); font-size: 0.9375rem; color: hsl(var(--muted-foreground)); }
.facts strong { display: block; color: hsl(var(--foreground)); font-weight: 600; margin-bottom: 0.1rem; }

.grid-2 { display: grid; gap: 2rem 2.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 2.5rem; }
.grid-2 h3 { margin: 0 0 0.35rem; font-size: 1rem; font-weight: 600; }
.grid-2 p { margin: 0; color: hsl(var(--muted-foreground)); font-size: 0.9375rem; }

.mcp-tools td:first-child { min-width: 14rem; }
.mcp-tools td:first-child code { display: inline-block; margin: 0.1rem 0; margin-inline-end: 0.25rem; }
.risk { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.risk b, .risk strong { font-weight: 600; }
.risk-sensitive b, .risk-sensitive strong, .risk-critical b, .risk-critical strong { color: hsl(var(--danger)); }
.risk-medium { color: hsl(var(--warning)); }
@media (max-width: 40rem) {
  /* Stack each tool row instead of scrolling sideways: tool, then scope and risk on one line. */
  .mcp-tools thead { display: none; }
  .mcp-tools, .mcp-tools tbody { display: block; }
  .mcp-tools tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.75rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid hsl(var(--border)); }
  .mcp-tools tr:last-child { border-bottom: 0; }
  .mcp-tools td { padding: 0; border: 0; }
  .mcp-tools td:first-child { flex: 1 1 100%; min-width: 0; }
  .mcp-tools td:nth-child(3) { margin-inline-start: auto; text-align: end; }
}

.cta-band { margin-top: 6rem; padding: 2.5rem; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--surface)); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.cta-band h2 { font-size: 1.375rem; margin: 0; letter-spacing: -0.02em; }
.cta-band p { margin: 0.35rem 0 0; color: hsl(var(--muted-foreground)); }

/* ---------- code ---------- */
code { font-size: 0.875em; background: hsl(var(--muted)); padding: 0.12em 0.35em; border-radius: 4px; }
pre { margin: 1.25rem 0; padding: 1rem 1.1rem; background: hsl(var(--surface)); border: 1px solid hsl(var(--border)); border-radius: 8px; overflow-x: auto; font-size: 0.8125rem; line-height: 1.6; tab-size: 2; }
pre code { background: none; padding: 0; font-size: inherit; border-radius: 0; }
.code { position: relative; }
.code .copy { position: absolute; top: 0.5rem; inset-inline-end: 0.5rem; opacity: 0; font: inherit; font-size: 0.75rem; padding: 0.15rem 0.5rem; color: hsl(var(--muted-foreground)); background: hsl(var(--background)); border: 1px solid hsl(var(--input)); border-radius: 5px; cursor: pointer; }
.code:hover .copy, .code .copy:focus-visible { opacity: 1; }
.code .copy:hover { color: hsl(var(--foreground)); }
@media (hover: none) { .code .copy { opacity: 1; } }
.hljs-keyword, .hljs-built_in, .hljs-literal, .hljs-selector-tag, .hljs-type { color: var(--hl-keyword); }
.hljs-string, .hljs-attr, .hljs-regexp, .hljs-symbol { color: var(--hl-string); }
.hljs-number, .hljs-meta, .hljs-variable, .hljs-template-variable { color: var(--hl-number); }
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-title, .hljs-function, .hljs-section, .hljs-name { color: var(--hl-title); }
.hljs-attr { color: var(--hl-keyword); }
.hljs-attr + .hljs-string, .hljs-string { color: var(--hl-string); }

/* ---------- docs ---------- */
.docs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-block: 2.5rem 0; }
.docs-nav { font-size: 0.9rem; }
.docs-nav h2 { margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.docs-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.1rem; }
.docs-nav a { display: block; padding: 0.35rem 0.6rem; border-radius: 6px; color: hsl(var(--muted-foreground)); text-decoration: none; }
.docs-nav a:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.docs-nav a[aria-current='page'] { background: hsl(var(--muted)); color: hsl(var(--foreground)); font-weight: 500; }
.docs-nav details { border: 1px solid hsl(var(--border)); border-radius: 8px; padding: 0.6rem 0.8rem; }
.docs-nav summary { cursor: pointer; font-weight: 500; }
.docs-nav details[open] summary { margin-bottom: 0.5rem; }
.docs-toc { font-size: 0.8125rem; display: none; }
.docs-toc h2 { margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.docs-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; border-left: 1px solid hsl(var(--border)); }
.docs-toc a { display: block; padding: 0.2rem 0 0.2rem 0.8rem; color: hsl(var(--muted-foreground)); text-decoration: none; }
.docs-toc a:hover { color: hsl(var(--foreground)); }
.docs-toc .l3 a { padding-left: 1.6rem; }

.prose { min-width: 0; max-width: 46rem; }
.prose > :first-child { margin-top: 0; }
.prose h1 { max-width: none; font-size: clamp(1.75rem, 3.4vw, 2.25rem); letter-spacing: -0.025em; }
.prose .lead { font-size: 1.0625rem; }
.prose h2 { margin: 3rem 0 0.75rem; padding-top: 2rem; border-top: 1px solid hsl(var(--border)); font-size: 1.4rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; }
.prose h2:first-of-type { }
.prose h3 { margin: 2rem 0 0.5rem; font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }
.prose h4 { margin: 1.5rem 0 0.4rem; font-size: 1rem; font-weight: 600; }
.prose p, .prose li { text-wrap: pretty; }
.prose p { margin: 0.9rem 0; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0.9rem 0; }
.prose li { margin: 0.3rem 0; }
.prose li > ul, .prose li > ol { margin: 0.3rem 0; }
.prose blockquote { margin: 1.25rem 0; padding: 0.1rem 1rem; border-left: 3px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); }
.prose hr { border: 0; border-top: 1px solid hsl(var(--border)); margin: 2.5rem 0; }
.prose .anchor { margin-left: 0.4rem; color: hsl(var(--muted-foreground)); text-decoration: none; opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus-visible { opacity: 1; }
.prose .table-wrap table td, .prose .table-wrap table th { font-size: 0.875rem; }
.prose td code { white-space: normal; }
.prose td:last-child:not(:first-child) { min-width: 9rem; }
pre.mermaid { background: transparent; border: 1px solid hsl(var(--border)); text-align: center; white-space: pre; color: hsl(var(--muted-foreground)); }
pre.mermaid[data-processed='true'] { white-space: normal; }
pre.mermaid svg { margin-inline: auto; max-width: 100%; height: auto; }
pre.mermaid.zoomable { cursor: zoom-in; }
pre.mermaid.zoomable::after { content: 'Click to enlarge'; display: block; margin-top: 0.5rem; text-align: right; font-family: 'Onest Variable', ui-sans-serif, system-ui, sans-serif; font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
dialog.diagram { width: min(96vw, 90rem); max-width: none; max-height: 92vh; padding: 1rem; border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--background)); color: hsl(var(--foreground)); overflow: auto; }
dialog.diagram::backdrop { background: rgb(0 0 0 / 0.55); }
dialog.diagram svg { max-width: none; height: auto; margin: 0 auto; }
dialog.diagram .close { position: sticky; top: 0; float: right; z-index: 1; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid hsl(var(--border)); font-size: 0.9rem; }
.pager a { text-decoration: none; }
.pager small { display: block; color: hsl(var(--muted-foreground)); font-size: 0.75rem; }
.doc-cards { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prose .doc-cards { padding: 0; margin: 1.5rem 0; }
.prose .doc-cards li { margin: 0; display: flex; }
.doc-cards a { display: block; flex: 1; padding: 1rem 1.1rem; border: 1px solid hsl(var(--border)); border-radius: 8px; text-decoration: none; color: hsl(var(--foreground)); }
.doc-cards a:hover { background: hsl(var(--surface)); border-color: hsl(var(--input)); }
.doc-cards strong { display: block; font-weight: 600; }
.doc-cards span { display: block; margin-top: 0.15rem; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }

.notfound { padding-block: 6rem; }
.notfound h1 { font-size: 2rem; }

@media (min-width: 52rem) {
  .docs { grid-template-columns: 13.5rem minmax(0, 1fr); gap: 3rem; }
  .docs-nav { position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 6rem); overflow: auto; }
  .docs-nav details { border: 0; padding: 0; }
  .docs-nav summary { display: none; }
}
@media (min-width: 70rem) {
  .docs { grid-template-columns: 13.5rem minmax(0, 46rem) 12rem; }
  .docs-toc { display: block; position: sticky; top: 5rem; align-self: start; max-height: calc(100vh - 6rem); overflow: auto; }
}
@media (max-width: 52rem) {
  .docs-nav h2 { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .shots, .grid-2, .two, .doc-cards { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 3rem; }
  section.block { padding-top: 4.5rem; }
}
@media (max-width: 30rem) {
  .hide-sm { display: none; }
  .cta .btn { flex: 1 1 100%; }
  .nav > a { padding-inline: 0.5rem; }
  .cta-band { padding: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- page transitions ----------
   Cross-document View Transitions (Chrome, Edge, Safari 18.2+): the header and the brand mark stay put and morph between
   the floating landing nav and the docs bar, the page body fades and rises. Browsers without support navigate normally. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-nav; }
.brand .mark { view-transition-name: brand-mark; }
main { view-transition-name: page-main; }
::view-transition-group(site-nav) { animation-duration: 0.45s; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
::view-transition-old(page-main) { animation: vt-out 0.18s ease-in both; }
::view-transition-new(page-main) { animation: vt-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
