:root {
  --bg: #0B0E14;
  --surface: #12161F;
  --surface-raised: #171C27;
  --border: #232A38;
  --border-soft: #1A2029;
  --text: #E9ECF1;
  --text-muted: #8A93A6;
  --text-faint: #565F73;
  --cyan: #4FE3C1;
  --cyan-dim: #2B7A6B;
  --coral: #FF6B4A;
  --danger: #FF8A73;
  --radius: 14px;
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  background:
    radial-gradient(75% 52% at 50% 0%, rgba(79, 227, 193, 0.12), transparent 68%),
    radial-gradient(40% 32% at 88% 14%, rgba(255, 107, 74, 0.08), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
code { font-family: var(--font-mono); font-size: .9em; color: var(--cyan); }
strong { color: var(--text); font-weight: 600; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--cyan); color: #07120F; padding: 8px 14px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 820px; }

/* ===== Header ===== */
header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11, 14, 20, 0.88);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(10px);
}
nav { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 28px; width: auto; filter: brightness(0) invert(1); }
.brand-logo-sm { height: 20px; }
.brand-tag {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  color: var(--cyan); border: 1px solid var(--cyan-dim); border-radius: 6px; padding: 2px 6px;
}
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 9px; border: 1px solid var(--border);
  background: transparent; color: var(--text);
  font: 600 14px/1.2 var(--font-body); cursor: pointer; transition: all .16s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--cyan-dim); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--cyan); border-color: transparent; color: #07120F; }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(79, 227, 193, 0.24); }
.btn-lg { padding: 13px 20px; font-size: 15px; }
.btn-sm { padding: 7px 11px; font-size: 13px; }

/* ===== Type ===== */
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--cyan);
}
h1 {
  margin: 14px 0 20px;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 6vw, 64px); line-height: 1.12; letter-spacing: -.02em;
  background: linear-gradient(180deg, #fff, #b3bfce 150%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
h3 { font-family: var(--font-display); font-weight: 600; }
.sub { color: var(--text-muted); font-size: 18px; max-width: 600px; }
.muted { color: var(--text-muted); }

/* ===== Hero ===== */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 24px; }
.hero-points { display: grid; gap: 8px; color: var(--text-muted); font-size: 14px; }
.hero-points li { display: flex; gap: 10px; align-items: baseline; }
.hero-points li::before { content: '✓'; color: var(--cyan); font-weight: 700; }

.demo-card {
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--border); border-radius: 18px; padding: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(79, 227, 193, .04);
}
.demo-head {
  display: flex; align-items: center; gap: 10px; padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border-soft); font: 500 13px var(--font-mono); color: var(--text-muted);
}
.demo-tag {
  margin-left: auto; font-size: 11px; color: var(--cyan);
  background: rgba(79, 227, 193, .08); border: 1px solid rgba(79, 227, 193, .25);
  border-radius: 6px; padding: 2px 8px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-live { background: var(--cyan); box-shadow: 0 0 0 4px rgba(79, 227, 193, .15); }
.demo-feed { display: grid; gap: 10px; font-size: 14px; }
.demo-feed li { opacity: 0; animation: feed-in .5s ease forwards; }
.demo-feed li:nth-child(1) { animation-delay: .1s; }
.demo-feed li:nth-child(2) { animation-delay: .5s; }
.demo-feed li:nth-child(3) { animation-delay: .9s; }
.demo-feed li:nth-child(4) { animation-delay: 1.3s; }
.demo-feed li:nth-child(5) { animation-delay: 1.6s; }
.demo-feed li:nth-child(6) { animation-delay: 2s; }
.demo-feed li:nth-child(7) { animation-delay: 2.4s; }
.demo-feed li:nth-child(8) { animation-delay: 2.8s; }
@keyframes feed-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg { padding: 10px 12px; border-radius: 10px; max-width: 85%; }
.msg-customer { background: var(--surface-raised); border: 1px solid var(--border); color: var(--text); }
.msg-agent {
  justify-self: end; background: rgba(79, 227, 193, .1); border: 1px solid rgba(79, 227, 193, .3);
  color: var(--cyan); font-weight: 600;
}
.call { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-family: var(--font-mono); font-size: 13px; }
.call .muted { font-size: 12px; }
.event { color: var(--text-muted); font-size: 13px; }
.rec { color: var(--coral); }
.ok { color: var(--cyan); font-weight: 700; }
.yours {
  font-family: var(--font-body); font-size: 11px; color: var(--coral);
  border: 1px solid rgba(255, 107, 74, .35); border-radius: 999px; padding: 1px 8px;
}
.triage { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 20px; }
.chip {
  font: 500 12px var(--font-mono); padding: 4px 9px; border-radius: 999px;
  background: rgba(79, 227, 193, .08); border: 1px solid rgba(79, 227, 193, .25); color: var(--cyan);
}
.chip-coral { background: rgba(255, 107, 74, .08); border-color: rgba(255, 107, 74, .3); color: var(--coral); }

/* ===== Sections ===== */
.section { padding: 80px 0; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(28px, 4.3vw, 44px); margin: 10px 0 12px; }
.section-head p { color: var(--text-muted); }

/* How it works */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: flow; }
.flow-step {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 20px;
}
.flow-step:not(:last-child)::after {
  content: '→'; position: absolute; right: -13px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; display: grid; place-items: center; z-index: 1;
  background: var(--bg); border: 1px solid var(--border); border-radius: 50%;
  color: var(--cyan); font-size: 12px;
}
.flow-num { font: 500 12px var(--font-mono); color: var(--cyan); }
.flow-step h3 { font-size: 17px; margin: 10px 0 8px; }
.flow-step p { font-size: 14px; color: var(--text-muted); }

/* Tools */
.tool-groups { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 18px; align-items: start; }
.tool-group { display: grid; gap: 12px; }
.group-title { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-muted); margin-bottom: 2px; }
.group-num {
  width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px;
  font: 600 12px var(--font-mono); color: var(--cyan); background: rgba(79, 227, 193, .1);
}
.tool {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
  transition: border-color .16s;
}
.tool:hover { border-color: var(--cyan-dim); }
.tool .sig { font-family: var(--font-mono); font-size: 14px; margin-bottom: 8px; }
.tool .sig span { color: var(--text-muted); white-space: nowrap; }
.tool p:last-child { color: var(--text-muted); font-size: 14px; }

/* ===== Setup ===== */
.setup { max-width: 860px; margin: 0 auto; display: grid; gap: 0; }
.setup-step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 20px; position: relative; padding-bottom: 28px; }
.setup-step:not(:last-child)::before {
  content: ''; position: absolute; left: 21px; top: 44px; bottom: 0; width: 2px; background: var(--border);
}
.setup-step[data-state="done"]:not(:last-child)::before { background: var(--cyan-dim); }
.step-marker span {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  font: 600 16px var(--font-display); background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
.setup-step[data-state="active"] .step-marker span,
.setup-step[data-state="open"] .step-marker span { border-color: var(--cyan); color: var(--cyan); }
.setup-step[data-state="done"] .step-marker span { background: var(--cyan); border-color: var(--cyan); color: #07120F; }
.setup-step[data-state="done"] .step-marker span { font-size: 0; }
.setup-step[data-state="done"] .step-marker span::after { content: '✓'; font-size: 18px; }

.step-body {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  min-width: 0;
}
.setup-step[data-state="locked"] .step-body { opacity: .62; }
.step-body h3 { font-size: 20px; margin-bottom: 6px; }
.step-intro { color: var(--text-muted); margin-bottom: 18px; }
.step-intro strong { color: var(--coral); }

.setup-step .unlocked { display: none; }
.setup-step .locked-note {
  border: 1px dashed var(--border); border-radius: 10px; padding: 14px 16px; color: var(--text-faint); font-size: 14px;
}
.setup-step:not([data-state="locked"]) .locked-note { display: none; }
.setup-step:not([data-state="locked"]) .unlocked { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; justify-items: start; }
.setup-step .unlocked > * { width: 100%; min-width: 0; }
.setup-step .unlocked > .btn, .setup-step .unlocked > .try-actions { width: auto; }

/* Form */
.form { display: grid; gap: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; border: 0; min-width: 0; }
.field[hidden] { display: none; }
label, legend { font-size: 14px; font-weight: 600; color: var(--text); }
legend { margin-bottom: 8px; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"] {
  width: 100%; padding: 11px 13px; border-radius: 9px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font: 400 15px var(--font-body); transition: border-color .16s, box-shadow .16s;
}
input::placeholder { color: var(--text-faint); }
input:focus { outline: none; border-color: var(--cyan-dim); box-shadow: 0 0 0 3px rgba(79, 227, 193, .15); }
input[aria-invalid="true"] { border-color: var(--danger); }
.hint { font-size: 13px; color: var(--text-muted); }
.field-error, .form-error { font-size: 13px; color: var(--danger); min-height: 0; }
.field-error:empty, .form-error:empty { display: none; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  transition: border-color .16s, background .16s; font-weight: 400;
}
.choice:hover { border-color: var(--cyan-dim); }
.choice:has(input:checked) { border-color: var(--cyan); background: rgba(79, 227, 193, .05); }
.choice input { accent-color: var(--cyan); margin-top: 3px; }
.choice-body { display: grid; gap: 4px; }
.choice-title { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.choice-desc { font-size: 13px; color: var(--text-muted); }
.pill {
  font: 500 11px var(--font-mono); color: var(--cyan); background: rgba(79, 227, 193, .1);
  border-radius: 999px; padding: 2px 8px;
}
.form-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

.done-note {
  display: flex; gap: 12px; align-items: center;
  background: rgba(79, 227, 193, .06); border: 1px solid rgba(79, 227, 193, .3);
  border-radius: 10px; padding: 14px 16px;
}
.done-note[hidden] { display: none; }

/* Secrets */
.secret { display: grid; gap: 6px; }
.secret-row { display: flex; gap: 8px; }
.secret-row input { font-family: var(--font-mono); font-size: 13px; }

/* Tabs + code */
.tablist { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
[role="tab"] {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--text-muted); font: 600 14px var(--font-body); padding: 10px 12px; cursor: pointer;
}
[role="tab"]:hover { color: var(--text); }
[role="tab"][aria-selected="true"] { color: var(--cyan); border-bottom-color: var(--cyan); }
.tabpanel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.snippet-where { font-size: 14px; color: var(--text-muted); }
.code-block { position: relative; }
.code-block pre {
  background: #080A0F; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; padding-right: 80px; overflow-x: auto; font-size: 13px; line-height: 1.6;
}
.code-block pre code { color: var(--text); white-space: pre; }
.code-copy { position: absolute; top: 10px; right: 10px; background: var(--surface); }

.mini-steps { display: grid; gap: 8px; counter-reset: mini; }
.mini-steps li { counter-increment: mini; display: flex; gap: 10px; color: var(--text-muted); font-size: 14px; }
.mini-steps li::before {
  content: counter(mini); flex-shrink: 0; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface-raised); border: 1px solid var(--border);
  font: 600 12px var(--font-mono); color: var(--cyan);
}

/* Try it */
.try-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.run-log { display: grid; gap: 8px; }
.run-log:empty { display: none; }
.log-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
}
.log-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.log-status { width: 16px; flex-shrink: 0; text-align: center; font-weight: 700; }
.log-item[data-status="pending"] .log-status { color: var(--text-faint); }
.log-item[data-status="ok"] .log-status { color: var(--cyan); }
.log-item[data-status="error"] { border-color: rgba(255, 138, 115, .45); }
.log-item[data-status="error"] .log-status { color: var(--danger); }
.log-who { font: 500 11px var(--font-mono); color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.log-title { font-family: var(--font-mono); font-size: 13px; color: var(--cyan); }
.log-item[data-who="customer"] .log-title { color: var(--coral); }
.log-summary { color: var(--text-muted); font-size: 14px; margin: 6px 0 0 26px; overflow-wrap: anywhere; }
.log-item details { margin: 8px 0 0 26px; }
.log-item summary { cursor: pointer; font-size: 12px; color: var(--text-faint); }
.log-item details pre {
  margin-top: 8px; background: #080A0F; border-radius: 8px; padding: 12px; overflow-x: auto;
  font: 12px/1.5 var(--font-mono); color: var(--text-muted);
}
.spinner {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--cyan); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 20px; }
.faq details[open] { border-color: var(--cyan-dim); }
.faq summary {
  cursor: pointer; padding: 18px 0; font: 600 16px var(--font-display); list-style: none;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--cyan); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--text-muted); padding-bottom: 18px; }

/* CTA */
.cta-band { padding-top: 20px; }
.cta-card {
  text-align: center; padding: 56px 24px; border-radius: 20px; border: 1px solid var(--border);
  background:
    radial-gradient(60% 120% at 50% 0%, rgba(79, 227, 193, .12), transparent 70%),
    var(--surface);
}
.cta-card h2 { font-size: clamp(26px, 3.6vw, 38px); margin-bottom: 10px; }
.cta-card p { color: var(--text-muted); margin-bottom: 24px; }

/* Footer */
footer { border-top: 1px solid var(--border-soft); padding: 32px 0; color: var(--text-faint); font-size: 14px; }
.footer-row { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; margin-left: auto; }
.footer-links a { color: var(--text-muted); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--surface-raised); border: 1px solid var(--cyan-dim); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; transition: all .2s; z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow-step::after { display: none; }
  .tool-groups { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  .code-block pre { padding-top: 56px; }
  .wrap { padding: 0 16px; }
  .brand-logo { height: 22px; }
  nav .btn { padding: 8px 12px; font-size: 13px; }
  .hero { padding-top: 44px; }
  .section { padding: 56px 0; }
  .flow { grid-template-columns: 1fr; }
  .field-row, .choice-grid { grid-template-columns: 1fr; }
  .setup-step { grid-template-columns: 32px 1fr; gap: 12px; }
  .step-marker span { width: 32px; height: 32px; font-size: 14px; }
  .setup-step:not(:last-child)::before { left: 15px; top: 32px; }
  .step-body { padding: 18px; }
  .secret-row { flex-wrap: wrap; }
  .secret-row input { flex-basis: 100%; }
  .footer-links { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .demo-feed li { animation: none; opacity: 1; }
  .spinner { animation: none; }
  * { transition: none !important; }
}
