:root {
  --bg: #05070f;
  --bg-2: #0a0f1f;
  --panel: rgba(14, 20, 42, 0.62);
  --panel-solid: #0c1226;
  --line: rgba(129, 140, 248, 0.16);
  --line-strong: rgba(129, 140, 248, 0.34);
  --text: #e8ebf7;
  --muted: #9aa3c2;
  --faint: #6b7394;
  --cyan: #67e8f9;
  --indigo: #818cf8;
  --violet: #c084fc;
  --ok: #34d399;
  --warn: #fbbf24;
  --grad: linear-gradient(100deg, #67e8f9 0%, #818cf8 46%, #c084fc 100%);
  --radius: 18px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
code, pre { font-family: var(--mono); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: 10px; background: var(--indigo); color: #05070f; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Backdrop: grid + slow drifting glows */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.backdrop-grid {
  position: absolute; inset: -1px;
  background-image:
    linear-gradient(rgba(129, 140, 248, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 140, 248, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.backdrop-glow { position: absolute; width: 760px; height: 760px; border-radius: 50%; filter: blur(110px); opacity: 0.42; will-change: transform; }
.glow-a { top: -320px; left: -160px; background: radial-gradient(circle, #0891b2 0%, transparent 65%); animation: drift-a 26s ease-in-out infinite alternate; }
.glow-b { top: -260px; right: -220px; background: radial-gradient(circle, #7c3aed 0%, transparent 65%); animation: drift-b 30s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate3d(140px, 90px, 0) scale(1.08); } }
@keyframes drift-b { to { transform: translate3d(-120px, 140px, 0) scale(0.94); } }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(5, 7, 15, 0.72); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand-name { font-size: 17px; }
.brand-dim { color: var(--muted); font-weight: 500; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.site-nav > a { padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 14px; transition: color 0.2s, background-color 0.2s; }
.site-nav > a:hover { color: var(--text); background: rgba(129, 140, 248, 0.1); }
.nav-github { display: inline-flex; align-items: center; gap: 6px; color: var(--text) !important; border: 1px solid var(--line-strong); }
.lang-switch { display: inline-flex; margin-left: 8px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; }
.lang-switch button { border: 0; background: transparent; color: var(--muted); font: 600 12px/1 var(--sans); padding: 7px 11px; border-radius: 999px; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--grad); color: #05070f; }
.menu-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border: 1px solid var(--line-strong); border-radius: 12px; background: transparent; cursor: pointer; position: relative; }
.menu-toggle i { position: absolute; left: 11px; right: 11px; height: 2px; border-radius: 2px; background: var(--text); transition: transform 0.25s; }
.menu-toggle i:first-of-type { top: 15px; }
.menu-toggle i:last-of-type { bottom: 15px; }
.menu-toggle[aria-expanded="true"] i:first-of-type { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] i:last-of-type { transform: translateY(-4px) rotate(-45deg); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 14px; font-weight: 600; font-size: 15px; text-decoration: none; transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #05070f; box-shadow: 0 10px 40px -10px rgba(129, 140, 248, 0.7); }
.btn-primary:hover { box-shadow: 0 16px 48px -10px rgba(129, 140, 248, 0.9); }
.btn-ghost { border: 1px solid var(--line-strong); color: var(--text); background: rgba(14, 20, 42, 0.5); }
.btn-ghost:hover { background: rgba(129, 140, 248, 0.12); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 56px; align-items: center; padding-top: 88px; padding-bottom: 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 26px; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px; font: 600 11.5px/1 var(--mono); letter-spacing: 0.14em; color: var(--muted); background: rgba(14, 20, 42, 0.5); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
h1 { margin: 0; font-size: clamp(52px, 7.4vw, 100px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; }
html[lang="en"] h1 { font-size: clamp(38px, 5.1vw, 74px); line-height: 1.04; overflow-wrap: break-word; }
.lead { margin: 28px 0 0; max-width: 33em; font-size: 19px; line-height: 1.7; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 52px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.hero-stats div { min-width: 0; }
.hero-stats dt { font: 700 30px/1.1 var(--mono); letter-spacing: -0.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats dt small { font-size: 15px; margin-left: 2px; }
.hero-stats dd { margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* Glass card with gradient hairline */
.card, .flow-panel, .browser, .terminal { position: relative; background: var(--panel); border-radius: var(--radius); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.card::before, .flow-panel::before, .browser::before, .terminal::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(103, 232, 249, 0.45), rgba(129, 140, 248, 0.12) 40%, rgba(192, 132, 252, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}

/* Context-flow panel */
.flow-panel { margin: 0; padding: 0; box-shadow: 0 40px 120px -40px rgba(99, 102, 241, 0.55); }
.flow-head, .browser-bar, .terminal-bar { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); font: 500 12px/1 var(--mono); color: var(--faint); }
.flow-dots { display: inline-flex; gap: 6px; }
.flow-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(129, 140, 248, 0.25); }
.flow-dots i:first-child { background: rgba(248, 113, 113, 0.55); }
.flow-dots i:nth-child(2) { background: rgba(251, 191, 36, 0.55); }
.flow-dots i:last-child { background: rgba(52, 211, 153, 0.55); }
.flow-title { letter-spacing: 0.08em; }
.flow-meter { margin-left: auto; color: var(--muted); }
.flow-meter b { color: var(--cyan); font-weight: 600; }
.flow-stage { position: relative; aspect-ratio: 560 / 440; }
.flow-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow-label { position: absolute; padding: 5px 10px; border-radius: 8px; font: 600 11.5px/1.2 var(--mono); letter-spacing: 0.02em; white-space: nowrap; background: rgba(5, 7, 15, 0.72); border: 1px solid var(--line-strong); }
.label-kept { top: 5%; left: 5%; color: var(--cyan); border-color: rgba(103, 232, 249, 0.5); }
.label-summary { top: 26%; right: 5%; color: var(--violet); border-color: rgba(192, 132, 252, 0.5); }
.label-gate { top: 44.5%; left: 5%; color: var(--text); }
.label-stream { bottom: 5%; right: 5%; color: var(--muted); }
.flow-caption { padding: 12px 16px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }

/* Product shot */
.shot { padding-top: 24px; padding-bottom: 40px; }
.browser { overflow: hidden; box-shadow: 0 60px 160px -60px rgba(129, 140, 248, 0.6), 0 0 0 1px rgba(5, 7, 15, 0.6); }
.browser-url { flex: 1; max-width: 360px; margin: 0 auto; padding: 6px 12px; border-radius: 8px; background: rgba(129, 140, 248, 0.08); text-align: center; color: var(--muted); }
.browser img { width: 100%; height: auto; }
.shot-note { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--faint); }

/* Sections */
.section { padding-top: 120px; padding-bottom: 20px; scroll-margin-top: 72px; }
.section-head { max-width: 780px; margin-bottom: 48px; }
.kicker { margin: 0 0 18px; font: 600 12px/1 var(--mono); letter-spacing: 0.18em; color: var(--cyan); }
h2 { margin: 0; text-wrap: balance; font-size: clamp(34px, 4.6vw, 58px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; }
h3 { margin: 0 0 14px; font-size: 19px; line-height: 1.35; letter-spacing: -0.01em; }
.section-lead { margin: 22px 0 0; font-size: 18px; color: var(--muted); }
.muted { color: var(--muted); margin: 0 0 16px; }
.fine { font-size: 12.5px; color: var(--faint); }
.card { padding: 30px; }
.card p { margin: 0; color: var(--muted); }

/* Memory */
.memory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.memory-card h3 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tag { padding: 4px 9px; border-radius: 7px; font: 700 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.tag-cyan { color: var(--cyan); background: rgba(103, 232, 249, 0.12); }
.tag-violet { color: var(--violet); background: rgba(192, 132, 252, 0.13); }
.tag-ok { color: var(--ok); background: rgba(52, 211, 153, 0.12); }
.ticks { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 26px; color: var(--muted); }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 12px; height: 7px; border-left: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); transform: rotate(-45deg); }
.memory-safe { background: linear-gradient(160deg, rgba(52, 211, 153, 0.08), var(--panel) 55%); }
.bars { display: grid; gap: 14px; margin: 6px 0 18px; }
.bar-row { display: grid; grid-template-columns: 88px 1fr 70px; align-items: center; gap: 12px; font-size: 14px; }
.bar-row b { font: 600 14px/1 var(--mono); text-align: right; white-space: nowrap; }
.bar-label { color: var(--muted); }
.bar { height: 10px; border-radius: 6px; background: rgba(129, 140, 248, 0.1); overflow: hidden; }
.bar-fill { display: block; width: 100%; height: 100%; border-radius: inherit; transform-origin: left center; transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1); }
.fill-slow { background: rgba(154, 163, 194, 0.55); transform: scaleX(1); }
.fill-mid { background: linear-gradient(90deg, #818cf8, #c084fc); transform: scaleX(0.5); }
.fill-fast { background: linear-gradient(90deg, #67e8f9, #818cf8); transform: scaleX(0.133); }

/* Capabilities */
.cap-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.cap-card { padding: 28px 26px; transition: transform 0.3s; }
.cap-card:hover { transform: translateY(-4px); }
.cap-icon { width: 44px; height: 44px; padding: 10px; margin-bottom: 22px; border-radius: 13px; fill: none; stroke: var(--cyan); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; background: linear-gradient(140deg, rgba(103, 232, 249, 0.16), rgba(192, 132, 252, 0.16)); }
.cap-card p { font-size: 14.5px; line-height: 1.7; }

/* Performance */
.perf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.metric h3 { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.metric-value { font: 700 40px/1.05 var(--mono) !important; letter-spacing: -0.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.metric-bars { display: grid; gap: 7px; margin: 20px 0 12px; }
.mbar { display: block; height: 6px; border-radius: 4px; transform-origin: left center; transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1); }
.mbar-before { background: rgba(154, 163, 194, 0.35); }
.mbar-after { background: var(--grad); }
.p10 { transform: scaleX(0.1); } .p11 { transform: scaleX(0.11); } .p14 { transform: scaleX(0.14); }
.p27 { transform: scaleX(0.27); } .p31 { transform: scaleX(0.31); } .p34 { transform: scaleX(0.34); }
.metric-from { font: 500 13px/1.4 var(--mono) !important; color: var(--faint) !important; }
.perf-note { margin-top: 18px; }
.mini-log { margin: 22px 0 0; padding: 16px 18px; border-radius: 12px; background: rgba(5, 7, 15, 0.6); border: 1px solid var(--line); font-size: 13px; line-height: 1.9; color: var(--muted); overflow-x: auto; }
.lg-k { color: var(--indigo); } .lg-a { color: var(--faint); } .lg-ok { color: var(--ok); } .lg-v { color: var(--cyan); }
.memory-grid > *, .cap-grid > *, .perf-grid > *, .install-grid > *, .hero > * { min-width: 0; }

/* Install */
.install-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; align-items: start; }
.install-grid .section-head { margin-bottom: 0; }
.install-grid .ticks { margin-top: 30px; }
.terminal { overflow: hidden; }
.terminal-bar { justify-content: flex-start; }
.copy-btn { margin-left: auto; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(129, 140, 248, 0.12); color: var(--text); font: 600 12px/1 var(--sans); cursor: pointer; transition: background-color 0.2s; }
.copy-btn:hover { background: rgba(129, 140, 248, 0.24); }
.terminal-body { margin: 0; padding: 26px 22px; overflow-x: auto; font-size: 14px; line-height: 1.7; color: var(--text); white-space: pre-wrap; word-break: break-all; }
.prompt { color: var(--ok); margin-right: 6px; user-select: none; }
.copy-status { min-height: 1.4em; margin: 0; padding: 0 22px; font-size: 12.5px; color: var(--ok); }
.warn { margin: 12px 22px 0; padding: 16px 18px; border-radius: 12px; border: 1px solid rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.07); }
.warn strong { display: block; margin-bottom: 6px; color: var(--warn); font-size: 14px; }
.warn p { margin: 0; color: var(--muted); font-size: 14px; }
.warn code { padding: 1px 6px; border-radius: 6px; background: rgba(5, 7, 15, 0.6); color: var(--text); }
.text-link { display: inline-block; margin: 18px 22px 22px; color: var(--cyan); text-decoration: none; font-weight: 600; font-size: 14px; }
.text-link:hover { text-decoration: underline; }

/* Lineage */
.lineage-card { padding: 40px; }
.lineage-card h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 18px; }
.lineage-card p { max-width: 64em; margin-top: 12px; line-height: 1.8; }
.lineage-card a { color: var(--cyan); }

/* CTA + footer */
.cta { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 140px; padding-bottom: 120px; }
.cta img { margin-bottom: 28px; filter: drop-shadow(0 12px 40px rgba(129, 140, 248, 0.6)); }
.cta h2 { max-width: 16em; }
.cta .hero-actions { justify-content: center; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 36px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-inner a { color: var(--muted); }

/* Reveal on scroll (JS adds .reveal; content stays visible without JS) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }
.reveal:not(.in) .mbar-after, .reveal:not(.in) .mbar-before, .reveal:not(.in) .bar-fill { transform: scaleX(0); }

/* Responsive */
@media (max-width: 1080px) {
  .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding-top: 56px; }
  .install-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .site-nav { position: absolute; top: 68px; left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 20px 20px; background: rgba(5, 7, 15, 0.96); border-bottom: 1px solid var(--line); }
  .site-nav.open { display: flex; }
  .site-nav > a { padding: 12px; font-size: 16px; }
  .lang-switch { margin: 10px 0 0; align-self: flex-start; }
}
@media (max-width: 680px) {
  .wrap { padding: 0 18px; }
  .memory-grid, .cap-grid, .perf-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr; gap: 16px; }
  .hero-stats div { display: flex; align-items: baseline; gap: 14px; }
  .hero-stats dd { margin: 0; }
  .lead { font-size: 17px; }
  .card { padding: 24px 20px; }
  .lineage-card { padding: 28px 22px; }
  .section { padding-top: 88px; }
  .flow-label { font-size: 10px; padding: 4px 7px; }
  .bar-row { grid-template-columns: 70px 1fr 66px; font-size: 13px; }
  .eyebrow { font-size: 10px; letter-spacing: 0.06em; padding: 7px 12px; }
  .browser-url { display: none; }
}
@media (max-width: 380px) {
  h1 { font-size: 44px; }
  .eyebrow { font-size: 9px; letter-spacing: 0.04em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
