/* The MCP and AI agent pages (/mcp, /ai-agents, /ai-agents/{slug}). Built on base.css (the hero,
   section headings, bands, stage and tray) and site.css; see DESIGN.md. */

/* Hero: centred on the paper, with the example chat on the stage underneath. */
.page-hero .ag-pair { margin-bottom: 30px; }
.page-hero .server-url { margin-top: 34px; }
.page-hero .ag-cta { margin-top: 22px; justify-content: center; }
.page-hero .server-url + .ag-cta { margin-top: 18px; }
.page-hero .ag-note { margin-top: 20px; }
.page-hero .ag-logos { margin-top: 30px; }
.ag-note { font: 500 12.5px var(--mono); letter-spacing: .02em; color: var(--ink-3); }
.ag-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.page-hero .ag-cta .btn { height: 50px; padding: 0 24px; font-size: 16px; }
.ag-stage { width: 100%; padding: 64px 32px 72px; display: grid; justify-items: center; }
.ag-stage .ag-window { width: min(100%, 680px); text-align: left; }

/* The server address with a copy button */
.server-url { display: flex; align-items: center; gap: 8px; width: min(100%, 480px); min-width: 0; padding: 6px 6px 6px 20px; border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; box-shadow: var(--shadow); }
.server-url code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: none; border: 0; padding: 0; font-size: 15px; color: var(--ink); text-align: left; }
.server-url button { height: 40px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--dark); color: #fff; font: 600 14px var(--font); cursor: pointer; flex: none; }
.server-url button:hover { background: var(--dark-2); }

/* Logos */
.logo-tile { width: 56px; height: 56px; border-radius: 16px; background: var(--card); display: grid; place-items: center; border: 1px solid var(--line); flex: none; color: var(--ink-3); font-size: 22px; }
.logo-tile img { width: 58%; height: 58%; }
.logo-tile.lg { width: 68px; height: 68px; border-radius: 20px; }
.mark-tile { width: 68px; height: 68px; border-radius: 20px; background: var(--red-ink); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 22px -10px rgba(225, 29, 42, .7); }
.mark-tile svg { width: 48px; height: 48px; }
.ag-pair { display: flex; align-items: center; gap: 10px; }
.ag-pair .line { width: 24px; height: 0; border-top: 2px dashed var(--line-2); }
.ag-pair .plus { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; background: var(--card); color: var(--ink-3); font-weight: 600; }
.ag-logos { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ag-logos a { display: block; transition: transform .15s ease; }
.ag-logos a:hover { transform: translateY(-3px); }

/* Extras that sit in a section heading on the connect step. */
.head > .ag-badge { margin-top: 22px; }
.head > p.ag-note { margin-top: 16px; font: 500 12.5px/1.5 var(--mono); color: var(--ink-3); max-width: 560px; }

/* Example chat */
.ag-window { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.ag-window-bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font: 500 12.5px var(--mono); letter-spacing: .04em; color: var(--ink-3); background: var(--card-hover); }
.ag-window-bar .dots { display: flex; gap: 6px; margin-right: 6px; }
.ag-window-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); display: block; }
.ag-window-bar img { width: 18px; height: 18px; }
.ag-chat { padding: 26px; display: grid; gap: 14px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.ag-chat .you { justify-self: end; max-width: 85%; background: var(--dark); color: #fff; padding: 12px 17px; border-radius: 20px 20px 6px 20px; }
.ag-chat .ai { max-width: 92%; }
.ag-chat .ai strong { color: var(--ink); font-weight: 600; }
.tool-chip { justify-self: start; display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--mono); color: var(--ink-2); background: var(--paper); padding: 6px 11px; border-radius: 999px; }
.tool-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.ag-push { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; background: var(--paper); border-radius: 18px; padding: 12px 14px; }
.ag-push .icon { width: 34px; height: 34px; border-radius: 9px; background: var(--red-ink); color: #fff; display: grid; place-items: center; }
.ag-push .icon svg { width: 24px; height: 24px; }
.ag-push b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.ag-push span { font-size: 14px; display: block; }
.ag-push .from { color: var(--ink-3); font: 500 11.5px var(--mono); margin-top: 3px; }
.ag-chat .later { justify-self: center; font: 500 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: 999px; padding: 5px 13px; }

/* Steps: numbered circles down one dashed track, the last one red, like the home page. */
.ag-how { max-width: 760px; margin-inline: auto; }
.ag-steps { list-style: none; padding: 0; margin: 0; display: grid; counter-reset: s; }
/* The circle is pulled up 10px so its centre lines up with the first line of the step. */
.ag-steps li { counter-increment: s; position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 18px; align-items: start; padding: 22px 0 12px; font-size: 17px; line-height: 1.45; color: var(--ink); }
.ag-steps li::before { content: counter(s); width: 40px; height: 40px; border-radius: 50%; background: var(--dark); color: #fff; display: grid; place-items: center; font: 600 17px/1 var(--font); position: relative; z-index: 1; margin-top: -8px; }
.ag-steps li:last-child::before { background: var(--red-ink); box-shadow: 0 0 0 5px rgba(255, 45, 58, .14); }
.ag-steps li:not(:last-child)::after { content: ""; position: absolute; left: 19px; top: 60px; bottom: -8px; width: 2px; background: repeating-linear-gradient(to bottom, var(--line-2) 0 6px, transparent 6px 12px); }
.ag-box { margin-top: 36px; padding: 28px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.ag-box pre { margin: 0; }
.ag-where { font: 500 12.5px var(--mono); color: var(--ink-3); }
.ag-badge { display: inline-flex; align-items: center; gap: 8px; font: 500 12px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--green); background: var(--green-soft); padding: 7px 13px; border-radius: 999px; }
.ag-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Cards and grids */
.ag-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ag-card { display: grid; gap: 18px; align-content: start; height: 100%; padding: 26px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); text-decoration: none; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; position: relative; }
.band .ag-card { background: var(--paper); border-color: transparent; }
.band .ag-card .logo-tile { border-color: transparent; }
a.ag-card:hover { border-color: var(--line-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.ag-card b { font-size: 19px; font-weight: 600; letter-spacing: -.02em; display: block; }
.ag-card .tag { font-size: 14.5px; color: var(--ink-3); display: block; margin-top: 3px; }
.ag-card .arrow { position: absolute; top: 24px; right: 24px; color: var(--ink-3); transition: color .15s ease, transform .15s ease; }
a.ag-card:hover .arrow { color: var(--ink); transform: translate(2px, -2px); }
.ag-card > a { color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; margin-top: auto; }
.ag-card > a:hover { color: var(--red-ink); }
.ag-card .ag-steps li { font-size: 15px; padding: 10px 0; grid-template-columns: 26px 1fr; gap: 12px; color: var(--ink-2); }
.ag-card .ag-steps li::before { width: 26px; height: 26px; font-size: 12.5px; margin-top: -2px; box-shadow: none; }
.ag-card .ag-steps li:not(:last-child)::after { left: 12px; top: 38px; bottom: -4px; }
.ag-card.other { grid-column: span 2; background: var(--dark); border-color: var(--dark); color: #fff; }
.ag-card.other .arrow { color: rgba(255, 255, 255, .6); }
a.ag-card.other:hover .arrow { color: #fff; }
.ag-card.other p { font-size: 15.5px; color: rgba(255, 255, 255, .7); }
.ag-group + .ag-group { margin-top: 96px; }
.ag-group-head { display: grid; justify-items: center; text-align: center; gap: 12px; margin-bottom: 36px; }
.ag-group-head h2 { font-size: clamp(26px, 2.8vw, 36px); font-weight: 600; letter-spacing: -.035em; line-height: 1.08; }
.ag-group-head p { color: var(--ink-2); font-size: 16.5px; }

.ag-prompts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ag-prompt { padding: 28px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); display: grid; gap: 16px; align-content: start; }
.band .ag-prompt { background: var(--paper); border-color: transparent; }
.ag-prompt .ask { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; color: var(--ink); }
.ag-prompt .answer { display: grid; gap: 10px; color: var(--ink-2); font-size: 15.5px; }
.band .ag-prompt .tool-chip { background: var(--card); }

.ag-caps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--card); }
.ag-caps li { padding: 26px 28px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin: 0 0 -1px -1px; }
.ag-caps b, .ag-guards b { display: block; margin-bottom: 6px; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.ag-caps p, .ag-guards p { color: var(--ink-2); font-size: 15.5px; }
.ag-guards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ag-guards li { position: relative; padding: 30px 32px 30px 76px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.ag-guards li::before { content: ""; position: absolute; left: 28px; top: 30px; width: 30px; height: 30px; border-radius: 50%; border: 1.8px solid var(--red-ink); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e11d2a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 12.5 3.3 3.3L17 9'/%3E%3C/svg%3E") center / 20px no-repeat; }

.ag-more .head { max-width: 1000px; margin-bottom: 0; gap: 28px; }
.ag-others { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ag-others a { display: inline-flex; align-items: center; gap: 9px; padding: 7px 16px 7px 7px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 15px; font-weight: 600; background: var(--paper); transition: border-color .15s ease, background .15s ease; }
.ag-others a:hover { border-color: var(--line-2); background: var(--card); }
.ag-others img { width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); }
.ag-dev { margin: 48px auto 0; max-width: 900px; padding: 26px 28px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); color: var(--ink-2); font-size: 15.5px; }
.ag-dev h3 { font: 500 12.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; color: var(--ink-3); }
.ag-dev a { color: var(--red-ink); }
.ag-close { padding: 0 0 20px; }

@media (max-width: 1240px) {
  .ag-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ag-card.other { grid-column: span 3; }
}
@media (max-width: 1020px) {
  .ag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ag-card.other { grid-column: span 2; }
  .ag-grid[style] { grid-template-columns: minmax(0, 1fr) !important; max-width: 560px; margin-inline: auto; }
  .ag-caps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ag-group + .ag-group { margin-top: 72px; }
}
@media (max-width: 640px) {
  .ag-stage { padding: 20px 12px 24px; }
  .ag-chat { padding: 18px; font-size: 15px; }
  .ag-cta { width: 100%; }
  .ag-cta .btn { flex: 1 1 auto; }
  .ag-steps li { font-size: 16px; grid-template-columns: 36px 1fr; gap: 14px; }
  .ag-steps li::before { width: 36px; height: 36px; font-size: 15.5px; margin-top: -7px; }
  .ag-steps li:not(:last-child)::after { left: 17px; top: 56px; }
  .ag-box { padding: 20px; }
  .ag-prompts, .ag-guards, .ag-caps { grid-template-columns: minmax(0, 1fr); }
  .ag-prompt { padding: 22px; }
  .ag-prompt .ask { font-size: 18.5px; }
  .ag-guards li { padding: 22px 20px 22px 62px; }
  .ag-guards li::before { left: 20px; top: 22px; width: 26px; height: 26px; background-size: 17px; }
  .ag-caps li { padding: 20px; }
  .ag-grid { gap: 12px; }
  .ag-card { padding: 20px; }
  .server-url { padding-left: 16px; }
  .server-url code { font-size: 13.5px; }
}
