:root {
  color-scheme: dark;
  --bg: #050a12;
  --panel: rgba(9, 18, 31, 0.88);
  --panel-2: #0d1929;
  --line: rgba(128, 176, 210, 0.18);
  --muted: #8094a8;
  --text: #edf8ff;
  --cyan: #39dcff;
  --teal: #42f5c5;
  --violet: #9e7bff;
  --warning: #ffc857;
  --danger: #ff7285;
  --display: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(57, 220, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 220, 255, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 54px 54px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 22%, rgba(57, 220, 255, 0.13), transparent 28%),
    radial-gradient(circle at 90% 65%, rgba(158, 123, 255, 0.11), transparent 28%);
}

.site-header, main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header {
  height: 78px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
}
.brand { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; font-weight: 700; }
.brand-mark { width: 14px; height: 14px; transform: rotate(45deg); border: 2px solid var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.live-badge { display: flex; align-items: center; gap: 8px; margin-left: 36px; color: var(--muted); }
.live-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.repo-link { margin-left: auto; color: var(--muted); text-decoration: none; }
.repo-link:hover { color: var(--cyan); }

.hero { padding: 90px 0 58px; }
.eyebrow, .step, .local-tag, .status-tag, label, .input-meta, .examples, .answer-heading, footer {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.11em;
}
.eyebrow { margin: 0 0 20px; color: var(--cyan); font-size: 12px; }
h1 {
  max-width: 840px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(58px, 9vw, 118px);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}
h1 span { color: transparent; -webkit-text-stroke: 1px rgba(237, 248, 255, 0.72); }
.lede { max-width: 630px; margin: 34px 0 0; color: #9fb2c4; font-size: 18px; line-height: 1.65; }

.demo-shell { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr); border: 1px solid var(--line); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35); }
.panel { min-width: 0; padding: 34px; background: var(--panel); backdrop-filter: blur(16px); }
.input-panel { border-right: 1px solid var(--line); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.panel-heading h2 { margin: 8px 0 0; font-size: 22px; }
.step { color: var(--muted); font-size: 10px; }
.local-tag, .status-tag { padding: 8px 10px; color: var(--teal); border: 1px solid rgba(66, 245, 197, 0.32); font-size: 9px; }
.status-tag { color: var(--muted); border-color: var(--line); }
.status-tag.running { color: var(--cyan); border-color: rgba(57, 220, 255, 0.35); }
.status-tag.done { color: var(--teal); border-color: rgba(66, 245, 197, 0.35); }
.status-tag.warning { color: var(--warning); border-color: rgba(255, 200, 87, 0.35); }
.status-tag.failed { color: var(--danger); border-color: rgba(255, 114, 133, 0.35); }

label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 10px; }
textarea {
  display: block;
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: 20px;
  color: var(--text);
  background: #07111d;
  border: 1px solid var(--line);
  border-radius: 0;
  line-height: 1.65;
}
textarea:focus { border-color: rgba(57, 220, 255, 0.65); }
.input-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 10px; color: #64798d; font-size: 9px; }
.run-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding: 17px 20px;
  color: #021015;
  background: var(--cyan);
  border: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.run-button:hover { transform: translateY(-2px); box-shadow: 0 10px 34px rgba(57, 220, 255, 0.2); }
.run-button:disabled { cursor: wait; opacity: 0.55; transform: none; }
.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; color: #64798d; font-size: 9px; }
.examples button { padding: 7px 9px; color: #99adbf; background: transparent; border: 1px solid var(--line); cursor: pointer; font-size: 10px; }
.examples button:hover { color: var(--cyan); border-color: rgba(57, 220, 255, 0.45); }

.trace-panel { background: linear-gradient(145deg, rgba(12, 24, 40, 0.95), rgba(7, 14, 24, 0.95)); }
.trace { list-style: none; margin: 0; padding: 4px 0 8px; }
.trace li { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 16px; min-height: 82px; opacity: 0.48; transition: opacity 250ms ease; }
.trace li:not(:last-child)::after { content: ""; position: absolute; left: 18px; top: 36px; width: 1px; height: 47px; background: var(--line); }
.trace li.active, .trace li.complete { opacity: 1; }
.trace li.active .node { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 20px rgba(57, 220, 255, 0.18); }
.trace li.complete .node { border-color: var(--teal); color: var(--teal); }
.node { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); font: 11px var(--mono); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.trace li div { padding: 1px 0 0; }
.trace small { display: block; margin-bottom: 7px; color: var(--muted); font: 9px var(--mono); letter-spacing: 0.12em; }
.trace strong { display: block; overflow-wrap: anywhere; font: 600 14px/1.45 var(--mono); }
.model-badge { display: inline-block; margin-top: 8px; padding: 5px 7px; border: 1px solid; font: 8px var(--mono); letter-spacing: 0.1em; }
.model-badge[hidden] { display: none; }
.model-badge.warning { color: var(--warning); border-color: rgba(255, 200, 87, 0.35); }
.model-badge.failed { color: var(--danger); border-color: rgba(255, 114, 133, 0.35); }
.answer-card { margin-top: 18px; padding: 20px; border: 1px solid rgba(66, 245, 197, 0.25); background: rgba(4, 19, 22, 0.72); }
.answer-heading { display: flex; justify-content: space-between; color: var(--teal); font-size: 9px; }
.answer-heading button { color: var(--muted); background: none; border: 0; cursor: pointer; font: inherit; text-transform: uppercase; }
.answer-heading button:hover { color: var(--text); }
#answer { margin: 18px 0 0; max-height: 300px; overflow: auto; white-space: pre-wrap; color: #d9e9e7; font: 13px/1.65 var(--mono); }
.error-message { margin: 18px 0 0; padding: 16px; color: #ffdbe0; background: rgba(255, 114, 133, 0.08); border: 1px solid rgba(255, 114, 133, 0.25); font-size: 13px; line-height: 1.5; }

.principles { display: grid; grid-template-columns: repeat(3, 1fr); margin: 66px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principles article { padding: 28px; }
.principles article + article { border-left: 1px solid var(--line); }
.principles span { color: var(--cyan); font: 10px var(--mono); }
.principles h3 { margin: 14px 0 8px; font-size: 15px; }
.principles p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 0 0 38px; color: #607589; font-size: 9px; }

@media (max-width: 820px) {
  .hero { padding-top: 70px; }
  .demo-shell { grid-template-columns: 1fr; }
  .input-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .principles { grid-template-columns: 1fr; }
  .principles article + article { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .site-header { height: 66px; }
  .live-badge { display: none; }
  .hero { padding: 58px 0 42px; }
  h1 { font-size: clamp(51px, 17vw, 82px); }
  .lede { font-size: 16px; }
  .panel { padding: 24px 18px; }
  .input-meta, footer { flex-direction: column; }
  footer { line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
