/* CandleScope — candlescope.app
   Dark, terminal-grade theme that matches the product UI. */

:root {
  color-scheme: dark;
  --bg: #04070d;
  --bg-raise: #080e18;
  --panel: #0b121d;
  --panel-2: #0f1826;
  --line: rgba(150, 172, 200, 0.11);
  --line-2: rgba(150, 172, 200, 0.2);
  --text: #eef3f8;
  --text-2: #b4c0cd;
  --muted: #7b8a9c;
  --teal: #12bfae;
  --teal-hi: #34e3cf;
  --blue: #1473e6;
  --blue-hi: #5aa2ff;
  --amber: #f5b544;
  --up: #12bfae;
  --down: #f2546b;
  --radius: 18px;
  --font: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
.i18n-wait body { opacity: 0; }
img, svg, canvas { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal-hi); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(18, 191, 174, 0.35); }

.wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: 8px; background: var(--teal); color: #031014; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--text); }
h2 {
  font-size: clamp(32px, 4.6vw, 56px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
:lang(zh) h2 { line-height: 1.2; letter-spacing: -0.01em; }
/* Break Chinese headlines at punctuation, not mid-phrase. */
:lang(zh) :is(h1, h2, h3) { word-break: keep-all; overflow-wrap: anywhere; }
h3 { font-size: 21px; line-height: 1.3; letter-spacing: -0.015em; }
:lang(zh) h3 { letter-spacing: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--teal-hi);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: 0.7; }
.eyebrow-amber { color: var(--amber); }
.section-sub { margin: 20px 0 0; max-width: 620px; font-size: 18px; line-height: 1.7; color: var(--text-2); text-wrap: pretty; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 12px;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(180deg, #2fd9c5, var(--teal));
  color: #02131a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(52, 227, 207, 0.4), 0 10px 32px -10px rgba(18, 191, 174, 0.75);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 0 1px rgba(52, 227, 207, 0.6), 0 14px 40px -10px rgba(18, 191, 174, 0.9); }
.btn-ghost { background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(150, 172, 200, 0.32); }
.btn-sm { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; gap: 8px; }
.gh { width: 18px; height: 18px; fill: currentColor; }
.btn-sm .gh { width: 16px; height: 16px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.nav.scrolled {
  background: rgba(4, 7, 13, 0.72);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}
.nav-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wordmark { font-size: 19px; font-weight: 700; letter-spacing: -0.03em; }
.wordmark span { color: var(--teal); }
.nav-links { display: flex; gap: 4px; margin-left: 12px; }
.nav-links a { padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--text-2); transition: color 0.2s, background 0.2s; }
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-end { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.lang { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.02); }
.lang button {
  min-width: 34px; height: 28px; padding: 0 8px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lang button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.09); color: var(--text); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 148px 0 40px; isolation: isolate; }
.hero-bg { position: absolute; inset: 0 0 auto; height: 1100px; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 380px at 22% 18%, rgba(18, 191, 174, 0.2), transparent 70%),
    radial-gradient(700px 420px at 82% 30%, rgba(20, 115, 230, 0.22), transparent 70%),
    radial-gradient(900px 500px at 50% 75%, rgba(18, 191, 174, 0.1), transparent 70%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(150, 172, 200, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 172, 200, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, #000 20%, transparent 75%);
}
.hero-orbit {
  position: absolute; left: 50%; top: -260px;
  width: 1180px; height: 1180px; margin-left: -590px;
  color: rgba(214, 228, 245, 0.09);
  animation: spin 160s linear infinite;
  /* Fade out under the nav so the orbit dots never read as badges. */
  -webkit-mask-image: linear-gradient(transparent 24%, #000 34%, #000 45%, transparent 80%);
  mask-image: linear-gradient(transparent 24%, #000 34%, #000 45%, transparent 80%);
}
.hero-orbit circle { opacity: 0.55; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-copy { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(8, 14, 24, 0.7);
  font-size: 13px; color: var(--text-2);
  transition: border-color 0.2s, color 0.2s;
}
.pill:hover { border-color: rgba(52, 227, 207, 0.45); color: var(--text); }
.pill-arrow { color: var(--muted); transition: transform 0.2s var(--ease); }
.pill:hover .pill-arrow { transform: translateX(3px); color: var(--teal-hi); }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--teal-hi); }
.pulse::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--teal-hi); animation: ping 2.2s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2); opacity: 0; } }

h1 {
  margin: 28px 0 0;
  font-size: clamp(44px, 7.6vw, 100px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 750;
}
:lang(zh) h1 { font-size: clamp(42px, 6.8vw, 86px); line-height: 1.12; letter-spacing: -0.02em; }
.h1-line { display: block; }
.grad {
  background: linear-gradient(95deg, var(--teal-hi) 0%, var(--teal) 30%, var(--blue-hi) 75%, #8bb8ff 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-bottom: 0.06em;
}
.lede { margin: 26px 0 0; max-width: 660px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.65; color: var(--text-2); text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 36px; }
.hero-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 0;
  margin: 28px 0 0; padding: 0; list-style: none;
  font-size: 13px; line-height: 1.4; color: var(--muted);
}
.hero-meta li { display: inline-flex; align-items: center; }
.hero-meta li + li::before { content: ""; width: 4px; height: 4px; margin: 0 14px; border-radius: 50%; background: rgba(150, 172, 200, 0.35); }

/* ---------- Product mock ---------- */
.mock-stage { margin-top: 72px; perspective: 2000px; --tilt: 1; }
.mock {
  position: relative;
  display: grid; grid-template-rows: 46px 1fr 28px;
  height: clamp(420px, 50vw, 620px);
  border-radius: 16px;
  background: #060b13;
  border: 1px solid rgba(150, 172, 200, 0.16);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 50px 120px -30px rgba(18, 191, 174, 0.28),
    0 40px 90px -40px rgba(20, 115, 230, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transform-origin: 50% 0;
  transform: rotateX(calc(var(--tilt) * 14deg)) scale(calc(1 - var(--tilt) * 0.05));
  will-change: transform;
  font-family: var(--font);
}
.mock::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px; z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(52, 227, 207, 0.6), rgba(90, 162, 255, 0.6), transparent);
}
.mock-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 14px; border-bottom: 1px solid var(--line);
  background: #070d16; font-size: 13px; min-width: 0;
}
.mock-symbol { display: flex; align-items: baseline; gap: 8px; padding: 5px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); white-space: nowrap; }
.mock-symbol b { font-weight: 700; letter-spacing: 0.01em; }
.mock-symbol span { font-size: 11px; color: var(--muted); }
.mock-symbol i { font-style: normal; }
.mock-intervals { display: flex; gap: 2px; font: 500 12px/1 var(--mono); color: var(--muted); }
.mock-intervals span { padding: 6px 8px; border-radius: 6px; }
.mock-intervals .on { color: var(--blue-hi); background: rgba(20, 115, 230, 0.16); }
.mock-price { display: flex; align-items: baseline; gap: 10px; margin-left: auto; font-family: var(--mono); white-space: nowrap; }
.mock-price b { font-size: 17px; font-weight: 700; color: var(--up); transition: color 0.3s; font-variant-numeric: tabular-nums; }
.mock-price b.dn { color: var(--down); }
.mock-price span { font-size: 12px; color: var(--muted); }
.demo-badge {
  padding: 4px 8px; border-radius: 6px;
  border: 1px solid rgba(245, 181, 68, 0.4); color: var(--amber);
  font: 600 10px/1 var(--mono); letter-spacing: 0.08em; white-space: nowrap;
}
.mock-body { display: grid; grid-template-columns: 44px minmax(0, 1fr) 256px; min-height: 0; }
.mock-tools { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 10px; border-right: 1px solid var(--line); }
.mock-tools svg { width: 30px; height: 30px; padding: 6px; border-radius: 7px; fill: none; stroke: #8a98ab; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.mock-tools svg:first-child { background: rgba(20, 115, 230, 0.16); stroke: var(--blue-hi); }
.mock-chart { position: relative; min-width: 0; min-height: 0; cursor: crosshair; }
.mock-chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mock-legend {
  position: absolute; left: 12px; top: 9px; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  font: 500 11px/1.4 var(--mono); color: var(--muted); pointer-events: none;
}
.mock-legend b { font-weight: 500; color: var(--text-2); }
.mock-legend .up { color: var(--up); }
.mock-legend .dn { color: var(--down); }
.mock-legend .e1 { color: var(--blue-hi); }
.mock-legend .e2 { color: var(--amber); }
.mock-side { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); font-family: var(--mono); font-size: 11px; overflow: hidden; }
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 8px; font-family: var(--font); font-size: 12px; }
.side-head b { font-weight: 600; }
.side-head span { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.side-head:not(:first-child) { border-top: 1px solid var(--line); }
.ob-cols, .ob-row, .tape-row { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 6px; padding: 0 12px; }
.ob-cols { color: var(--muted); font-size: 10px; padding-bottom: 4px; }
.ob-cols span:not(:first-child), .ob-row span:not(:first-child), .tape-row span:not(:first-child) { text-align: right; }
.ob { display: flex; flex-direction: column; }
.ob-row { position: relative; line-height: 17px; font-variant-numeric: tabular-nums; }
.ob-row i { position: absolute; top: 1px; bottom: 1px; right: 0; transition: width 0.4s var(--ease); }
.ob-row span { position: relative; }
.ob-row.ask span:first-child { color: var(--down); }
.ob-row.bid span:first-child { color: var(--up); }
.ob-row.ask i { background: rgba(242, 84, 107, 0.12); }
.ob-row.bid i { background: rgba(18, 191, 174, 0.12); }
.ob-row span:nth-child(3) { color: var(--muted); }
.ob-mid { display: flex; align-items: baseline; gap: 8px; padding: 5px 12px; margin: 3px 0; font-size: 14px; font-weight: 700; border-block: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ob-mid.up { color: var(--up); }
.ob-mid.dn { color: var(--down); }
.ob-mid small { font-size: 10px; font-weight: 400; color: var(--muted); }
.tape { flex: 1; min-height: 0; overflow: hidden; }
.tape-row { line-height: 18px; font-variant-numeric: tabular-nums; }
.tape-row span:last-child { color: var(--muted); }
.tape-row.buy span:first-child { color: var(--up); }
.tape-row.sell span:first-child { color: var(--down); }
.tape-row.fresh { animation: flash 0.9s ease-out; }
@keyframes flash { from { background: rgba(255, 255, 255, 0.07); } to { background: transparent; } }
.mock-status {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 0 14px; border-top: 1px solid var(--line); background: #070d16;
  font: 500 11px/1 var(--mono); color: var(--muted); white-space: nowrap;
}
.mock-status > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); font-style: normal; }

/* ---------- Facts ---------- */
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: 96px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
}
.fact { display: flex; flex-direction: column; padding: 30px 28px; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact b {
  font-size: 56px; line-height: 1; font-weight: 750; letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff, #9fb2c6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.fact-k { margin-top: 10px; font-size: 15px; font-weight: 600; }
.fact-d { margin-top: 4px; font-size: 13px; line-height: 1.55; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 140px 0 0; }
.section-head { max-width: 760px; margin-bottom: 56px; }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.card {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column;
  padding: 28px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)), var(--bg-raise);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color 0.3s;
}
.card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -200px), rgba(18, 191, 174, 0.09), transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.card:hover { border-color: var(--line-2); }
.card:hover::after { opacity: 1; }
.card-copy p, .card-mini p { margin: 10px 0 0; font-size: 15px; line-height: 1.65; color: var(--text-2); text-wrap: pretty; }
.card-tag { display: block; margin-bottom: 14px; font: 600 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }
.chips li { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); }
.card-hint { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

.card-flow { grid-column: span 4; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 28px; }
.card-linked { grid-column: span 2; }
.card-pine, .card-research { grid-column: span 3; }
.card-mini { grid-column: span 2; padding: 26px; }

.card-visual { position: relative; min-height: 260px; border-radius: 12px; border: 1px solid var(--line); background: #060b13; overflow: hidden; }
.card-visual canvas, .pine-canvas, .research-canvas { width: 100%; height: 100%; }
.flow-visual canvas { position: absolute; inset: 0; }
.viz-labels { position: absolute; left: 12px; top: 10px; z-index: 1; display: flex; flex-wrap: wrap; gap: 4px 14px; font: 500 11px/1.4 var(--mono); color: var(--muted); }
.viz-labels > span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 3px; border-radius: 2px; }
.sw-price { background: var(--blue-hi); }
.sw-delta { background: linear-gradient(90deg, var(--up) 50%, var(--down) 50%); height: 8px; width: 8px; border-radius: 2px; }
.sw-cvd { background: var(--amber); }

.linked { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 22px; flex: 1; min-height: 220px; cursor: crosshair; touch-action: pan-y; }
.linked-cell { position: relative; display: flex; flex-direction: column; min-height: 104px; border-radius: 10px; border: 1px solid var(--line); background: #060b13; overflow: hidden; }
.lc-head { display: flex; align-items: baseline; gap: 6px; padding: 7px 9px 0; font: 500 10px/1.2 var(--mono); color: var(--muted); white-space: nowrap; }
.lc-head b { color: var(--text-2); font-weight: 600; }
.lc-head em { margin-left: auto; font-style: normal; color: var(--text); font-variant-numeric: tabular-nums; }
.linked-cell canvas { flex: 1; width: 100%; min-height: 0; }
.linked-chip {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px; border-radius: 999px;
  background: rgba(8, 14, 24, 0.92); border: 1px solid rgba(90, 162, 255, 0.45);
  font-size: 11px; font-weight: 600; color: var(--blue-hi); white-space: nowrap; pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.linked-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.pine, .research { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; flex: 1; }
.code { border-radius: 12px; border: 1px solid var(--line); background: #060b13; overflow: hidden; }
.code-head { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); font: 500 11px/1.2 var(--mono); color: var(--muted); }
.code-lang { color: var(--teal-hi); }
.code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: 12.5px/1.65 var(--mono); color: #c9d4e0; tab-size: 2; }
.c-cm { color: #5f6f82; }
.c-fn { color: #7fb5ff; }
.c-st { color: #8ee0b5; }
.c-kw { color: #d79bff; }
.c-nu { color: #f5b544; }
.c-a { color: var(--blue-hi); }
.c-b { color: var(--amber); }
.pine-canvas { height: 150px; border-radius: 12px; border: 1px solid var(--line); background: #060b13; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.metrics div { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #060b13; }
.metrics span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metrics b { display: block; margin-top: 2px; font: 700 17px/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.research-canvas { flex: 1; min-height: 190px; border-radius: 12px; border: 1px solid var(--line); background: #060b13; }
.viz-note { margin: 0; font: 500 11px/1.5 var(--mono); color: var(--muted); }

.mini-icon {
  display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px;
  border-radius: 12px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(18, 191, 174, 0.14), rgba(18, 191, 174, 0.02));
}
.mini-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--teal-hi); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.card-mini h3 { font-size: 18px; }

/* ---------- Replay ---------- */
.replay-section { position: relative; }
.replay-section::before {
  content: ""; position: absolute; left: 0; right: 0; top: 60px; height: 700px; z-index: -1; pointer-events: none;
  background: radial-gradient(600px 400px at 75% 50%, rgba(245, 181, 68, 0.08), transparent 70%);
}
.replay-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 64px; align-items: center; }
.ticks { display: grid; gap: 18px; margin: 36px 0 0; padding: 0; list-style: none; }
.ticks li { display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; }
.ticks li::before {
  content: ""; grid-row: span 2; width: 18px; height: 18px; margin-top: 3px; border-radius: 6px;
  background: rgba(245, 181, 68, 0.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23f5b544' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}
.ticks b { font-weight: 600; }
.ticks span { font-size: 15px; color: var(--text-2); }

.replay {
  display: grid; gap: 0;
  border-radius: var(--radius); border: 1px solid var(--line-2);
  background: #060b13; overflow: hidden;
  box-shadow: 0 40px 100px -40px rgba(245, 181, 68, 0.25), 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
.rp-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #070d16; font-size: 13px; }
.rp-sym { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.rp-sym span:last-child { font: 500 12px/1 var(--mono); color: var(--muted); }
.rp-badge { padding: 4px 7px; border-radius: 6px; background: rgba(245, 181, 68, 0.14); color: var(--amber); font: 700 10px/1 var(--mono); letter-spacing: 0.08em; }
.rp-clock { display: flex; align-items: baseline; gap: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.rp-clock time { font: 600 13px/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.rp-chart { position: relative; height: 300px; }
.rp-chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.rp-toast {
  position: absolute; left: 50%; top: 14px; transform: translate(-50%, -8px);
  padding: 6px 12px; border-radius: 999px;
  background: rgba(8, 14, 24, 0.94); border: 1px solid var(--line-2);
  font-size: 12px; color: var(--text); white-space: nowrap;
  opacity: 0; transition: opacity 0.25s, transform 0.25s var(--ease); pointer-events: none;
}
.rp-toast.show { opacity: 1; transform: translate(-50%, 0); }
.rp-controls { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.rp-btn {
  display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.rp-btn:hover { background: rgba(255, 255, 255, 0.08); }
.rp-btn svg { width: 14px; height: 14px; fill: var(--text); }
.rp-btn .i-pause, .replay.playing .rp-btn .i-play { display: none; }
.replay.playing .rp-btn .i-pause { display: block; }
.replay.playing [data-rp-play] { border-color: rgba(245, 181, 68, 0.5); }
.rp-scrub { flex: 1; min-width: 60px; height: 24px; margin: 0 6px; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.rp-scrub::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--amber) var(--p, 0%), rgba(150, 172, 200, 0.2) var(--p, 0%)); }
.rp-scrub::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(150, 172, 200, 0.2); }
.rp-scrub::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--amber); }
.rp-scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 3px solid var(--amber); }
.rp-scrub::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid var(--amber); }
.rp-speed { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--line-2); }
.rp-speed button { height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 600 12px/1 var(--mono); cursor: pointer; }
.rp-speed button[aria-pressed="true"] { background: rgba(245, 181, 68, 0.16); color: var(--amber); }
.rp-account { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); background: #070d16; }
.rp-stats { display: flex; gap: 22px; margin: 0; min-width: 0; }
.rp-stats div { min-width: 0; }
.rp-stats dt { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rp-stats dd { margin: 2px 0 0; font: 600 14px/1.3 var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-actions { display: flex; gap: 6px; flex-shrink: 0; }
.rp-actions button {
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13px; font-weight: 650; cursor: pointer; transition: filter 0.2s, transform 0.15s;
}
.rp-actions button:hover { filter: brightness(1.12); }
.rp-actions button:active { transform: scale(0.97); }
.rp-buy { background: var(--up); color: #02131a; }
.rp-sell { background: var(--down); color: #1a0308; }
.rp-actions .rp-close { background: transparent; border-color: var(--line-2); color: var(--text-2); }
.rp-note { margin: 0; padding: 10px 16px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- Local-first ---------- */
.arch {
  display: grid; grid-template-columns: 200px 120px minmax(280px, 1fr) minmax(220px, 0.9fr);
  align-items: center; gap: 0;
  padding: 40px; border-radius: var(--radius); border: 1px solid var(--line);
  background:
    radial-gradient(500px 300px at 50% 50%, rgba(20, 115, 230, 0.1), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), var(--bg-raise);
}
.arch-sources { display: grid; gap: 40px; }
.node { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); }
.node b { font-size: 15px; }
.node span:last-child { grid-column: 2; font-size: 12px; color: var(--muted); }
.ex-dot { grid-row: span 2; width: 10px; height: 10px; border-radius: 3px; transform: rotate(45deg); }
.ex-bn { background: #f0b90b; box-shadow: 0 0 12px rgba(240, 185, 11, 0.5); }
.ex-okx { background: #e8edf3; box-shadow: 0 0 12px rgba(232, 237, 243, 0.35); }
.arch-wire { position: relative; height: 200px; }
.arch-wire svg { width: 100%; height: 100%; overflow: visible; }
.wire { fill: none; stroke: var(--teal); stroke-width: 1.5; stroke-dasharray: 4 6; animation: flow 1.2s linear infinite; vector-effect: non-scaling-stroke; opacity: 0.85; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.wire-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -150%); font: 500 10px/1 var(--mono); color: var(--muted); white-space: nowrap; background: var(--bg-raise); padding: 3px 5px; border-radius: 4px; }
.arch-machine {
  position: relative; padding: 18px; border-radius: 16px;
  border: 1px solid rgba(52, 227, 207, 0.35);
  background: linear-gradient(180deg, rgba(18, 191, 174, 0.08), rgba(18, 191, 174, 0.02)), var(--panel);
  box-shadow: 0 0 0 6px rgba(18, 191, 174, 0.04), 0 30px 60px -30px rgba(18, 191, 174, 0.4);
}
.machine-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.machine-head b { font-size: 15px; }
.machine-head > span:last-child { margin-left: auto; font: 500 11px/1 var(--mono); color: var(--teal-hi); }
.machine-dots { display: inline-flex; gap: 4px; }
.machine-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.machine-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); }
.machine-row + .machine-row { margin-top: 8px; }
.machine-row b { display: block; font-size: 14px; font-weight: 600; }
.machine-row code { font: 500 11px/1.4 var(--mono); color: var(--muted); }
.mr-ic { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; background: rgba(18, 191, 174, 0.12); color: var(--teal-hi); font: 700 10px/1 var(--mono); letter-spacing: 0.04em; }
.arch-promises { display: grid; gap: 14px; margin: 0 0 0 40px; padding: 0; list-style: none; }
.arch-promises li { display: flex; gap: 10px; font-size: 15px; color: var(--text-2); }
.arch-promises li::before { content: ""; flex-shrink: 0; width: 16px; height: 16px; margin-top: 4px; border-radius: 50%; background: rgba(18, 191, 174, 0.16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.2 2.2 4.8-4.8' fill='none' stroke='%2334e3cf' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }

/* ---------- Quick start ---------- */
.start-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 64px; align-items: start; }
.reqs { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.reqs li { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.025); font: 500 13px/1.4 var(--mono); }
.reqs li span { color: var(--muted); font-family: var(--font); font-size: 12px; }
.steps { display: grid; gap: 0; margin: 32px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; display: flex; flex-direction: column; padding: 0 0 22px 44px; counter-increment: s; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px;
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--panel); font: 600 12px/1 var(--mono); color: var(--teal-hi);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 1px; background: var(--line-2); }
.steps b { font-weight: 600; }
.steps span, .steps a { font-size: 14px; color: var(--muted); }
.steps a { font-family: var(--mono); color: var(--teal-hi); }
.steps a:hover { text-decoration: underline; text-underline-offset: 3px; }
.term { border-radius: var(--radius); border: 1px solid var(--line-2); background: #05090f; overflow: hidden; box-shadow: 0 40px 100px -40px rgba(20, 115, 230, 0.35); }
.term-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--line); background: #080e18; }
.term-tabs { display: flex; gap: 4px; }
.term-tabs button { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.term-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.term-dots { display: inline-flex; gap: 6px; padding-right: 8px; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(150, 172, 200, 0.16); }
.copy { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: 600 12px/1 var(--font); cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.copy:hover { color: var(--text); border-color: rgba(150, 172, 200, 0.35); }
.copy.done { color: var(--teal-hi); border-color: rgba(52, 227, 207, 0.5); }
.term-body { padding: 6px 0 10px; font: 13.5px/1.85 var(--mono); color: #d6dfe9; }
.term-block + .term-block { border-top: 1px dashed var(--line); }
.term-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px 0 22px; }
.term-block pre { margin: 0; padding: 6px 22px 16px; overflow-x: auto; font: inherit; }
.t-cm { color: #5f6f82; }
.t-ps { color: var(--teal-hi); user-select: none; }
.t-ok { color: var(--teal-hi); }
.t-dim { color: var(--muted); }

.scope { margin-top: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-raise); }
.scope summary {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.scope summary::-webkit-details-marker { display: none; }
.scope summary::before { content: "+"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line-2); font: 500 13px/1 var(--mono); color: var(--muted); }
.scope[open] summary::before { content: "−"; }
.scope ul { margin: 0; padding: 0 20px 18px 50px; display: grid; gap: 8px; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* ---------- Final CTA ---------- */
.final {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-top: 140px; padding: 96px 32px 72px;
  border-radius: 28px; border: 1px solid var(--line-2);
  background:
    radial-gradient(700px 360px at 50% 0%, rgba(18, 191, 174, 0.22), transparent 70%),
    radial-gradient(600px 300px at 50% 120%, rgba(20, 115, 230, 0.25), transparent 70%),
    var(--bg-raise);
}
.final-orbit { position: absolute; left: 50%; top: 50%; width: 900px; height: 900px; margin: -450px 0 0 -450px; z-index: -1; color: rgba(214, 228, 245, 0.07); animation: spin 120s linear infinite reverse; }
.final-mark { margin-bottom: 26px; filter: drop-shadow(0 8px 30px rgba(18, 191, 174, 0.45)); }
.final p { max-width: 520px; margin: 18px 0 0; font-size: 17px; line-height: 1.7; color: var(--text-2); }
.final .cta { margin-top: 32px; }
.repo { margin-top: 26px; font: 500 12px/1 var(--mono); color: var(--muted); }
.repo:hover { color: var(--teal-hi); }

/* ---------- Footer ---------- */
.footer { margin-top: 120px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; padding: 56px 0 40px; }
.footer-brand p { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { margin-bottom: 4px; font: 600 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.footer-col a { font-size: 14px; color: var(--text-2); transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-base { display: flex; justify-content: space-between; gap: 24px; padding: 20px 0 32px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .mock-stage.reveal { transform: translateY(40px); }
.js .mock-stage.reveal.in { transform: none; }
.bento .reveal:nth-child(2), .facts .reveal:nth-child(2) { transition-delay: 0.08s; }
.bento .reveal:nth-child(3), .facts .reveal:nth-child(3) { transition-delay: 0.16s; }
.bento .reveal:nth-child(4), .facts .reveal:nth-child(4) { transition-delay: 0.08s; }
.hero-copy .reveal:nth-child(2) { transition-delay: 0.08s; }
.hero-copy .reveal:nth-child(3) { transition-delay: 0.16s; }
.hero-copy .reveal:nth-child(4) { transition-delay: 0.24s; }
.hero-copy .reveal:nth-child(5) { transition-delay: 0.32s; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .card-flow { grid-column: span 6; }
  .card-linked { grid-column: span 6; }
  .linked { grid-template-columns: repeat(4, 1fr); min-height: 150px; }
  .card-pine, .card-research { grid-column: span 3; }
  .arch { grid-template-columns: 180px 90px minmax(260px, 1fr); }
  .wire-label { display: none; }
  .arch-promises { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; margin: 32px 0 0; }
}
@media (max-width: 900px) {
  .mock-body { grid-template-columns: 40px minmax(0, 1fr); }
  .mock-side { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .card-pine, .card-research, .card-mini { grid-column: span 6; }
  .card-flow { grid-template-columns: 1fr; }
  .replay-grid, .start-grid { grid-template-columns: 1fr; gap: 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .nav-inner { height: 60px; gap: 12px; }
  .wordmark { font-size: 17px; }
  .brand img { width: 26px; height: 26px; }
  .nav .btn-sm span { display: none; }
  .nav .btn-sm { width: 36px; padding: 0; }
  .hero { padding-top: 112px; }
  .hero-orbit { width: 760px; height: 760px; margin-left: -380px; top: -170px; }
  .cta { width: 100%; }
  .cta .btn { flex: 1 1 200px; }
  .hero-meta { font-size: 12px; gap: 6px 18px; }
  .hero-meta li + li::before { display: none; }
  .mock-price span { display: none; }
  .mock-stage { margin-top: 48px; }
  .mock { height: 380px; grid-template-rows: 44px 1fr 26px; border-radius: 12px; }
  .mock-body { grid-template-columns: minmax(0, 1fr); }
  .mock-tools, .mock-intervals, .mock-symbol span, .hide-sm { display: none; }
  .mock-bar { gap: 10px; padding: 0 10px; }
  .mock-price b { font-size: 15px; }
  .facts { margin-top: 64px; }
  .fact { padding: 22px 18px; }
  .fact b { font-size: 42px; }
  .section { padding-top: 96px; }
  .section-head { margin-bottom: 36px; }
  .section-sub { font-size: 16px; }
  .card { padding: 22px; }
  .card-visual { min-height: 220px; }
  .linked { grid-template-columns: 1fr 1fr; min-height: 230px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .rp-chart { height: 260px; }
  .rp-top { padding: 10px 12px; }
  .rp-clock > span { display: none; }
  .rp-controls { flex-wrap: wrap; }
  .rp-scrub { order: 3; flex-basis: 100%; margin: 4px 0 0; }
  .rp-speed { margin-left: auto; }
  .rp-account { flex-direction: column; align-items: stretch; }
  .rp-stats { justify-content: space-between; gap: 12px; }
  .rp-actions button { flex: 1; }
  .arch { grid-template-columns: 1fr; padding: 24px 20px; justify-items: stretch; }
  .arch-sources { grid-template-columns: 1fr 1fr; gap: 10px; }
  .arch-wire { height: 70px; }
  .arch-wire svg { display: none; }
  .arch-wire::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1.5px dashed var(--teal); opacity: 0.8; }
  .wire-label { display: block; transform: translate(-50%, -50%); }
  .arch-promises { grid-template-columns: 1fr; margin-top: 28px; }
  .term-body { font-size: 12px; }
  .term-label { padding-left: 16px; }
  .term-block pre { padding: 6px 16px 14px; }
  .final { margin-top: 96px; padding: 72px 20px 56px; border-radius: 22px; }
  .footer { margin-top: 88px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-base { flex-direction: column; gap: 8px; }
}
@media (max-width: 400px) {
  .lang button { min-width: 30px; padding: 0 6px; }
  .rp-stats dd { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-orbit, .final-orbit, .pulse::after, .wire { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .mock { transform: none; }
  .btn:hover { transform: none; }
}
