/*
 * zanora.dev — the landing page, in the console's palette (design/zanora-console.html)
 * and the docs' type system: Chakra Petch for display, IBM Plex Sans for prose,
 * JetBrains Mono for anything read character by character. The tokens are the
 * docs' tokens (apps/docs/src/assets/docs.css), so moving between the two sites
 * changes nothing but the layout. Code and the trace stay dark in both themes,
 * as terminals do.
 */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #f3f6f9;
  --line: #e4e9ef;
  --line-2: #d3dbe4;
  --text: #0f1720;
  --text-2: #3a4756;
  --muted: #5b6b7c;
  --faint: #8594a4;
  --accent: #1a6fc4;
  --accent-strong: #0f5fa6;
  --accent-soft: rgba(26, 111, 196, 0.09);
  --accent-ink: #ffffff;
  --ok: #178a55;
  --warn: #a86b00;
  --code-bg: #0d1219;
  --code-head: #121922;
  --code-line: #1f2b38;
  --code-text: #dde6ee;
  --code-muted: #8193a6;
  --inline-code-bg: #eef2f6;
  --inline-code-text: #1b3a57;
  --shadow: 0 1px 2px rgba(15, 23, 32, 0.05), 0 8px 24px rgba(15, 23, 32, 0.06);
  --shadow-lg: 0 1px 2px rgba(15, 23, 32, 0.06), 0 24px 60px -12px rgba(15, 23, 32, 0.18);
  --topbar-bg: rgba(255, 255, 255, 0.86);
  --grid-line: rgba(15, 23, 32, 0.045);

  --font-display: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --topbar-h: 64px;
  --wrap: 1180px;
  --gutter: 24px;
  --radius: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e13;
    --bg-soft: #0d1219;
    --surface: #121922;
    --surface-2: #18212c;
    --line: #1f2b38;
    --line-2: #2a3847;
    --text: #e6edf3;
    --text-2: #c3cfdb;
    --muted: #8193a6;
    --faint: #5f7184;
    --accent: #62b4f5;
    --accent-strong: #8cc8f8;
    --accent-soft: rgba(98, 180, 245, 0.12);
    --accent-ink: #06121d;
    --ok: #4cc38a;
    --warn: #e5b04b;
    --code-head: #111820;
    --inline-code-bg: #18212c;
    --inline-code-text: #cfe3f5;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 60px -12px rgba(0, 0, 0, 0.6);
    --topbar-bg: rgba(10, 14, 19, 0.86);
    --grid-line: rgba(230, 237, 243, 0.035);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0e13;
  --bg-soft: #0d1219;
  --surface: #121922;
  --surface-2: #18212c;
  --line: #1f2b38;
  --line-2: #2a3847;
  --text: #e6edf3;
  --text-2: #c3cfdb;
  --muted: #8193a6;
  --faint: #5f7184;
  --accent: #62b4f5;
  --accent-strong: #8cc8f8;
  --accent-soft: rgba(98, 180, 245, 0.12);
  --accent-ink: #06121d;
  --ok: #4cc38a;
  --warn: #e5b04b;
  --code-head: #111820;
  --inline-code-bg: #18212c;
  --inline-code-text: #cfe3f5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 60px -12px rgba(0, 0, 0, 0.6);
  --topbar-bg: rgba(10, 14, 19, 0.86);
  --grid-line: rgba(230, 237, 243, 0.035);
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar-h) + 16px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; color: var(--text); }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
code, pre, .install, .trace-lines { font-variant-ligatures: none; }
code { font-family: var(--font-mono); font-size: 0.86em; }
:not(pre) > code { background: var(--inline-code-bg); color: var(--inline-code-text); padding: 0.12em 0.38em; border-radius: 5px; }
.ic { width: 1em; height: 1em; flex: none; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (max-width: 640px) { :root { --gutter: 16px; } }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }

/* ── Buttons and links ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 10px;
  font: 600 15px/1 var(--font-body);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.btn .ic { transition: transform 0.15s; }
.btn:hover .ic { transform: translateX(2px); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--faint); color: var(--text); }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14.5px; }
.text-link .ic { transition: transform 0.15s; }
.text-link:hover .ic { transform: translateX(3px); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-row { height: var(--topbar-h); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; flex: none; fill: var(--accent); }
.brand-name { font: 600 19px/1 var(--font-display); letter-spacing: 0.01em; }
.brand-beta {
  font: 600 10.5px/1 var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 7px;
}
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); font-size: 14.5px; font-weight: 500; padding: 6px 10px; border-radius: 7px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.quiet-link { color: var(--text-2); font-size: 14.5px; font-weight: 500; }
.quiet-link:hover { color: var(--text); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 17px;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
@media (max-width: 860px) { .nav { display: none; } }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 72px 0 96px;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent 55%, var(--bg));
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 13px/1 var(--font-mono); color: var(--text-2);
  padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); }
@media (prefers-reduced-motion: no-preference) { .pulse { animation: pulse 2.4s infinite; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.hero h1 { text-wrap: balance; margin-top: 22px; font-size: clamp(40px, 5.6vw, 66px); line-height: 1.02; letter-spacing: -0.025em; }
.accent { color: var(--accent); }
.lede { margin-top: 22px; font-size: clamp(17px, 1.6vw, 19px); line-height: 1.6; color: var(--text-2); max-width: 34em; }
.hero .cta-row { margin-top: 32px; }
.install {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  font: 14px/1 var(--font-mono); color: var(--text-2);
  padding: 0 6px 0 14px; height: 42px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface);
}
.install code { font-size: 14px; background: none; padding: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.install .prompt { color: var(--faint); }
.hero-install { margin-top: 20px; }
.agent-setup-label { margin: 28px 0 8px; font-size: 13.5px; color: var(--text-2); }
.agent-setup { display: flex; width: 100%; max-width: 560px; height: auto; min-height: 42px; padding-block: 8px; }
.agent-setup code { min-width: 0; flex: 1 1 auto; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.agent-setup-alt { margin-top: 10px; font-size: 13.5px; color: var(--text-2); }

/* Copy buttons (enabled by site.js) */
.copy {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
  height: 30px; padding: 0 10px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--faint); font: 500 12.5px/1 var(--font-body); cursor: pointer;
}
.copy:hover { color: var(--text); background: var(--surface-2); }
.copy.done { color: var(--ok); }
.window-bar .copy { color: var(--code-muted); }
.window-bar .copy:hover { color: var(--code-text); background: rgba(255, 255, 255, 0.06); }

/* Dark "windows": the trace and the code */
.window, .trace {
  background: var(--code-bg); border: 1px solid var(--code-line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; color: var(--code-text);
}
.window-bar {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 8px 0 14px;
  background: var(--code-head); border-bottom: 1px solid var(--code-line);
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a3847; }
.window-title { font: 12.5px/1 var(--font-mono); color: var(--code-muted); }
.code { margin: 0; padding: 18px 20px; overflow-x: auto; font: 13.5px/1.7 var(--font-mono); tab-size: 2; }
.code code { font-size: inherit; }
.tk-c { color: #6c7f93; font-style: italic; }
.tk-s { color: #a5d6a0; }
.tk-k { color: #c9a8ff; }
.tk-n { color: #f2bb74; }
.tk-f { color: #82c8ff; }
.tk-t { color: #7fdac6; }
.tk-p { color: #82c8ff; }
.tk-v { color: #f2bb74; }
.tk-o { color: #e7a5cb; }

/* The transaction trace */
.trace { margin: 0; }
.replay {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 7px; border: 1px solid var(--code-line); background: transparent; color: var(--code-muted);
  font: 500 12px/1 var(--font-body); cursor: pointer;
}
.replay .ic { transform: rotate(180deg) scaleX(-1); }
.replay:hover { color: var(--code-text); border-color: #2a3847; }
.trace-lines { list-style: none; margin: 0; padding: 14px 0; font: 13px/1.55 var(--font-mono); }
.tl {
  display: grid; grid-template-columns: 64px 18px minmax(0, 1fr); gap: 8px; align-items: baseline;
  padding: 7px 18px; border-left: 2px solid transparent;
}
.tl-who { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #5f7184; }
.tl-agent .tl-who { color: #82c8ff; }
.tl-seller .tl-who { color: #c9a8ff; }
.tl-zanora .tl-who { color: #62b4f5; }
.tl-zanora { background: rgba(98, 180, 245, 0.05); border-left-color: rgba(98, 180, 245, 0.5); }
.tl-dir { color: #5f7184; text-align: center; }
.tl-body { display: flex; flex-direction: column; min-width: 0; }
.tl-text { color: var(--code-text); overflow-wrap: anywhere; }
.tl-detail { color: var(--code-muted); font-size: 12px; overflow-wrap: anywhere; }
.tone-ok .tl-dir, .tone-ok .tl-text { color: #4cc38a; }
.tone-warn .tl-text { color: #e5b04b; }
.tone-muted .tl-text { color: #c3cfdb; }
.trace figcaption { padding: 12px 18px; border-top: 1px solid var(--code-line); font-size: 12.5px; color: var(--code-muted); }
/* Animated only once site.js says so; without JS (or with reduced motion) every line shows. */
.trace.animate .tl { opacity: 0; transform: translateY(4px); transition: opacity 0.35s ease, transform 0.35s ease; }
.trace.animate .tl.on { opacity: 1; transform: none; }

@media (max-width: 980px) {
  .hero { padding: 48px 0 72px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
}
@media (max-width: 480px) {
  .tl { grid-template-columns: 52px 14px minmax(0, 1fr); padding: 7px 12px; gap: 6px; }
  .trace-lines { font-size: 12px; }
  .hero .btn { flex: 1 1 auto; justify-content: center; }
}

/* ── Sections ─────────────────────────────────────────────────────────────── */
.section { padding: 104px 0; }
.section + .section { border-top: 1px solid var(--line); }
@media (max-width: 720px) { .section { padding: 72px 0; } }
.section-head { max-width: 720px; margin-bottom: 52px; }
.kicker { font: 500 12.5px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 16px; }
.section h2 { text-wrap: balance; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
.section-lede { margin-top: 18px; font-size: 17.5px; color: var(--text-2); }
.terms-note { margin-top: 14px; font-size: 13.5px; color: var(--muted); }
h3 { font-size: 19px; line-height: 1.3; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.card, .feature, .use {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card p, .feature p, .use p { margin-top: 10px; color: var(--text-2); font-size: 15.5px; }
.card-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; margin-bottom: 18px;
  background: var(--accent-soft); color: var(--accent); font-size: 20px;
}

/* Problem */
.problem { background: var(--bg-soft); }

/* How it works */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; position: relative; }
.flow::before {
  content: ""; position: absolute; top: 21px; left: 8%; right: 8%; height: 1px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px);
}
.flow-step { position: relative; padding: 0 14px; text-align: center; }
.flow-num { display: block; font: 500 11.5px/1 var(--font-mono); color: var(--faint); margin-bottom: 0; position: absolute; top: -20px; left: 0; right: 0; }
.flow-icon {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--accent); font-size: 19px; box-shadow: var(--shadow);
}
.flow-step:nth-child(3) .flow-icon, .flow-step:nth-child(4) .flow-icon { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.flow-step h3 { margin-top: 18px; font-size: 17px; }
.flow-step p { margin-top: 8px; font-size: 14.5px; color: var(--text-2); line-height: 1.55; }
@media (max-width: 1020px) {
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 56px; }
  .flow::before { display: none; }
}
@media (max-width: 640px) {
  .flow { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .flow-step { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 18px; text-align: left; padding: 0 0 28px; }
  .flow-step::before { content: ""; position: absolute; left: 21.5px; top: 44px; bottom: 0; width: 1px; background: var(--line-2); }
  .flow-step:last-child::before { display: none; }
  .flow-num { position: static; grid-column: 2; grid-row: 1; margin-top: 2px; }
  .flow-icon { grid-row: 1 / span 3; }
  .flow-step h3 { grid-column: 2; margin-top: 4px; }
  .flow-step p { grid-column: 2; }
}

/* Platform */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.feature { display: flex; flex-direction: column; }
.feature .text-link { margin-top: auto; padding-top: 18px; }
.feature:hover, .use:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.feature-wide { grid-column: span 3; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.feature-wide .text-link { margin-top: 0; padding-top: 18px; }
.window-sm { box-shadow: none; }
@media (max-width: 980px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-wide { grid-column: span 2; }
}
@media (max-width: 680px) {
  .features { grid-template-columns: minmax(0, 1fr); }
  .feature-wide { grid-column: auto; grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

/* Developers */
.dx-section, .dx { background: transparent; }
.dx-tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 20px; width: fit-content; max-width: 100%;
  border: 1px solid var(--line); border-radius: 11px; background: var(--bg-soft); overflow-x: auto; scrollbar-width: none;
}
.dx-tabs::-webkit-scrollbar { display: none; }
.dx-tab {
  flex: none; height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font: 500 14px/1 var(--font-body); cursor: pointer; white-space: nowrap;
}
.dx-tab:hover { color: var(--text); }
.dx-tab[aria-selected="true"] { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: 0 1px 2px rgba(15, 23, 32, 0.06); }
.dx-panel { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.dx-panel[hidden] { display: none; }
.dx-side { display: flex; flex-direction: column; gap: 24px; padding-top: 4px; }
.dx-side .install { width: 100%; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ticks li { display: flex; gap: 12px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.ticks .ic { color: var(--ok); margin-top: 4px; font-size: 16px; }
@media (max-width: 900px) { .dx-panel { grid-template-columns: minmax(0, 1fr); } }

/* Architecture */
.arch { background: var(--bg-soft); }
.arch-diagram {
  display: grid; gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr);
  grid-template-areas:
    "agents link sellers"
    "agents hub sellers"
    "rails rails rails";
}
.arch-agents { grid-area: agents; }
.arch-sellers { grid-area: sellers; }
.arch-link-direct { grid-area: link; }
.arch-hub { grid-area: hub; }
.arch-rails { grid-area: rails; }
.arch-col { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.arch-label { font: 500 12px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 4px; }
.node { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.node b, .hub-head b, .rail b { display: block; font-weight: 600; font-size: 15px; }
.node small, .hub-head small, .rail small { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.node small code { font-size: 12px; }
.node-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 17px; flex: none; }
.arch-sellers .node-icon { color: #8b5cf6; }
:root[data-theme="dark"] .arch-sellers .node-icon { color: #c9a8ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .arch-sellers .node-icon { color: #c9a8ff; } }
.arch-agents .node-icon { color: var(--accent); }
.arch-link-direct {
  display: flex; align-items: center; justify-content: center; position: relative; min-height: 64px;
}
.arch-link-direct::before {
  content: ""; position: absolute; left: -20px; right: -20px; top: 50%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 14px);
  opacity: 0.6;
}
@media (prefers-reduced-motion: no-preference) {
  .arch-link-direct::before { animation: march 1.2s linear infinite; background-size: 14px 2px; }
}
@keyframes march { to { background-position: 14px 0; } }
.arch-link-direct span {
  position: relative; font: 500 12px/1.4 var(--font-mono); color: var(--text-2); text-align: center;
  background: var(--bg-soft); padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
}
.arch-hub {
  position: relative; padding: 22px; border-radius: var(--radius);
  border: 1.5px solid var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft);
}
/* Connectors from the gateway to both columns: seller middleware and agents both talk to it. */
.arch-hub::before, .arch-hub::after {
  content: ""; position: absolute; top: 50%; width: 21px; height: 0; border-top: 2px dashed var(--faint); opacity: 0.7;
}
.arch-hub::before { right: 100%; }
.arch-hub::after { left: 100%; }
.hub-head { display: flex; gap: 12px; align-items: center; }
.hub-head .brand-mark { width: 34px; height: 34px; }
.hub-parts { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hub-parts li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); color: var(--text); }
.hub-parts .ic { color: var(--accent); }
.hub-note { margin-top: 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.arch-rails {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; align-items: center;
  padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--radius);
}
.rail { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.rail-dir { font: 600 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ok); }
.rail:nth-child(2) .rail-dir { color: var(--warn); }
.rail-note { font-size: 13.5px; color: var(--muted); line-height: 1.55; padding: 0 6px; }
@media (max-width: 980px) {
  .arch-hub::before, .arch-hub::after { display: none; }
  .arch-diagram { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "agents sellers" "link link" "hub hub" "rails rails"; }
  .arch-link-direct::before { left: 0; right: 0; }
  .arch-rails { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rail-note { grid-column: span 2; }
}
@media (max-width: 600px) {
  .arch-diagram { grid-template-columns: minmax(0, 1fr); grid-template-areas: "agents" "link" "sellers" "hub" "rails"; }
  .arch-link-direct::before { left: 50%; right: auto; top: -20px; bottom: -20px; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--accent) 0 8px, transparent 8px 14px); animation: none; }
  .arch-rails, .hub-parts { grid-template-columns: minmax(0, 1fr); }
  .rail-note { grid-column: auto; }
}

/* Use cases */
.use { display: flex; flex-direction: column; }
.use-who { font: 500 12px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 14px; }
.use p.use-who { margin-top: 0; color: var(--muted); font-size: 12px; }
.use .text-link { margin-top: auto; padding-top: 18px; }

/* Pricing */
.terms-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.terms h2 { font-size: clamp(26px, 3vw, 36px); }
.terms .text-link { margin-top: 20px; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.facts div { padding: 24px; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { border-right: 1px solid var(--line); }
.facts div:nth-last-child(-n + 2) { border-bottom: 0; }
.facts dt { font: 500 12px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.facts dd { margin: 12px 0 0; font: 600 28px/1.1 var(--font-display); color: var(--text); }
.facts dd small { display: block; margin-top: 6px; font: 400 13.5px/1.4 var(--font-body); color: var(--muted); }
@media (max-width: 860px) { .terms-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

/* Final CTA */
.final { padding: 0 0 104px; }
.final-inner {
  text-align: center; padding-top: 88px; padding-bottom: 88px;
  border-radius: 20px; background: var(--code-bg); color: var(--code-text); position: relative; overflow: hidden;
  background-image:
    linear-gradient(rgba(230, 237, 243, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 237, 243, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.final-inner h2 { color: #e6edf3; font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.02em; line-height: 1.1; }
.final-inner p { margin: 18px auto 0; max-width: 36em; color: #a9b8c7; font-size: 17px; }
.final .cta-row { justify-content: center; margin-top: 32px; }
.final .btn-primary { background: #62b4f5; color: #06121d; }
.final .btn-primary:hover { background: #8cc8f8; color: #06121d; }
.final .btn-ghost { background: transparent; color: #e6edf3; border-color: #2a3847; }
.final .btn-ghost:hover { border-color: #5f7184; }
@media (max-width: 640px) {
  .final { padding-bottom: 72px; }
  .final-inner { padding: 56px 20px; border-radius: 16px; }
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 56px 0 32px; background: var(--bg-soft); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-brand p { margin-top: 14px; color: var(--muted); font-size: 14.5px; }
.footer-label { font: 500 12px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); margin-bottom: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { color: var(--text-2); font-size: 14.5px; }
.footer ul a:hover { color: var(--text); }
.footer-base { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13.5px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: span 2; } }

/* ── Reveal on scroll (only when site.js opts the page in) ────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .js-reveal .reveal.in { opacity: 1; transform: none; }
}

/* ── 404 ──────────────────────────────────────────────────────────────────── */
.notfound { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 20px; max-width: 640px; }
.notfound h1 { font-size: 44px; margin-top: 24px; }
.notfound p { color: var(--text-2); font-size: 17px; }
