:root {
  --bg: #07080c;
  --bg-2: #0d1017;
  --panel: #10141d;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #e9edf5;
  --muted: #8a93a6;
  --accent: #7cf5c4;
  --accent-2: #7aa2ff;
  --accent-3: #c79bff;
  --warn: #ffb86b;
  --bad: #ff6b8a;
  --radius: 18px;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.mono { font-family: var(--mono); }
::selection { background: var(--accent); color: #04120c; }

/* ambient layers */
.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor-glow {
  position: fixed; width: 520px; height: 520px; border-radius: 50%;
  pointer-events: none; z-index: 0; left: 0; top: 0;
  background: radial-gradient(circle, rgba(124, 245, 196, .10), rgba(122, 162, 255, .05) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity .3s;
}
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)); }

/* nav */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(1120px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 14px 10px 20px; z-index: 50;
  background: rgba(13, 16, 23, .6); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 999px;
}
.brand { font-family: var(--display); font-weight: 700; text-decoration: none; font-size: 20px; letter-spacing: -.02em; }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 26px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 14px; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.lang { display: flex; gap: 2px; background: rgba(255,255,255,.04); border-radius: 999px; padding: 3px; }
.lang button {
  border: 0; background: transparent; padding: 5px 11px; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; color: var(--muted); transition: all .2s;
}
.lang button.active { background: var(--text); color: var(--bg); }

/* hero */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding-bottom: 150px; }
.hero::before {
  content: ""; position: absolute; right: -10%; top: 10%; width: 60vw; height: 60vw; max-width: 760px; max-height: 760px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,245,196,.10), rgba(122,162,255,.06) 45%, transparent 70%); pointer-events: none;
}
.hero-marquee { position: absolute; left: 0; right: 0; bottom: 28px; z-index: 3; }
.hero-marquee .marquee { padding: 16px 0; }
.hero-marquee .track { font-size: clamp(14px, 1.4vw, 18px); color: #8a93a6; animation-duration: 70s; gap: 56px; }
.hero-marquee .marquee.reverse .track { animation-duration: 80s; }
.hero-marquee .track span::after { margin-left: 56px; }
.hero-marquee em { font-style: normal; color: var(--accent); margin: 0 12px; opacity: .9; }
.hero-marquee b { font-weight: 500; color: var(--text); }
#flow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.hero-inner { position: relative; z-index: 3; width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding-top: 80px; pointer-events: none; }
.hero-inner a, .hero-inner button { pointer-events: auto; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; background: rgba(7,8,12,.55); backdrop-filter: blur(6px); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(124,245,196,.6); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(124,245,196,.6); } 80%,100% { box-shadow: 0 0 0 10px rgba(124,245,196,0); } }
.hero-title {
  font-family: var(--display); font-weight: 700; letter-spacing: -.035em; line-height: .98;
  font-size: clamp(40px, 5.6vw, 84px); margin: 26px 0 22px; max-width: 11ch;
}
@media (min-width: 761px) { .hero-inner > * { max-width: min(560px, 48vw); } .hero-title { max-width: min(600px, 50vw); } }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; }
.grad { background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 560px; color: #b9c1d1; font-size: clamp(16px, 1.6vw, 19px); margin: 0 0 34px; text-shadow: 0 2px 20px var(--bg); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-cta.center { justify-content: center; }
.hero-hint { margin-top: 40px; font-size: 12px; color: var(--muted); opacity: .8; }
.flow-tip {
  position: absolute; z-index: 4; pointer-events: none; max-width: 260px;
  background: rgba(16,20,29,.95); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 12px; font-size: 12px; line-height: 1.5; color: var(--text);
  box-shadow: 0 20px 40px rgba(0,0,0,.4);
}
.flow-tip b { color: var(--accent); display: block; margin-bottom: 2px; font-weight: 500; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: 15px;
  border: 1px solid var(--line-2); transition: background .25s, border-color .25s, color .25s, transform .2s;
  will-change: transform;
}
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: rgba(255,255,255,.03); }
.btn.ghost:hover { border-color: var(--text); }
.btn.small { padding: 9px 16px; font-size: 13px; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

/* stats */
.stats {
  position: relative; z-index: 3;
  width: min(1120px, calc(100% - 32px)); margin: -40px auto 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); background: rgba(13,16,23,.7); backdrop-filter: blur(10px);
}
.stat { padding: 26px 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--display); font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13.5px; line-height: 1.45; display: block; margin-top: 6px; }

/* sections */
.section { position: relative; z-index: 3; width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 140px 0 0; }
.section-head { max-width: 760px; margin-bottom: 56px; }
.kicker { color: var(--accent); font-size: 13px; letter-spacing: .04em; margin: 0 0 14px; }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(32px, 4.6vw, 58px); line-height: 1.04; letter-spacing: -.03em; margin: 0; }
h2.big { font-size: clamp(38px, 6vw, 80px); }
.lead { color: var(--muted); font-size: 18px; margin: 18px 0 0; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card {
  position: relative; padding: 34px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
  border: 1px solid var(--line); overflow: hidden; transform-style: preserve-3d;
  transition: border-color .3s;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(124,245,196,.10), transparent 60%);
}
.card:hover { border-color: var(--line-2); }
.card:hover::before { opacity: 1; }
.card-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: rgba(124,245,196,.08); border: 1px solid rgba(124,245,196,.2); margin-bottom: 22px; }
.card-icon svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-family: var(--display); font-size: 24px; letter-spacing: -.02em; margin: 0 0 10px; font-weight: 600; }
.card p { color: var(--muted); margin: 0 0 22px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.tags li { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: #c6cddb; }

/* tabs & panels */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.tab {
  border: 1px solid var(--line); background: rgba(255,255,255,.02); padding: 10px 16px; border-radius: 999px;
  font-size: 14px; color: var(--muted); transition: all .25s;
}
.tab .mono { font-size: 11px; opacity: .6; margin-right: 4px; }
.tab:hover { color: var(--text); border-color: var(--line-2); }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.panel { display: none; grid-template-columns: 1fr 1.05fr; gap: 28px; align-items: start; }
.panel.active { display: grid; }
.case { padding: 8px 4px; }
.case-tag { color: var(--accent); font-size: 12.5px; margin: 0 0 12px; }
.case h3 { font-family: var(--display); font-size: clamp(26px, 2.8vw, 36px); line-height: 1.1; letter-spacing: -.025em; margin: 0 0 18px; font-weight: 600; }
.case p { color: #b3bbcb; margin: 0 0 14px; }
.case-facts { list-style: none; padding: 0; margin: 22px 0; border-top: 1px solid var(--line); }
.case-facts li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.case-facts b { display: block; color: var(--text); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 2px; }
.link { color: var(--accent); text-decoration: none; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* demo window */
.demo {
  position: relative; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--panel);
  padding: 0 22px 22px; min-height: 460px; overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.04);
}
.demo-bar { display: flex; align-items: center; gap: 7px; margin: 0 -22px 18px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.demo-bar span { width: 10px; height: 10px; border-radius: 50%; background: #2a3040; }
.demo-bar span:first-child { background: #ff6b8a55; }
.demo-bar span:nth-child(2) { background: #ffb86b55; }
.demo-bar span:nth-child(3) { background: #7cf5c455; margin-right: 6px; }
.demo-label { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.chips { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.chip { text-align: left; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); border-radius: 12px; padding: 10px 14px; font-size: 14px; transition: all .2s; }
.chip:hover { border-color: var(--accent); }
.chip.active { border-color: var(--accent); background: rgba(124,245,196,.07); }
.rag-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-bottom: 14px; }
.rag-steps span { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); transition: all .3s; }
.rag-steps span.on { border-color: var(--accent); color: var(--accent); background: rgba(124,245,196,.07); }
.rag-steps i { font-style: normal; opacity: .5; }
.docs { display: grid; gap: 6px; margin-bottom: 14px; }
.doc { font-family: var(--mono); font-size: 12px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; gap: 10px; transition: all .35s; }
.doc .score { color: var(--muted); opacity: 0; transition: opacity .3s; white-space: nowrap; }
.doc.scored .score { opacity: 1; }
.doc.hit { border-color: var(--accent); color: var(--text); background: rgba(124,245,196,.06); }
.doc.hit .score { color: var(--accent); }
.answer { font-size: 14px; color: #d4dae6; min-height: 60px; white-space: pre-wrap; }
.answer .cite { color: var(--accent); font-family: var(--mono); font-size: 12px; }
.answer .caret { display: inline-block; width: 7px; height: 15px; background: var(--accent); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ads */
.ads-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 16px; }
.ads-table th { text-align: left; color: var(--muted); font-weight: 400; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.ads-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); transition: background .4s, color .4s; }
.ads-table tr.flag-bad td { background: rgba(255,107,138,.07); }
.ads-table tr.flag-warn td { background: rgba(255,184,107,.07); }
.ads-table tr.flag-ok td.st { color: var(--accent); }
.ads-table tr.flag-bad td.st { color: var(--bad); }
.ads-table tr.flag-warn td.st { color: var(--warn); }
#adsAnswer { margin-top: 16px; }

/* store */
.stock { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.stock b { color: var(--text); font-size: 18px; margin-left: 4px; }
.timeline { list-style: none; padding: 0; margin: 0 0 18px; position: relative; }
.timeline li { position: relative; padding: 9px 0 9px 30px; color: var(--muted); font-size: 14px; transition: color .3s; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #343b4c; background: var(--panel); transition: all .3s; }
.timeline li::after { content: ""; position: absolute; left: 11px; top: 26px; width: 2px; height: calc(100% - 14px); background: #232836; }
.timeline li:last-child::after { display: none; }
.timeline li.done { color: var(--text); }
.timeline li.done::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px rgba(124,245,196,.5); }
.timeline li.fail { color: var(--bad); text-decoration: line-through; }
.timeline li.fail::before { border-color: var(--bad); }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
#storeLog { margin-top: 10px; font-family: var(--mono); font-size: 12.5px; }
#storeLog .ok { color: var(--accent); }
#storeLog .warn { color: var(--warn); }
#storeLog .bad { color: var(--bad); }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.col h4 { font-size: 11px; color: var(--muted); font-weight: 400; margin: 0 0 8px; }
.lane { min-height: 300px; border-radius: 12px; background: rgba(255,255,255,.02); border: 1px dashed var(--line); padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.task { font-size: 12px; padding: 9px 10px; border-radius: 10px; background: #171c27; border: 1px solid var(--line-2); line-height: 1.35; }
.task small { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 4px; }
.task.working { border-color: var(--accent-2); box-shadow: 0 0 0 1px rgba(122,162,255,.3); }
.task.review { border-color: var(--warn); }
.task.merged { border-color: rgba(124,245,196,.4); opacity: .75; }

/* edge */
#edgeCanvas { width: 100%; height: 280px; display: block; border-radius: 12px; background: #0a0d13; border: 1px solid var(--line); }
.edge-ctrl { margin-top: 14px; display: grid; gap: 14px; }
.switch { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); width: fit-content; }
.switch button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 12px; color: var(--muted); }
.switch button.active { background: var(--text); color: var(--bg); }
.meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.meters div { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 11px; color: var(--muted); }
.meters b { display: block; color: var(--text); font-size: 18px; font-weight: 500; margin-top: 4px; }
.meters b.bad { color: var(--bad); }

/* process */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); position: relative; }
.steps::before { content: ""; position: absolute; top: -1px; left: 0; height: 1px; width: var(--fill, 0%); background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.step { padding: 30px 26px 0 0; }
.step .num { color: var(--accent); font-size: 13px; }
.step h3 { font-family: var(--display); font-size: 22px; margin: 12px 0 10px; font-weight: 600; letter-spacing: -.02em; }
.step p { color: var(--muted); margin: 0; font-size: 15px; }

/* marquee */
.stack-sec { width: 100%; }
.stack-sec .section-head { width: min(1120px, calc(100% - 32px)); margin-left: auto; margin-right: auto; }
.marquee { overflow: hidden; border-top: 1px solid var(--line); padding: 22px 0; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee:last-child { border-bottom: 1px solid var(--line); }
.track { display: flex; gap: 46px; width: max-content; animation: scroll 40s linear infinite; font-size: clamp(20px, 2.6vw, 32px); color: #aab3c4; }
.marquee.reverse .track { animation-direction: reverse; animation-duration: 46s; }
.track span { white-space: nowrap; }
.track span::after { content: "✦"; color: var(--accent); margin-left: 46px; font-size: .6em; vertical-align: middle; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* contact */
.contact { text-align: center; padding-bottom: 120px; }
.contact-inner { max-width: 860px; margin: 0 auto; }
.contact .lead { margin: 22px auto 36px; max-width: 620px; }
.footer { position: relative; z-index: 3; width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }

/* reveal default (JS enhances) */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(40px); }

/* responsive */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: 0; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .cards { grid-template-columns: 1fr; }
  .panel.active { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 30px; }
  .section { padding-top: 100px; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .lane { min-height: 120px; }
}
@media (max-width: 560px) {
  .nav { padding: 8px 8px 8px 16px; }
  .card { padding: 26px; }
  .demo { padding: 0 14px 16px; min-height: 0; }
  .demo-bar { margin: 0 -14px 14px; }
  .steps { grid-template-columns: 1fr; }
  .meters { grid-template-columns: 1fr 1fr 1fr; }
  .meters b { font-size: 15px; }
  .hero-hint { display: none; }
  .stat { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
