/* ---------------------------------------------------------------------
 * 1. Tokens (values copied literally from ../web/styles-landing.ts)
 * ------------------------------------------------------------------- */
:root {
  --bg:#ffffff;
  --ink:#0f1222;
  --muted:#5c6072;
  --border:#e8e9ef;
  --accent:#5e6aff;
  --accent-2:#b053f0;
  --signal:#c9660b;
  --ok:#22a06b;
  --code-bg:#f7f8fb;
  --dark-bg:#0b0c10;
}

/* ---------------------------------------------------------------------
 * 2. Reset / base
 * ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

code, pre { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

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

ul { list-style: none; margin: 0; padding: 0; }

main { display: block; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------------
 * 3. Typography
 * ------------------------------------------------------------------- */
h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 780;
  letter-spacing: -.02em;
  line-height: 1.12;
  margin: 0 0 .5rem;
}

h2 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 .75rem;
}

/* ---------------------------------------------------------------------
 * 4. Nav / header
 * ------------------------------------------------------------------- */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.wordmark {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
}

/* ---------------------------------------------------------------------
 * 5. Buttons
 * ------------------------------------------------------------------- */
.btn, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .7em 1.2em;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

/* Dark-ink fill, not white-on-accent: same contrast reasoning as
   ../web/styles-landing.ts's .btn — kept in sync by value, not by import. */
.btn {
  background: #0f1222;
  color: #fff;
}
.btn:hover, .btn:focus-visible { background: #232741; }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}
.btn-outline:hover, .btn-outline:focus-visible { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------------
 * 6. Hero
 * ------------------------------------------------------------------- */
.hero { padding-top: 56px; padding-bottom: 24px; }

.hero-sub {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  max-width: 52ch;
}

/* Small aside below the hero-sub pointing at the manual address further
   down the page (agent-first hero revision). */
.hero-note {
  font-size: .85rem;
  color: var(--muted);
  margin: 12px 0 0;
}

/* ---------------------------------------------------------------------
 * 7. Address block
 * ------------------------------------------------------------------- */
.address-block {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.demo-address {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: clamp(1.15rem, 4vw, 1.7rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 16px;
  word-break: break-all;
}

.address-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.address-warning {
  margin: 0;
  font-size: .85rem;
  color: var(--signal);
}

/* ---------------------------------------------------------------------
 * 8. Inbox: status/spinner + message cards
 * ------------------------------------------------------------------- */
.inbox-section { padding: 32px 0; }

#inbox { text-align: left; }

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  margin: 0 0 16px;
  animation: demo-spin .8s linear infinite;
}

.inbox-status {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: .95rem;
}
.inbox-status[hidden] { display: none; }

.message-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 0 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(15 18 34/.04), 0 8px 24px rgb(15 18 34/.06);
}

/* Each message renders as the exact JSON shape /inbox/:tag returns (see
   ../demo/script.ts's renderMessageJson) — same visual language as the
   .code-card snippets below, so a visitor's own inbox and the "for coding
   agents" examples read as one system. */
.message-json {
  margin: 0;
  padding: 14px 16px;
  background: var(--code-bg);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.tok-key { color: var(--ink); font-weight: 600; }
.tok-str { color: var(--muted); }
.tok-signal { color: var(--signal); font-weight: 700; }
.tok-link, a.tok-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------------------------------------------------------------
 * 9. Agent snippets
 * ------------------------------------------------------------------- */
.agents-section { padding: 32px 0 48px; border-top: 1px solid var(--border); }

.code-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--code-bg);
  overflow: hidden;
}

.cc-head {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .78rem;
  color: var(--muted);
}

.code-card pre {
  margin: 0;
  padding: 14px 16px;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.agent-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .88rem;
}

.agent-links { margin: 8px 0 0; font-size: .9rem; }

/* The single agent-quote under the hero: styled as a quote (not code) —
   deliberately distinct from .code-card so it doesn't read as a prompt
   meant to be copy-pasted verbatim. Kept as a wrapper (rather than the
   blockquote alone) for the same margin/gap rhythm as its original two-quote
   layout, in case a second quote is ever added back. */
.agent-quotes {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.agent-quote {
  margin: 0;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-size: .95rem;
  font-style: italic;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------
 * 10. Footer
 * ------------------------------------------------------------------- */
.site-footer {
  padding: 24px 0 48px;
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: .88rem;
}
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* ---------------------------------------------------------------------
 * 11. Motion
 * ------------------------------------------------------------------- */
@keyframes demo-spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------
 * 12. Focus
 * ------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid #5e6aff;
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------
 * 13. Responsive
 * ------------------------------------------------------------------- */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
}

/* ---------------------------------------------------------------------
 * 14. Reduced motion: the spinner is the only animation in this file
 * ------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
