:root {
  /* The MultiAgency dashboard's base (shadcn neutral, yellow primary). */
  --paper: #FFFFFF;
  --surface: #FFFFFF;
  --ink: #0A0A0A;
  --muted: #737373;
  --rule: #E5E5E5;
  --primary: #FACC15;
  --primary-ink: #713F12;
  --dot: color-mix(in oklab, var(--ink) 11%, transparent);
  /* The relay's legend: who acted, and where money moved. People are a deep
     amber, clear of the brand yellow. */
  --usdc: #2775CA;
  --human: #B45309;
  --paid: #1E7F55;
  --warn: #DC2626;
  --radius-field: 0.625rem;
  --measure: 72ch;
  --heading: "Geist", "Inter", system-ui, sans-serif;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0A0A0A;
    --surface: #171717;
    --ink: #FAFAFA;
    --muted: #A1A1A1;
    --rule: rgb(255 255 255 / 10%);
    --primary: #EAB308;
    --primary-ink: #422006;
    --dot: color-mix(in oklab, var(--ink) 4.5%, transparent);
    --usdc: #5C9DE6;
    --human: #F97316;
    --paid: #4CB386;
    --warn: #FF6467;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0);
  background-size: 22px 22px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, summary, .lede { font-family: var(--heading); letter-spacing: -0.015em; }
a { color: inherit; text-decoration-color: color-mix(in oklab, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.num { font-variant-numeric: tabular-nums; }

/* Bar: sticky and translucent, as in the dashboard */
.bar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in oklab, var(--paper) 75%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.bar-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; max-width: 64rem; margin: 0 auto; padding: 0.75rem 1rem; }
.mark { display: flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; font-family: var(--heading); font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; }
.mark:hover { opacity: 0.7; }
.mark svg { width: 1.5rem; height: 1.5rem; shape-rendering: crispEdges; }
.net { font-size: 0.8rem; color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: 0.1rem 0.55rem; }
.net[data-network="mainnet"] { color: var(--ink); font-weight: 600; }
.bar-links { margin-left: auto; display: flex; gap: 1.25rem; font-size: 0.9rem; }
.bar-links a { color: var(--muted); text-decoration: none; }
.bar-links a:hover { color: var(--ink); }

main { padding: clamp(1.5rem, 5vw, 3.5rem) 1rem 5rem; max-width: 64rem; margin: 0 auto; }
main:focus { outline: none; }

/* Home */
.hero { margin: 0 0 2rem; }
.hero .sub { margin-bottom: 0; }
/* The hero's figure: a finished job's relay, captioned with its story. Its
   space is held before the data arrives (a six-lane relay, at the swimlane's
   minimum width on phones), so the page below does not jump. */
.featured { margin: 0; }
.featured a.relay-scroll { display: block; color: inherit; text-decoration: none; }
.featured a.relay-scroll:hover { border-color: var(--ink); }
.relay-placeholder { overflow: hidden; }
.relay-placeholder > div { min-width: 720px; aspect-ratio: 960 / 316; }
.featured figcaption { margin-top: 0.9rem; max-width: var(--measure); min-height: 6.5rem; }
.featured figcaption p { margin: 0.2rem 0 0; }
@media (max-width: 40rem) { .featured figcaption { min-height: 11.25rem; } }
.caption-title { font-family: var(--heading); font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.proof { margin: 0.75rem 0 3.5rem; color: var(--muted); max-width: var(--measure); min-height: 1.55em; }
.columns { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 6vw, 5rem); }
.columns h2 { font-size: 1.05rem; margin: 0 0 1rem; }
@media (max-width: 860px) { .columns { grid-template-columns: 1fr; } }
.lede { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.08; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 1rem; max-width: 18ch; }
.sub { color: var(--muted); max-width: 52ch; margin: 0 0 2rem; }
form { display: grid; gap: 1rem; max-width: 34rem; }
label { font-weight: 500; font-size: 0.95rem; display: grid; gap: 0.35rem; }
input, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--radius-field); padding: 0.65rem 0.8rem;
}
textarea { min-height: 9rem; resize: vertical; }
.hint { color: var(--muted); font-size: 0.85rem; font-weight: 400; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
legend { font-weight: 500; font-size: 0.95rem; margin-bottom: 0.35rem; width: 100%; }
label.choice { display: flex; align-items: center; gap: 0.4rem; font-weight: 400; }
button {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: var(--radius-field);
  padding: 0.7rem 1.15rem; background: var(--primary); color: var(--primary-ink); justify-self: start;
}
button:hover { background: color-mix(in oklab, var(--primary) 88%, var(--ink)); }
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
button:disabled { opacity: 0.5; cursor: progress; }

.list h2, .section h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.engagements { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.engagements li { border-bottom: 1px solid var(--rule); }
.engagements a { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 1rem; padding: 0.9rem 0; color: var(--ink); text-decoration: none; }
.engagements a:hover .t { text-decoration: underline; }
.engagements .t { font-weight: 700; grid-column: 1; }
.engagements .m { color: var(--muted); font-size: 0.85rem; grid-column: 1; }
.engagements .s { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 0.85rem; }
.empty { color: var(--muted); }

/* Quote */
.quote { max-width: 40rem; }
.quote h1, .engagement h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
.pay { margin: 2rem 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 1.5rem; }
.pay dt { color: var(--muted); }
.pay dd { margin: 0; overflow-wrap: anywhere; }
.pay .amount { font-size: 1.6rem; font-weight: 700; color: var(--usdc); }
.memo { font-weight: 700; font-size: 1.15rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.cli { margin-top: 1.5rem; }
.cli pre { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-field); padding: 0.9rem; overflow-x: auto; font-size: 0.8rem; }
.status { margin-top: 1.5rem; padding-left: 0.9rem; border-left: 3px solid var(--primary); }
.status.error { border-color: var(--warn); color: var(--warn); }

/* Engagement */
.who { color: var(--muted); margin: 0 0 2rem; }
.stages { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; padding: 0; margin: 0 0 3rem; counter-reset: stage; font-size: 0.9rem; }
.stages li { counter-increment: stage; color: var(--muted); }
.stages li::before { content: counter(stage) " "; font-variant-numeric: tabular-nums; }
.stages li[aria-current="step"] { color: var(--ink); font-weight: 700; }
.stages li.done { color: var(--paid); }

.trail { position: relative; list-style: none; margin: 0; padding: 0 0 0 2.75rem; }
.trail::before { content: ""; position: absolute; left: 0.9rem; top: 0.6rem; bottom: 0.6rem; width: 3px; background: var(--usdc); border-radius: 2px; }
.stop { position: relative; padding: 0 0 2.5rem; }
.stop::before {
  content: ""; position: absolute; left: -2.35rem; top: 0.35rem; width: 1.05rem; height: 1.05rem;
  border-radius: 50%; background: var(--paper); border: 3px solid var(--usdc);
}
.stop.human::before { border-color: var(--human); }
.stop.paid::before { background: var(--paid); border-color: var(--paid); }
.stop-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; }
.stop-head h3 { margin: 0; font-size: 1.1rem; }
.flow { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--usdc); white-space: nowrap; }
.stop.out .flow { color: var(--ink); }
.seat { font-size: 0.85rem; color: var(--muted); }
.stop.human .seat { color: var(--human); font-weight: 700; }
.facts { margin: 0.5rem 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.92rem; }
.facts li { margin: 0.2rem 0; }
.facts .ok { color: var(--paid); font-weight: 500; }
.brief-section { margin: 0 0 2.5rem; }
.brief-section h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.brief { white-space: pre-wrap; max-width: var(--measure); margin: 0; color: var(--muted); }
.details { margin: 0 0 1rem; }
.details > summary { cursor: pointer; font-weight: 700; margin: 0 0 1.5rem; }

/* Now, and the result */
.now { font-size: 1.15rem; font-weight: 500; max-width: var(--measure); margin: -1.5rem 0 1.5rem; padding: 0.8rem 1rem; background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--primary); border-radius: 0 var(--radius-field) var(--radius-field) 0; }
.now.cancelled { border-left-color: var(--muted); }
.approvals { margin: 0 0 3rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-field); padding: 0.75rem 1.25rem 1rem; }
.approvals h2 { margin-top: 0.25rem; }
.approvals-list { list-style: none; padding: 0; margin: 0.75rem 0 1rem; }
.approvals-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.6rem 0; border-top: 1px solid var(--rule); }
.approvals .voted { color: var(--paid); font-weight: 500; }
.result { margin: 0 0 3rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-field); padding: 0.75rem 1.25rem; }
.result summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; }
.result-body { margin-top: 0.75rem; }
.result-body.clipped { max-height: 28rem; overflow: hidden; mask-image: linear-gradient(to bottom, #000 75%, transparent); }
.result .more { margin-top: 0.5rem; }
.result-body h1 { font-size: 1.3rem; } .result-body h2 { font-size: 1.1rem; }
.result-body table { border-collapse: collapse; font-size: 0.85rem; display: block; overflow-x: auto; }
.result-body th, .result-body td { border: 1px solid var(--rule); padding: 0.35rem 0.5rem; vertical-align: top; text-align: left; }
.how { list-style: none; counter-reset: how; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.6rem; max-width: 52ch; }
.how li { counter-increment: how; padding-left: 2rem; position: relative; color: var(--muted); }
.how li::before { content: counter(how); position: absolute; left: 0; top: 0.05rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-size: 0.8rem; font-weight: 700; display: grid; place-items: center; }
.how strong { color: var(--ink); }
.steps { max-width: none; gap: 0.9rem; margin-bottom: 2.5rem; }
.steps li { color: var(--ink); }
.steps .cli { margin-top: 0.5rem; }
.form-h { font-size: 1.05rem; margin: 0 0 1rem; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; padding: 0; margin: 0.6rem 0 0; font-size: 0.8rem; color: var(--muted); }
.legend i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; margin-right: 0.35rem; vertical-align: -0.05rem; }
.legend .dot-agent { background: var(--usdc); } .legend .dot-person { background: var(--human); } .legend .dot-system { background: var(--muted); }
.legend .dot-money { background: var(--paid); } .legend .dot-warn { background: var(--warn); } .legend .dot-took { border: 2px solid var(--usdc); }
.swimlane .ev-label { font-size: 11px; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }

/* Relay: who did what, and where the deposit goes */
.relay { margin: 0 0 3rem; }
.relay h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.relay-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-field); padding: 0.75rem 0.75rem 0.25rem; }
.swimlane { display: block; width: 100%; min-width: 720px; height: auto; font-family: inherit; }
.swimlane .lane line { stroke: var(--rule); stroke-width: 1; }
.swimlane .lane-name { font-size: 13px; font-weight: 700; fill: var(--ink); }
.swimlane .lane-role { font-size: 11px; fill: var(--muted); }
.swimlane .gap line { stroke: var(--muted); stroke-dasharray: 2 4; opacity: 0.6; }
.swimlane .gap text { font-size: 11px; fill: var(--muted); text-anchor: middle; font-variant-numeric: tabular-nums; }
.swimlane .handoff-line { stroke: var(--muted); stroke-width: 1; opacity: 0.35; }
.swimlane .ev { stroke: var(--surface); stroke-width: 2; fill: var(--usdc); }
.swimlane .ev.human { fill: var(--human); }
.swimlane .ev.paid { fill: var(--paid); }
.swimlane .ev.system { fill: var(--muted); }
.swimlane .ev.client { fill: var(--ink); }
.swimlane .ev.changes-requested, .swimlane .ev.reopened { fill: var(--warn); }
.swimlane .ev.claim, .swimlane .ev.team-draft { fill: var(--surface); stroke: currentColor; }
.swimlane .ev.claim.agent { stroke: var(--usdc); }
.swimlane .ev.claim.human { stroke: var(--human); }
.swimlane .ev.team-draft { stroke: var(--muted); }
.swimlane .ev.latest { stroke: var(--usdc); }
.swimlane a:focus-visible .ev { stroke: var(--usdc); stroke-width: 4; }
.money { display: flex; margin-top: 1rem; border-radius: var(--radius-field); overflow: hidden; border: 1px solid var(--rule); min-height: 2.4rem; }
.money .seg { display: flex; align-items: center; padding: 0 0.6rem; font-size: 0.8rem; white-space: nowrap; overflow: hidden; color: var(--ink); text-decoration: none; background: var(--surface); border-right: 1px solid var(--rule); background-image: repeating-linear-gradient(135deg, transparent 0 6px, var(--rule) 6px 7px); }
.money .seg.paid { background: var(--paid); color: var(--surface); }
.money .seg.margin { background: var(--paper); color: var(--muted); border-right: 0; }
.money .seg span { overflow: hidden; text-overflow: ellipsis; }

.totals { margin-top: 1rem; border-top: 1px solid var(--rule); padding-top: 1.25rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; }
.totals div { display: grid; }
.totals span { color: var(--muted); font-size: 0.85rem; }
.totals strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: no-preference) {
  .trail::before { transform-origin: top; animation: draw 700ms ease-out both; }
  @keyframes draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  .swimlane .ev.latest { animation: pulse 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
  /* The hero's one moment: the relay draws itself in, event by event, in the
     order the work happened. */
  .swimlane.reveal .handoff-line, .swimlane.reveal .ev-label { animation: appear 350ms ease-out both; animation-delay: calc(var(--i) * var(--step)); }
  .swimlane.reveal .ev { animation: land 350ms cubic-bezier(0.3, 1.4, 0.6, 1) both; animation-delay: calc(var(--i) * var(--step)); transform-box: fill-box; transform-origin: center; }
  @keyframes appear { from { opacity: 0; } }
  @keyframes land { from { opacity: 0; transform: scale(0.2); } }
  @keyframes pulse { 0% { stroke-width: 2; stroke-opacity: 1; } 100% { stroke-width: 14; stroke-opacity: 0; } }
}
