/* V0 Web & Dev: interactive terminal + top-down stack map (v0-dev.js). */

/* ── Stack map ── */
.jfx-map {
  --jfx-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  margin: clamp(56px, 8vw, 110px) 0;
  padding: clamp(28px, 5vw, 64px);
  border-radius: 28px;
  background: radial-gradient(circle at 50% 40%, rgba(4, 207, 254, .1), transparent 55%), #06070a;
  color: #ece7dd;
}
.jfx-map__head { max-width: 680px; margin-bottom: clamp(20px, 4vw, 40px); }
html body .jfx-map__head h2 { margin: 8px 0 14px; color: #fff; font: 600 clamp(34px, 5vw, 64px)/1.02 "Bricolage Grotesque", sans-serif; letter-spacing: -.03em; text-wrap: balance; }
html body .jfx-map__head h2 em { color: #04cffe; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; }
.jfx-map__head p { margin: 0; color: rgba(236, 231, 221, .7); font-size: 16px; line-height: 1.6; }
.jfx-map__head .jfv0-note { color: #5cf2c2; }
.jfx-map__body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: clamp(20px, 4vw, 48px); align-items: start; }
.jfx-map__stage { position: relative; width: 100%; max-width: 720px; margin-inline: auto; }
.jfx-map__svg { display: block; width: 100%; height: auto; overflow: visible; }
.jfx-map__fallback { margin: 0; padding: 24px 24px 24px 44px; color: rgba(236, 231, 221, .8); line-height: 1.9; }
.jfx-graph { display: block; width: 100%; border-radius: 20px; cursor: grab; }
.jfx-graph:active { cursor: grabbing; }
.jfx-graph__hint { position: absolute; left: 16px; bottom: 12px; margin: 0; color: rgba(236, 231, 221, .45); font: 500 11px/1 var(--jfx-mono); letter-spacing: .06em; pointer-events: none; }
.jfx-map--flat .jfx-map__stage { display: none; }
.jfx-map--flat .jfx-map__body { grid-template-columns: 1fr; }
.jfx-badge { flex: none; }
.jfx-badge path { fill: currentColor; }
.jfx-badge text { fill: currentColor; font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 700; }
.jfx-badge--bus { color: #04cffe; } .jfx-badge--agent { color: #8fdcff; } .jfx-badge--memory { color: #5cf2c2; }
.jfx-badge--tools { color: #ff9ad6; } .jfx-badge--compute { color: #ffc27a; } .jfx-badge--model { color: #cbb8ff; }
.jfx-map__detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.jfx-map__how-label { display: block; margin: 16px 0 6px; color: #04cffe; font: 600 10px/1 var(--jfx-mono); letter-spacing: .1em; text-transform: uppercase; }
.jfx-map__how-label--radar { color: rgba(236, 231, 221, .45); }
.jfx-map__how { margin: 0; color: #fff; font-size: 15px; line-height: 1.6; }
.jfx-tour { display: grid; gap: 12px; padding: 18px; border: 1px solid rgba(4, 207, 254, .25); border-radius: 18px; background: linear-gradient(135deg, rgba(4, 207, 254, .08), rgba(182, 157, 255, .06)); }
html .jfx-tour__play { justify-self: start; min-height: 42px; padding: 10px 16px; border: 0; border-radius: 999px; background: #04cffe; color: #05070a; font: 700 13px/1 var(--jfx-mono); cursor: pointer; }
html .jfx-tour__play:hover, html .jfx-tour__play:focus-visible { background: #fff; outline: none; }
.jfx-tour__steps { display: flex; flex-wrap: wrap; gap: 6px; }
html .jfx-tour__step { width: 32px; height: 32px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; background: transparent; color: rgba(236, 231, 221, .7); font: 600 12px/1 var(--jfx-mono); cursor: pointer; }
html .jfx-tour__step.is-done { border-color: rgba(92, 242, 194, .5); color: #5cf2c2; }
html .jfx-tour__step[aria-current="step"] { border-color: #fff; background: #fff; color: #05070a; }
.jfx-tour__caption { min-height: 3.2em; margin: 0; color: #fff; font-size: 15px; line-height: 1.55; }
.jfx-tour__caption:empty::before { content: "Follow one request from message to commit."; color: rgba(236, 231, 221, .55); }
html .jfx-map__chip { display: inline-flex; align-items: center; gap: 7px; }
.jfx-map__side { display: grid; gap: 22px; position: sticky; top: calc(var(--jf-header-clearance, 90px) + 16px); }
.jfx-map__detail { min-height: 150px; padding: 22px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px; background: rgba(255, 255, 255, .03); }
.jfx-map__kind { color: #5cf2c2; font: 600 11px/1.2 var(--jfx-mono); letter-spacing: .08em; text-transform: uppercase; }
html body .jfx-map__name { margin: 8px 0 8px; color: #fff; font: 600 28px/1.1 "Bricolage Grotesque", sans-serif; }
.jfx-map__role { margin: 0; color: rgba(236, 231, 221, .78); font-size: 15px; line-height: 1.6; }
.jfx-map__legend { display: grid; gap: 14px; }
.jfx-map__group-label { display: block; margin-bottom: 7px; color: rgba(236, 231, 221, .45); font: 600 10px/1 var(--jfx-mono); letter-spacing: .1em; text-transform: uppercase; }
.jfx-map__chips { display: flex; flex-wrap: wrap; gap: 7px; }
html .jfx-map__chip {
  min-height: 36px; padding: 7px 12px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px;
  background: transparent; color: rgba(236, 231, 221, .85); font: 500 12px/1 var(--jfx-mono); cursor: pointer;
}
html .jfx-map__chip:hover, html .jfx-map__chip:focus-visible, html .jfx-map__chip[aria-pressed="true"] { border-color: #04cffe; color: #fff; background: rgba(4, 207, 254, .12); outline: none; }

@media (max-width: 900px) {
  .jfx-map__body { grid-template-columns: 1fr; }
  .jfx-map__side { position: static; }
}
@media (max-width: 520px) {
  .jfx-map { --jfx-mpad: 16px; padding: 24px 16px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .jfx-map__node circle, .jfx-map__edge { transition: none; }
}
.jfx-map__plain { margin: 14px 0 0; padding: 12px 14px; border-left: 3px solid #ffb35c; border-radius: 0 10px 10px 0; background: rgba(255, 179, 92, .07); color: #f6efe3; font-size: 14.5px; line-height: 1.55; }
.jfx-map__plain-label { display: block; margin-bottom: 4px; color: #ffb35c; font: 600 10px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }

/* The graph is the Web page hero. */
.jfx-map--hero { margin: 0 0 clamp(48px, 7vw, 96px); padding-top: calc(var(--jf-header-clearance, 96px) + clamp(28px, 5vw, 64px)); border-radius: 0 0 32px 32px; }
.jfx-map--hero .jfx-map__head { max-width: 860px; }
html body .jfx-map.jfx-map--hero h1 { margin: 14px 0 18px; color: #fff; font: 600 clamp(44px, 7vw, 104px)/.95 "Bricolage Grotesque", sans-serif; letter-spacing: -.045em; text-wrap: balance; }
html body .jfx-map.jfx-map--hero h1 em { color: #04cffe; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; letter-spacing: -.02em; }
.jfx-map__lead { max-width: 68ch; margin: 0 0 24px; color: rgba(236, 231, 221, .78); font-size: clamp(16px, 1.4vw, 18px); line-height: 1.65; }
.jfx-map__lead strong { color: #fff; }
.jfx-map--hero .jfv0-kicker { color: #5cf2c2; }
.jfx-map > .jfx-map__legend { margin-top: clamp(24px, 4vw, 40px); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.jfx-map__stage { max-width: none; }
.jfx-graph { touch-action: pan-y; }
.jfx-graph__controls { position: absolute; top: 14px; right: 14px; display: grid; gap: 8px; }
html .jfx-graph__btn { width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; background: rgba(8, 11, 16, .78); color: #fff; font: 600 20px/1 "JetBrains Mono", ui-monospace, monospace; cursor: pointer; backdrop-filter: blur(6px); }
html .jfx-graph__btn:hover, html .jfx-graph__btn:focus-visible { border-color: #04cffe; outline: none; }
/* Full-bleed stage on tablets and phones: the negative margin equals the
   section padding exactly, so the page can never scroll sideways. */
.jfx-map { --jfx-mpad: clamp(28px, 5vw, 64px); padding-inline: var(--jfx-mpad); }
@media (max-width: 900px) { .jfx-map--hero .jfx-map__stage { margin-inline: 0; width: 100%; } }
html body .jfx-map__out { display: inline-flex; margin-top: 16px; padding: 8px 12px; border: 1px solid rgba(4, 207, 254, .35); border-radius: 999px; color: #04cffe; font: 600 12px/1 "JetBrains Mono", ui-monospace, monospace; text-decoration: none; }
html body .jfx-map__out:hover, html body .jfx-map__out:focus-visible { background: rgba(4, 207, 254, .12); color: #fff; outline: none; }
.jfx-graph__rotate { position: absolute; left: 50%; top: 14px; margin: 0; padding: 8px 12px; border-radius: 999px; background: rgba(8, 11, 16, .85); border: 1px solid rgba(92, 242, 194, .35); color: #5cf2c2; font: 600 11px/1.2 "JetBrains Mono", ui-monospace, monospace; white-space: nowrap; transform: translate(-50%, -6px); opacity: 0; transition: opacity .35s ease, transform .35s ease; pointer-events: none; }
.jfx-graph__rotate.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (orientation: landscape) { .jfx-graph__rotate { display: none; } }
@media (max-width: 639px) { html body .jfx-graph__btn { width: 38px; height: 38px; font-size: 18px; } }

/* Heads-up bar on the graph (all sizes); replaces the side tour on phones. */
.jfx-hud { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px 40px; align-items: center; gap: 6px; padding: 8px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; background: rgba(8, 11, 16, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .9); }
html body .jfx-hud__btn { width: 40px; height: 40px; margin: 0; padding: 0; border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; background: rgba(255, 255, 255, .04); color: #fff; font: 600 20px/1 "JetBrains Mono", ui-monospace, monospace; cursor: pointer; }
html body .jfx-hud__btn--play { background: #04cffe; border-color: #04cffe; color: #05070a; font-size: 14px; }
html body .jfx-hud__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
html body .jfx-hud__text { display: grid; gap: 2px; min-width: 0; margin: 0; padding: 2px 6px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.jfx-hud__kicker { overflow: hidden; color: #5cf2c2; font: 600 9.5px/1.2 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis; }
.jfx-hud__name { overflow: hidden; color: #fff; font: 600 15px/1.2 "Bricolage Grotesque", sans-serif; white-space: nowrap; text-overflow: ellipsis; }
.jfx-hud__line { display: -webkit-box; overflow: hidden; color: rgba(236, 231, 221, .78); font-size: 12.5px; line-height: 1.35; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.jfx-graph__hint { bottom: auto; top: 12px; left: 14px; }
@media (max-width: 900px) {
  .jfx-map__side .jfx-tour { display: none; }
  .jfx-graph__controls { top: 12px; bottom: auto; right: 12px; grid-auto-flow: row; }
  .jfx-graph__hint { max-width: 60%; font-size: 10px; }
}
@media (min-width: 901px) { .jfx-hud { left: 16px; right: auto; width: min(520px, calc(100% - 100px)); } }
@media (max-width: 360px) { .jfx-hud { grid-template-columns: 34px minmax(0, 1fr) 34px 34px; } html body .jfx-hud__btn { width: 34px; height: 34px; } .jfx-hud__line { -webkit-line-clamp: 3; } }
@media (max-width: 900px) { .jfx-hud__line { -webkit-line-clamp: 3; } }

/* Phones: everything fits the viewport width, with calmer type. */
@media (max-width: 900px) {
  .jfx-map, .jfx-map * { box-sizing: border-box; }
  .jfx-map__stage, .jfx-graph { max-width: 100%; }
  .jfx-hud { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: calc(100% - 16px); gap: 4px; padding: 6px; border-radius: 14px; grid-template-columns: 34px minmax(0, 1fr) 34px 34px; }
  html body .jfx-hud__btn { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
  html body .jfx-hud__btn--play { font-size: 12px; }
  .jfx-hud__kicker { font-size: 8.5px; }
  .jfx-hud__name { font-size: 13.5px; }
  .jfx-hud__line { font-size: 11.5px; line-height: 1.3; }
  .jfx-map__detail { min-height: 0; padding: 16px; border-radius: 14px; }
  html body .jfx-map__name { font-size: 22px; }
  .jfx-map__detail-head { gap: 10px; margin-bottom: 8px; }
  .jfx-map__detail-head .jfx-badge { width: 34px; height: 34px; }
  .jfx-map__role, .jfx-map__how { font-size: 14px; line-height: 1.5; }
  .jfx-map__plain { font-size: 13.5px; padding: 10px 12px; }
  .jfx-map__side { gap: 14px; }
  html body .jfx-map__chip { min-height: 32px; padding: 6px 10px; font-size: 11px; }
  .jfx-graph__hint { font-size: 9.5px; letter-spacing: .04em; }
}
/* Phones: the graph hero breaks out of the 18px page gutter so the stage and
   its heads-up bar use the full screen width. */
@media (max-width: 760px) {
  .jfx-map.jfx-map--hero { margin-inline: -18px; border-radius: 0; --jfx-mpad: 14px; padding-inline: 14px; }
}
