/* === Agents page (MCP) ===
   Extends the site design system in style.css. Light-only, matching every
   other page. Local tokens are green-biased neutrals, not generic greys. */

.ag {
  --ag-ink: #16211b;          /* forest near-black, for the transcript panel */
  --ag-ink-soft: #1f2e26;
  --ag-ink-line: rgba(255, 255, 255, 0.12);
  --ag-ink-text: rgba(255, 255, 255, 0.74);
  --ag-mono-accent: #8ECF93;  /* tool identifiers on the dark ground */
  --ag-tint: #f1f8f2;
  --ag-line: rgba(0, 0, 0, 0.09);
  --ag-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* --- Bands & shared rhythm --- */
.ag-band {
  padding: 4.5rem 1.5rem;
}
.ag-band--tint {
  background: var(--ag-tint);
  border-top: 1px solid var(--ag-line);
  border-bottom: 1px solid var(--ag-line);
}

.ag-wrap {
  max-width: 1000px;
  margin: 0 auto;
}
.ag-wrap--text > * {
  max-width: 820px;
}

.ag-wrap--prose {
  max-width: 720px;
}

.ag-eyebrow {
  font-family: var(--ag-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.9rem;
}
.ag-band h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary-dark);
  text-wrap: balance;
  margin-bottom: 0.75rem;
}
.ag-band h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.ag-band p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.ag-band a:not(.btn):not(.ag-chip) {
  color: var(--primary);
  text-decoration: underline;
}
code {
  font-family: var(--ag-mono);
}

/* --- Hero --- */
.ag-hero {
  padding: 7.5rem 1.5rem 4rem;
}
.ag-hero-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 430px);
  gap: 3rem;
  align-items: center;
}
.ag-kicker {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--primary);
  margin-bottom: 0.1rem;
}

.ag-hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text);
  text-wrap: balance;
  margin-bottom: 1rem;
}
.ag-hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.75rem;
}
.ag-updated {
  font-family: var(--ag-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  opacity: 0.8;
  margin-top: 2rem;
}

/* Server address */
.ag-endpoint {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--ag-line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.ag-endpoint-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.ag-endpoint code {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
  word-break: break-all;
}

/* Client availability row */
.ag-clients {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.ag-client {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--ag-line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
}
.ag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--primary);
}
.ag-dot--pending {
  background: var(--secondary);
}
.ag-client-state {
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* --- Transcript mockup --- */
.ag-transcript {
  background: var(--ag-ink);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.ag-transcript-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--ag-ink-line);
  font-family: var(--ag-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.ag-msg {
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
}
.ag-msg--user {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  align-self: flex-end;
  max-width: 92%;
}
.ag-msg--agent {
  background: var(--ag-ink-soft);
  border: 1px solid var(--ag-ink-line);
  color: var(--ag-ink-text);
}
.ag-msg--agent strong {
  color: white;
  font-weight: 600;
}
.ag-calls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.25rem 0;
}
.ag-call {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-family: var(--ag-mono);
  font-size: 0.8rem;
  color: var(--ag-mono-accent);
}
.ag-call span {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.75rem;
}

/* --- Coverage --- */
.ag-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem 1.75rem;
  margin: 1.75rem 0 2rem;
}
.ag-stat-num {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ag-stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}
.ag-provider-group + .ag-provider-group {
  margin-top: 1.5rem;
}
.ag-provider-group h3 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.7rem;
}
.ag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ag-chips-toggle {
  display: none;
}

.ag-chip {
  background: var(--surface);
  border: 1px solid var(--ag-line);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
  color: var(--text);
}

/* --- Coverage map: styles live in style.css (.cm-*) --- */
.ag-map {
  margin: 1.75rem 0 0.5rem;
}
.ag-map + .ag-provider-group {
  margin-top: 2rem;
}

/* --- Numbered steps --- */
.ag-steps {
  counter-reset: ag-step;
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
  max-width: 760px;
}
.ag-step {
  counter-increment: ag-step;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.ag-step::before {
  content: counter(ag-step);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.ag-step p {
  margin: 0.35rem 0 0;
}
.ag-step-title {
  font-weight: 600;
  color: var(--text);
  padding-top: 0.35rem;
}

/* Flow sequence */
.ag-seq {
  margin: 1.75rem 0 2.25rem;
}

.ag-seq-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  border: 1px solid var(--ag-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #eef3ef;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.09);
}

.ag-seq-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.ag-seq-frame.is-on {
  opacity: 1;
}

.ag-seq-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.9rem 0 0;
}

.ag-seq-bar .ag-seq-caption {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-secondary);
}


.ag-seq-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.ag-seq-toggle {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ag-line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.ag-seq-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.ag-seq-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.ag-seq-toggle svg {
  display: block;
  fill: currentColor;
}

/* beats the UA [hidden] rule, which this class selector would otherwise outrank */
.ag-seq-toggle svg[hidden] {
  display: none;
}

.ag-seq-dots {
  display: flex;
  gap: 0.45rem;
}

.ag-seq-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.ag-seq-dot.is-on {
  background: var(--primary);
  transform: scale(1.3);
}

.ag-seq-dot:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* --- Tinted-band surfaces --- */
.ag-band--tint .ag-chip {
  background: var(--surface);
}

/* --- Scope cards --- */
.ag-scopes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.ag-scope {
  background: var(--surface);
  border: 1px solid var(--ag-line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.ag-scope-name {
  font-family: var(--ag-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.4rem;
}
.ag-scope p {
  font-size: 0.92rem;
  margin: 0;
}
.ag-never {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.ag-never li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.035);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
}
.ag-never li::before {
  content: "\00d7";
  color: #c62828;
  font-weight: 700;
  margin-right: 0.4rem;
}

/* --- Tool table --- */
.ag-tools {
  margin-top: 2rem;
}
.ag-tool-family + .ag-tool-family {
  margin-top: 2.25rem;
}
.ag-tool-family-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.ag-tool-family-head h3 {
  margin: 0;
}
.ag-tool-count {
  font-family: var(--ag-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.ag-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--ag-line);
  border-radius: var(--radius);
  background: var(--surface);
}
table.ag-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}
table.ag-table th,
table.ag-table td {
  text-align: left;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--ag-line);
  vertical-align: top;
}
table.ag-table tr:last-child td {
  border-bottom: none;
}
table.ag-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.02);
}
table.ag-table td:first-child {
  white-space: nowrap;
}
table.ag-table code {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
}
table.ag-table td:last-child {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}
.ag-flag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b3261e;
  background: rgba(179, 38, 30, 0.08);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.4rem;
  vertical-align: 1px;
}

/* --- Prompt examples --- */
.ag-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.75rem;
}
.ag-prompt {
  background: var(--surface);
  border: 1px solid var(--ag-line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ag-prompt-quote {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.55;
  margin: 0;
  font-style: italic;
}
.ag-prompt-uses {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--ag-line);
}
.ag-prompt-uses code {
  font-size: 0.75rem;
  color: var(--primary-dark);
  background: var(--ag-tint);
  border-radius: 5px;
  padding: 0.15rem 0.45rem;
}

/* --- Two-column prose --- */
.ag-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
}
.ag-split h3 {
  margin-bottom: 0.5rem;
}
.ag-split p:last-child {
  margin-bottom: 0;
}

/* --- Closing help band --- */
.ag-help {
  text-align: center;
}
.ag-help p {
  margin-left: auto;
  margin-right: auto;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .ag-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }
  .ag-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }
}

@media (max-width: 700px) {
  /* the coverage lists run to 13 chips each -- collapse them to one row on a phone */
  .ag-provider-group.is-collapsed .ag-chips {
    overflow: hidden;
  }

  .ag-chips-toggle {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--primary-light);
    border-radius: 999px;
    background: transparent;
    color: var(--primary-dark);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
  }

  .ag-chips-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }
}

@media (max-width: 600px) {
  .ag-hero {
    padding-top: 6rem;
  }
  .ag-hero h1,
  .ag-kicker {
    font-size: 2rem;
  }
  .ag-band {
    padding: 3.25rem 1.25rem;
  }
  .ag-band h2 {
    font-size: 1.55rem;
  }
  .ag-scopes,
  .ag-prompts {
    grid-template-columns: minmax(0, 1fr);
  }
  .ag-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
  }

  /* 224,000+ crowds its neighbour in a two-column grid at this width */
  .ag-stat-num {
    font-size: 1.7rem;
  }
  .ag-msg--user {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag * {
    transition: none !important;
    animation: none !important;
  }
}
