/* =========================================================================
   Page — KI-Apps, the SIDES NEO MCP (U-2286, redesign brief R8j)
   -------------------------------------------------------------------------
   ai-apps.html in every tree. The frame, the hero band, the sections, the
   cards, the steps and the closing band are R8a's (marketing.css and the
   components); this file holds only what this one page draws: the map of the
   MCP in the hero, the example conversation, the store's domains and the four
   rules. The map itself and the home page's teaser band are
   components/ai-map.css. No literal colour; every value comes from tokens.css.

   The design draws its icons from the sides-icons font. A public page needs
   no script and the font's code points are named in `glyphs.js` alone, so
   this page carries no glyph: a check is a drawn mark, a domain and a rule
   carry their words and numbers.
   ========================================================================= */

/* ---- Hero: the copy beside the map ------------------------------------- */

.ai-hero > .container {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 40px;
}

@media (min-width: 1024px) {
  .ai-hero > .container {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
}

.ai-hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
}

.ai-hero h1 em {
  font-style: normal;
  color: var(--brand-mint);
}

.ai-tag {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 6px 12px;
  border: var(--border-w) solid var(--brand-mint);
  border-radius: var(--radius-pill);
  color: var(--brand-mint);
  font-size: var(--text-caption);
  line-height: var(--text-caption-lh);
  font-weight: 600;
}

.ai-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--hero-ink-quiet);
  font-size: var(--text-caption);
  line-height: var(--text-caption-lh);
}

/* A drawn check: two borders of a rotated box, in the mint on the dark band
   and in the link ink on a themed section. */
.ai-checks li::before,
.ai-trust li::before {
  content: "";
  display: inline-block;
  flex: none;
  width: 5px;
  height: 9px;
  margin: 0 8px 2px 2px;
  border: solid var(--sd-secondary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ai-trust li::before {
  border-color: var(--brand-mint);
}

/* ---- What sets SIDES apart: three cards with the accent bar ------------- */

.ai-cards .card {
  box-shadow: inset var(--border-w-strong) 0 0 var(--accent-bar);
}

.ai-cards h3 {
  margin: 0;
  font-size: var(--text-title-lg);
  line-height: var(--text-title-lg-lh);
}

/* ---- The example conversation ------------------------------------------ */

.ai-demo {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  align-items: start;
}

@media (min-width: 1024px) {
  .ai-demo {
    grid-template-columns: 1.1fr 1fr;
  }
}

.ai-demo-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.ai-checks {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xs) var(--space-lg);
  margin: var(--space-xs) 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .ai-checks {
    grid-template-columns: 1fr 1fr;
  }
}

.ai-checks li {
  display: flex;
  align-items: baseline;
}

.ai-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--doc-panel);
  box-shadow: var(--shadow-overlay);
}

.ai-chat .who {
  margin: 0;
  font-size: var(--text-caption);
  line-height: var(--text-caption-lh);
  color: var(--doc-ink-soft);
}

.ai-chat .bubble {
  max-width: 88%;
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius);
}

/* The band's teal in both themes, because the themed teal turns mint in dark
   and white on mint fails: white on #027261 is 5.86:1 (card.css's figure). */
.ai-chat .bubble-me {
  align-self: flex-end;
  background: var(--band-from);
  color: var(--brand-on-dark);
}

.ai-chat .bubble-ai {
  align-self: flex-start;
  background: var(--sd-surface-alt);
  color: var(--doc-ink);
}

.ai-calls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.ai-calls li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: var(--border-w) solid var(--doc-line);
  border-radius: var(--radius-sm);
  background: var(--doc-panel);
  font-size: var(--text-caption);
  line-height: var(--text-caption-lh);
}

/* Read and write are told apart by their WORD; the border is the accent. */
.ai-calls .rw {
  flex: none;
  padding: 0 6px;
  border: var(--border-w) solid var(--sd-info);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.ai-calls .rw-write {
  border-color: var(--sd-warning);
  background: var(--sd-warning-bg);
}

.ai-chat .demo-note {
  margin: 0;
  font-size: var(--text-caption);
  line-height: var(--text-caption-lh);
  color: var(--doc-ink-soft);
  text-align: center;
}

/* ---- The store's domains: eight tiles, 1 / 2 / 4 across ---------------- */

.ai-domains {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .ai-domains {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .ai-domains {
    grid-template-columns: repeat(4, 1fr);
  }
}

.ai-domains li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-md);
  border-radius: var(--radius);
  background: var(--doc-panel);
  box-shadow: inset var(--border-w-strong) 0 0 var(--accent-bar);
}

.ai-domains b {
  color: var(--doc-ink);
}

.ai-domains span {
  font-size: var(--text-caption);
  line-height: var(--text-caption-lh);
  color: var(--doc-ink-soft);
}

/* ---- Four rules, numbered, 2 × 2 from 768 px ---------------------------- */

.ai-rules {
  counter-reset: rule;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .ai-rules {
    grid-template-columns: 1fr 1fr;
  }
}

.ai-rules li {
  counter-increment: rule;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 0 var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius);
  background: var(--doc-panel);
}

.ai-rules li::before {
  content: counter(rule);
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: var(--border-w-strong) solid var(--sd-secondary);
  border-radius: var(--radius-pill);
  color: var(--sd-secondary);
  font-weight: 700;
}

.ai-rules h3 {
  margin: 0 0 6px;
  font-size: var(--text-title-lg);
  line-height: var(--text-title-lg-lh);
}

.section-alt .ai-rules li,
.section-alt .ai-domains li {
  background: var(--sd-surface-alt);
}

.ai-rules p {
  margin: 0;
  color: var(--doc-ink-soft);
}

.ai-chat .bubble-ai > p {
  margin: 0;
}

/* ---- Print: the page's inks on paper ------------------------------------ *
 * print.css restores the themed ink on `.on-brand`, and these are the parts
 * it cannot reach: the mint emphasis and tag of the hero and the visitor's
 * bubble, whose teal fill a printer drops. */
@media print {
  .ai-hero h1 em,
  .ai-tag {
    color: var(--doc-ink);
    border-color: var(--doc-ink);
  }

  .ai-chat .bubble-me {
    border: var(--border-w) solid var(--doc-line);
    background: transparent;
    color: var(--doc-ink);
  }
}
