:root {
  --bg: #0a0a0a;
  --bg-2: #121212;
  --line: rgba(237, 237, 237, 0.14);
  --line-2: rgba(237, 237, 237, 0.32);
  --fg: #ededed;
  --fg-2: rgba(237, 237, 237, 0.62);
  --fg-dim: rgba(237, 237, 237, 0.18);
  --accent: #5eead4;
  --accent-2: #a78bfa;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter Tight", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
em { font-style: italic; color: var(--fg-2); }
.mono { font-family: var(--mono); font-size: .86em; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 18px var(--gutter);
  background: linear-gradient(to bottom, rgba(10,10,10,.7), rgba(10,10,10,0));
}
.nav-menu { justify-self: start; background: none; border: 0; color: var(--fg); font: 500 14px var(--sans); cursor: pointer; }
.logo { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; letter-spacing: .14em; font-size: 15px; }
.nav-right { justify-self: end; display: flex; gap: 20px; align-items: center; font-size: 14px; }
.nav-link { color: var(--fg-2); transition: color .2s; }
.nav-link:hover { color: var(--fg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font: 500 15px var(--sans); white-space: nowrap;
  transition: transform .3s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-light { background: var(--fg); color: var(--bg); }
.btn-light:hover { background: #fff; }
.btn-ghost { border: 1px solid var(--line-2); color: var(--fg); }
.btn-ghost:hover { border-color: var(--fg); }
.btn-pill { height: 36px; padding: 0 6px 0 16px; background: rgba(237,237,237,.1); font-size: 14px; }
.btn-pill:hover { background: rgba(237,237,237,.18); }
.btn-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: 13px; }
.wide { width: 100%; }

/* ---------- type ---------- */
.eyebrow { font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); }
.eyebrow::before { content: "— "; color: var(--fg-dim); }
.display {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(56px, 11vw, 168px); line-height: .92; letter-spacing: -.02em;
}
.display.sm { font-size: clamp(44px, 7vw, 104px); line-height: 1; }
.h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5vw, 68px); line-height: 1; letter-spacing: -.01em; margin-top: 14px; }
.lede { max-width: 520px; font-size: clamp(17px, 1.4vw, 19px); color: var(--fg-2); margin-top: 28px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); filter: blur(6px);
  transition: opacity 1s var(--ease) var(--d, 0s), transform 1s var(--ease) var(--d, 0s), filter 1s var(--ease) var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; filter: none; }

.line { display: block; overflow: hidden; padding-bottom: .2em; margin-bottom: -.14em; } /* room for descenders (g, y) */
.line > span { display: inline-block; transform: translateY(105%); transition: transform 1.2s var(--ease); }
.line:nth-child(2) > span { transition-delay: .12s; }
.loaded .line > span { transform: none; }

/* ---------- hero: blob dive ---------- */
#blob {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block;
  pointer-events: none; opacity: 0; transition: opacity .6s;
  background: radial-gradient(circle at 62% 50%, rgba(94,234,212,.18), rgba(167,139,250,.08) 22%, transparent 45%);
}
#blob.ready { opacity: var(--blob-o, 1); transition: none; }
main, .foot { position: relative; z-index: 1; }
.dive { position: relative; height: 320vh; }
.dive-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.hero-copy {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 96px; z-index: 2; max-width: 1000px;
  opacity: var(--hero-o, 1); transform: translateY(var(--hero-y, 0px)); will-change: opacity, transform;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.dive-line {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 18px;
  opacity: var(--dl-o, 0); transform: scale(var(--dl-s, .9)); pointer-events: none; z-index: 2;
}
.dive-line .eyebrow::before { content: none; }
.dive-big { font: 400 clamp(52px, 9vw, 140px)/.95 var(--serif); letter-spacing: -.02em; text-shadow: 0 2px 40px rgba(0,0,0,.6); }
.dive-big em { color: var(--fg); opacity: .75; }
.statement { background: transparent; }

.scroll-hint { opacity: var(--hero-o, 1); position: absolute; right: var(--gutter); bottom: 32px; z-index: 2; font: 12px var(--mono); color: var(--fg-2); display: flex; gap: 10px; align-items: center; }
.scroll-hint span { width: 1px; height: 36px; background: var(--line-2); position: relative; overflow: hidden; }
.scroll-hint span::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--fg); animation: drip 1.8s var(--ease) infinite; }
@keyframes drip { to { top: 100%; } }

/* ---------- paint text ---------- */
.statement, .founders { padding: 22vh var(--gutter); }
.paint {
  font-family: var(--serif); font-size: clamp(30px, 4.4vw, 64px); line-height: 1.12; letter-spacing: -.01em;
  max-width: 1200px;
}
.paint.small { font-size: clamp(24px, 2.8vw, 40px); max-width: 900px; margin-top: 12vh; }
.paint .w { color: var(--fg-dim); transition: color .35s linear; }
.paint .w.on { color: var(--fg); }

/* ---------- scenes (sticky, scroll-scrubbed) ---------- */
.scene { position: relative; height: var(--len, 500vh); border-top: 1px solid var(--line); }
.stage {
  position: sticky; top: 0; height: 100svh;
  display: grid; grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.2fr) minmax(300px, 1.1fr);
  gap: clamp(16px, 3vw, 48px); align-items: center;
  padding: 90px var(--gutter) 40px;
}
.stage-side .h2 { margin-bottom: 28px; }
.side-copy { color: var(--fg-2); max-width: 340px; }
.roster { list-style: none; display: grid; gap: 4px; font-size: 14px; }
.roster li { color: var(--fg-dim); transition: color .3s; display: flex; gap: 10px; align-items: center; }
.roster li::before { content: ""; width: 14px; height: 1px; background: currentColor; transition: width .3s var(--ease); }
.roster li.active { color: var(--fg); }
.roster li.active::before { width: 26px; background: var(--accent); }
.meters { display: grid; grid-template-columns: repeat(3, auto); gap: 22px; margin-top: 36px; justify-content: start; }
.m-label { display: block; font: 11px var(--mono); color: var(--fg-2); text-transform: uppercase; letter-spacing: .08em; }
.m-val { display: block; font: 400 28px var(--serif); margin-top: 4px; font-variant-numeric: tabular-nums; }

.stage-graph svg { width: 100%; max-height: 72svh; overflow: visible; }
.g-edge { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 1; }
.g-edge.hot { stroke: var(--accent); }
.g-node circle { fill: var(--bg); stroke: var(--fg-2); stroke-width: 1.2; transition: stroke .3s, fill .3s; }
.g-node text { fill: var(--fg-2); font: 11px var(--mono); text-anchor: middle; transition: fill .3s; }
.g-node.active circle { stroke: var(--accent); fill: rgba(94,234,212,.12); }
.g-node.active text { fill: var(--fg); }
.g-node .halo { fill: none; stroke: var(--accent); opacity: 0; }
.g-node.active .halo { animation: halo 1.4s var(--ease) infinite; }
@keyframes halo { 0% { opacity: .6; r: 20; } 100% { opacity: 0; r: 36; } }
.g-org { fill: none; stroke: var(--line); stroke-dasharray: 3 5; }
.g-org-label { fill: var(--fg-2); font: 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.packet { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.packet.env { fill: var(--accent-2); filter: drop-shadow(0 0 6px var(--accent-2)); }

.stage-chat {
  align-self: stretch; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(18,18,18,.7);
  backdrop-filter: blur(8px); overflow: hidden; max-height: calc(100svh - 130px);
}
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--fg-2); display: flex; gap: 8px; align-items: center; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.chat { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 16px; overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent 0, #000 22%); }
.msg { display: none; max-width: 92%; }
.msg.on, .msg.typing { display: block; animation: msgIn .45s var(--ease); }
.msg.right { align-self: flex-end; text-align: right; }
.msg-meta { font: 11px var(--mono); color: var(--fg-2); margin-bottom: 4px; }
.msg-meta b { color: var(--fg); font-weight: 500; }
.msg-meta .arrow { color: var(--accent); margin: 0 4px; }
.msg-body { display: inline-block; text-align: left; padding: 10px 14px; border-radius: 12px; background: rgba(237,237,237,.06); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.45; }
.msg.human .msg-body { background: var(--fg); color: var(--bg); border-color: transparent; }
.msg.fed .msg-body { border-color: rgba(167,139,250,.4); }
.msg .sigline { display: block; margin-top: 6px; font: 10.5px var(--mono); color: var(--accent-2); }
.msg.typing .msg-body { color: transparent; position: relative; min-width: 56px; height: 38px; overflow: hidden; }
.msg.typing .msg-body::after { content: "•••"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--fg-2); letter-spacing: 3px; animation: pulse 1s infinite; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.sig { margin-top: 28px; padding: 12px 14px; border: 1px dashed rgba(167,139,250,.4); border-radius: 10px; color: var(--fg-2); font-size: 12px; word-break: break-all; min-height: 64px; }
.sig.ok { color: var(--accent-2); }

/* ---------- principles ---------- */
.principles, .editions { padding: 18vh var(--gutter); border-top: 1px solid var(--line); }
.section-head { margin-bottom: 64px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.card { background: var(--bg); padding: 32px 26px 36px; min-height: 320px; display: flex; flex-direction: column; transition: background .3s; }
.card:hover { background: var(--bg-2); }
.card h3 { font: 400 26px/1.1 var(--serif); margin: auto 0 12px; padding-top: 48px; }
.card p { color: var(--fg-2); font-size: 15px; }
.ico { width: 52px; height: 52px; }
.draw * { fill: none; stroke: var(--fg); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.8s var(--ease) calc(var(--d, 0s) + .3s); }
.in .draw *, .draw.in * { stroke-dashoffset: 0; }

/* ---------- live numbers (stats) ---------- */
.stats { border-top: 1px solid var(--line); padding: 0 0 18vh; overflow: hidden; }
.ticker { border-bottom: 1px solid var(--line); overflow: hidden; white-space: nowrap; padding: 12px 0; font: 12px var(--mono); color: var(--fg-2);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: inline-block; animation: tick 48s linear infinite; }
.tk { margin-right: 44px; text-transform: uppercase; letter-spacing: .06em; }
.tk b { color: var(--fg); font-weight: 500; margin-right: 6px; }
.tk i { font-style: normal; margin-left: 6px; }
.up { color: var(--accent); } .down { color: #fb7185; }
@keyframes tick { to { transform: translateX(-50%); } }
.stats-inner { padding: 14vh var(--gutter) 0; }
.stats .section-head .side-copy { margin-top: 18px; max-width: 560px; color: var(--fg-2); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.kpi { background: var(--bg); padding: 24px 24px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font: 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--fg-2); }
.kpi-val { font: 400 clamp(36px, 3.6vw, 52px)/1.05 var(--serif); font-variant-numeric: tabular-nums; }
.kpi-val span { border-radius: 6px; transition: background .8s; }
.kpi-val span.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { background: rgba(94,234,212,.25); } 100% { background: transparent; } }
.kpi-delta { font: 500 13px var(--sans); }
.kpi-delta span { color: var(--fg-2); font-weight: 400; margin-left: 4px; }
.spark { width: 100%; height: 34px; margin-top: 10px; overflow: visible; }
.spark { clip-path: inset(0 100% 0 0); }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.dash-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); padding: 22px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.panel-title { font: 500 16px var(--sans); }
.panel-sub { font: 12px var(--mono); color: var(--fg-2); margin-top: 2px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--fg-2); }
.legend span::before { content: ""; display: inline-block; width: 14px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--accent); }
.legend .lg-f::before { background: repeating-linear-gradient(90deg, var(--fg-2) 0 4px, transparent 4px 7px); }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-axis { fill: var(--fg-2); font: 11px var(--mono); }
.c-act { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.c-fore { fill: none; stroke: var(--fg-2); stroke-width: 1.4; stroke-dasharray: 5 5; }
.c-guide { stroke: var(--line-2); stroke-dasharray: 2 3; transition: opacity .3s; }
.c-dot { fill: var(--bg); stroke: var(--accent); stroke-width: 2.4; filter: drop-shadow(0 0 6px var(--accent)); transition: opacity .3s; }
.chart-tip { position: absolute; transform: translate(-50%, calc(-100% - 16px)); pointer-events: none; white-space: nowrap;
  background: var(--fg); color: var(--bg); font: 500 12px var(--sans); padding: 6px 10px; border-radius: 8px; transition: opacity .3s; }
.chart-tip i { font-style: normal; font-weight: 400; margin-left: 6px; opacity: .7; }
.chart-tip i.up, .chart-tip i.down { color: inherit; }
.running { display: inline-flex; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--accent); }
.feed { list-style: none; display: grid; gap: 2px; }
.job { display: grid; grid-template-columns: auto auto 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 3px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--line); animation: jobIn .5s var(--ease); }
.job:last-child { border-bottom: 0; }
@keyframes jobIn { from { opacity: 0; transform: translateY(-10px); } }
.job-time { font: 12px var(--mono); color: var(--fg-2); }
.job-agent { font: 11px var(--mono); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--fg-2); }
.a-finance { color: #93c5fd; border-color: rgba(147,197,253,.4); } .a-sales { color: #c4b5fd; border-color: rgba(196,181,253,.4); }
.a-ops { color: var(--accent); border-color: rgba(94,234,212,.4); } .a-legal { color: #f9a8d4; border-color: rgba(249,168,212,.4); }
.job-name { font: 500 14px var(--sans); }
.job-res { grid-column: 2 / -1; font-size: 13px; color: var(--fg-2); display: flex; align-items: center; gap: 8px; }
.job-res b { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font-size: 10px; }
.job-res .ok { background: rgba(94,234,212,.15); color: var(--accent); }
.job-res .flag { background: rgba(251,191,36,.15); color: #fbbf24; }
.job.done .job-res { color: var(--fg); }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dash-note { margin-top: 14px; font: 11px var(--mono); color: var(--fg-2); opacity: .7; }
.stats .paint.small { padding: 0 var(--gutter); margin-top: 16vh; }
.cards { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-row { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .kpi { padding: 18px 16px 14px; }
  .kpi-delta span { display: block; margin: 2px 0 0; }
  .panel { padding: 16px; }
  .legend { display: none; }
  .c-axis { font-size: 20px; }
  .cards { grid-template-columns: 1fr; }
}

/* ---------- editions ---------- */
.ed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.ed { border: 1px solid var(--line); border-radius: 18px; padding: 34px; display: flex; flex-direction: column; gap: 22px; background: var(--bg); }
.ed-pro { background: radial-gradient(ellipse at 100% 0%, rgba(94,234,212,.1), transparent 60%), var(--bg-2); border-color: var(--line-2); }
.ed-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed h3 { font: 400 34px var(--serif); }
.tag { font: 11px var(--mono); padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--fg-2); }
.tag-accent { border-color: var(--accent); color: var(--accent); }
.price { font: 400 44px var(--serif); }
.price span { font: 15px var(--sans); color: var(--fg-2); }
.ed ul { list-style: none; display: grid; gap: 12px; flex: 1; }
.ed li { padding-left: 26px; position: relative; color: var(--fg-2); }
.ed li::before { content: ""; position: absolute; left: 0; top: .7em; width: 14px; height: 1px; background: var(--fg); }

/* ---------- founders / cta / footer ---------- */
.founders { border-top: 1px solid var(--line); }
.cta { position: relative; padding: 26vh var(--gutter) 22vh; border-top: 1px solid var(--line); overflow: hidden; }
.cta-art { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .8; }
.cta-art path { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 1; vector-effect: non-scaling-stroke; }
.cta-art .faint { stroke: var(--line); }
.cta > :not(svg) { position: relative; }

.foot { padding: 64px var(--gutter) 40px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }
.foot-brand p { color: var(--fg-2); margin-top: 10px; font-size: 14px; }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.foot-cols h4 { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--fg-2); margin-bottom: 12px; }
.foot-cols a { display: block; font-size: 14px; padding: 4px 0; color: var(--fg); opacity: .85; }
.foot-cols a:hover { opacity: 1; }
.foot-legal { grid-column: 1 / -1; font: 12px var(--mono); color: var(--fg-2); padding-top: 32px; border-top: 1px solid var(--line); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .stage { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; align-items: start; padding-top: 80px; gap: 16px; }
  .stage-side { grid-column: 1 / -1; }
  .stage-side .h2 { margin-bottom: 12px; font-size: 40px; }
  .roster, .side-copy { display: none; }
  .meters { margin-top: 8px; }
  .sig { margin-top: 10px; min-height: 0; }
  .stage-chat { max-height: none; }
}
@media (max-width: 640px) {
  .nav-link, .nav-menu { display: none; }
  .nav { grid-template-columns: 1fr auto; }
  .logo { justify-self: start; }
  .stage { grid-template-columns: 1fr; grid-template-rows: auto 30svh 1fr; }
  .stage-graph svg { max-height: 30svh; }
  .m-val { font-size: 22px; }
  .meters { gap: 16px; }
  .hero-copy { bottom: 64px; }
  .foot { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .msg-body { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  .line > span { transform: none; }
}

/* ---------- hivors mark (Link) ---------- */
.logo { gap: 10px; }
.wordmark { font: italic 400 27px/1 var(--serif); letter-spacing: 0; text-transform: none; }
.foot .wordmark { font-size: 24px; }
.mark { overflow: visible; }
.mark .hx { transition: transform .6s var(--ease); }
.logo:hover .mark .hx-a { transform: translateX(1.6px); }
.logo:hover .mark .hx-b { transform: translateX(-1.6px); }
.loaded .nav .mark .hx-a { animation: linkA 1s var(--ease) both; }
.loaded .nav .mark .hx-b { animation: linkB 1s var(--ease) both; }
@keyframes linkA { from { transform: translateX(-5px); opacity: 0; } }
@keyframes linkB { from { transform: translateX(5px); opacity: 0; } }

/* ---------- 3D agent world (org scene) ---------- */
.gl #scene-org .stage-graph svg { visibility: hidden; }
.g3-labels { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; }
.g3-label {
  position: absolute; left: 0; top: 0; text-align: center; white-space: nowrap;
  font: 11px var(--mono); color: var(--fg-2); transition: opacity .3s; will-change: transform;
}
.g3-label b { display: block; font: 500 14px var(--sans); color: var(--fg); letter-spacing: .03em; transition: color .3s; }
.g3-label.active b { color: var(--accent); }
.gl #scene-org .stage-side { text-shadow: 0 1px 24px rgba(0,0,0,.8); }

/* ---------- live demo (experiment) ---------- */
.demo { padding: 18vh var(--gutter) 14vh; border-top: 1px solid var(--line); position: relative; z-index: 1; background: var(--bg); }
.demo-head .side-copy { margin-top: 18px; max-width: 460px; }
.demo-form { display: flex; gap: 10px; margin-top: 36px; max-width: 760px; }
.demo-form input { flex: 1; min-width: 0; height: 52px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(237,237,237,.04); color: var(--fg); font: 16px var(--sans); outline: none; transition: border-color .2s, background .2s; }
.demo-form input::placeholder { color: rgba(237,237,237,.38); }
.demo-form input:focus { border-color: var(--accent); background: rgba(94,234,212,.05); }
.demo-form .btn { height: 52px; padding: 0 22px; white-space: nowrap; }
.demo-form .btn:disabled { opacity: .45; pointer-events: none; }
.demo-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; max-width: 900px; }
.chip { font: 13px var(--sans); color: var(--fg-2); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: none; cursor: pointer; transition: color .2s, border-color .2s; text-align: left; }
.chip:hover { color: var(--fg); border-color: var(--line-2); }
.demo-note { min-height: 20px; margin-top: 10px; font: 12.5px var(--mono); color: #fcd34d; }

.demo-stage { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; margin-top: 28px; align-items: start; }
.demo-graph { position: relative; border: 1px solid var(--line); border-radius: 18px; padding: 12px;
  background: radial-gradient(60% 55% at 50% 45%, rgba(94,234,212,.07), transparent 70%), var(--bg-2); }
.demo-graph svg { display: block; width: 100%; height: auto; overflow: visible; }
.demo-status { font: 12px var(--mono); color: var(--fg-2); padding: 6px 6px 2px; min-height: 26px; }
.demo-status[data-kind="busy"]::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 1.2s infinite; vertical-align: 1px; }
.demo-status[data-kind="done"] { color: var(--accent); }
.demo-status[data-kind="error"] { color: #fca5a5; }

.d-edge { stroke: rgba(237,237,237,.18); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: dDraw .6s var(--ease) forwards; transition: stroke .3s; }
.d-edge.hot { stroke: var(--accent); stroke-width: 1.6; }
@keyframes dDraw { to { stroke-dashoffset: 0; } }
.d-node { transform-box: view-box; transform-origin: var(--x) var(--y); animation: dPop .55s var(--ease) both, dFloat 5s ease-in-out var(--d) infinite; }
@keyframes dPop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes dFloat { 50% { translate: 0 -3px; } }
.d-ball { transition: filter .3s; filter: brightness(.75) saturate(.9); }
.d-halo { fill: none; stroke: var(--accent); stroke-width: 1; opacity: 0; transition: opacity .3s; }
.d-node.active .d-ball { filter: brightness(1.12) drop-shadow(0 0 10px rgba(94,234,212,.55)); }
.d-node.active .d-halo { opacity: .55; }
.d-node.human .d-ball { filter: none; }
.d-name { font: 500 12.5px var(--sans); fill: var(--fg); text-anchor: middle; }
.d-role { font: 10px var(--mono); fill: var(--fg-2); text-anchor: middle; }
.d-node.active .d-name { fill: var(--accent); }
.d-packet { fill: #cffff6; filter: drop-shadow(0 0 6px var(--accent)); }

.demo-meters { display: flex; gap: 28px; margin-bottom: 16px; }
.demo-chat { border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); display: flex; flex-direction: column; height: 380px; }
.demo-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px; scroll-behavior: smooth; scrollbar-width: thin; }
.demo-log .msg:first-child { margin-top: auto; }
.demo-answer { margin-top: 16px; padding: 18px 20px; border-radius: 18px; border: 1px solid rgba(94,234,212,.45);
  background: linear-gradient(180deg, rgba(94,234,212,.08), rgba(94,234,212,.02)); opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.demo-answer.in { opacity: 1; transform: none; }
.demo-answer-head { font: 11px var(--mono); color: var(--fg-2); margin-bottom: 8px; }
.demo-answer-head b { color: var(--accent); font-weight: 500; }
.demo-answer-head .arrow { color: var(--accent); margin: 0 4px; }
[data-demo-answer-text] { font-size: 16.5px; line-height: 1.55; }

@media (max-width: 900px) {
  .demo-stage { grid-template-columns: 1fr; }
  .demo-chat { height: 320px; }
}
@media (max-width: 560px) {
  .demo-form { flex-direction: column; }
  .demo-form input { flex: none; }  /* flex:1 in a column squashed its height */
  .demo-form .btn { justify-content: center; }
  .demo-meters { gap: 20px; }
}

/* live demo in 3D (when WebGL works): the SVG stays for layout, the canvas draws on top */
.demo-gl, .d3-labels { position: absolute; pointer-events: none; }
.demo-graph.gl svg { visibility: hidden; }
.d3-labels { overflow: hidden; }
.d3-label { position: absolute; left: 0; top: 0; text-align: center; white-space: nowrap; transition: opacity .3s; }
.d3-label b { display: block; font: 500 13px var(--sans); color: var(--fg); transition: color .3s; }
.d3-label span { display: block; font: 10.5px var(--mono); color: var(--fg-2); margin-top: 2px; }
.d3-label.active b { color: var(--accent); }
.d3-label.human b { color: var(--fg-2); }

/* ---------- form fixes (iOS styling) ---------- */
input, button, .chip { -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }
.demo-form input { background-clip: padding-box; box-shadow: none; caret-color: var(--accent); -webkit-text-fill-color: var(--fg); }
.demo-form input::placeholder { -webkit-text-fill-color: rgba(237,237,237,.38); }
.demo-form .btn { border: 0; font: inherit; font-weight: 500; }
/* the answer box keeps its place, so the page below doesn't jump when a run starts or ends */
.demo-answer[hidden] { display: block; visibility: hidden; }
[data-demo-answer-text] { min-height: calc(1.55em * 4); }
@media (max-width: 560px) { [data-demo-answer-text] { min-height: calc(1.55em * 8); } }
/* the answer is laid out in full before it types, so its box never grows mid-read */
[data-demo-answer-text] .w { opacity: 0; transition: opacity .25s; }
[data-demo-answer-text] .w.on { opacity: 1; }
/* one line, always: a wrapping status used to change the stage's height during a run */
.demo-status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .demo-note { min-height: calc(12.5px * 1.5 * 2); } }
/* touch screens: the chat log must not catch the finger. As its own scroller it swallowed page
   scrolls mid-run and fought the auto-scroll to the newest message. It still follows the newest
   message from code; older ones fade out at the top. */
@media (hover: none), (pointer: coarse) {
  .demo-log { overflow: hidden; scroll-behavior: auto; touch-action: pan-y;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 48px); mask-image: linear-gradient(to bottom, transparent, #000 48px); }
}
