/* agentmessaging.ai: the readable palette shared with dev.agentmesh.ai and the
   standards sites (approved 2026-10-11). Light by default, dark on the toggle.
   Every text colour clears 4.5:1 on the ground it sits on; none is faded. */

/* ── Light (the default) ── */
:root{
  /* grounds */
  --bg:#FFFFFF;          /* page and content */
  --surface:#F6F4EF;     /* left menu, cards, diagram side panels (warm off-white) */
  --line:#DCD8CF;        /* borders only, never text */

  /* text */
  --text:#14211F;        /* headings, body, menu headings     16.57 on bg, 15.08 on surface */
  --text-2:#3B4A48;      /* secondary body, menu items          9.30 on bg,  8.46 on surface */
  --text-3:#4F5F5C;      /* captions, labels, small print       6.72 on bg,  6.12 on surface */

  /* the teal accent: links, current page, kickers */
  --accent:#0A5E49;      /*                                     7.75 on bg,  7.05 on surface */
  --accent-tint:#E3F1EB; /* current-page row; --text on it     14.24, --accent on it 6.66 */

  /* diagram and standard colours (text, border, tint) */
  --amber:#8A4B00;       --amber-tint:#FDF1E0;   /* 6.80 on bg, 6.10 on its tint */
  --blue:#1D5BC2;        --blue-tint:#EAF1FD;    /* 6.31 on bg, 5.56 on its tint */
  --violet:#6340C4;      --violet-tint:#F1ECFC;  /* 6.86 on bg, 5.93 on its tint */
  --mint:#0A5E49;        --mint-tint:#E3F1EB;    /* 7.75 on bg, 6.66 on its tint */

  --disp:'Space Grotesk', sans-serif;
  --body:'IBM Plex Sans', system-ui, sans-serif;
  --wire:'IBM Plex Mono', ui-monospace, monospace;
}

/* ── Dark (only when the reader turns it on) ── */
:root[data-theme="dark"]{
  --bg:#10191C;
  --surface:#16232A;
  --line:#2A3B40;

  --text:#E9F0EE;        /* 15.42 on bg, 13.89 on surface */
  --text-2:#C3D0CD;      /* 11.23 on bg, 10.11 on surface */
  --text-3:#A7B6B2;      /*  8.47 on bg,  7.63 on surface */

  --accent:#4FD9AB;      /* 10.06 on bg,  9.06 on surface */
  --accent-tint:#15302A; /* --text on it 12.21, --accent on it 7.96 */

  --amber:#F2A93B;       --amber-tint:#2A2418;   /* 8.93 on bg, 7.71 on its tint */
  --blue:#8AB8FF;        --blue-tint:#172636;    /* 8.81 on bg, 7.59 on its tint */
  --violet:#C2AEFF;      --violet-tint:#221F35;  /* 9.16 on bg, 8.20 on its tint */
  --mint:#4FD9AB;        --mint-tint:#15302A;    /* 10.06 on bg, 7.96 on its tint */
}

*{ box-sizing:border-box; }
html,body{ margin:0; }
body{ background:var(--bg); color:var(--text); font-family:var(--body);
  font-size:17px; line-height:1.65; -webkit-font-smoothing:antialiased; }
a{ color:var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }
h1,h2,h3{ font-family:var(--disp); font-weight:700; letter-spacing:-.015em; line-height:1.15; color:var(--text); }

/* ── shell ── */
.layout{ display:grid; grid-template-columns:280px 1fr; min-height:100vh; }
.rail{ background:var(--surface); border-right:1px solid var(--line);
  position:sticky; top:0; align-self:start; height:100vh; overflow-y:auto;
  scrollbar-width:thin; padding:22px 18px 28px; }
.railhead{ display:flex; align-items:center; gap:10px; margin:0 0 22px; }
.brand{ display:flex; align-items:center; gap:9px; color:var(--text); text-decoration:none; }
.brand .mark{ flex:none; }
.brand .wm{ font-family:var(--disp); font-weight:500; font-size:1.12rem; letter-spacing:-.01em; }
.brand .wm b{ font-weight:700; }
.iconbtn{ margin-left:auto; display:inline-flex; align-items:center; gap:6px;
  font-family:var(--body); font-size:.85rem; font-weight:600; color:var(--text);
  background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:6px 10px; cursor:pointer; }
.iconbtn:hover{ border-color:var(--text-3); }
.iconbtn svg{ width:16px; height:16px; }
.iconbtn .to-light{ display:none; }
:root[data-theme="dark"] .iconbtn .to-dark{ display:none; }
:root[data-theme="dark"] .iconbtn .to-light{ display:inline; }
.menubtn{ display:none; margin-left:0; }

/* ── left menu ── */
.rail nav{ display:block; }
.sec{ margin:0 0 6px; }
.sec > summary{ list-style:none; cursor:pointer; display:flex; align-items:center; gap:8px;
  font-family:var(--body); font-size:.9rem; font-weight:700; letter-spacing:.01em;
  color:var(--text); padding:8px 10px; border-radius:8px; }
.sec > summary::-webkit-details-marker{ display:none; }
.sec > summary:hover{ background:var(--bg); }
.sec > summary .chev{ margin-left:auto; width:14px; height:14px; color:var(--text-3);
  transition:transform .15s ease; }
.sec[open] > summary .chev{ transform:rotate(90deg); }
.sec .items{ padding:2px 0 8px; }
.rail nav a{ display:block; font-family:var(--body); font-size:.9375rem; line-height:1.35;
  color:var(--text-2); text-decoration:none; padding:7px 10px 7px 20px; margin:1px 0;
  border-radius:8px; border-left:3px solid transparent; }
.rail nav a:hover{ color:var(--text); background:var(--bg); }
.rail nav a.on{ color:var(--text); font-weight:600; background:var(--accent-tint);
  border-left-color:var(--accent); }
.rail .ext{ font-size:.8em; margin-left:3px; }
.rail .foot{ margin-top:22px; padding:16px 10px 0; border-top:1px solid var(--line);
  font-size:.85rem; color:var(--text-3); line-height:1.5; }
.rail .foot a{ color:var(--accent); font-weight:600; }

.main{ min-width:0; }
.wrap{ max-width:1000px; margin:0 auto; padding:0 48px; }

/* ── shared type ── */
.kicker{ font-family:var(--body); font-size:.82rem; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--accent); margin:0 0 12px; }
section.band{ padding:56px 0; border-bottom:1px solid var(--line); }
section.band h2{ font-size:1.9rem; margin:0 0 14px; }
section.band > .wrap > p{ color:var(--text-2); max-width:66ch; }
b{ color:var(--text); font-weight:600; }

/* ── home ── */
.hero{ padding-top:64px; padding-bottom:32px; }
.eyebrow{ display:block; font-size:.82rem; font-weight:700; letter-spacing:.08em;
  text-transform:uppercase; color:var(--accent); margin-bottom:18px; }
.hero h1{ font-size:clamp(2.2rem,4.6vw,3rem); margin:0 0 14px; }
.lede{ color:var(--text-2); font-size:1.15rem; max-width:56ch; margin:0; }
.quick{ margin:22px 0 4px; background:var(--surface); border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.quick .bar{ padding:10px 16px; border-bottom:1px solid var(--line); font-size:.85rem;
  font-weight:600; color:var(--text-2); }
.quick pre{ margin:0; padding:16px 18px; font-family:var(--wire); font-size:.9rem; line-height:1.7;
  color:var(--text); background:var(--bg); overflow-x:auto; }
.quick .note{ padding:12px 18px; border-top:1px solid var(--line); font-size:.95rem; color:var(--text-2); }
.doors{ display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin:28px 0 6px; }
.doors a.door{ --c:var(--accent); display:block; text-decoration:none; border:1px solid var(--line);
  border-left:4px solid var(--c); border-radius:12px; background:var(--bg); padding:18px 20px; }
.doors a.door:hover{ border-color:var(--text-3); border-left-color:var(--c); }
.doors .door h3{ font-size:1.12rem; margin:0 0 6px; }
.doors .door p{ margin:0 0 8px; font-size:.97rem; color:var(--text-2); }
.doors .door p.go{ margin:0; font-size:.88rem; font-weight:600; color:var(--c); }
.doors a.door.c-amber{ --c:var(--amber); } .doors a.door.c-mint{ --c:var(--mint); }
.doors a.door.c-blue{ --c:var(--blue); } .doors a.door.c-violet{ --c:var(--violet); }
.after{ color:var(--text-2); font-size:.97rem; margin:28px 0 0; max-width:64ch; }
footer.sitefoot{ padding:18px 0 60px; }
footer.sitefoot .wrap{ font-size:.9rem; color:var(--text-3); display:flex; gap:16px; flex-wrap:wrap; }


/* ── agentmessaging.ai: the brand mark, buttons and the pieces its pages use ── */
.brand .mark{ color:var(--accent); }
.brand .wm{ white-space:nowrap; font-size:1rem; }
.cta{ display:flex; gap:12px; flex-wrap:wrap; margin-top:24px; }
.btn{ font-family:var(--body); font-size:.95rem; font-weight:600; text-decoration:none;
  padding:11px 18px; border-radius:9px; border:1px solid var(--line); display:inline-flex; align-items:center; gap:8px; }
.btn-primary{ background:var(--accent); border-color:var(--accent); color:var(--bg); }
.btn-primary:hover{ text-decoration:underline; }
.btn-ghost{ background:var(--bg); color:var(--text); }
.btn-ghost:hover{ border-color:var(--text-3); }
.version{ font-size:.92rem; color:var(--text-3); margin:16px 0 0; }
.mono{ font-family:var(--wire); }
code.inline, .band p code, .band li code{ font-family:var(--wire); font-size:.88em; color:var(--accent);
  background:var(--accent-tint); border-radius:5px; padding:1px 5px; overflow-wrap:anywhere; }

/* the envelope figure on the home page, built on .quick */
.quick pre .k{ color:var(--text-3); }
.quick pre .v{ color:var(--amber); }
.quick pre .addr{ color:var(--blue); }
.quick pre .ok{ color:var(--accent); font-weight:600; }

/* the six primitives */
.prims{ display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:24px 0; }
.prims div{ background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px 18px; }
.prims .n{ font-family:var(--wire); font-size:.95rem; font-weight:600; color:var(--accent); }
.prims p{ margin:6px 0 0; font-size:.95rem; color:var(--text-2); }

/* lists and code on the conformance page */
ul.plain{ margin:18px 0 0; padding-left:20px; color:var(--text-2); max-width:70ch; }
ul.plain li{ margin:10px 0; }
pre.code{ background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px 18px;
  overflow-x:auto; font-family:var(--wire); font-size:.88rem; line-height:1.7; color:var(--text); margin:20px 0; }
pre.code .c{ color:var(--text-3); }
table.tests{ border-collapse:collapse; margin:22px 0 0; width:100%; max-width:880px;
  border:1px solid var(--line); border-radius:10px; display:block; overflow-x:auto; }
table.tests th{ font-size:.82rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  color:var(--text-3); text-align:left; padding:10px 14px; background:var(--surface);
  border-bottom:1px solid var(--line); white-space:nowrap; }
table.tests td{ padding:10px 14px; border-bottom:1px solid var(--line); font-size:.95rem; color:var(--text-2); vertical-align:top; }
table.tests tr:last-child td{ border-bottom:0; }
table.tests td:first-child{ font-family:var(--wire); font-weight:600; color:var(--accent); white-space:nowrap; }
table.tests td:last-child{ font-family:var(--wire); font-size:.88rem; color:var(--text-3); white-space:nowrap; }

/* ── narrow screens ── */
@media (max-width:900px){
  .layout{ grid-template-columns:1fr; }
  .rail{ position:sticky; top:0; z-index:10; height:auto; max-height:100vh; border-right:0;
    border-bottom:1px solid var(--line); padding:12px 16px; }
  .railhead{ margin:0; }
  .menubtn{ display:inline-flex; }
  .rail nav, .rail .foot{ display:none; }
  .rail.open nav{ display:block; margin-top:14px; }
  .rail.open .foot{ display:block; }
  .wrap{ padding-left:16px; padding-right:16px; }
  table.tests td:last-child{ white-space:normal; }
  .doors, .prims{ grid-template-columns:1fr; }
  .hero{ padding-top:40px; }
}
@media (max-width:700px){
  .quick pre{ font-size:.8rem; padding:14px 14px; }
}
@media (prefers-reduced-motion:reduce){ *{ transition:none !important; } }
