:root {
  color: #171715;
  background: #11131a;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  font-weight: 450;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --paper: rgba(253, 252, 247, 0.94);
  --ink: #161615;
  --muted: #6b6960;
  --line: rgba(220, 227, 255, 0.28);
  --line-strong: rgba(255, 255, 255, 0.88);
  --sand: #c9af78;
  --sand-dark: #9a7c45;
  --blueprint: #3f6b74;
  --green: #496f55;
  --stage-ink: #f7f8ff;
  --stage-muted: rgba(229, 234, 255, 0.62);
  --stage-panel: rgba(17, 20, 31, 0.72);
  --panel-shadow: 0 26px 80px rgba(10, 12, 18, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow: auto;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 19% 16%, rgba(255, 255, 255, 0.86), transparent 26%),
    radial-gradient(circle at 82% 9%, color-mix(in srgb, var(--accent, #4f7cff) 20%, transparent), transparent 28%),
    linear-gradient(180deg, #faf9f3 0%, #ebe9df 100%);
  overflow: hidden;
}

.particle-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.texture-layer {
  position: absolute;
  inset: -10%;
  background-image: url("../assets/sandy-particles.png");
  background-size: 420px 420px;
  opacity: 0.18;
  mix-blend-mode: multiply;
  filter: grayscale(0.2);
}

.particle-field i {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent, #c9af78) 42%, #c9af78 58%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent, #c9af78) 24%, transparent);
  animation: drift 12s ease-in-out infinite;
}

.builder-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding: 18px 22px 110px;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  padding: 2px 2px 10px;
}

.topbar > div:first-child {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.eyebrow,
.mini-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.02rem, 1.7vw, 1.35rem);
  line-height: 1;
  max-width: none;
}

h2 {
  font-size: clamp(1.7rem, 3.8vw, 3.2rem);
  line-height: 0.95;
}

.topbar__links,
.link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar__links a,
.link-grid a,
.selected-strip span {
  border: 1px solid rgba(22, 22, 20, 0.18);
  background: rgba(255, 255, 255, 0.62);
  padding: 7px 10px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(20, 20, 18, 0.08);
}

.workspace {
  width: 100%;
  max-width: 1560px;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(360px, 430px);
  align-items: start;
  gap: 20px;
}

.stage {
  position: relative;
  min-height: 610px;
  height: min(690px, calc(100vh - 165px));
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--accent, #4f7cff) 20%, transparent), transparent 31%),
    radial-gradient(circle at 20% 78%, rgba(255, 184, 77, 0.11), transparent 28%),
    linear-gradient(145deg, rgba(17, 20, 31, 0.96), rgba(30, 33, 45, 0.88));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 26px 70px rgba(10, 12, 18, 0.22);
  overflow: hidden;
}

.stage::before,
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(222, 229, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(222, 229, 255, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 12%, transparent 78%);
  pointer-events: none;
}

.stage::after {
  background-size: 168px 168px;
  opacity: 0.7;
}

.recording-plane {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 7%;
  height: 25%;
  border-top: 1px solid rgba(241, 245, 255, 0.22);
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent, #4f7cff) 14%, transparent), transparent),
    repeating-linear-gradient(90deg, transparent 0 74px, rgba(233, 238, 255, 0.16) 75px 77px, transparent 78px 130px);
  opacity: 0.78;
  pointer-events: none;
  z-index: 1;
}

.plane-node,
.gateway-node {
  position: absolute;
  border: 1px solid rgba(241, 245, 255, 0.22);
  border-radius: 8px;
  background: rgba(14, 17, 27, 0.66);
  color: var(--stage-ink);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  cursor: pointer;
}

.plane-node {
  left: 9%;
  right: 26%;
  bottom: 16%;
  min-height: 50px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.plane-node span {
  border-left: 2px solid color-mix(in srgb, var(--accent, #4f7cff) 65%, rgba(255, 255, 255, 0.45));
  padding-left: 8px;
  font-size: 0.68rem;
  font-weight: 820;
  text-transform: uppercase;
}

.gateway-node {
  right: 7%;
  bottom: 54%;
  width: min(22%, 210px);
  min-height: 54px;
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 12px;
  box-shadow: 0 0 28px color-mix(in srgb, var(--accent, #4f7cff) 18%, transparent);
}

.gateway-node__label {
  font-size: 1rem;
  font-weight: 900;
}

.gateway-node__route {
  color: var(--stage-muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.plane-node.is-active,
.gateway-node.is-active {
  outline: 2px solid color-mix(in srgb, var(--accent, #4f7cff) 72%, white);
}

.agent-figure {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(28vw, 300px);
  height: min(57vh, 520px);
  min-width: 218px;
  min-height: 390px;
  transform: translate(-50%, -50%);
  filter:
    drop-shadow(0 0 28px color-mix(in srgb, var(--accent, #4f7cff) 22%, transparent))
    drop-shadow(0 20px 18px rgba(0, 0, 0, 0.34));
  animation: suspended 6.5s ease-in-out infinite;
}

.agent-figure::before,
.agent-figure::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  width: 122%;
  height: 76%;
  border: 1px solid color-mix(in srgb, var(--accent, #4f7cff) 38%, transparent);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  opacity: 0.38;
  pointer-events: none;
}

.agent-figure::after {
  width: 92%;
  height: 104%;
  transform: translate(-50%, -50%) rotate(14deg);
  opacity: 0.22;
}

.agent-part {
  position: absolute;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.36) 48%, rgba(255, 255, 255, 0.08) 70%),
    color-mix(in srgb, var(--accent, #4f7cff) 16%, rgba(255, 255, 255, 0.12));
  border: 2px solid rgba(247, 249, 255, 0.74);
  box-shadow:
    inset 0 0 24px rgba(255, 255, 255, 0.22),
    inset 0 0 38px color-mix(in srgb, var(--accent, #4f7cff) 16%, transparent),
    0 0 0 1px rgba(0, 0, 0, 0.48),
    0 12px 26px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(2px);
}

.head {
  left: 38%;
  top: 0;
  width: 24%;
  height: 15%;
  overflow: visible;
}

.provider-chip {
  position: absolute;
  left: 50%;
  min-width: 44px;
  border: 1px solid color-mix(in srgb, var(--accent, #4f7cff) 48%, white);
  border-radius: 999px;
  background: rgba(11, 14, 23, 0.78);
  color: var(--stage-ink);
  padding: 3px 5px;
  font-size: 0.42rem;
  font-weight: 850;
  text-align: center;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent, #4f7cff) 20%, transparent);
}

.provider-chip--openai {
  top: 12%;
  transform: translateX(-128%) rotate(-9deg);
}

.provider-chip--anthropic {
  top: -18%;
  transform: translateX(-50%);
}

.provider-chip--gemini {
  top: 12%;
  transform: translateX(30%) rotate(9deg);
}

.neck {
  left: 45%;
  top: 14%;
  width: 10%;
  height: 6%;
}

.torso {
  left: 29%;
  top: 17%;
  width: 42%;
  height: 30%;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 82% 78%, 82% 100%, 18% 100%, 18% 78%, 0 78%);
}

.pelvis {
  left: 31%;
  top: 47%;
  width: 38%;
  height: 11%;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 62% 72%, 50% 100%, 38% 72%, 0 72%);
}

.arm.upper.left {
  left: 9%;
  top: 20%;
  width: 18%;
  height: 24%;
}

.arm.lower.left {
  left: 11%;
  top: 43%;
  width: 17%;
  height: 22%;
}

.hand.left {
  left: 13%;
  top: 64%;
  width: 15%;
  height: 13%;
}

.arm.upper.right {
  right: 9%;
  top: 20%;
  width: 18%;
  height: 24%;
}

.arm.lower.right {
  right: 11%;
  top: 43%;
  width: 17%;
  height: 22%;
}

.hand.right {
  right: 13%;
  top: 64%;
  width: 15%;
  height: 13%;
}

.leg.upper.left {
  left: 30%;
  top: 58%;
  width: 18%;
  height: 19%;
}

.leg.lower.left {
  left: 28%;
  top: 76%;
  width: 20%;
  height: 17%;
}

.foot.left {
  left: 8%;
  top: 91%;
  width: 40%;
  height: 8%;
  clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%, 0 55%, 24% 55%);
}

.leg.upper.right {
  right: 30%;
  top: 58%;
  width: 18%;
  height: 19%;
}

.leg.lower.right {
  right: 28%;
  top: 76%;
  width: 20%;
  height: 17%;
}

.foot.right {
  right: 8%;
  top: 91%;
  width: 40%;
  height: 8%;
  clip-path: polygon(0 0, 76% 0, 76% 55%, 100% 55%, 100% 100%, 0 100%);
}

.rig-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.rig-lines line {
  stroke: var(--line);
  stroke-width: 0.12;
  stroke-dasharray: 0.8 1.2;
  vector-effect: non-scaling-stroke;
}

.rig-lines line.is-active {
  stroke: color-mix(in srgb, var(--accent, #4f7cff) 74%, white);
  stroke-width: 0.28;
  stroke-dasharray: none;
}

.artifact-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.artifact {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  min-height: 0;
  border: 1px solid color-mix(in srgb, var(--accent, #4f7cff) 68%, rgba(255, 255, 255, 0.28));
  border-radius: 14px;
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.24), transparent 35%),
    linear-gradient(145deg, color-mix(in srgb, var(--accent, #4f7cff) 18%, rgba(19, 22, 33, 0.94)), rgba(11, 14, 23, 0.78));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 12px 28px rgba(0, 0, 0, 0.32),
    inset 0 0 18px rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  color: var(--stage-ink);
  text-align: center;
  animation: seesaw 5.6s ease-in-out infinite;
  animation-delay: var(--sway);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.artifact::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid color-mix(in srgb, var(--accent, #4f7cff) 28%, transparent);
  border-radius: inherit;
  opacity: 0.52;
  pointer-events: none;
}

.artifact::after {
  content: "";
  position: absolute;
  inset: -13px;
  border-radius: inherit;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, #4f7cff) 22%, transparent), transparent 68%);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 140ms ease;
  z-index: -1;
}

.artifact:hover,
.artifact:focus-visible,
.artifact.is-active {
  border-color: color-mix(in srgb, var(--accent, #4f7cff) 76%, white);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent, #4f7cff) 70%, white),
    0 0 30px color-mix(in srgb, var(--accent, #4f7cff) 46%, transparent),
    0 18px 34px rgba(0, 0, 0, 0.34),
    inset 0 0 22px color-mix(in srgb, var(--accent, #4f7cff) 16%, transparent);
  outline: none;
  transform: translate(-50%, -50%) scale(1.12);
  z-index: 8;
}

.artifact:hover::after,
.artifact:focus-visible::after,
.artifact.is-active::after {
  opacity: 1;
}

.artifact.is-active {
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.34), transparent 36%),
    linear-gradient(145deg, color-mix(in srgb, var(--accent, #4f7cff) 32%, rgba(20, 23, 34, 0.94)), rgba(11, 14, 23, 0.86));
}

.artifact.is-selected {
  border-color: color-mix(in srgb, #72e3a1 72%, var(--accent, #4f7cff));
}

.artifact__icon {
  width: 30px;
  height: 30px;
  border: 2px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.12);
}

.glyph {
  position: relative;
  width: 36px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: var(--stage-ink);
  opacity: 0.92;
  transform: scale(0.9);
}

.glyph i,
.glyph b {
  display: block;
  font-style: normal;
}

.glyph--model {
  width: 42px;
  height: 38px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
}

.glyph--model i {
  position: absolute;
  border: 1px solid rgba(20, 20, 18, 0.6);
  background: white;
  padding: 1px 3px;
  font-size: 0.38rem;
  font-weight: 900;
}

.glyph--model i:nth-child(1) {
  top: -9px;
  left: -12px;
}

.glyph--model i:nth-child(2) {
  top: 12px;
  right: -20px;
}

.glyph--model i:nth-child(3) {
  bottom: -9px;
  left: 3px;
}

.glyph--law {
  border: 2px solid var(--ink);
  background: rgba(255, 255, 255, 0.8);
  grid-template-rows: 1fr auto 1fr;
  padding: 3px;
}

.glyph--law i {
  width: 100%;
  border-top: 1px solid rgba(20, 20, 18, 0.55);
}

.glyph--law b {
  font-size: 0.42rem;
  font-weight: 900;
}

.glyph--tools,
.glyph--streams {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.glyph--tools i {
  width: 9px;
  height: 28px;
  border: 2px solid var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.glyph--toolbox {
  border: 2px solid var(--ink);
  border-top-width: 7px;
  background: rgba(255, 255, 255, 0.76);
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 6px 4px 3px;
}

.glyph--toolbox b {
  position: absolute;
  top: -10px;
  left: 10px;
  right: 10px;
  height: 7px;
  border: 2px solid var(--ink);
  border-bottom: 0;
}

.glyph--toolbox i {
  height: 12px;
  border: 1px solid rgba(20, 20, 18, 0.55);
}

.glyph--capability {
  border-left: 3px solid var(--green);
  border-right: 3px solid var(--green);
  display: grid;
  gap: 4px;
  padding: 4px;
}

.glyph--capability i {
  border-top: 2px solid var(--ink);
}

.glyph--harness {
  width: 42px;
  height: 38px;
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
}

.glyph--harness i {
  border: 1px solid rgba(20, 20, 18, 0.5);
  background: white;
  padding: 1px 3px;
  font-size: 0.36rem;
  font-weight: 850;
}

.glyph--output {
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  align-items: end;
}

.glyph--output i {
  border: 2px solid var(--ink);
  background: rgba(255, 255, 255, 0.76);
  min-height: 20px;
  font-size: 0.5rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.glyph--backpack {
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.75);
}

.glyph--backpack i {
  position: absolute;
  left: 8px;
  right: 8px;
  top: -8px;
  height: 9px;
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.glyph--backpack b {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(20, 20, 18, 0.55);
}

.glyph--messages i {
  position: absolute;
  width: 29px;
  height: 15px;
  border: 2px solid var(--ink);
  background: white;
}

.glyph--messages i:nth-child(1) {
  top: 3px;
  left: 0;
}

.glyph--messages i:nth-child(2) {
  top: 10px;
  left: 5px;
}

.glyph--messages i:nth-child(3) {
  top: 17px;
  left: 10px;
}

.glyph--multi i {
  position: absolute;
  border: 2px solid var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.glyph--multi i:nth-child(1) {
  width: 18px;
  height: 28px;
  left: 9px;
  top: 1px;
}

.glyph--multi i:nth-child(2),
.glyph--multi i:nth-child(3) {
  width: 12px;
  height: 18px;
  bottom: 1px;
}

.glyph--multi i:nth-child(2) {
  left: 0;
}

.glyph--multi i:nth-child(3) {
  right: 0;
}

.glyph--logfire {
  width: 42px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.glyph--logfire i {
  border-top: 2px solid var(--blueprint);
  position: relative;
}

.glyph--logfire i::after {
  content: "";
  position: absolute;
  top: -5px;
  left: calc(20% * var(--n, 1));
  width: 7px;
  height: 7px;
  border: 2px solid var(--ink);
  background: white;
  rotate: 45deg;
}

.glyph--logfire i:nth-child(2) {
  --n: 2;
}

.glyph--logfire i:nth-child(3) {
  --n: 3;
}

.glyph--logfire i:nth-child(4) {
  --n: 4;
}

.glyph--gateway {
  width: 42px;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  align-items: center;
}

.glyph--gateway i,
.glyph--gateway b {
  border: 1px solid rgba(20, 20, 18, 0.65);
  background: white;
  padding: 2px;
  font-size: 0.38rem;
  font-weight: 900;
  text-align: center;
}

.glyph--browser {
  width: 42px;
  border: 2px solid var(--ink);
  background: white;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 9px 4px 4px;
}

.glyph--browser i {
  position: absolute;
  top: 4px;
  left: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 8px 0 0 rgba(20, 20, 18, 0.55);
}

.glyph--browser b {
  min-height: 10px;
  border: 1px solid rgba(20, 20, 18, 0.5);
}

.glyph--streams i {
  width: 8px;
  height: 8px;
  border: 2px solid var(--ink);
  background: white;
  box-shadow: 10px 0 0 rgba(63, 107, 116, 0.35);
}

.glyph--terminal {
  width: 42px;
  border: 2px solid var(--ink);
  background: #1f211d;
  color: white;
  justify-items: start;
  padding: 5px;
  gap: 2px;
}

.glyph--terminal i,
.glyph--terminal b {
  font-size: 0.48rem;
  font-weight: 900;
}

.glyph--graph i {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: white;
}

.glyph--graph i:nth-child(1) {
  left: 2px;
  top: 4px;
}

.glyph--graph i:nth-child(2) {
  right: 3px;
  top: 13px;
}

.glyph--graph i:nth-child(3) {
  left: 12px;
  bottom: 3px;
}

.glyph--graph b {
  position: absolute;
  width: 32px;
  border-top: 1px solid rgba(20, 20, 18, 0.65);
}

.glyph--graph b:nth-child(4) {
  rotate: 18deg;
}

.glyph--graph b:nth-child(5) {
  rotate: -52deg;
}

.glyph i,
.glyph b {
  border-color: currentColor !important;
}

.artifact__label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  max-width: 112px;
  transform: translateX(-50%);
  color: rgba(247, 248, 255, 0.66);
  font-size: 0.52rem;
  font-weight: 820;
  line-height: 1.05;
  overflow: visible;
  text-align: center;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.42);
  white-space: nowrap;
  pointer-events: none;
  transition:
    color 140ms ease,
    opacity 140ms ease,
    transform 140ms ease;
  opacity: 0.72;
  z-index: 9;
}

.artifact:hover .artifact__label,
.artifact:focus-visible .artifact__label,
.artifact.is-active .artifact__label {
  color: var(--stage-ink);
  opacity: 1;
  transform: translateX(-50%) translateY(-2px) scale(1.08);
}

.artifact__pin {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: #72e3a1;
  box-shadow: 0 0 14px rgba(114, 227, 161, 0.54);
}

.artifact__pin::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 4px;
  height: 8px;
  border: solid #102015;
  border-width: 0 2px 2px 0;
  rotate: 42deg;
}

.artifact--lens {
  border-radius: 50%;
  aspect-ratio: 1;
  width: 72px;
  height: 72px;
}

.artifact--lens::before,
.artifact--gauge::before {
  border-radius: inherit;
}

.artifact--clamp {
  clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%);
}

.artifact--cartridge {
  border-radius: 8px;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 78% 100%, 0 100%);
}

.artifact--port {
  border-radius: 50% 50% 50% 12px;
}

.artifact--prism {
  clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
}

.artifact--pack {
  border-radius: 18px 18px 10px 10px;
}

.artifact--rail {
  width: 50px;
  height: 76px;
  border-radius: 999px;
  transform-origin: 20% 50%;
}

.artifact--gauge {
  border-radius: 50% 50% 14px 14px;
}

.artifact--beacon {
  border-radius: 50%;
}

.artifact--beacon::before {
  animation: pulse-ring 2.8s ease-out infinite;
}

.artifact--anchor {
  border-radius: 14px;
  clip-path: polygon(50% 0, 100% 32%, 82% 100%, 18% 100%, 0 32%);
}

.artifact--lock {
  border-radius: 16px 16px 22px 22px;
  clip-path: polygon(50% 0, 100% 18%, 88% 78%, 50% 100%, 12% 78%, 0 18%);
}

.artifact--scroll {
  width: 68px;
  height: 58px;
  border-radius: 8px;
  clip-path: polygon(14% 0, 100% 0, 86% 100%, 0 100%);
}

.artifact--core {
  width: 82px;
  height: 82px;
  border-radius: 28px;
  border-width: 2px;
}

.surface-strip {
  position: relative;
  width: 100%;
  max-width: 1560px;
  margin: -6px auto 14px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(15, 18, 28, 0.72);
  color: var(--stage-ink);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 44px rgba(10, 12, 18, 0.16);
}

.surface-strip button {
  min-height: 42px;
  border: 1px solid color-mix(in srgb, var(--accent, #4f7cff) 56%, rgba(255, 255, 255, 0.22));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #4f7cff) 13%, rgba(255, 255, 255, 0.07));
  color: var(--stage-ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 7px;
  font-size: 0.7rem;
  font-weight: 820;
  cursor: pointer;
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent, #4f7cff) 16%, transparent);
}

.surface-strip button .glyph {
  width: 26px;
  height: 26px;
  transform: scale(0.58);
  transform-origin: center;
}

.surface-strip button.is-active {
  color: var(--stage-ink);
  background: color-mix(in srgb, var(--accent, #4f7cff) 35%, rgba(255, 255, 255, 0.1));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent, #4f7cff) 56%, white),
    0 0 28px color-mix(in srgb, var(--accent, #4f7cff) 36%, transparent);
}

.info-panel {
  min-height: 0;
  border: 1px solid color-mix(in srgb, var(--accent, #4f7cff) 28%, rgba(20, 20, 18, 0.16));
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--panel-shadow);
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  padding: 20px;
  overflow: hidden;
  position: relative;
}

.info-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent, #4f7cff), transparent);
  pointer-events: none;
}

.panel-heading {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
}

.panel-heading p:last-child {
  color: var(--muted);
  margin: 0;
  font-size: 0.98rem;
}

.media-preview {
  margin: 0 0 14px;
  border: 1px solid color-mix(in srgb, var(--accent, #4f7cff) 24%, rgba(20, 20, 18, 0.12));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 30px rgba(20, 20, 18, 0.08);
  overflow: hidden;
}

.media-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8.6;
  object-fit: cover;
  object-position: top left;
  filter: saturate(0.86) contrast(1.05);
}

.media-preview figcaption {
  padding: 8px 10px;
  color: var(--muted);
  border-top: 1px solid rgba(20, 20, 18, 0.14);
  font-size: 0.74rem;
  font-weight: 720;
}

.preview-diagram {
  min-height: 138px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 10px;
  background:
    linear-gradient(rgba(20, 20, 18, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 18, 0.06) 1px, transparent 1px),
    rgba(255, 255, 255, 0.5);
  background-size: 20px 20px;
}

.gateway-preview {
  grid-template-columns: 1fr 22px 1.2fr 22px 1fr;
  align-items: center;
}

.gateway-preview span,
.gateway-preview b,
.gateway-preview small {
  border: 1px solid rgba(20, 20, 18, 0.32);
  background: rgba(255, 255, 255, 0.74);
  padding: 9px;
  text-align: center;
  font-weight: 840;
}

.gateway-preview i {
  border-top: 2px solid rgba(20, 20, 18, 0.62);
}

.gateway-preview small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.72rem;
}

.terminal-preview {
  background: #1f211d;
  color: #f6f6ef;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.terminal-preview span,
.terminal-preview b {
  border-left: 2px solid #79b587;
  padding-left: 10px;
  font-size: 0.8rem;
}

.streams-preview {
  grid-template-columns: 1fr;
}

.streams-preview span,
.streams-preview i {
  display: block;
  border: 1px solid rgba(20, 20, 18, 0.26);
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 10px;
  font-style: normal;
  font-weight: 820;
}

.streams-preview i {
  margin-left: 28px;
  color: var(--blueprint);
}

.providers-preview,
.harness-preview,
.capability-preview {
  grid-template-columns: repeat(2, 1fr);
}

.providers-preview span,
.harness-preview span,
.capability-preview span {
  border: 1px solid rgba(20, 20, 18, 0.28);
  background: rgba(255, 255, 255, 0.74);
  padding: 9px;
  font-size: 0.76rem;
  font-weight: 850;
  text-align: center;
}

.tab-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid rgba(20, 20, 18, 0.18);
  border-radius: 8px;
  overflow: hidden;
}

.tab-list button {
  min-width: 0;
  border: 0;
  border-right: 1px solid rgba(20, 20, 18, 0.18);
  background: rgba(255, 255, 255, 0.36);
  padding: 10px 6px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 820;
}

.tab-list button:last-child {
  border-right: 0;
}

.tab-list button.is-active {
  color: #fff;
  background: var(--accent, #4f7cff);
}

.tab-panel {
  overflow: auto;
  padding: 18px 2px;
}

.copy-stack {
  display: grid;
  gap: 14px;
  color: #302f2a;
}

.copy-stack p {
  margin: 0;
}

.example-block {
  border: 1px solid rgba(20, 20, 18, 0.2);
  background: rgba(255, 255, 255, 0.66);
}

.example-meta {
  border-bottom: 1px solid rgba(20, 20, 18, 0.16);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

pre {
  margin: 0;
  overflow: auto;
}

code {
  display: block;
  white-space: pre;
  padding: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.48;
}

.connection-list {
  display: grid;
  gap: 10px;
}

.connection-list button {
  position: relative;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--accent, #4f7cff) 24%, rgba(20, 20, 18, 0.14));
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--accent-soft, rgba(63, 107, 116, 0.12)), transparent 68%),
    rgba(255, 255, 255, 0.62);
  padding: 12px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(20, 20, 18, 0.06);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.connection-list button::after {
  content: "→";
  position: absolute;
  right: 12px;
  top: 12px;
  color: var(--accent, #4f7cff);
  font-weight: 900;
  opacity: 0.72;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.connection-list button:hover,
.connection-list button:focus-visible {
  border-color: var(--accent, #4f7cff);
  box-shadow: 0 16px 28px color-mix(in srgb, var(--accent, #4f7cff) 14%, transparent);
  outline: none;
  transform: translateY(-1px);
}

.connection-list button:hover::after,
.connection-list button:focus-visible::after {
  opacity: 1;
  transform: translateX(2px);
}

.connection-list span {
  display: block;
  font-weight: 820;
  margin-bottom: 4px;
}

.connection-list small,
.drawer-note,
.compat-note {
  color: var(--muted);
}

.panel-actions {
  min-height: 48px;
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(20, 20, 18, 0.16);
  padding-top: 14px;
}

.primary-action {
  width: 100%;
  min-height: 42px;
  border: 2px solid var(--accent, #4f7cff);
  border-radius: 8px;
  background: var(--accent, #4f7cff);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 16px 30px color-mix(in srgb, var(--accent, #4f7cff) 20%, transparent);
}

.compat-note {
  font-size: 0.86rem;
  font-weight: 720;
}

.link-grid {
  padding-top: 14px;
}

.link-grid a {
  flex: 1 1 120px;
}

.spec-drawer {
  position: fixed;
  left: 22px;
  right: 22px;
  bottom: 0;
  z-index: 7;
  transform: translateY(calc(100% - 42px));
  transition: transform 220ms ease;
  pointer-events: none;
}

.spec-drawer.is-open {
  transform: translateY(0);
}

.drawer-tab {
  display: block;
  margin-left: 0;
  min-height: 42px;
  border: 1px solid rgba(20, 20, 18, 0.3);
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 16px;
  font-weight: 820;
  cursor: pointer;
  pointer-events: auto;
}

.drawer-body {
  display: grid;
  grid-template-columns: minmax(190px, 0.32fr) minmax(280px, 1fr) minmax(180px, 0.32fr);
  gap: 16px;
  max-height: 180px;
  border: 1px solid rgba(20, 20, 18, 0.24);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--panel-shadow);
  padding: 16px;
  overflow: auto;
  pointer-events: auto;
}

.spec-drawer.is-open .drawer-body {
  max-height: min(62vh, 560px);
}

.drawer-body pre {
  border: 1px solid rgba(20, 20, 18, 0.16);
  background: rgba(247, 246, 240, 0.82);
  min-height: 0;
  overflow: auto;
}

.selected-strip {
  display: flex;
  align-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  overflow: auto;
}

.selected-strip span {
  min-height: 28px;
  padding: 4px 7px;
  font-size: 0.72rem;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(14px, -18px, 0);
  }
}

@keyframes suspended {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(-0.3deg);
  }
  50% {
    transform: translate(-50%, calc(-50% - 8px)) rotate(0.35deg);
  }
}

@keyframes seesaw {
  0%,
  100% {
    rotate: -0.7deg;
  }
  50% {
    rotate: 0.8deg;
  }
}

@keyframes pulse-ring {
  0% {
    opacity: 0.54;
    transform: scale(1);
  }
  70% {
    opacity: 0;
    transform: scale(1.42);
  }
  100% {
    opacity: 0;
    transform: scale(1.42);
  }
}

@media (max-width: 1120px) {
  body {
    overflow: auto;
  }

  .builder-stage {
    min-height: 100vh;
    padding: 16px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 720px;
  }

  .info-panel {
    min-height: 520px;
  }

  .drawer-body {
    grid-template-columns: 1fr;
    max-height: 52vh;
    overflow: auto;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    gap: 14px;
  }

  .stage {
    min-height: 780px;
  }

  .agent-figure {
    width: 230px;
    height: 420px;
  }

  .artifact {
    width: 50px;
    height: 50px;
    padding: 0;
  }

  .artifact__icon {
    width: 24px;
    height: 24px;
  }

  .artifact--lens {
    width: 62px;
    height: 62px;
  }

  .artifact--core {
    width: 68px;
    height: 68px;
  }

  .artifact--rail {
    width: 44px;
    height: 64px;
  }

  .artifact--scroll {
    width: 60px;
    height: 50px;
  }

  .surface-strip button .surface-label {
    display: none;
  }

  .spec-drawer {
    left: 12px;
    right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
