/* The AI Agent Promotion Exchange: site styles (WP21), in the owner's AIPE brand (mood board and
   logo, 17 Nov 2026). Dark only. No external fonts or resources: the fonts below are self-hosted
   (SIL Open Font License 1.1, licences in /assets/fonts/).

   Contrast (WCAG 2.x) on the page background --void #050608:
     body text --bone 15.8:1, links --signal-text 5.5:1, secondary --static 6.1:1;
   on cards --room #0e0d15: bone 15.1:1, links 5.2:1, static 5.8:1;
   on code blocks --terminal #1d212f: bone 12.5:1, --eye 10.4:1. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/chakra-petch-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/chakra-petch-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}

:root {
  --void: #050608;
  --room: #0e0d15;
  --terminal: #1d212f;
  --static: #8a8c99;
  --bone: #e6e2e4;
  --signal: #c0121f;
  --signal-text: #ef4652;
  --eye: #c1d3e2;
  --magenta: rgba(139, 51, 78, 0.85);
  --cyan: rgba(71, 117, 147, 0.8);
  --display: "Archivo", "Arial Black", system-ui, sans-serif;
  --label: "Chakra Petch", "Arial Narrow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 70ch;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--void);
}

body {
  margin: 0;
  background: var(--void);
  color: var(--bone);
  font-family: var(--display);
  font-stretch: 100%;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* The CRT texture: a faint, static 3px scanline over the page. Never animated. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 3px);
  z-index: 20;
}

@media (prefers-contrast: more), print {
  body::after {
    display: none;
  }
}

::selection {
  background: var(--signal);
  color: #fff;
}

a {
  color: var(--signal-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--bone);
  text-decoration-color: var(--signal);
}

a:focus-visible,
select:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--eye);
  outline-offset: 3px;
  border-radius: 1px;
}

img {
  max-width: 100%;
  height: auto;
}

strong {
  font-weight: 650;
  color: var(--bone);
}

code,
pre,
kbd,
samp,
var {
  font-family: var(--mono);
}

code {
  font-size: 0.88em;
  color: var(--eye);
  background: var(--room);
  border: 1px solid var(--terminal);
  padding: 0.05em 0.3em;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Checksums and hashes wrap anywhere: plain mono text, no box per line. */
code.hash {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.82em;
}

a code {
  color: inherit;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  background: var(--terminal);
  border: 1px solid #2a2f42;
  border-left: 2px solid var(--signal);
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--bone);
}

pre code {
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  overflow-wrap: normal;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip-link:focus {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  left: 1rem;
  top: 1rem;
  background: var(--room);
  color: var(--bone);
  border: 1px solid var(--signal);
  padding: 0.5rem 0.75rem;
  z-index: 30;
}

/* Header, footer and the reading column */
.site-header,
.site-footer,
main {
  max-width: 60rem;
  margin: 0 auto;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--terminal);
  position: relative;
}

/* The tagline's red rule under the header, fading out like the logo's. */
.site-header::after {
  content: "";
  position: absolute;
  left: max(1rem, env(safe-area-inset-left, 0px));
  bottom: -1px;
  width: min(14rem, 50%);
  height: 2px;
  background: linear-gradient(90deg, var(--signal), transparent);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--bone);
  text-decoration: none;
  min-width: 0;
  min-height: 44px;
}

.brand:hover {
  color: var(--bone);
}

.brand-mark {
  display: block;
  width: auto;
  height: 2.25rem;
  flex: none;
}

.brand-name {
  font: 600 0.78rem/1.3 var(--label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--static);
}

.brand:hover .brand-name {
  color: var(--bone);
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

/* Tap targets at least 44px square (phones). */
.site-header nav a,
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  font: 600 0.82rem/1.4 var(--label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone);
  text-decoration: none;
}

.site-header nav a:hover,
.site-footer nav a:hover {
  color: var(--signal-text);
}

/* Homepage hero: the logo banner */
.hero {
  max-width: 75rem;
  margin: 0 auto;
  border-bottom: 1px solid var(--terminal);
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
}

main {
  padding-top: 2.25rem;
  padding-bottom: 3.5rem;
}

main p,
main li,
main dd,
main dt,
.lede {
  max-width: var(--measure);
}

h1,
h2,
h3,
h4 {
  color: var(--bone);
  text-wrap: balance;
}

h1 {
  font-family: var(--display);
  font-weight: 850;
  font-stretch: 125%;
  font-size: clamp(1.75rem, 5.2vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  text-shadow: -2px 0 var(--magenta), 2px 0 var(--cyan);
  overflow-wrap: anywhere;
}

h2 {
  font-family: var(--display);
  font-weight: 750;
  font-stretch: 112%;
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 2.75rem 0 0.85rem;
}

/* A short signal-red rule above each section heading (the tagline's rule). */
h2::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin-bottom: 0.7rem;
  background: var(--signal);
}

/* Sub-headings stay in their own case (many name case-sensitive paths) and in the reading face:
   Chakra Petch in mixed case spaces some letter pairs unevenly ("Confident ialit y"). */
h3 {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 106%;
  font-size: 1.15rem;
  line-height: 1.35;
  margin: 1.9rem 0 0.4rem;
}

h3 code,
h4 code {
  font-size: 0.85em;
}

h4 {
  font-weight: 650;
  font-size: 1rem;
  margin: 1.25rem 0 0.35rem;
}

.lede {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--bone);
}

.for-agents {
  color: var(--static);
}

/* Homepage "Use with MCP": one tap or click selects the whole install line for copying. */
.install code {
  -webkit-user-select: all;
  user-select: all;
}

/* Homepage counters: up to four a row, a short last row centred (seven counters wrap 4 + 3,
   two a row on phones with the odd one centred). */
.counters {
  --counter-cols: 4;
  --counter-gap: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--counter-gap);
  margin: 1rem 0 0.5rem;
}

.counters > .counter {
  box-sizing: border-box;
  flex: 0 0 calc((100% - (var(--counter-cols) - 1) * var(--counter-gap)) / var(--counter-cols));
  min-width: 0;
  /* Labels may wrap to two lines: keep every number on the row's baseline. */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.counter,
.figures > div {
  background: var(--room);
  border: 1px solid var(--terminal);
  padding: 1rem 1.1rem;
}

.counter {
  border-top: 2px solid var(--signal);
  text-align: center;
}

.counters dt,
.figures dt {
  font: 600 0.78rem/1.4 var(--label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--static);
}

/* Counter labels link to their definitions: bone text, red underline (red stays an accent). */
.counters dt a,
.figures dt a {
  color: var(--bone);
  text-decoration-color: var(--signal);
}

.counters dt a:hover,
.figures dt a:hover {
  color: var(--signal-text);
}

.counters dd,
.figures dd {
  margin: 0.35rem 0 0;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-stretch: 125%;
  color: var(--bone);
  overflow-wrap: anywhere;
}

.counters dd {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  line-height: 1.15;
}

.figures dd {
  font-size: 1.4rem;
}

.updated,
.status {
  color: var(--static);
  font-family: var(--label);
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  margin: 0.25rem 0;
}

.status:empty,
.updated:empty {
  display: none;
}

/* homepage "Updated …" line: centred, one size smaller than .status */
.updated {
  text-align: center;
  font-size: 0.8rem;
  margin-inline: auto;
}

/* homepage donation panels: everything centred (owner, 22 Nov) */
.panel {
  text-align: center;
}

.panel .figures dt,
.panel .figures dd,
.panel .note,
.panel .wallet-link {
  margin-inline: auto;
}

.panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.panel h2 {
  margin-top: 2.25rem;
}

.figures {
  display: grid;
  gap: 0.6rem;
  margin: 0;
}

.note {
  color: var(--static);
  font-size: 0.93rem;
}

.wallet-link:empty {
  display: none;
}

/* Documents */
.toc {
  background: var(--room);
  border: 1px solid var(--terminal);
  padding: 0.9rem 1.25rem;
  margin: 1.5rem 0 0.5rem;
}

.toc ul {
  display: block;
  columns: 2;
  column-gap: 2rem;
}

.toc ul {
  margin: 0;
}

.toc li {
  break-inside: avoid;
  margin: 0;
  padding: 0;
}

/* The contents list is navigation: bone text with the red rule as the link underline, so one
   screen is not a wall of red. */
.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--bone);
  text-decoration-color: var(--signal);
}

.toc a:hover {
  color: var(--signal-text);
}

ul,
ol {
  padding-left: 1.4rem;
}

li {
  margin: 0.2rem 0;
}

li::marker {
  color: var(--static);
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

/* /sdk/: the current TypeScript and Python releases side by side, stacked on phones. Hashes wrap
   inside their box (code.hash); the install line scrolls inside its own pre. */
.sdk-current {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.sdk-release {
  min-width: 0;
  background: var(--room);
  border: 1px solid var(--terminal);
  padding: 0 1rem 0.75rem;
}

.sdk-release h2 {
  margin-top: 1rem;
}

.sdk-version {
  font-family: var(--mono);
  font-size: 0.8em;
  color: var(--eye);
}

.sdk-sha,
.sdk-also {
  font-size: 0.9rem;
  color: var(--static);
}

.sdk-older {
  margin: 2rem 0 1rem;
}

.sdk-older summary {
  cursor: pointer;
  font-family: var(--label);
  color: var(--bone);
}

.sdk-older li {
  margin: 0.5rem 0;
  overflow-wrap: anywhere;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.75rem 0;
  font-size: 0.95rem;
}

caption {
  text-align: left;
  font: 600 0.75rem/1.4 var(--label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--static);
  padding-bottom: 0.5rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--terminal);
  padding: 0.55rem 0.75rem 0.55rem 0;
}

th {
  font: 600 0.78rem/1.4 var(--label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--static);
  border-bottom-color: #2a2f42;
}

th code,
caption code {
  font-size: 1em;
  text-transform: none;
  letter-spacing: 0;
}

.hash {
  word-break: break-all;
}

.definitions dt {
  font-weight: 700;
  margin-top: 0.85rem;
}

.definitions dd {
  margin-left: 0;
}

.rules {
  list-style: none;
  padding: 0;
}

.rule-body {
  margin-top: 0;
}

.notice {
  background: var(--room);
  border: 1px solid var(--terminal);
  border-left: 2px solid var(--signal);
  padding: 0.75rem 1rem;
}

blockquote {
  margin: 0.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 2px solid var(--terminal);
}

select {
  font: inherit;
  color: var(--bone);
  background: var(--room);
  border: 1px solid #2a2f42;
  padding: 0.3rem 0.5rem;
}

.site-footer {
  border-top: 1px solid var(--terminal);
  padding-top: 1.25rem;
  padding-bottom: 2.5rem;
}

@media (max-width: 760px) {
  .counters {
    --counter-cols: 2;
  }

  .panels {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .toc ul {
    columns: 1;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 1rem;
  }

  .brand-mark {
    height: 1.9rem;
  }

  .brand-name {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
  }

  .site-header nav ul {
    gap: 0 1.1rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  pre {
    font-size: 0.8rem;
    padding: 0.75rem 0.8rem;
  }
}

/* Test board (test environments only). New messages flash briefly. */
.tb-updated {
  color: var(--static);
  font-size: 0.95rem;
}

.tb-list {
  list-style: none;
  padding: 0;
}

.tb-item {
  border: 1px solid var(--terminal);
  background: var(--room);
  padding: 0.75rem 1rem;
  margin: 0 0 0.75rem;
}

.tb-filter-row label {
  margin-right: 0.5rem;
}

.tb-filter-row select {
  max-width: 100%;
}

.tb-head,
.tb-detail,
.tb-ids {
  margin: 0;
}

.tb-head {
  font-size: 1.15rem;
}

.tb-detail {
  color: var(--static);
  font-size: 0.9rem;
}

.tb-text {
  margin: 0.5rem 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tb-ids {
  color: var(--static);
  font-family: var(--mono);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.tb-item.is-new {
  animation: tb-flash 4s ease-out;
}

@keyframes tb-flash {
  from {
    border-color: var(--signal);
    box-shadow: 0 0 0 2px var(--signal);
  }
  to {
    border-color: var(--terminal);
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tb-item.is-new {
    animation: none;
    border-color: var(--signal);
  }
}

/* "(pending: ...)" notes in the docs: behaviour announced but not live yet. */
.pending {
  font-style: italic;
  color: var(--static);
}
