/* ==========================================================================
   /mcp-tools — Figma 0:5548 (desktop) / 0:8039 (mobile)
   Loaded after style.css + product.css. Diagrams sit at Figma coordinates
   and scale as a unit on phones. ≥ 1000 px desktop frame, < 1000 px mobile.
   ========================================================================== */

/* ---- Two use cases ─ 0:5595 ---- */
.mc-uses { padding: 85px 0; }
.mc-uses__wrap { width: min(1200px, 100% - 48px); margin: 0 auto; }
.mc-uses__title { padding: 48px 0; font-size: 40px; font-weight: 600; font-variation-settings: "opsz" 31; line-height: 1.1; letter-spacing: -0.01em; }
.uc { position: relative; display: flex; }
/* the outer rule sits on top of the cards (inside stroke, 484 tall as drawn) */
.uc::after { content: ''; position: absolute; z-index: 3; inset: 0; border: 1px solid var(--hairline); pointer-events: none; }
.uc-card { z-index: 0; }
.uc-card { position: relative; flex: 0 0 50%; height: 484px; overflow: hidden; background: #101010; }
.uc-card + .uc-card { border-left: 1px solid var(--hairline); }
.uc-card > * { position: absolute; }
/* 13 × 13 cells of 46.846 px, drawn as a tiled background (Figma: a 609 px grid at 30 %) */
.uc-grid {
  left: calc(50% + 1px);
  top: -10px;
  width: 609px;
  height: 609px;
  margin-left: -304.5px;
  opacity: .3;
  background:
    linear-gradient(to right, var(--hairline) .756px, transparent .756px) 0 0 / 46.846px 46.846px,
    linear-gradient(to bottom, var(--hairline) .756px, transparent .756px) 0 0 / 46.846px 46.846px;
  box-shadow: inset -.756px -.756px 0 var(--hairline);
}
.uc-card--hub .uc-grid { left: calc(50% + 3px); top: -9.73px; }
/* the grid fades out under the copy */
.uc-card::after { content: ''; position: absolute; left: 0; right: 0; height: 182px; pointer-events: none; }
.uc-card--loop::after { top: 0; background: linear-gradient(to top, rgb(16 16 16 / 0), #101010); }
.uc-card--hub::after { bottom: 0; background: linear-gradient(to bottom, rgb(16 16 16 / 0), #101010); }
.uc-card > :not(.uc-grid) { z-index: 1; }
.uc-tag {
  left: 24px;
  top: 24px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.uc-copy { left: 24px; width: 536px; display: flex; flex-direction: column; gap: 16px; }
.uc-card--loop .uc-copy { top: 65px; }
.uc-card--hub .uc-copy { top: 377px; }
.uc-copy h3 { font-family: var(--mono); font-weight: 500; font-size: 20px; line-height: normal; color: #f2f0ed; white-space: nowrap; }
.uc-copy p { font-size: 14px; line-height: 1.5; color: #8a8a8a; }

/* loop diagram ─ 0:5774 (411 × 248) */
.uc-loop { --lf: 10.367px; left: 97.5px; top: 187px; width: 411.206px; height: 248px; transform-origin: 0 0; }
.uc-loop > * { position: absolute; }
.lp-inner {
  left: 44.92px;
  top: 74.06px;
  width: 366.284px;
  display: flex;
  align-items: center;
  gap: 20.733px;
  padding: 37.147px 30.236px;
  border: .864px solid #313131;
  border-radius: 20.733px;
}
.lp-tile { position: relative; flex: none; display: block; width: 62.199px; height: 62.199px; overflow: hidden; background: #2a2a2a; }
.lp-tile img { position: absolute; display: block; max-width: none; }
.lp-tile--tools { background: none; }
.lp-tile--app { left: 44.67px; top: 0; }
.lp-arrows { position: relative; flex: 1 1 0; min-width: 0; height: 21.597px; }
.lp-arrows img { position: absolute; left: -.62%; top: -29.46%; width: 101.24%; height: 158.92%; max-width: none; }
.lp-path { display: block; max-width: none; }
.lp-path--top { left: 102.51px; top: 26.25px; width: 131.912px; height: 49.529px; }
.lp-path--back { left: -.87px; top: 24.51px; width: 233.535px; height: 224.059px; }
.lp-lbl { font-family: var(--mono); font-size: var(--lf); line-height: 1.5; text-transform: uppercase; color: #fff; white-space: nowrap; }
.lp-lbl--llm { left: 50.97px; top: 105.39px; position: absolute; }
.lp-lbl--tools { left: 288.54px; top: 105.39px; position: absolute; }
.lp-lbl--final { left: 32.83px; top: 218.32px; font-size: 10.367px; }
.lp-lbl--app { left: 113.97px; top: 2.74px; width: 62.199px; color: #cfcfcf; }
.lp-note { left: 292.85px; top: 218.32px; width: 126.99px; font-family: var(--mono); font-weight: 500; font-size: var(--lf); line-height: 1.4; color: #b3b3b3; }

/* hub diagram ─ 600 × 484 card space */
.uc-hub { inset: 0; transform-origin: 0 0; }
.uc-hub > * { position: absolute; }
.hb-wires { left: 0; top: 0; overflow: visible; }
.hb-wires path { stroke: #bebebe; stroke-dasharray: 4 4; }
.hb-tile { width: 53px; height: 53px; overflow: hidden; border-radius: 8px; background: #2a2a2a; }
.hb-tile img { position: absolute; display: block; max-width: none; }
.hb-tile--off img { opacity: .5; left: 50% !important; top: 50% !important; translate: calc(-50% + .5px) calc(-50% + .5px); }
.hb-hub {
  left: 247.5px;
  top: 178px;
  width: 106px;
  height: 68px;
  background: var(--accent);
  font-family: var(--mono);
  line-height: 1.5;
  color: #fff;
  white-space: nowrap;
}
.hb-hub b { position: absolute; left: 31px; top: 10px; font-weight: 500; font-size: 18px; }
.hb-hub span { position: absolute; left: 22px; top: 40px; font-size: 11.37px; text-transform: uppercase; }
.hb-lbl { left: 251px; top: 254px; font-family: var(--mono); font-size: 11.37px; line-height: 1.5; text-transform: uppercase; color: #fff; white-space: nowrap; }
.hb-blocked { left: 504px; top: 263px; padding: 2px 4px; background: #ffc4c4; font-family: var(--mono); font-weight: 500; font-size: 10px; line-height: 1.5; text-transform: uppercase; color: #b0231e; }
/* requests flow from the clients into the hub and on to the tools; the
   blocked redis link stays still */
.mc-uses.is-live .hb-in { animation: hb-flow 1.1s linear infinite; }
.mc-uses.is-live .hb-out { animation: hb-flow-out 1.1s linear infinite; }
.mc-uses.is-live .hb-out--blocked { animation: none; }
@keyframes hb-flow { to { stroke-dashoffset: -8; } }
@keyframes hb-flow-out { to { stroke-dashoffset: 8; } }
.hb-blocked { animation: hb-flag 2.4s ease-in-out infinite; }
.mc-uses:not(.is-live) .hb-blocked { animation-play-state: paused; }
@keyframes hb-flag { 0%, 60%, 100% { scale: 1; } 70% { scale: 1.08; } 80% { scale: 1; } }

/* ---- Connectors ─ 0:6004 ---- */
.mc-cn { padding: 156.5px 0 179px; overflow-x: clip; }   /* 465 box centred in 778, as drawn */
.mc-cn__head { display: flex; flex-direction: column; align-items: center; gap: 32px; padding: 48px 32px; text-align: center; }
.mc-cn__title { font-size: 40px; font-weight: 600; font-variation-settings: "opsz" 31; line-height: 1.1; letter-spacing: -0.01em; }
.cn-rows {
  --t: 72px;
  --g: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  height: 254px;
  margin-top: .5px;
  padding-top: 1px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 18.75%, #000 81.25%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 18.75%, #000 81.25%, transparent);
}
.cn-row { overflow: hidden; }
.cn-run { display: flex; gap: var(--g); width: max-content; padding-right: var(--g); will-change: transform; }   /* padding = one gap, so −50 % is exactly one period */
.cn-tile { flex: none; width: var(--t); height: var(--t); border-radius: 12px; background: #5f5f5f; }
.cn-tile--logo { display: grid; place-items: center; background: none; }
.cn-tile--logo img { width: calc(var(--t) * .96); height: calc(var(--t) * .96); }
/* placeholder brand tiles (make_logos.py) until the real connector list lands */
.cn-tile--brand { background: none; border-radius: calc(var(--t) * .194); overflow: hidden; }
.cn-tile--brand img { display: block; width: 100%; height: 100%; }
/* Figma offsets: rows a/c start at the left edge, b is right-aligned */
.cn-row--a .cn-run, .cn-row--c .cn-run { margin-left: -1px; }
.cn-row--b .cn-run { margin-left: calc(100% - 22 * (var(--t) + var(--g)) + var(--g) + 1px); }
.mc-cn.is-live .cn-row--a .cn-run { animation: cn-left 70s linear infinite; }
.mc-cn.is-live .cn-row--b .cn-run { animation: cn-right 80s linear infinite; }
.mc-cn.is-live .cn-row--c .cn-run { animation: cn-left 64s linear infinite; }
@keyframes cn-left { to { transform: translateX(-50%); } }
@keyframes cn-right { from { transform: translateX(-50%); } to { transform: none; } }

/* ---- Access control ─ 0:6018 / 0:6209 ---- */
.mc-ac { padding-top: 112px; }
.mc-col { width: min(1200px, 100% - 48px); margin: 0 auto; }
.mc-ac__box { display: flex; border: 1px solid var(--hairline); border-bottom: 0; }
.ac-copy {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 32px;
  border-right: 1px solid var(--hairline);
  background: #101010;
}
.ac-copy__top { display: flex; flex-direction: column; align-items: flex-start; gap: 40px; }
.ac-title { font-size: 36px; font-weight: 600; font-variation-settings: "opsz" 31; line-height: 1.2; color: #f2f0ed; }
.ac-sub { font-size: 15px; line-height: 1.3; color: var(--fg-1); }
.ac-demo { flex: 0 0 50%; display: flex; flex-direction: column; min-width: 0; }
.ac-tabs { display: flex; flex: none; height: 50px; border-bottom: 1px solid #202020; }
.ac-tabs button {
  flex: 1 1 0;
  border-right: 1px solid var(--hairline);
  background: #171717;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.4;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}
.ac-tabs button:last-child { border-right: 0; }
.ac-tabs button:hover { background: #222; }
.ac-tabs button[aria-selected="true"] { background: #fff; color: #171717; font-weight: 500; }
.ac-tabs button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }

.ac-ill { position: relative; height: 347px; overflow: hidden; background: #101010; }
.ac-plane { position: absolute; left: 50%; top: 0; width: 600px; height: 347px; margin-left: -300px; transform-origin: 50% 0; }
.ac-plane > * { position: absolute; }
.ac-grid { left: -734.6px; top: -374.05px; width: 2011.596px; height: 1161.395px; max-width: none; }
.ac-path { display: block; max-width: none; }
.ac-wire { overflow: visible; }
.ac-wire path { stroke: var(--accent); stroke-dasharray: 1 1; }
.ac-wire--modify path, .ac-wire--block path { stroke-dashoffset: 1; transition: stroke-dashoffset .75s cubic-bezier(.65, 0, .35, 1); }
.ac-demo.is-modify .ac-wire--modify path, .ac-demo.is-block .ac-wire--block path { stroke-dashoffset: 0; transition-delay: .1s; }
.ac-glow { display: flex; align-items: center; justify-content: center; }
.ac-glow i { flex: none; display: block; opacity: .6; transform: rotate(-29.65deg) skewX(30.69deg) scaleY(.86); }
.ac-glow--engine i { background: var(--accent); filter: blur(18px); }
.ac-glow--modify i { background: #df9e2f; filter: blur(14px); }
.ac-glow--block i { background: #ff1818; filter: blur(14px); }
.ac-glow--modify, .ac-glow--block { opacity: 0; transition: opacity .5s ease; }
.ac-demo.is-modify .ac-glow--modify, .ac-demo.is-block .ac-glow--block { opacity: 1; transition-delay: .6s; }
/* Figma's extrude groups are `contents`: side faces and top sit in plane space.
   Iso order is rotate → skewX → scaleY (as on home's receipts) — any other
   order lifts the tops off their side faces. */
.ac-block { inset: 0; pointer-events: none; }
.ac-block > * { position: absolute; }
.ac-side { display: block; max-width: none; }
.ac-top { display: flex; align-items: center; justify-content: center; }
.ac-iso { flex: none; transform: rotate(-29.65deg) skewX(30.69deg) scaleY(.86); }
.ac-face { display: flex; align-items: center; justify-content: center; background: #000; }
.ac-face__in {
  position: relative;
  flex: none;
  overflow: hidden;
  background:
    url("data:image/svg+xml;utf8,<svg viewBox='0 0 60.036 60.036' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'><rect x='0' y='0' height='100%' width='100%' fill='url(%23grad)' opacity='0.20000000298023224'/><defs><radialGradient id='grad' gradientUnits='userSpaceOnUse' cx='0' cy='0' r='10' gradientTransform='matrix(-5.6563 1.0042 4.6273 -5.6563 59.331 30.77)'><stop stop-color='rgba(102,102,102,1)' offset='0'/><stop stop-color='rgba(77,77,77,1)' offset='0.25'/><stop stop-color='rgba(51,51,51,1)' offset='0.5'/><stop stop-color='rgba(26,26,26,1)' offset='0.75'/><stop stop-color='rgba(13,13,13,1)' offset='0.875'/><stop stop-color='rgba(6,6,6,1)' offset='0.9375'/><stop stop-color='rgba(0,0,0,1)' offset='1'/></radialGradient></defs></svg>") 0 0 / 100% 100%,
    #252525;
}
.ac-face__in span { position: absolute; display: flex; align-items: center; justify-content: center; translate: -50% 0; }
.ac-face__in b { flex: none; font-family: var(--mono); font-weight: 400; line-height: 1.4; text-align: center; text-transform: uppercase; color: var(--accent); text-shadow: 0 0 6px rgb(255 96 56 / .85), 0 0 14px rgb(255 96 56 / .55); transform: rotate(-.4deg) skewX(-.8deg); }

/* ---- Per-tool controls ─ 0:6074 ---- */
.mc-pt { padding-bottom: 80px; }
.mc-head { display: flex; flex-direction: column; align-items: flex-start; gap: 40px; padding: 152px 32px 48px; box-shadow: inset 0 0 0 1px var(--hairline); }   /* inside stroke: 306 tall */
.mc-head__title { font-size: 48px; font-weight: 600; font-variation-settings: "opsz" 31; line-height: 1.1; letter-spacing: -0.01em; }
.pt { font-family: var(--mono); }
.pt-row { display: grid; grid-template-columns: 366px minmax(0, 1fr); align-items: center; padding: 24px; box-shadow: inset 0 -1px 0 var(--hairline); line-height: normal; }
.pt-row--head { padding: 20px; background: #282828; border-inline: 1px solid var(--hairline); box-shadow: none; font-size: 12px; color: #b4b4b4; text-transform: uppercase; }
.pt-body { outline: 1px solid var(--hairline); outline-offset: -1px; }
.pt-body .pt-row { font-size: 14px; }
.pt-body .pt-row > span:first-child { color: #f2f0ed; }
.pt-body .pt-row > span:last-child { color: #8a8a8a; }
.pt-body .pt-row i { font-style: normal; }

@supports (text-box: trim-both cap alphabetic) {
  .ac-tabs button { text-box: trim-both cap alphabetic; }
  @media (min-width: 1000px) {
    .mc-uses__title, .mc-cn__title, .mc-head__title { text-box: trim-both cap alphabetic; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hb-in, .hb-out, .hb-blocked, .cn-run { animation: none !important; }
  .ac-wire path, .ac-glow { transition: none !important; }
}

/* 1000–1239: the two 1200 rows zoom as a unit */
@media (max-width: 1239px) and (min-width: 1000px) {
  .uc, .mc-ac__box { zoom: var(--rz, 1); }
  .mc-uses__wrap, .mc-ac .mc-col { width: auto; max-width: 1200px; padding: 0 24px; }
  .uc, .mc-ac__box { width: 1200px; }
}

/* ==========================================================================
   < 1000: mobile frame
   ========================================================================== */
@media (max-width: 999px) {
  /* use cases ─ 0:8079: cards stack. Tablets keep the 600-wide desktop
     cards; phones get the 350 mobile cards below. */
  .mc-uses { padding: 64px 0; }
  .mc-uses__wrap { width: min(600px, 100% - 40px); }
  .mc-uses__title { padding: 24px 0; font-size: 28px; line-height: 1.1; text-align: center; }
  .uc { flex-direction: column; }
  .uc-card { flex: none; width: 100%; }
  .uc-card + .uc-card { border-left: 0; border-top: 1px solid var(--hairline); }

  /* connectors ─ 0:8490 */
  /* 0:8490: head + strip centred in a 463 box, 64 above and below */
  .mc-cn { padding: 64px 0 94.3px; }
  .mc-cn__head { gap: 32px; padding: 30.3px 20px 24px; }
  .mc-cn .chip { height: 32px; }
  .mc-cn__title { font-size: 28px; }
  .cn-rows { --t: 56px; --g: 9.72px; gap: 10.11px; height: 198px; margin-top: 24px; padding-top: 5px; }
  .cn-tile { border-radius: 9.33px; }

  /* access control ─ 0:8505 */
  .mc-ac { padding-top: 64px; }
  .mc-col { width: min(560px, 100% - 40px); }
  .mc-ac__box { flex-direction: column; }
  .ac-copy { flex: none; gap: 16px; padding: 24px 16px; border-right: 0; border-bottom: 1px solid var(--hairline); }
  .ac-copy__top { gap: 32px; }
  .mc-ac .chip { height: 32px; }
  .ac-title { font-size: 28px; line-height: 1.1; letter-spacing: -0.01em; color: #fff; }
  .ac-sub { font-size: 13px; line-height: 1.4; color: var(--fg-2); }
  .ac-demo { flex: none; }
  .ac-tabs { order: 2; height: 48px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
  .ac-tabs button { background: #1b1b1b; font-family: var(--sans); font-weight: 700; font-size: 12px; color: #acacac; }
  .ac-tabs button[aria-selected="true"] { background: #fff; color: #1b1b1b; font-weight: 700; }
  .ac-ill { order: 1; height: calc(347px * var(--ak, .5833)); }
  .ac-plane { transform: scale(var(--ak, .5833)); }

  /* per-tool controls ─ 0:8559 */
  .mc-pt { padding-bottom: 64px; }
  /* 0:8561: the column's side rules run 64 px above the head; no top rule */
  .mc-head { gap: 32px; padding: 88px 16px 24px; box-shadow: inset 1px 0 0 var(--hairline), inset -1px 0 0 var(--hairline), inset 0 -1px 0 var(--hairline); }
  .mc-pt .chip { height: 32px; }
  .mc-head__title { font-size: 28px; line-height: 1.2; }
  .pt-row { grid-template-columns: 88px minmax(0, 1fr); column-gap: 12px; padding: 14px 12px; }
  .pt-row--head { padding: 12px; font-size: 11px; }
  .pt-body .pt-row { font-size: 12px; }
}

/* < 640: the 350 mobile cards ─ 0:8079 */
@media (max-width: 639px) {
  .mc-uses__wrap { width: min(350px, 100% - 40px); }
  .uc-card { width: 350px; max-width: 100%; }
  .uc-card--loop { height: 384px; }
  .uc-card--hub { height: 380px; }
  .uc-grid { left: 50%; margin-left: -304.5px; }
  .uc-card--hub .uc-grid { left: 50%; top: -10px; }
  .uc-tag { left: 15px; top: 15px; font-size: 11px; }
  .uc-card--hub .uc-tag { top: 16px; }
  .uc-copy { left: 16px; width: 284px; gap: 8px; }
  .uc-card--loop .uc-copy { top: 46px; }
  .uc-card--hub .uc-copy { top: 284px; }
  .uc-copy h3 { font-size: 14px; }
  .uc-copy p { font-size: 12px; }
  /* the desktop diagram, scaled; labels keep their mobile size */
  .uc-loop { --lf: 13.333px; left: 16px; top: 152.29px; transform: scale(.7719); }
  .lp-note { left: auto; right: -.4px; top: 226.66px; width: 149.3px; text-align: right; }
  .uc-hub { transform: translate(-47.47px, -3.75px) scale(.738); }
  /* the mobile frame enlarges the hub labels and tucks BLOCKED onto the
     redis tile (values in desktop units, under the .738 scale) */
  .hb-hub { left: 244.5px; top: 175.7px; width: 111.1px; height: 71.8px; }
  .hb-hub b { left: 32.5px; top: 10.8px; font-size: 18.8px; }
  .hb-hub span { left: 19px; top: 40.8px; font-size: 13.4px; }
  .hb-lbl { left: 240.5px; top: 254px; font-size: 13.4px; }
  .hb-blocked { left: 462.7px; top: 257px; }
}
