/* ============================================================================
   Floom — AI & MCP
   ----------------------------------------------------------------------------
   One section: a line drawing of how the fund's records reach the tools people
   already work in, and the card that names them.

   Ported onto the site's own tokens rather than the drawing's. Every colour in
   here resolves through --ap-ink, --ap-orange or --ap-cream, so the section
   introduces none of its own and the design-system check has nothing new to
   learn. The greys are mixes of the ink into the cream, which is how the rest
   of the page makes its greys.
   ========================================================================== */

.mcp{
  background: var(--ap-cream);
  padding: var(--fl-pad-section) 0;
  /* the drawing's own palette, all of it derived */
  --mcp-stage: var(--ap-cream);   /* the drawing sits on the page, not on a panel */
  --mcp-face:  #FFFFFF;
  --mcp-ln:    var(--ap-ink);
  --mcp-ghost: color-mix(in srgb, var(--ap-ink) 16%, transparent);
  --mcp-bar:   color-mix(in srgb, var(--ap-ink) 13%, var(--ap-cream));
  --mcp-disc:  color-mix(in srgb, var(--ap-orange) 26%, var(--ap-cream));
  --mcp-side:  color-mix(in srgb, var(--ap-ink) 78%, var(--ap-cream));
  --mcp-note:  var(--text-secondary);
  --mcp-mono:  var(--font);      /* the system has no monospace: its notes and labels are Urbanist */
}
/* Centred, and narrower than the drawing below it: the words are a column,
   the drawing is the width of the window. The three gaps are the ones every
   other head on the site uses, stated rather than inherited — eyebrow to
   heading, heading to standfirst, standfirst to what follows. */
.mcp-head{
  display: grid; justify-items: center; text-align: center;
  margin-bottom: var(--fl-gap-head);
}
.mcp-head .ap-eyebrow{ margin: 0 0 var(--fl-gap-eyebrow); }
.mcp-head .mcp-stand{ margin-top: var(--fl-gap-stand); }
.mcp-head h2{
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fl-head-size);
  font-weight: var(--fl-head-weight);
  letter-spacing: var(--fl-head-track);
  line-height: var(--fl-head-lead);
  text-transform: uppercase;
  color: var(--black);
  text-wrap: balance;
  max-width: 24ch;
}
.mcp-head .mcp-stand{
  font-family: var(--font);
  /* 20px and 46ch, which is what every other standfirst on the site carries */
  font-size: clamp(15.79px, 1.7vw, 20px);
  font-weight: 450;
  line-height: 1.3;    /* the body leading the rest of the page uses */
  color: var(--text-secondary);
  text-wrap: balance;
  /* 76ch, not the 46 the other standfirsts carry: at 46 both of these run to
     three lines and the block reads as a paragraph rather than a standfirst.
     76 holds them to two, and the container caps it below 1000. */
  max-width: 76ch;
}
/* The break is at the full stop, which is where the copy itself breaks — not
   wherever the balancer lands. Above 1120 it is written in and the balancer
   stands down; below that the second sentence is wider than the measure, so
   the break is hidden and the line wraps on its own. The space before the
   <br> is load-bearing: hidden, it is the only thing between the two halves. */
.mcp-stand br{ display: none; }
@media (min-width: 1120px){
  .mcp-head .mcp-stand{ text-wrap: initial; }
  .mcp-stand br{ display: inline; }
}

/* ── the stage ────────────────────────────────────────────────────────────*/
.mcp-stage{
  /* The box still spans the window — it is what the incoming threads run out
     into — but it carries no surface of its own, so there is no panel edge
     anywhere on the page. */
  margin-inline: round(calc(50% - 50vw), 4px);
  border-radius: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.mcp-stage::-webkit-scrollbar{ display: none; }
.mcp-stage svg{
  /* Drawn on the same column as every other section, rather than stretched to
     the window. overflow:visible lets the threads carry on past that column
     and out to the window edge; the stage clips them there. */
  display: block;
  width: min(100%, 1360px);
  min-width: 1100px;
  height: auto;
  margin-inline: auto;
  overflow: visible;
}
/* Upright (floom-mcp.js lays the drawing out top to bottom on a phone, where
   the strip no longer fits): the column's width, 560 at most, and no floor —
   there is nothing to pan. */
.mcp-stage svg.is-upright{ min-width: 0; width: min(100%, 560px); }
/* A phone: the upright drawing at the column's width is seven tenths of its
   own size at 400px. The annotation and the windows' cell and formula labels
   come out at 5 to 10px at that — too small to read, so they only added
   grain. The shapes say it; the names (files, tools, the server) stay. */
@media (max-width: 760px){
  .mcp .note, .mcp .arrow, .mcp .ah, .mcp .code{ display: none; }
}

.mcp .ln{ fill: none; stroke: var(--mcp-ln); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mcp .face{ fill: var(--mcp-face); stroke: var(--mcp-ln); stroke-width: 1.5; stroke-linejoin: round; }
.mcp .ghost{ fill: none; stroke: var(--mcp-ghost); stroke-width: 1.5; stroke-linejoin: round; }
.mcp .ghost-fill{ fill: var(--mcp-stage); stroke: var(--mcp-ghost); stroke-width: 1.5; stroke-linejoin: round; }
.mcp .solid{ fill: var(--mcp-ln); }
.mcp .bar{ fill: var(--mcp-bar); }
.mcp .soft{ fill: var(--mcp-note); opacity: .45; }
.mcp .grid-ln{ stroke: var(--mcp-bar); stroke-width: 1.2; }
.mcp .disc-top{ fill: var(--mcp-disc); stroke: var(--mcp-ln); stroke-width: 1.5; }
.mcp .accent-fill{ fill: var(--ap-orange); }
.mcp .accent-ln{ fill: none; stroke: var(--ap-orange); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mcp .note{ font-family: var(--mcp-mono); font-size: 15px; fill: var(--mcp-note); transition: fill .16s; }
/* Size is authored per element, in the drawing's own coordinates (8px on a
   spreadsheet label, 9px on a tool call, 10px on a window title). Declaring
   one here would override every one of those presentation attributes. */
.mcp .code{ font-family: var(--mcp-mono); fill: var(--mcp-note); opacity: .6; }
/* The things in the drawing that are names rather than annotations — a file,
   a tool, the server — are set in the page's own face, not its monospace. */
.mcp .lab-name text{
  font-family: var(--font-display);
  font-weight: 700;
  fill: var(--black);
}
/* ds-exempt-start: a vendor's own mark is their colour, not ours. The knot's
   loops are filled with the ground behind them rather than white — the mark
   has no background of its own, and a white one reads as a card under it. */
.mcp .mark-knot{ fill: var(--mcp-stage); stroke: #000000; stroke-linejoin: round; }
.mcp .mark-ray{ fill: #D97757; }
/* ds-exempt-end */
.mcp .ah-t{ fill: none; stroke: var(--ap-orange); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mcp .arrow, .mcp .ah{ fill: none; stroke: var(--mcp-note); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; transition: stroke .16s; }
.mcp .tile-out{ fill: var(--mcp-ln); stroke: var(--mcp-ln); stroke-width: 3; }
.mcp .tile-side{ fill: var(--mcp-side); }
.mcp .tile-front{ fill: var(--mcp-ln); stroke: var(--mcp-ln); stroke-width: 1.5; }
.mcp .wave{ fill: none; stroke: var(--ap-orange); stroke-width: 3; stroke-linecap: round; }

/* What is moving on the wire: orange out of the record, ink back into it. */
.mcp .pulse{
  fill: none; stroke: var(--ap-orange); stroke-width: 3.2; stroke-linecap: round;
  stroke-dasharray: 22 1000; stroke-dashoffset: 22;
  animation: mcp-flow 3.2s linear infinite;
}
.mcp .pulse.write{ stroke: var(--mcp-ln); animation-name: mcp-flow-back; animation-duration: 3.6s; }
/* off screen (floom-mcp.js): a repaint a frame for nothing */
.mcp svg.is-off .pulse{ animation-play-state: paused; }
@keyframes mcp-flow{      from{ stroke-dashoffset: 22; }    to{ stroke-dashoffset: -1000; } }
@keyframes mcp-flow-back{ from{ stroke-dashoffset: -1000; } to{ stroke-dashoffset: 22; } }

.mcp .grp{ transition: transform var(--ap-swipe-dur, 480ms) var(--ap-swipe-ease, cubic-bezier(.2, 1.2, .35, 1)); }

/* ── naming a tool ────────────────────────────────────────────────────────
   A row of names under the drawing. Picking one shows that part and steps the
   rest back; picking it again puts them all back. */
.mcp-chips{
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px round(clamp(24px, 3.4vw, 44px), 4px);
  margin-top: round(clamp(24px, 3vw, 40px), 4px);
}
.mcp-chip{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 4px;
  border: 0; background: none; cursor: pointer;
  font-family: var(--font);
  font-size: 16.5px; font-weight: 600; line-height: 1;
  color: var(--text-secondary);
  transition: color .14s ease, transform .12s ease-out;
}
.mcp-chip .mcp-mark{ width: 22px; height: 22px; flex: none; display: grid; place-items: center; }
/* Each chip carries the tool's own mark from the library (LIBRARY.md):
   Floom's from /favicon.svg, the vendors' from assets/brand, as supplied and
   never recoloured — only the name takes the orange. */
.mcp-chip .mcp-mark img{ display: block; width: 100%; height: 100%; object-fit: contain; }
.mcp-chip .mcp-mark svg{
  width: 100%; height: 100%;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
/* The same answer the product cards give: the name takes the orange and the
   whole thing comes up a little. More than the cards' 1.5% because a chip is
   a fifth of their width and the same percentage would not be seen. */
.mcp-chip:is(:hover, :focus-visible, .is-on){ color: var(--ap-orange); }
.mcp-chip:is(:hover, :focus-visible){ transform: scale(1.06); }
.mcp-chip:active{ transform: scale(.97); }
/* On a phone the four names need 383px and get 358, so the row broke three
   and one. Two by two instead, centred, the same as the Access section's
   tool row. */
@media (max-width: 760px){
  .mcp-chips{
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: center;
    gap: var(--sp-2) var(--sp-8);
  }
  .mcp-chip{ justify-self: start; }
}

/* The jump: up and a little larger at the top of it, then down and back to
   size, with one small second bounce so it lands rather than stops. The part
   turns about its own middle, set on the element in floom-mcp.js. */
.mcp [data-part]{ transform-box: view-box; }
.mcp [data-part].is-hop{ animation: mcp-hop 780ms cubic-bezier(.22, 1, .36, 1); }
@keyframes mcp-hop{
  0%   { transform: translateY(0)     scale(1);     }
  26%  { transform: translateY(-17px) scale(1.055); }
  54%  { transform: translateY(0)     scale(1.008); }
  74%  { transform: translateY(-5px)  scale(1.022); }
  100% { transform: translateY(0)     scale(1);     }
}

@media (prefers-reduced-motion: reduce){
  .mcp .pulse{ display: none; }
  .mcp .grp, .mcp [data-part]{ transition: none; }
  /* No jump. The name still colours, so the click is still answered. */
  .mcp [data-part].is-hop{ animation: none; }
}

/* ── the threads, in the design language's own three strengths ────────────
   Loose is an unread input and the only thing that wobbles, woven is Floom
   working, ruled is the saved record and it ends in a cell. The drawing reads
   left to right in that order, which is the order the language sets. */
.mcp .t-loose{ fill: none; stroke: var(--ap-orange); stroke-width: 1.5; stroke-linecap: round; opacity: .25; }
.mcp .t-woven{ fill: none; stroke: var(--ap-orange); stroke-width: 1.5; stroke-linecap: round; opacity: .5; }
.mcp .t-ruled{ fill: none; stroke: var(--ap-orange); stroke-width: 1.75; stroke-linecap: round; }
.mcp .t-cell{ fill: var(--ap-orange); }
.mcp .doc{ fill: var(--mcp-face); stroke: var(--mcp-ln); stroke-width: 1.5; stroke-linejoin: round; }
.mcp .doc-ln{ fill: none; stroke: var(--mcp-note); stroke-width: 1.4; stroke-linecap: round; opacity: .55; }
.mcp .win{ fill: var(--mcp-face); stroke: var(--mcp-ln); stroke-width: 1.5; }
.mcp .win-bar{ fill: var(--mcp-ln); }
.mcp .win-side{ fill: var(--mcp-stage); }
