:root {
  --core: #f43f5e;
  --long: #ffb800;
  --short: #00f0ff;
  --working: #94a3b8;
  --brand-a: #8b5cf6;
  --brand-b: #22d3ee;
  --radius: 16px;
  --maxw: 1180px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}
html[data-theme="dark"] {
  --bg: #070a12;
  --bg-2: #0b1020;
  --surface: rgba(255,255,255,0.035);
  --surface-2: rgba(255,255,255,0.06);
  --text: #e8eef7;
  --muted: #97a7bd;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.16);
  --glow: rgba(139,92,246,0.25);
  --grid: rgba(255,255,255,0.08);
}
html[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-2: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f3f6fb;
  --text: #0e1726;
  --muted: #5a6b80;
  --border: rgba(15,23,42,0.09);
  --border-strong: rgba(15,23,42,0.16);
  --glow: rgba(139,92,246,0.18);
  --grid: rgba(15,23,42,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.gradient-text {
  background: linear-gradient(110deg, var(--brand-a), var(--brand-b));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  color: var(--muted); text-transform: uppercase;
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--short); box-shadow: 0 0 12px var(--short); }

/* NAV */
header.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.logo .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-a), var(--brand-b));
  display: grid; place-items: center; box-shadow: 0 6px 22px var(--glow);
}
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { font-size: 14.5px; color: var(--muted); font-weight: 500; transition: color .2s; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 18px; border-radius: 11px; font-weight: 600; font-size: 14.5px;
  border: 1px solid var(--border); cursor: pointer; transition: all .2s ease; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(110deg, var(--brand-a), var(--brand-b)); color: #fff; border: none;
  box-shadow: 0 8px 26px var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px var(--glow); }
.btn-ghost { background: var(--surface); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text);
  transition: all .2s;
}
.icon-btn:hover { border-color: var(--border-strong); }
.menu-toggle { display: none; }

/* HERO */
.hero { position: relative; padding: 92px 0 70px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 620px; z-index: 0;
  background:
    radial-gradient(620px 380px at 22% 8%, rgba(139,92,246,0.22), transparent 60%),
    radial-gradient(560px 360px at 82% 0%, rgba(34,211,238,0.18), transparent 60%);
  filter: blur(8px);
}
.hero-grid {
  position: absolute; inset: 0; z-index: 0; opacity: .7;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(80% 60% at 50% 0%, #000 40%, transparent 80%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid-2 { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 {
  font-size: clamp(38px, 5.4vw, 62px);
  line-height: 1.15;
  letter-spacing: -.025em;
  font-weight: 800;
  margin: 22px 0 18px;
  min-height: 3.6em;
}
html[lang="en"] .hero h1 { font-size: clamp(34px, 4.4vw, 52px); }
.hero h1 #typewriter {
  display: inline;
}
.hero h1 #typewriter .cursor {
  display: inline-block;
  color: var(--brand-b);
  animation: blink 1s infinite;
  font-weight: 300;
  margin-left: 2px;
  vertical-align: baseline;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 540px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note { margin-top: 22px; font-size: 13.5px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }
.hero-note span { display: inline-flex; align-items: center; gap: 7px; }
.check { color: var(--working); }

/* HERO VISUAL */
.hero-visual { position: relative; }
.chat-card {
  border: 1px solid var(--border); border-radius: 20px; background: var(--surface);
  box-shadow: 0 30px 80px rgba(0,0,0,0.45); overflow: hidden; backdrop-filter: blur(8px);
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.chat-head .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--working); box-shadow: 0 0 0 4px color-mix(in srgb, var(--working) 25%, transparent); }
.chat-head .title { font-weight: 700; font-size: 14.5px; }
.chat-head .badge { margin-left: auto; font-size: 11.5px; color: var(--muted); border: 1px solid var(--border); padding: 3px 9px; border-radius: 999px; }
.chat-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 296px; }
.msg { max-width: 84%; padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: linear-gradient(110deg, var(--brand-a), var(--brand-b)); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg .tool { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--short); margin-top: 6px; font-weight: 600; }
.mem-float {
  position: absolute; right: -22px; bottom: -26px; width: 188px;
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--surface);
  box-shadow: 0 22px 50px rgba(0,0,0,0.4); font-size: 12.5px;
}
.mem-float .tag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; color: var(--core); text-transform: uppercase; }
.mem-float .bar { height: 6px; border-radius: 999px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.mem-float .bar i { display: block; height: 100%; width: 90%; background: linear-gradient(90deg, var(--core), var(--short)); border-radius: 999px; }

/* STATS */
.stats { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 26px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center; }
.stat .num { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.stat .lbl { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* SECTION */
section.block { padding: 92px 0; }
.sec-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.sec-head h2 { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: -.02em; font-weight: 800; margin: 18px 0 14px; }
.sec-head p { font-size: 17px; color: var(--muted); }

/* FEATURES */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  perspective: 1000px;
}
.feat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  background: var(--surface);
  transition: transform 0.1s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}
.feat .feat-shine {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: var(--radius);
  z-index: 1;
}
html[data-theme="light"] .feat .feat-shine {
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(139,92,246,0.12) 0%, transparent 50%);
}
.feat:hover .feat-shine {
  opacity: 1;
}
.feat:hover {
  border-color: var(--border-strong);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2), 0 0 30px rgba(139,92,246,0.1);
}
html[data-theme="light"] .feat:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,0.08), 0 0 30px rgba(139,92,246,0.15);
}
.feat .ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-a) 30%, transparent), color-mix(in srgb, var(--brand-b) 30%, transparent));
  border: 1px solid var(--border);
  transform: translateZ(10px);
}
.feat h3 {
  font-size: 18px; font-weight: 700; margin-bottom: 8px;
  transform: translateZ(8px);
}
.feat p {
  font-size: 14.5px; color: var(--muted);
  transform: translateZ(5px);
}
.feat .kpi {
  margin-top: 14px; font-size: 12.5px; font-weight: 600; color: var(--short);
  transform: translateZ(3px);
}

/* ARCHITECTURE */
.arch { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.pyramid { display: flex; flex-direction: column; gap: 12px; }
.tier {
  border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; background: var(--surface);
  display: flex; align-items: center; gap: 16px; position: relative; transition: transform .25s, border-color .25s;
}
.tier:hover { transform: translateX(6px); border-color: var(--border-strong); }
.tier .swatch { width: 12px; height: 38px; border-radius: 6px; flex: none; }
.tier .t-name { font-weight: 700; font-size: 16px; }
.tier .t-desc { font-size: 13px; color: var(--muted); }
.tier .t-meta { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); }
.tier .t-meta b { color: var(--text); font-size: 14px; }
.arch-copy h3 { font-size: 24px; font-weight: 800; margin-bottom: 14px; letter-spacing: -.01em; }
.arch-copy p { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.arch-list { display: flex; flex-direction: column; gap: 12px; }
.arch-list li { list-style: none; display: flex; gap: 11px; font-size: 14.5px; align-items: flex-start; }
.arch-list .dotc { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; }

/* GRAPH */
.graph-wrap {
  border: 1px solid var(--border); border-radius: 22px; background: var(--surface); overflow: hidden;
  position: relative;
  min-height: 460px;
  height: 460px;
}
.graph-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  background: var(--bg);
}
.graph-wrap canvas:active { cursor: grabbing; }
.graph-legend { position: absolute; left: 18px; bottom: 16px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.graph-legend span { display: inline-flex; align-items: center; gap: 7px; }
.graph-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.graph-tag { position: absolute; right: 18px; top: 16px; font-size: 12px; color: var(--muted); border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px; background: var(--bg); }
.graph-tooltip {
  display: none;
  position: fixed;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 280px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  pointer-events: none;
  font-size: 13px;
  line-height: 1.5;
}
.graph-tooltip .gt-layer {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}
.graph-tooltip .gt-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
}
.graph-tooltip .gt-summary {
  margin-top: 8px;
  font-weight: 600;
  color: var(--text);
}
.graph-tooltip .gt-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

/* HOW IT WORKS */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 24px; background: var(--surface); position: relative; }
.step .n { font-size: 13px; font-weight: 800; color: var(--brand-b); letter-spacing: .08em; }
.step h3 { font-size: 18px; font-weight: 700; margin: 10px 0 8px; }
.step p { font-size: 14.5px; color: var(--muted); }
.step .flow { margin-top: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }

/* TECH */
.tech-grid { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.tech-pill { border: 1px solid var(--border); border-radius: 999px; padding: 11px 20px; background: var(--surface); font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 9px; transition: all .2s; }
.tech-pill:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.tech-pill .b { width: 9px; height: 9px; border-radius: 50%; }

/* DEPLOY */
.deploy-grid { display: grid; grid-template-columns: 1fr; gap: 24px; max-width: 720px; margin: 0 auto; }
.deploy {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 28px; background: var(--surface);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  position: relative; overflow: hidden;
}
.deploy::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-a), var(--brand-b));
  opacity: 0; transition: opacity .3s ease;
}
.deploy:hover {
  transform: translateY(-8px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}
.deploy:hover::before { opacity: 1; }
.deploy-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-a) 15%, transparent), color-mix(in srgb, var(--brand-b) 15%, transparent));
  border: 1px solid var(--border);
}
.deploy h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.deploy .sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.deploy ul { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.deploy li { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.deploy .cmd {
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace; font-size: 13px; color: var(--short);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.deploy .cmd-prompt { color: var(--working); font-weight: 600; }
.deploy .cmd-block { display: block; }
.deploy .cmd-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.deploy .cmd-line + .cmd-line { margin-top: 10px; }
.deploy .cmd-comment { color: var(--muted); font-size: 12px; }
.deploy .deploy-dl {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 16px;
  font-size: 13px; font-weight: 600; color: var(--brand-b); text-decoration: none;
}
.deploy .deploy-dl:hover { text-decoration: underline; }

/* CTA */
.cta {
  position: relative; border: 1px solid var(--border); border-radius: 26px; padding: 64px 40px; text-align: center; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-a) 16%, var(--surface)), color-mix(in srgb, var(--brand-b) 14%, var(--surface)));
}
.cta::before { content:""; position:absolute; inset:0; background: radial-gradient(500px 300px at 50% 0%, var(--glow), transparent 70%); }
.cta > * { position: relative; }
.cta h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; }
.cta p { color: var(--muted); font-size: 17px; margin-bottom: 28px; }

/* FOOTER */
footer { border-top: 1px solid var(--border); padding: 54px 0 36px; margin-top: 30px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.foot-brand p { color: var(--muted); font-size: 14px; margin-top: 14px; max-width: 280px; }
.foot-col h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 14px; }
.foot-col a { display: block; font-size: 14.5px; color: var(--text); opacity: .82; margin-bottom: 10px; transition: opacity .2s; }
.foot-col a:hover { opacity: 1; color: var(--brand-b); }
.foot-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; gap: 12px; }

/* SCREENSHOTS */
.screenshot-section { padding-bottom: 0; }
.screenshot-stage {
  position: relative;
  height: 230vh;
}
.screenshot-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 72px 24px 36px;
  overflow: hidden;
}
.shot-frame {
  position: relative;
  flex: none;
  width: min(960px, 100%, calc((100vh - 134px) * 1.70514));
  aspect-ratio: 1758 / 1031;
  border-radius: 18px;
  overflow: hidden;
  border: none;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong), 0 30px 90px rgba(0,0,0,0.5);
}
html[data-theme="light"] .shot-frame {
  box-shadow: 0 0 0 1px var(--border-strong), 0 30px 90px rgba(15,23,42,0.18);
}
.shot-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.shot-light { z-index: 1; }
.shot-dark-clip {
  position: absolute;
  inset: 0;
  z-index: 2;
  clip-path: inset(100% 0 0 0);
  will-change: clip-path;
}
.shot-dark { z-index: 1; }
.shot-badge {
  position: absolute;
  z-index: 3;
  top: 18px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  backdrop-filter: blur(10px);
  border: 1px solid transparent;
  pointer-events: none;
}
.shot-badge-light {
  left: 18px;
  color: #0e1726;
  background: rgba(255,255,255,0.78);
  border-color: rgba(15,23,42,0.08);
}
.shot-badge-dark {
  right: 18px;
  color: #e8eef7;
  background: rgba(7,10,18,0.62);
  border-color: rgba(255,255,255,0.14);
  opacity: 0;
}
.shot-progress {
  flex: none;
  width: min(720px, 80vw);
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.shot-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-a), var(--brand-b));
}
@media (max-width: 920px) {
  .screenshot-stage { height: 260vh; }
  .screenshot-sticky { padding-top: 84px; }
}

/* REVEAL */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 1120px) {
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 14px; }
  .nav-actions { gap: 8px; }
  .lang-switch .lang-label { display: none; }
}
@media (max-width: 920px) {
  .hero-grid-2 { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 460px; }
  .arch, .feat-grid, .steps, .deploy-grid, .stats-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .menu-toggle { display: grid; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .feat-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
}