/* AMorti design tokens
   Subject: local businesses becoming query-able / bookable by AI assistants.
   The visual idea is a "signal" — something previously invisible starting
   to register. Amber beacon accent against a cool slate field; one
   monospace moment reserved for the thing that is literally code (the
   endpoint URL), not used decoratively elsewhere. */

:root {
  color-scheme: light dark;

  --ink: #12161c;
  --paper: #eef1f5;
  --paper-raised: #ffffff;
  --line: #d7dde6;
  --muted: #5b6472;
  --accent: #ffb020;
  --accent-ink: #4a3200;
  --ok: #1b7f4c;
  --ok-bg: #e9f6ee;
  --danger: #b4362b;
  --danger-bg: #fbeceb;
  --warn-bg: #fff4de;
  --warn-ink: #8a5a00;

  /* Fixed "terminal" pair — the signal panel and endpoint snippets are
     deliberately always dark-on-light-text, independent of site theme
     (a terminal doesn't flip to a light theme), so they read off --ink /
     --paper's *values*, not the tokens, and stay put when those invert. */
  --terminal-bg: #12161c;
  --terminal-fg: #eef1f5;

  --font-display: "Space Grotesk", "Arial Narrow", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

/* Dark mode: follows the OS/browser preference by default; an explicit
   data-theme attribute on <html> (for a future manual toggle) overrides it
   in either direction. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eef1f5;
    --paper: #0f1216;
    --paper-raised: #171b21;
    --line: #2a313b;
    --muted: #9aa7bd;
    --ok-bg: #12241a;
    --danger-bg: #2a1614;
    --warn-bg: #2b2210;
    --warn-ink: #e0ab4a;
  }
}
:root[data-theme="dark"] {
  --ink: #eef1f5;
  --paper: #0f1216;
  --paper-raised: #171b21;
  --line: #2a313b;
  --muted: #9aa7bd;
  --ok-bg: #12241a;
  --danger-bg: #2a1614;
  --warn-bg: #2b2210;
  --warn-ink: #e0ab4a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em 0;
}

h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); line-height: 1.05; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }

p { max-width: 62ch; color: var(--ink); }
p.lede { color: var(--muted); font-size: 1.15rem; max-width: 52ch; }

a { color: var(--ink); }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

nav.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
nav.top .mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}
nav.top .mark::before {
  content: "";
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 9px;
  vertical-align: middle;
}
nav.top a.navlink {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  margin-left: 20px;
}

section.hero {
  padding: 72px 0 56px 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 860px) {
  section.hero { grid-template-columns: 1fr; padding: 44px 0; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  padding: 13px 22px;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
}
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }

input, select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper-raised);
  width: 100%;
}
label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 16px 0 6px 0;
}
form.stack { max-width: 440px; }

/* The "signal panel" — a query box that visually registers a result.
   This is the one deliberate moment of motion on the page. */
.signal-panel {
  background: var(--terminal-bg);
  color: var(--terminal-fg);
  border-radius: 6px;
  padding: 26px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  position: relative;
  overflow: hidden;
  min-height: 220px;
}
.signal-panel .query-line { color: #9aa7bd; }
.signal-panel .result-line { color: var(--accent); }
.signal-panel .sweep {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  opacity: 0.7;
  animation: sweep 2.2s ease-in-out infinite;
}
@keyframes sweep {
  0% { top: 0; opacity: 0; }
  10% { opacity: 0.9; }
  90% { opacity: 0.9; }
  100% { top: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .signal-panel .sweep { animation: none; display: none; }
}

.pill {
  display: inline-block;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pill.ok { border-color: var(--ok); color: var(--ok); }
.pill.no { border-color: var(--danger); color: var(--danger); }
.pill.warn { border-color: var(--accent); color: var(--ink); }
.pill.unk { border-style: dashed; }

table.report td.check-detail { color: var(--muted); font-size: 0.88rem; padding-left: 12px; }
table.report td.check-status { white-space: nowrap; padding-right: 12px; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 28px 0;
}
@media (max-width: 780px) { .grid-3 { grid-template-columns: 1fr; } }

.panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px;
}

table.report {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
table.report th, table.report td {
  text-align: left;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
table.report th { color: var(--muted); font-weight: 500; font-size: 0.85rem; }

code.endpoint {
  display: block;
  font-family: var(--font-mono);
  background: var(--terminal-bg);
  color: var(--accent);
  padding: 12px 14px;
  border-radius: 4px;
  font-size: 0.92rem;
  overflow-x: auto;
  margin: 10px 0 4px 0;
}

footer.foot {
  border-top: 1px solid var(--line);
  padding: 26px 0;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 60px;
}

/* --- /api-vs-mcp page: the animated old-integrations-vs-MCP pipeline demo.
   Namespaced under .api-vs-mcp so it can't leak onto other pages. --- */
.api-vs-mcp section { padding: 40px 0; }
.api-vs-mcp section + section { border-top: 1px solid var(--line); }

.api-vs-mcp .query-block { margin: 36px 0 48px 0; }
.api-vs-mcp .query-bar {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.api-vs-mcp .query-bar .qtext {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  color: var(--ink);
  flex: 1;
  min-width: 260px;
}
.api-vs-mcp .query-bar .qtext::before { content: "\201C"; color: var(--muted); }
.api-vs-mcp .query-bar .qtext::after { content: "\201D"; color: var(--muted); }
.api-vs-mcp button.run {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 5px;
  padding: 11px 20px;
  cursor: pointer;
}
.api-vs-mcp button.run:disabled { opacity: 0.55; cursor: default; }
.api-vs-mcp button.run:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.api-vs-mcp .compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 860px) { .api-vs-mcp .compare { grid-template-columns: 1fr; } }

.api-vs-mcp .col {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-raised);
}
.api-vs-mcp .col-head {
  padding: 16px 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.api-vs-mcp .col.old .col-head { background: var(--danger-bg); }
.api-vs-mcp .col.new .col-head { background: var(--ok-bg); }
.api-vs-mcp .col-head h3 { margin: 0; }
.api-vs-mcp .col.old .col-head h3 { color: var(--danger); }
.api-vs-mcp .col.new .col-head h3 { color: var(--ok); }
.api-vs-mcp .timer { font-family: var(--font-mono); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.api-vs-mcp .col.old .timer { color: var(--danger); }
.api-vs-mcp .col.new .timer { color: var(--ok); }
.api-vs-mcp .timer .unit { font-size: 0.7rem; color: var(--muted); margin-left: 3px; }

.api-vs-mcp .steps { padding: 16px 18px 22px 18px; min-height: 380px; }
.api-vs-mcp .step {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  opacity: 0;
  transform: translateY(6px);
}
.api-vs-mcp .step:last-child { border-bottom: none; }
.api-vs-mcp .step.show { animation: api-vs-mcp-reveal 0.4s ease forwards; }
@keyframes api-vs-mcp-reveal { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .api-vs-mcp .step { transition: none; }
  .api-vs-mcp .step.show { animation: none; opacity: 1; transform: none; }
}
.api-vs-mcp .step .tag {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-radius: 4px;
  padding: 3px 6px;
  height: fit-content;
  white-space: nowrap;
}
.api-vs-mcp .col.old .step .tag { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.api-vs-mcp .col.new .step .tag { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.api-vs-mcp .step .body p { margin: 0; font-size: 0.92rem; }
.api-vs-mcp .step .body .call { display: block; margin-top: 4px; font-size: 0.82rem; color: var(--muted); }
.api-vs-mcp .step.warn .body p { color: var(--danger); }

.api-vs-mcp .result-line {
  margin: 6px 18px 18px 18px;
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 0.92rem;
  opacity: 0;
}
.api-vs-mcp .result-line.show { animation: api-vs-mcp-reveal 0.4s ease forwards; }
.api-vs-mcp .col.old .result-line { background: var(--danger-bg); color: var(--danger); }
.api-vs-mcp .col.new .result-line { background: var(--ok-bg); color: var(--ok); }

.api-vs-mcp .flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 28px 0;
}
@media (max-width: 780px) { .api-vs-mcp .flow { grid-template-columns: 1fr; } }
.api-vs-mcp .node {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-raised);
  padding: 18px;
  text-align: center;
}
.api-vs-mcp .node .k { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.api-vs-mcp .node .v { font-family: var(--font-display); font-weight: 600; margin-top: 4px; }
.api-vs-mcp .node.mcp { border-color: var(--accent); }
.api-vs-mcp .node.mcp .lock { font-size: 1.2rem; }
.api-vs-mcp .tools-list { margin-top: 10px; text-align: left; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.api-vs-mcp .tools-list div { padding: 2px 0; }
.api-vs-mcp .arrow { font-size: 1.4rem; color: var(--muted); text-align: center; }
@media (max-width: 780px) { .api-vs-mcp .arrow { transform: rotate(90deg); } }

.api-vs-mcp table.maturity { width: 100%; border-collapse: collapse; margin: 20px 0 8px 0; font-size: 0.92rem; }
.api-vs-mcp table.maturity th, .api-vs-mcp table.maturity td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.api-vs-mcp table.maturity th { font-family: var(--font-display); font-weight: 600; font-size: 0.82rem; color: var(--muted); }
.api-vs-mcp .badge { display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; }
.api-vs-mcp .badge.mature { background: var(--ok-bg); color: var(--ok); }
.api-vs-mcp .badge.emerging { background: var(--warn-bg); color: var(--warn-ink); }
.api-vs-mcp .badge.rare { background: var(--danger-bg); color: var(--danger); }

.api-vs-mcp .takeaway {
  margin: 48px 0 20px 0;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
}
.api-vs-mcp .takeaway p { font-size: 1.05rem; }

.api-vs-mcp .note { font-size: 0.82rem; color: var(--muted); margin-top: 10px; }

/* --- /api-vs-mcp/:slug: the live run against one onboarded business. --- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.api-vs-mcp .query-bar .qinput {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.98rem;
  color: var(--ink);
}
.api-vs-mcp .suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.api-vs-mcp .suggest {
  font: inherit;
  font-size: 0.85rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  text-align: left;
}
.api-vs-mcp .suggest:hover { border-color: var(--accent); }
.api-vs-mcp .run-options { margin-top: 14px; }
.api-vs-mcp label.inline { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; }
.api-vs-mcp label.inline input { width: auto; margin: 0; }
.api-vs-mcp .steps .idle { color: var(--muted); margin: 0; }
.api-vs-mcp .step .body { min-width: 0; overflow-wrap: anywhere; }
.api-vs-mcp .step .body .pending { color: var(--muted); }
.api-vs-mcp .step .body .call + p { margin-top: 4px; }
.api-vs-mcp .result-line:empty { display: none; }
.api-vs-mcp .col.new .result-line.error { background: var(--danger-bg); color: var(--danger); }
.api-vs-mcp .live-picker { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.api-vs-mcp .live-picker select { width: auto; margin: 0; min-width: 220px; }

/* --- Owner business tabs + commerce pages ------------------------------------ */
.biz-tabs { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--line, #d9dee5); margin: 8px 0 24px; }
.biz-tabs a { padding: 10px 0; text-decoration: none; color: inherit; opacity: .75; border-bottom: 2px solid transparent; }
.biz-tabs a.on { opacity: 1; font-weight: 600; border-bottom-color: currentColor; }
.biz-tabs a.attn { opacity: 1; color: var(--danger, #c0392b); font-weight: 600; }
.panel.flash { margin-bottom: 20px; }
.panel.flash.ok { border-color: var(--ok, #2e8b57); }
.panel.flash.no { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }
.row-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; }
.row-form .wide { grid-column: span 2; }
.inline-form { display: inline; margin: 0; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.muted { opacity: .7; font-size: 14px; }
table.report td .btn.small + .inline-form { margin-left: 6px; }
@media (max-width: 640px) { .row-form .wide { grid-column: auto; } }
