:root {
  --ink: #101216;
  --ink-2: #191c23;
  --bone: #edf0eb;
  --blue: #183ee8;
  --orange: #ff5a36;
  --mint: #72f1b8;
  --line: rgba(237, 240, 235, 0.16);
  --muted: rgba(237, 240, 235, 0.58);
  --display: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}
html {
  background: var(--ink);
  color: var(--bone);
}
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}
button,
textarea {
  color: inherit;
  font: inherit;
}
button {
  cursor: pointer;
}
button:active {
  transform: scale(0.96);
}
button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}
.skip {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--bone);
  color: var(--ink);
  transform: translateY(-180%);
}
.skip:focus {
  transform: none;
}
.topbar {
  height: 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.wordmark i {
  display: block;
  width: 22px;
  height: 22px;
  border: 1px solid var(--bone);
  border-radius: 50%;
  position: relative;
}
.wordmark i::before,
.wordmark i::after {
  content: "";
  position: absolute;
  background: var(--orange);
}
.wordmark i::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  left: 8px;
  top: 8px;
}
.wordmark i::after {
  width: 1px;
  height: 30px;
  left: 10px;
  top: -5px;
  transform: rotate(42deg);
}
.topbar > p {
  margin: 0;
  font: 10px var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
#model-button {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  background: transparent;
  font: 10px var(--mono);
  text-transform: uppercase;
}
#model-light {
  width: 7px;
  height: 7px;
  background: #999;
  border-radius: 50%;
}
#model-light.is-ready {
  background: var(--mint);
  box-shadow: 0 0 12px var(--mint);
}
#model-light.is-fallback {
  background: var(--orange);
}
.surface {
  min-height: calc(100vh - 106px);
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 330px;
  background: var(--ink);
  position: relative;
  cursor: none;
}
.surface button,
.surface textarea {
  cursor: none;
}
.rail {
  padding: 14px 0;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.rail button {
  border: 0;
  background: transparent;
}
.rail-logo,
.rail-user {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line) !important;
  border-radius: 50%;
  font: 11px var(--mono) !important;
}
.rail-button {
  width: 100%;
  min-height: 64px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--muted);
  position: relative;
}
.rail-button.is-active {
  color: var(--bone);
}
.rail-button.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--orange);
}
.rail-button span {
  font-size: 21px;
}
.rail-button small {
  font: 7px var(--mono);
  letter-spacing: 0.08em;
}
.rail-user {
  margin-top: auto;
  background: var(--blue) !important;
  border-color: transparent !important;
}
.work {
  padding: 32px 32px 0;
  min-width: 0;
  overflow: hidden;
}
.work-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}
.kicker {
  color: var(--muted);
  font: 9px var(--mono);
  letter-spacing: 0.12em;
}
h1,
h2 {
  font-family: var(--display);
  text-wrap: balance;
}
h1 {
  margin: 7px 0 0;
  font-size: clamp(40px, 4.7vw, 76px);
  line-height: 0.9;
  letter-spacing: -0.065em;
  font-stretch: condensed;
}
.clock {
  text-align: right;
}
.clock span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font: 8px var(--mono);
}
.clock b {
  font: 18px var(--mono);
  font-variant-numeric: tabular-nums;
}
.network-view {
  height: min(51vh, 510px);
  min-height: 390px;
  position: relative;
  margin-top: 26px;
  background: #131720;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
}
.network-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.network-view svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(114, 241, 184, 0.18));
}
.network-view svg path {
  fill: none;
}
.coast {
  stroke: #41454e;
  stroke-width: 22;
  opacity: 0.24;
}
.route {
  stroke-width: 2.5;
  stroke-dasharray: 7 8;
}
.route-a {
  stroke: var(--mint);
  animation: route 2s linear infinite;
}
.route-b {
  stroke: var(--orange);
  animation: route 1.2s linear infinite reverse;
}
.network-view svg circle {
  fill: var(--ink);
  stroke: var(--bone);
  stroke-width: 2;
}
@keyframes route {
  to {
    stroke-dashoffset: -30;
  }
}
.map-target {
  position: absolute;
  z-index: 2;
  display: grid;
  min-width: 142px;
  padding: 12px;
  text-align: left;
  background: rgba(16, 18, 22, 0.88);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.map-target span {
  grid-row: 1 / 3;
  margin-right: 12px;
  font: 34px/1 var(--display);
}
.map-target b {
  grid-column: 2;
  font: 9px var(--mono);
  color: var(--orange);
}
.map-target small {
  grid-column: 2;
  font-size: 10px;
  color: var(--muted);
}
.target-delay {
  left: 47%;
  top: 52%;
}
.target-hub {
  right: 7%;
  top: 14%;
}
.target-hub b {
  color: var(--mint);
}
.map-key {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: flex;
  gap: 18px;
  color: var(--muted);
  font: 8px var(--mono);
}
.map-key span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.map-key i {
  width: 15px;
  height: 2px;
}
.map-key .live {
  background: var(--mint);
}
.map-key .slow {
  background: var(--orange);
}
.signal-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.signal-strip button {
  min-height: 100px;
  padding: 15px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  gap: 4px;
  text-align: left;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
}
.signal-strip button:last-child {
  border-right: 0;
}
.signal-strip span {
  font: 8px var(--mono);
  color: var(--muted);
}
.signal-strip b {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  font: 30px var(--display);
}
.signal-strip small {
  font-size: 10px;
  color: var(--muted);
}
.context-panel {
  border-left: 1px solid var(--line);
  background: var(--ink-2);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.context-head {
  padding: 32px 20px 18px;
  border-bottom: 1px solid var(--line);
}
.context-head h2 {
  margin: 6px 0 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}
.event-stack {
  list-style: none;
  margin: 0;
  padding: 0;
}
.event-stack li {
  display: grid;
  grid-template-columns: 48px 1fr;
  border-bottom: 1px solid var(--line);
}
.event-stack time {
  padding: 18px 8px 0 14px;
  color: var(--muted);
  font: 9px var(--mono);
  font-variant-numeric: tabular-nums;
}
.event-stack button {
  min-height: 82px;
  padding: 16px 10px;
  border: 0;
  background: transparent;
  text-align: left;
}
.event-stack b,
.event-stack span {
  display: block;
}
.event-stack b {
  font-size: 13px;
}
.event-stack span {
  margin-top: 5px;
  color: var(--muted);
  font: 9px var(--mono);
}
.reply {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--line);
}
.reply label {
  font: 8px var(--mono);
  color: var(--muted);
}
.reply textarea {
  width: 100%;
  height: 78px;
  margin-top: 9px;
  padding: 10px;
  resize: none;
  background: #101216;
  border: 1px solid var(--line);
  font-size: 12px;
}
.reply button {
  width: 100%;
  min-height: 38px;
  border: 0;
  background: var(--blue);
  font-size: 11px;
  font-weight: 700;
}
.reply button:disabled {
  opacity: 0.4;
}
.onboarding {
  position: absolute;
  left: 50%;
  top: 51%;
  translate: -50% -50%;
  z-index: 4;
  min-width: 360px;
  padding: 15px 18px;
  background: var(--bone);
  color: var(--ink);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition:
    opacity 0.2s,
    translate 0.2s;
}
.onboarding b,
.onboarding span {
  display: block;
}
.onboarding b {
  font: 10px var(--mono);
}
.onboarding span {
  margin-top: 5px;
  font-size: 11px;
  color: #575b5b;
}
.onboarding.is-gone {
  opacity: 0;
  translate: -50% -44%;
}
.motive-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  z-index: 90;
  pointer-events: none;
  transform: translate3d(-60px, -60px, 0);
  will-change: transform;
  mix-blend-mode: difference;
}
.cursor-core {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-radius: 50%;
  transition:
    width 0.16s,
    height 0.16s,
    left 0.16s,
    top 0.16s,
    border-radius 0.16s,
    rotate 0.16s;
}
.motive-cursor.is-target .cursor-core {
  left: 2px;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 2px;
  rotate: 45deg;
}
.motive-cursor.kind-message .cursor-core {
  border-radius: 50% 50% 4px 50%;
}
.motive-cursor.kind-service .cursor-core {
  border-radius: 50%;
  width: 26px;
  height: 26px;
  left: 1px;
  top: 1px;
}
.cursor-label {
  position: absolute;
  left: 34px;
  top: 5px;
  width: max-content;
  padding: 5px 7px;
  color: white;
  background: black;
  font: 8px var(--mono);
  letter-spacing: 0.08em;
  opacity: 0;
  translate: -5px 0;
  transition:
    opacity 0.14s,
    translate 0.14s;
}
.motive-cursor.is-target .cursor-label {
  opacity: 1;
  translate: 0;
}
.semantic-frame {
  position: fixed;
  z-index: 89;
  pointer-events: none;
  border: 1px solid white;
  opacity: 0;
  transition:
    opacity 0.12s,
    left 0.12s,
    top 0.12s,
    width 0.12s,
    height 0.12s;
  mix-blend-mode: difference;
}
.semantic-frame.is-visible {
  opacity: 0.7;
}
.intent-bloom {
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  height: 250px;
  translate: -50% -50%;
  z-index: 95;
  border: 1px solid rgba(237, 240, 235, 0.28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 18, 22, 0.96) 0 27%, rgba(16, 18, 22, 0.68) 28% 57%, transparent 58%);
  pointer-events: none;
  opacity: 0;
  scale: 0.72;
  transition:
    opacity 0.16s,
    scale 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.intent-bloom.is-open {
  opacity: 1;
  scale: 1;
  pointer-events: auto;
}
.bloom-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 8px var(--mono);
  color: var(--muted);
}
.intent-bloom button {
  position: absolute;
  width: 78px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--ink);
  font: 10px var(--mono);
  pointer-events: none;
  transition:
    background 0.12s,
    color 0.12s,
    transform 0.12s;
}
.intent-bloom.is-open button {
  pointer-events: auto;
}
.intent-bloom button i {
  display: block;
  font-size: 7px;
  color: var(--muted);
}
.intent-bloom button:nth-of-type(1) {
  left: 86px;
  top: 2px;
}
.intent-bloom button:nth-of-type(2) {
  right: -5px;
  top: 104px;
}
.intent-bloom button:nth-of-type(3) {
  left: 86px;
  bottom: 2px;
}
.intent-bloom button:nth-of-type(4) {
  left: -5px;
  top: 104px;
}
.intent-bloom button.is-selected {
  background: var(--bone);
  color: var(--ink);
  transform: scale(1.08);
}
.answer-lens {
  position: fixed;
  z-index: 96;
  width: min(390px, calc(100vw - 28px));
  background: var(--bone);
  color: var(--ink);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.answer-lens[hidden] {
  display: none;
}
.answer-lens > div {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid #b8bbb6;
}
#answer-source {
  font: 8px var(--mono);
  letter-spacing: 0.1em;
}
#close-answer {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 22px;
}
.answer-lens h2 {
  margin: 18px 18px 8px;
  font-size: 24px;
  letter-spacing: -0.04em;
}
.answer-lens p {
  min-height: 64px;
  margin: 0;
  padding: 0 18px 18px;
  font-size: 14px;
  line-height: 1.45;
  text-wrap: pretty;
}
.answer-lens footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: #dadfd7;
}
.answer-lens footer button {
  min-width: 70px;
  min-height: 32px;
  border: 0;
  background: var(--blue);
  color: white;
}
.answer-lens footer span {
  font: 8px var(--mono);
  color: #575b5b;
}
.instruction-bar {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  background: var(--ink);
  font: 8px var(--mono);
}
.instruction-bar span {
  color: var(--muted);
}
kbd {
  color: var(--bone);
  font: inherit;
}
.instruction-bar b {
  margin-left: auto;
  font-weight: 400;
  color: var(--orange);
}

@media (max-width: 980px) {
  .surface {
    grid-template-columns: 58px 1fr;
  }
  .context-panel {
    grid-column: 2;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .event-stack {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .event-stack li {
    grid-template-columns: 42px 1fr;
    border-right: 1px solid var(--line);
  }
  .reply {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 0 12px;
  }
  .topbar > p {
    display: none;
  }
  #model-button b {
    max-width: 90px;
    text-align: right;
  }
  .surface {
    display: block;
    cursor: auto;
  }
  .surface button,
  .surface textarea {
    cursor: pointer;
  }
  .rail {
    height: 54px;
    padding: 0 8px;
    flex-direction: row;
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--ink);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail-logo,
  .rail-user {
    width: 34px;
    height: 34px;
  }
  .rail-button {
    width: 48px;
    min-height: 48px;
  }
  .rail-button small {
    display: none;
  }
  .rail-user {
    margin: 0 0 0 auto;
  }
  .work {
    padding: 24px 14px 0;
  }
  .clock {
    display: none;
  }
  h1 {
    font-size: 44px;
  }
  .network-view {
    height: 430px;
    min-height: 0;
  }
  .target-delay {
    left: 34%;
    top: 54%;
  }
  .target-hub {
    right: 3%;
    top: 12%;
  }
  .signal-strip {
    grid-template-columns: 1fr;
  }
  .signal-strip button {
    min-height: 76px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .context-panel {
    margin-left: 0;
  }
  .event-stack {
    display: block;
  }
  .onboarding {
    min-width: 0;
    width: calc(100% - 46px);
    top: 45%;
  }
  .motive-cursor,
  .semantic-frame {
    display: none;
  }
  .instruction-bar {
    display: none;
  }
  .intent-bloom {
    width: 220px;
    height: 220px;
  }
  .intent-bloom button:nth-of-type(1),
  .intent-bloom button:nth-of-type(3) {
    left: 71px;
  }
  .intent-bloom button:nth-of-type(2),
  .intent-bloom button:nth-of-type(4) {
    top: 89px;
  }
}

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