:root {
  --ink: #16151c;
  --ink-2: #3d3b47;
  --muted: #76737f;
  --line: #e8e6ee;
  --paper: #ffffff;
  --soft: #f6f5f8;
  --accent: #ff7a1a;
  --accent-ink: #ffffff;
  --violet: #8f86ff;
  --ok: #1f8a5c;
  --warn: #b7621b;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
code { font-family: var(--mono); font-size: .88em; background: #f0eef5; padding: 1px 5px; border-radius: 5px; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--muted); letter-spacing: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15px; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #2c2a35; }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 20px #ff7a1a40; }
.btn-accent:hover { background: #f26c0c; }
.btn-soft { background: var(--soft); color: var(--ink); }
.btn-soft:hover { background: #eeedf2; }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--soft); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: #ffffffd9; backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-color: var(--line); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 20px; letter-spacing: -.6px; }
.logo img { border-radius: 7px; }
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; gap: 6px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: clamp(56px, 9vw, 110px) 16px 40px; max-width: 1200px; margin: 0 auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); background: var(--soft); padding: 6px 14px; border-radius: 999px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px #ff7a1a26; }
h1 {
  margin-top: 26px;
  font-size: clamp(44px, 7.4vw, 92px); line-height: .98; letter-spacing: -.045em; font-weight: 600;
}
h1 em { font-size: 1.08em; letter-spacing: -.02em; }
.lede { max-width: 640px; margin: 26px auto 0; color: var(--muted); font-size: clamp(16px, 1.6vw, 18px); }
.lede b { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.platforms-line { margin-top: 22px; font-size: 13px; color: #a3a0ac; }

.hero-stage {
  position: relative; margin: 64px auto 0; max-width: 960px;
  display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: center; text-align: left;
}
.hero-stage::before {
  content: ""; position: absolute; inset: 10% -6% -8%; z-index: -1;
  background: radial-gradient(60% 60% at 60% 40%, #ff7a1a1f, transparent 70%), radial-gradient(50% 50% at 20% 70%, #8f86ff24, transparent 70%);
  filter: blur(10px);
}

.ctx-panel { background: var(--ink); color: #e9e7f2; border-radius: var(--radius); padding: 20px; box-shadow: 0 30px 60px -20px #16151c66; }
.ctx-head { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #a9a5b8; font-family: var(--mono); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 0 #3ddc9799; animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px #3ddc9700; } 100% { box-shadow: 0 0 0 0 #3ddc9700; } }
.ctx-panel ul { list-style: none; padding: 0; margin: 16px 0 0; }
.ctx-panel li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid #ffffff12; font-size: 13px; opacity: 0; transform: translateY(6px); animation: rise .5s forwards; }
.ctx-panel li:nth-child(1) { animation-delay: .2s } .ctx-panel li:nth-child(2) { animation-delay: .35s } .ctx-panel li:nth-child(3) { animation-delay: .5s }
.ctx-panel li:nth-child(4) { animation-delay: .65s } .ctx-panel li:nth-child(5) { animation-delay: .8s } .ctx-panel li:nth-child(6) { animation-delay: .95s }
@keyframes rise { to { opacity: 1; transform: none; } }
.ctx-panel li span { color: #8c88a0; }
.ctx-panel li b { font-weight: 500; text-align: right; }
.ctx-panel b.warn { color: #ffb37a; }
.ctx-panel b.ok { color: #6fe3b0; }
.ctx-src { margin-top: 12px; font-size: 11px; color: #75718a; font-family: var(--mono); }

.chat { background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 40px 80px -30px #16151c40, 0 2px 6px #16151c0a; overflow: hidden; }
.chat-top { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-top img { border-radius: 6px; }
.chat-top b { display: block; font-size: 14px; font-weight: 600; }
.chat-top small { display: block; font-size: 12px; color: var(--muted); }
.chat-body { padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 84%; padding: 11px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; }
.msg-user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.msg-bot { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 5px; }
.msg-q { display: block; margin-top: 8px; }
.msg-sys { align-self: center; font-size: 12.5px; color: var(--ok); background: #e9f6ef; padding: 6px 12px; border-radius: 999px; }
.msg-sys span { font-weight: 700; margin-right: 4px; }
.msg-agent { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; margin-top: 10px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13.5px; font-weight: 500; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.chip-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.chat-input { margin: 0 14px 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; color: #a7a4b0; font-size: 14px; }

/* ---------- sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) clamp(16px, 4vw, 48px); }
.section > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.section-ink { background: var(--ink); color: #f1eff7; }
.section-ink em { color: #8c88a0; }
.section-soft { background: var(--soft); }
.section-head { text-align: center; margin-bottom: clamp(40px, 6vw, 64px); }
.kicker { font-size: 13px; font-weight: 500; color: var(--accent); letter-spacing: .02em; margin-bottom: 14px; }
h2 { font-size: clamp(34px, 5vw, 58px); line-height: 1.02; letter-spacing: -.04em; font-weight: 600; }
h2 em { font-size: 1.08em; }
h3 { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.body { color: var(--muted); font-size: 17px; margin-top: 18px; max-width: 560px; }
.body.center { margin-left: auto; margin-right: auto; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pillars article { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.pillars .num { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.pillars h3 { margin: 18px 0 10px; font-size: 20px; }
.pillars p { color: var(--muted); font-size: 15px; }

/* flow */
.flow { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: f; }
.flow li { position: relative; background: #1f1e27; border: 1px solid #2c2a36; border-radius: var(--radius); padding: 24px; }
.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -14px; top: 26px; color: #5b5869; font-size: 14px; }
.flow-tag { font-family: var(--mono); font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.flow h3 { margin: 14px 0 8px; color: #fff; }
.flow p { font-size: 14px; color: #a19db1; }
.flow-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.flow-chips span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: #2b2936; color: #cfcbdc; }
.meter-bar { height: 8px; border-radius: 99px; background: #2b2936; overflow: hidden; margin-top: 18px; }
.meter-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--accent)); border-radius: 99px; }
.meter small { display: block; margin-top: 12px; font-size: 13px; color: #a19db1; line-height: 1.5; }
.split { display: grid; gap: 10px; margin-top: 14px; }
.split div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.split b { width: 100%; font-size: 12px; font-weight: 500; color: #fff; }
.split span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: #2b2936; color: #cfcbdc; }

/* bento */
.bento { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.card { grid-column: span 2; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: #fff; display: flex; flex-direction: column; }
.card-lg { grid-column: span 3; }
.card > p { color: var(--muted); font-size: 14.5px; margin: 6px 0 22px; }
.track { margin-top: auto; background: var(--soft); border-radius: 14px; padding: 18px; }
.track-head { display: flex; justify-content: space-between; font-size: 14px; }
.track-head span { color: var(--ok); font-weight: 500; }
.track-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 16px 0 12px; }
.track-line span { font-size: 12px; color: #a3a0ac; padding-top: 12px; border-top: 4px solid #e2e0e8; }
.track-line .done { color: var(--ink-2); border-color: var(--ink); }
.track-line .now { color: var(--accent); font-weight: 600; border-color: var(--accent); }
.track small { font-size: 12px; color: var(--muted); }
.stack-btns { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.code { margin: auto 0 0; background: var(--ink); color: #e8e6f0; border-radius: 12px; padding: 16px 18px; font: 13px/1.7 var(--mono); overflow-x: auto; }
.code .c { color: #77738a; } .code .k { color: #c792ea; } .code .f { color: #82aaff; } .code .s { color: #c3e88d; } .code .n { color: #ffb37a; }
.rules { list-style: none; padding: 0; margin: auto 0 0; display: grid; gap: 8px; }
.rules li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--ink-2); background: var(--soft); border-radius: 12px; padding: 12px 14px; }
.rule-if { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.rule-then { margin-left: auto; font-size: 12.5px; font-weight: 500; padding: 3px 10px; border-radius: 999px; }
.rule-then.ok { background: #e2f4ea; color: var(--ok); }
.rule-then.warn { background: #fdeedd; color: var(--warn); }

/* handoff */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.ticks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.ticks li { position: relative; padding-left: 30px; color: var(--ink-2); font-size: 15.5px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/10px no-repeat; }
.handoff-visual { display: flex; flex-direction: column; gap: 14px; }
.briefing { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 20px 50px -24px #16151c33; }
.briefing-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.briefing-head span { font-size: 11px; font-weight: 500; color: var(--warn); background: #fdeedd; padding: 2px 9px; border-radius: 999px; }
.briefing p { font-size: 14px; color: var(--ink-2); padding: 9px 0; border-top: 1px solid #f0eef4; }
.briefing p b { display: inline-block; min-width: 118px; color: var(--muted); font-weight: 500; }
.banner { align-self: center; font-size: 13px; color: var(--ink-2); background: #fff; border: 1px dashed #d6d3df; padding: 8px 14px; border-radius: 999px; }

/* knowledge */
.io { display: grid; grid-template-columns: 1fr auto 1fr; gap: 28px; align-items: center; }
.io-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.io-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; margin-bottom: 14px; }
.io-col ul { list-style: none; padding: 0; margin: 0; }
.io-col li { padding: 10px 0; border-top: 1px solid #f0eef4; font-size: 15px; }
.io-core { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; border-radius: 24px; background: var(--soft); }
.io-core img { border-radius: 14px; box-shadow: 0 0 0 8px #ff7a1a14, 0 0 0 16px #ff7a1a0a; }
.io-core b { margin-top: 12px; font-size: 18px; letter-spacing: -.5px; }
.io-core small { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* integrations */
.int-grid { display: grid; gap: 16px; }
.int-block { background: #1f1e27; border: 1px solid #2c2a36; border-radius: var(--radius); padding: 26px; }
.int-block h4 { font-size: 14px; font-weight: 500; color: #fff; margin-bottom: 16px; }
.int-block h4 small { font-weight: 400; color: #8c88a0; margin-left: 8px; font-size: 12px; }
.logos { display: flex; flex-wrap: wrap; gap: 8px; }
.logos span { font-size: 14px; padding: 8px 14px; border-radius: 10px; background: #2b2936; color: #e3e0ec; }

/* install */
.install { max-width: 820px; }
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px; background: var(--soft); border-radius: 14px; width: fit-content; margin: 0 auto 18px; }
.tabs button { font: inherit; font-size: 14px; border: 0; background: none; padding: 8px 14px; border-radius: 10px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #16151c14; }
.snippet { background: var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 60px -30px #16151c66; }
.snippet-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid #2c2a36; }
.snippet-bar > span { width: 10px; height: 10px; border-radius: 50%; background: #3a3846; }
.snippet-bar b { margin-left: 10px; font: 500 12px var(--mono); color: #8c88a0; }
.copy { margin-left: auto; font: 500 12px var(--sans); color: #e3e0ec; background: #2b2936; border: 0; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.snippet pre { margin: 0; padding: 22px; color: #e8e6f0; font: 13.5px/1.75 var(--mono); overflow-x: auto; min-height: 220px; }

/* faq */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid #e2e0e8; padding: 20px 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; font-size: 17px; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin-top: 12px; color: var(--muted); font-size: 15.5px; max-width: 640px; }

/* cta + footer */
.cta { text-align: center; padding: clamp(80px, 12vw, 150px) 16px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.cta img { border-radius: 16px; }
.cta p { color: var(--muted); font-size: 17px; margin-bottom: 8px; }
.footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding: 28px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
.footer nav a:hover { color: var(--ink); }
.footer .logo { font-size: 17px; color: var(--ink); }

/* reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ctx-panel li { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .hero-stage { grid-template-columns: 1fr; max-width: 560px; }
  .ctx-panel { order: 2; }
  .pillars, .flow { grid-template-columns: 1fr 1fr; }
  .flow li::after { display: none; }
  .bento { grid-template-columns: 1fr 1fr; }
  .card, .card-lg { grid-column: span 2; }
  .two-col { grid-template-columns: 1fr; }
  .io { grid-template-columns: 1fr; }
  .io-core { flex-direction: row; justify-content: center; gap: 14px; }
  .io-core b { margin-top: 0; }
}
@media (max-width: 600px) {
  .nav-cta .btn-ghost { display: none; }
  .pillars, .flow { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .briefing p b { display: block; margin-bottom: 2px; }
  .rule-then { margin-left: 0; }
}

button.btn { font: inherit; font-weight: inherit; border: 0; background: transparent; cursor: pointer; }
button.btn.btn-ink { background: var(--ink); }
