:root {
  --ink: #020614;
  --text: #17202b;
  --muted: #5f6e78;
  --line: #d9e2e5;
  --paper: #eff3f4;
  --surface: #ffffff;
  --cyan: #00b4be;
  --cyan-2: #00a6bc;
  --blue: #3266a5;
  --purple: #803482;
  --magenta: #b7094c;
  --ok: #118c4f;
  --warn: #8e8876;
 --radius: 8px;
  --shadow: 0 18px 60px rgba(2, 6, 20, 0.1);
  font-family: Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--cyan) 47%, var(--ink) 47% 53%, var(--cyan) 53%);
  box-shadow: 0 0 24px rgba(0, 180, 190, 0.24);
}

.brand b,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

nav a,
button,
.primary,
.secondary {
 min-height: 44px;
 display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

nav a:hover,
button:hover,
.secondary:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(0, 180, 190, 0.35);
  outline-offset: 3px;
}

.primary {
  border-color: transparent;
  background: var(--cyan);
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(340px, 1.05fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  min-height: 680px;
  padding: clamp(36px, 7vw, 88px) clamp(18px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(0, 180, 190, 0.12), transparent 55%),
    var(--paper);
}

.hero-copy {
  max-width: 740px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.97;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
}

.lead {
  max-width: 620px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.hero-actions,
.actions,
.report-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.confidence-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-pill {
  display: inline-flex;
  margin-bottom: 18px;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill.success {
  background: #e6f7ee;
  color: var(--ok);
}

.confidence-card p {
  color: var(--muted);
  line-height: 1.55;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.kpis div,
.score-list div {
  padding: 14px;
  border-radius: 12px;
  background: var(--paper);
}

.kpis b,
.kpis span,
.score-list b,
.score-list span {
 display: block;
}

.snapshot-list {
 display: grid;
 gap: 10px;
 margin-top: 18px;
}

.snapshot-list p {
 margin: 0;
 color: var(--muted);
 line-height: 1.45;
}

.snapshot-list b {
 color: var(--text);
}

.kpis b,
.score-list b {
  font-size: 24px;
}

.kpis span,
.score-list span,
label {
  color: var(--muted);
  font-size: 13px;
}

.section {
 padding: clamp(36px, 6vw, 78px) clamp(18px, 5vw, 72px);
 background: var(--surface);
}

.section.demo {
 padding-top: clamp(24px, 4vw, 42px);
 padding-bottom: clamp(28px, 4vw, 48px);
}

.section:nth-of-type(odd) {
  background: var(--paper);
}

.section-head {
 max-width: 760px;
 margin-bottom: 28px;
}

.demo .section-head {
 margin-bottom: 18px;
}

.agents-head {
 max-width: none;
 display: flex;
 align-items: end;
 justify-content: space-between;
 gap: 18px;
}

.add-agent-button {
 flex: 0 0 auto;
}

.section-head.compact p {
 color: var(--muted);
 line-height: 1.5;
}

.selection-hint {
 display: inline-block;
 margin-top: 6px;
 padding: 10px 14px;
 border: 1px solid rgba(0, 180, 190, 0.28);
 border-radius: var(--radius);
 background: #f1fbfc;
 font-size: 15px;
 white-space: nowrap;
}

.selection-hint a {
 color: var(--blue);
 font-weight: 800;
 text-decoration-thickness: 2px;
 text-underline-offset: 3px;
}

.path-grid,
.agent-grid,
.proof-grid,
.demo-shell {
  display: grid;
  gap: 18px;
}

.path-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.path-grid article,
.agent-card,
.control-panel,
.journey-panel,
.proof-panel,
.report {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 34px rgba(2, 6, 20, 0.06);
}

.path-grid article {
  padding: 22px;
}

.path-grid b {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
}

.path-grid p,
.agent-card p,
.score-list p {
  color: var(--muted);
  line-height: 1.5;
}

.demo-shell {
 grid-template-columns: repeat(2, minmax(0, 1fr));
 gap: 16px;
 align-items: start;
}

.control-panel,
.journey-panel,
.proof-panel {
 padding: 18px;
}

label {
 display: block;
 margin-bottom: 10px;
 font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fbfcfd;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

textarea {
  resize: vertical;
}

.chips {
 display: grid;
 grid-template-columns: 1fr;
 gap: 8px;
 margin: 10px 0 14px;
}

.chips button {
 width: 100%;
 min-height: 40px;
 padding: 8px 14px;
 border-radius: 999px;
 color: var(--muted);
 font-size: 13px;
 font-weight: 700;
 white-space: nowrap;
 overflow: visible;
 text-overflow: clip;
}

details {
  margin: 16px 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

summary {
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.error {
  margin: 14px 0 0;
  color: var(--magenta);
  font-weight: 800;
}

.journey-step {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.journey-step:last-child {
  border-bottom: 0;
}

.journey-step > span {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 50%;
  background: #bcc9ce;
}

.journey-step.done > span {
  background: var(--ok);
}

.journey-step.warn > span {
  background: var(--warn);
}

.journey-step p {
 margin: 4px 0 0;
 color: var(--muted);
 line-height: 1.48;
}

.scenario-tools {
 display: grid;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 align-items: center;
 gap: 12px;
 margin: 14px 0 16px;
 padding: 12px;
 border: 1px solid var(--line);
 border-radius: 16px;
 background: #f8fbfc;
}

.voice-toggle {
 display: inline-flex;
 align-items: center;
 justify-content: flex-start;
 gap: 10px;
 min-height: 48px;
 margin: 0;
 padding: 0 14px;
 border: 1px solid var(--line);
 border-radius: 999px;
 background: #fff;
 color: var(--text);
 font-size: 14px;
 font-weight: 800;
 line-height: 1.15;
 white-space: nowrap;
 width: 100%;
}

.mic-button {
 border-color: rgba(0, 180, 190, 0.34);
}

.mic-button.listening {
 border-color: var(--cyan);
}

.voice-switch input {
 position: absolute;
 opacity: 0;
 pointer-events: none;
}

.switch-track {
 position: relative;
 width: 42px;
 height: 24px;
 flex: 0 0 auto;
 border-radius: 999px;
 background: #bcc9ce;
 transition: background 160ms ease;
}

.switch-track::after {
 content: "";
 position: absolute;
 top: 3px;
 left: 3px;
 width: 18px;
 height: 18px;
 border-radius: 50%;
 background: #fff;
 box-shadow: 0 2px 6px rgba(2, 6, 20, 0.22);
 transition: transform 160ms ease;
}

.voice-switch input:checked + .switch-track {
 background: var(--cyan);
}

.mic-button.listening .switch-track {
 background: var(--cyan);
}

.voice-switch input:checked + .switch-track::after {
 transform: translateX(18px);
}

.mic-button.listening .switch-track::after {
 transform: translateX(18px);
}

.voice-switch:focus-within,
.mic-button:focus-visible {
 outline: 3px solid rgba(0, 180, 190, 0.24);
 outline-offset: 2px;
}

.scenario-tools .primary {
 grid-column: 1 / -1;
 justify-self: start;
 min-height: 48px;
 white-space: nowrap;
}

.voice-note {
 margin: -4px 0 14px;
 color: var(--magenta);
 font-weight: 800;
}

.section.gui-section {
  background: var(--ink);
  color: #fff;
}

.gui-section .section-head p {
  color: #bcc9ce;
}

.gui-frame {
  overflow: hidden;
  border: 1px solid rgba(188, 201, 206, 0.24);
  border-radius: var(--radius);
  background: #07101d;
}

.gui-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(188, 201, 206, 0.18);
}

.gui-toolbar a {
  color: var(--cyan);
}

iframe {
  display: block;
  width: 100%;
  height: min(720px, 76vh);
  border: 0;
  background: var(--ink);
}

.agent-grid {
 grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.agent-card {
 display: block;
 width: 100%;
 min-height: 210px;
 padding: 18px;
 text-align: left;
 word-break: normal;
 overflow-wrap: anywhere;
 transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.agent-card:hover,
.agent-card.selected {
 border-color: var(--cyan);
 box-shadow: 0 14px 42px rgba(0, 180, 190, 0.16);
}

.agent-card.selected {
 background: linear-gradient(180deg, #ffffff, #f1fbfc);
}

.agent-card:active {
 transform: translateY(1px);
}

.agent-card span,
.agent-card b {
 display: block;
 color: var(--purple);
 font-size: 12px;
 font-weight: 800;
 letter-spacing: 0.08em;
 text-transform: uppercase;
}

.agent-card h3 {
 margin: 18px 0 10px;
}

.modal-backdrop {
 position: fixed;
 inset: 0;
 z-index: 30;
 display: grid;
 place-items: center;
 padding: 18px;
 background: rgba(2, 6, 20, 0.48);
}

.modal {
 position: relative;
 width: min(720px, 100%);
 max-height: min(860px, 92dvh);
 overflow: auto;
 padding: clamp(24px, 5vw, 42px);
 border: 1px solid var(--line);
 border-radius: var(--radius);
 background: var(--surface);
 box-shadow: var(--shadow);
}

.modal h2 {
 margin-bottom: 22px;
}

.modal label {
 margin-top: 16px;
}

.modal select {
 width: 100%;
 min-height: 52px;
 border: 1px solid var(--line);
 border-radius: 12px;
 padding: 12px 14px;
 background: #fbfcfd;
 color: var(--text);
 font: inherit;
}

.modal-close {
 position: absolute;
 top: 18px;
 right: 18px;
 min-width: 44px;
 padding: 8px;
 border: 0;
 background: transparent;
 font-size: 28px;
 line-height: 1;
}

.switch-row {
 display: flex;
 align-items: center;
 gap: 12px;
}

.switch-row input {
 width: 22px;
 height: 22px;
}

.modal-actions {
 display: flex;
 justify-content: flex-end;
 gap: 12px;
 margin-top: 24px;
}

.proof-grid {
  grid-template-columns: minmax(300px, 0.9fr) minmax(380px, 1.1fr);
}

.score-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.score-list p {
  margin: 8px 0 0;
  font-size: 13px;
}

.proof-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.proof-tabs button {
  min-height: 38px;
  border-radius: 999px;
}

.proof-tabs .active {
  background: var(--ink);
  color: #fff;
}

pre {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  border-radius: 12px;
  padding: 14px;
  background: #07101d;
  color: #eff3f4;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.report {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
}

.report p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 1060px) {
  .hero,
  .demo-shell,
  .proof-grid {
    grid-template-columns: 1fr;
  }

  .path-grid,
  .agent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  nav a {
    width: 100%;
  }

  .hero {
    min-height: auto;
    padding-top: 42px;
  }

  h1 {
    font-size: 42px;
  }

  .lead {
    font-size: 17px;
  }

  .selection-hint {
    white-space: normal;
  }

  .path-grid,
  .agent-grid,
  .score-list,
  .kpis,
  .report {
    grid-template-columns: 1fr;
  }

  .report {
    display: grid;
  }

  .hero-actions,
  .actions,
  .report-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions > *,
  .actions > *,
  .report-actions > * {
    width: 100%;
  }

  .scenario-tools {
    grid-template-columns: 1fr;
  }

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

  .scenario-tools .primary,
  .mic-button,
  .voice-switch {
    width: 100%;
    justify-content: center;
  }

  iframe {
    height: 620px;
  }
}

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

@media print {
  .topbar,
  .hero,
  .choose,
  .demo,
  .gui-section,
  .proof-section,
  .report-actions {
    display: none;
  }

  .section {
    padding: 24px;
  }
}
