/* SpectRAG landing — dark, glow, graph-first */
:root {
  --bg: #04060c;
  --bg-2: #070b15;
  --panel: #0a0f1b;
  --panel-2: #0d1322;
  --line: rgba(148, 170, 220, 0.12);
  --line-2: rgba(148, 170, 220, 0.2);
  --text: #e9eefb;
  --muted: #94a0bd;
  --dim: #5f6a86;
  --blue: #3b82f6;
  --cyan: #38bdf8;
  --sky: #7dd3fc;
  --violet: #8b5cf6;
  --green: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --radius: 18px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; }
canvas { display: block; }
.mono { font-family: var(--mono); font-size: .92em; }
.dim { color: var(--dim); }
button { font: inherit; color: inherit; }

/* ───────── Buttons ───────── */
.btn {
  max-width: 100%;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn-sm { padding: 9px 18px; font-size: 14.5px; }
.btn-light { background: #f4f7ff; color: #070b15; box-shadow: 0 0 0 1px rgba(255,255,255,.4), 0 8px 40px -8px rgba(125,211,252,.55); }
.btn-light:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px #fff, 0 10px 50px -6px rgba(125,211,252,.8); }
.btn-ghost { background: rgba(255,255,255,.04); border: 1px solid var(--line-2); color: var(--text); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(148,170,220,.35); }

/* ───────── Nav ───────── */
.nav {
  position: fixed; inset: 18px 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1240px; margin: 0 auto; padding: 0 24px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -.01em; }
.brand img { border-radius: 10px; box-shadow: 0 0 0 1px var(--line-2); background: #050a18; }
.nav-links {
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  background: rgba(10, 15, 27, .65); border: 1px solid var(--line-2);
  backdrop-filter: blur(14px);
}
.nav-links a { padding: 7px 14px; border-radius: 999px; font-size: 14.5px; color: #c9d2e8; text-decoration: none; transition: background .2s, color .2s; }
.nav-links a:hover { background: rgba(255,255,255,.07); color: #fff; }

/* ───────── Hero ───────── */
.hero { position: relative; padding: 150px 24px 40px; overflow: hidden; isolation: isolate; }
.hero-net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .55; }
.glow { position: absolute; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.glow::before {
  content: ""; position: absolute; left: 50%; top: 30%; width: min(1200px, 120vw); height: 70vh; transform: translateX(-50%);
  background:
    radial-gradient(40% 45% at 30% 60%, rgba(59,130,246,.28), transparent 70%),
    radial-gradient(30% 35% at 75% 45%, rgba(139,92,246,.22), transparent 70%),
    radial-gradient(25% 30% at 50% 85%, rgba(56,189,248,.16), transparent 70%);
  filter: blur(30px);
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .75; } }

.hero-inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 6px 16px 6px 6px; border-radius: 999px; font-size: 14.5px; color: #d6deef; text-decoration: none;
  background: rgba(10,15,27,.7); border: 1px solid var(--line-2); backdrop-filter: blur(10px);
  transition: border-color .2s;
}
.pill:hover { border-color: rgba(125,211,252,.5); }
.pill-tag { background: #fff; color: #050a18; font: 700 11px/1 var(--mono); padding: 6px 9px; border-radius: 999px; letter-spacing: .05em; }

.hero-title {
  margin: 36px 0 0; font-weight: 800; letter-spacing: -.055em; line-height: .98;
  font-size: clamp(34px, 6.4vw, 92px);
  background: linear-gradient(180deg, #fff 30%, #c7d4f0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-title .line { display: block; white-space: nowrap; }
.logo-chip {
  display: inline-flex; vertical-align: middle; width: .9em; height: .9em; margin: -.12em .04em 0;
  border-radius: .2em; overflow: hidden; background: #050a18;
  box-shadow: 0 0 0 1px rgba(148,170,220,.25), 0 0 40px rgba(59,130,246,.5);
  animation: float 5s ease-in-out infinite;
}
.logo-chip img { width: 100%; height: 100%; object-fit: cover; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-2deg); } }

.hero-sub { max-width: 780px; margin: 30px auto 0; font-size: clamp(16px, 1.6vw, 20px); color: var(--muted); line-height: 1.75; }
.hero-sub strong { color: var(--text); font-weight: 600; }
.ico { color: var(--sky); margin-right: 4px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 38px; }
.hero-links { margin: 16px 0 0; font: 13px var(--mono); color: var(--dim); display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-links a { color: #9fb2d8; text-decoration: none; border-bottom: 1px dashed rgba(159,178,216,.35); }
.hero-links a:hover { color: #fff; border-color: #fff; }

.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; max-width: 820px; margin: 48px auto 0;
  background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.hero-stats div { background: rgba(7,11,21,.75); padding: 18px 16px; backdrop-filter: blur(10px); }
.hero-stats b { display: block; font-size: 30px; letter-spacing: -.03em; color: #fff; }
.hero-stats span { font-size: 13px; color: var(--muted); line-height: 1.4; display: block; }

/* ───────── Window chrome ───────── */
.window {
  border-radius: 20px; overflow: hidden; background: #070b14;
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.6), 0 -20px 80px -40px rgba(125,211,252,.35);
}
.win-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #080c17; font-size: 14px; }
.dots { display: flex; gap: 7px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.win-session { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sq { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; background: linear-gradient(135deg, #60a5fa, #8b5cf6); }
.caret { color: var(--dim); display: block; flex: none; }
.win-path { padding: 4px 10px; border-radius: 8px; background: rgba(255,255,255,.04); color: #b9c4dd; font-size: 13.5px; }
.win-right { margin-left: auto; display: flex; gap: 6px; }
.chip-sm { padding: 4px 12px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }
.chip-sm.on { color: #fff; background: rgba(255,255,255,.06); }

/* ───────── Mockup ───────── */
.mock { max-width: 1180px; margin: 70px auto 0; position: relative; }
.mock-note { text-align: center; color: var(--dim); font-size: 12.5px; margin: 14px 0 0; }
.mock-body { display: grid; grid-template-columns: 250px 1fr 300px; min-height: 440px; text-align: left; }
.mock-side { border-right: 1px solid var(--line); padding: 16px 14px; font-size: 14px; }
.search { border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; color: var(--dim); }
.side-label { color: var(--dim); font-size: 12.5px; margin: 20px 4px 8px; }
.sess { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 12px; }
.sess.active { background: rgba(255,255,255,.05); }
.sess .hash { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.04); color: var(--muted); }
.sess > div { min-width: 0; }
.sess b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess time { align-self: start; color: var(--dim); font-size: 12px; line-height: 1.6; padding-right: 2px; }
.src { display: flex; align-items: center; gap: 10px; padding: 6px 8px; font-size: 13px; color: #c5cee3; }
.src i, .sources i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); flex: none; }

.mock-chat { padding: 18px 26px; font-size: 14.5px; }
.day { text-align: center; color: var(--dim); font-size: 12.5px; margin-bottom: 14px; }
.msg { display: grid; grid-template-columns: 38px 1fr; gap: 12px; margin: 14px 0; }
.msg time { color: var(--dim); font-size: 12px; margin-left: 6px; }
.msg p { margin: 4px 0 0; color: #d7dff0; }
.av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.av-user { background: linear-gradient(135deg, #fb7185, #f43f5e); }
.av-bot { border-radius: 11px; background: #050a18; box-shadow: 0 0 0 1px var(--line-2); }
.av-bot img { width: 100%; height: 100%; object-fit: cover; }
.sys { display: flex; align-items: center; justify-content: center; text-align: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 6px 0; }
.sys::before, .sys::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cite { display: inline-block; font: 600 11px/1 var(--mono); padding: 3px 6px; border-radius: 6px; color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sources span { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 9px; border: 1px solid var(--line-2); font-size: 12.5px; color: #c5cee3; }

.mock-trace { border-left: 1px solid var(--line); padding: 16px 18px; font-size: 14px; }
.trace-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; }
.status { color: var(--cyan); padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(56,189,248,.35); background: rgba(56,189,248,.08); font-size: 12px; }
.mock-trace h4 { margin: 10px 0 2px; font-size: 17px; }
.trace { list-style: none; padding: 0; margin: 14px 0 0; }
.trace li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; }
.trace .n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font: 600 12px var(--mono); background: rgba(56,189,248,.12); color: var(--sky); }
.trace b { display: block; font-weight: 600; font-size: 14px; }
.trace small { color: var(--dim); font-size: 12px; }
.trace em { font: 500 12.5px var(--mono); font-style: normal; color: var(--amber); }
.budget { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; }
.budget-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.budget-row.dim { color: var(--dim); margin-top: 8px; }
.bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.06); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: 6px; box-shadow: 0 0 12px var(--cyan); }

/* ───────── Sections ───────── */
.section { max-width: 1240px; margin: 0 auto; padding: 120px 24px 0; }
.section-head { text-align: center; max-width: 780px; margin: 0 auto 48px; }
.section-head.left { text-align: left; margin: 0; }
.section-head p a, .section-head.left a { color: var(--sky); }
.eyebrow { display: inline-block; font: 500 12.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--sky); }
h2 { font-size: clamp(32px, 4.6vw, 56px); letter-spacing: -.04em; line-height: 1.05; margin: 14px 0 0; font-weight: 800; }
h3 { letter-spacing: -.02em; }
.section-head p { color: var(--muted); font-size: 17.5px; margin: 18px 0 0; }
.card {
  background: linear-gradient(180deg, rgba(13,19,34,.85), rgba(8,12,22,.85));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.tag { font: 600 11.5px var(--mono); padding: 4px 9px; border-radius: 7px; background: rgba(56,189,248,.14); color: var(--sky); border: 1px solid rgba(56,189,248,.35); }
.tag-muted { background: rgba(255,255,255,.04); color: var(--muted); border-color: var(--line-2); }
.formula { font: 500 14px var(--mono); color: #cfe7ff; padding: 10px 14px; border-radius: 12px; background: rgba(56,189,248,.06); border: 1px solid rgba(56,189,248,.18); }
.formula.big { font-size: 20px; padding: 16px 18px; margin: 22px 0; text-align: center; }

/* ───────── Compare animation ───────── */
.compare-anim { padding: 0; overflow: hidden; }
.compare-anim svg { width: 100%; height: auto; display: block; }
.cmp-foot { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.cmp-foot .verdict { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 16px 24px; font-size: 14px; }
.cmp-foot .verdict + .verdict { border-left: 1px solid var(--line); }
.bad::before { content: "✕ "; color: var(--rose); }
.good::before { content: "✓ "; color: var(--green); }
.bad { color: #c6b6c3; } .good { color: #d2f5e6; }

/* ───────── Explorer ───────── */
.explorer { padding: 18px; position: relative; overflow: hidden; }
.ex-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); gap: 2px; }
.seg-btn { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font-size: 14px; color: var(--muted); cursor: pointer; transition: .2s; }
.seg-btn:hover { color: #fff; }
.seg-btn.on { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.ex-controls { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); cursor: pointer; font-size: 18px; line-height: 1; transition: .2s; }
.icon-btn:hover { background: rgba(255,255,255,.08); }
.icon-btn.play { font-size: 12px; color: var(--sky); }

.ex-grid { display: grid; grid-template-columns: 230px 1fr 320px; gap: 16px; min-height: 520px; }
.ex-steps { position: relative; scrollbar-width: none; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ex-steps::-webkit-scrollbar { display: none; }
.ex-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; padding: 10px 10px; border-radius: 12px; cursor: pointer; color: var(--muted); font-size: 14px; transition: .2s; border: 1px solid transparent; }
.ex-steps li:hover { background: rgba(255,255,255,.03); color: #fff; }
.ex-steps li .k { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font: 600 12px var(--mono); background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.ex-steps li small { display: block; color: var(--dim); font-size: 12px; }
.ex-steps li.done .k { color: var(--sky); border-color: rgba(56,189,248,.3); }
.ex-steps li.on { background: rgba(56,189,248,.07); color: #fff; border-color: rgba(56,189,248,.25); }
.ex-steps li.on .k { background: var(--cyan); color: #04121f; border-color: var(--cyan); box-shadow: 0 0 16px rgba(56,189,248,.6); }

.ex-stage { position: relative; border-radius: 14px; background: radial-gradient(80% 80% at 50% 50%, #0b1426, #060a14); border: 1px solid var(--line); overflow: hidden; min-height: 420px; }
.ex-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ex-legend { position: absolute; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); max-width: calc(100% - 24px); }
.ex-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ex-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
.ex-legend i.ln { width: 14px; height: 3px; border-radius: 3px; }
.ex-query { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; padding: 9px 12px; border-radius: 12px; background: rgba(4,8,16,.8); border: 1px solid rgba(52,211,153,.3); backdrop-filter: blur(8px); }
.ex-query[hidden] { display: none; }
.q-ico { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-weight: 700; background: rgba(52,211,153,.15); color: var(--green); flex: none; }

.ex-info { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.ex-info h3 { margin: 0; font-size: 22px; }
.ex-info .file { font: 12.5px var(--mono); color: var(--dim); }
.ex-info p { margin: 0; color: #c2cbe0; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 12px; padding: 3px 9px; border-radius: 7px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); color: #c5cee3; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--line); font-size: 13px; }
.kv span { color: var(--muted); } .kv b { font: 500 13px var(--mono); text-align: right; color: #fff; }
.kv b.hl { color: var(--sky); } .kv b.good { color: var(--green); } .kv b.bad { color: var(--rose); }
.kv b.good::before, .kv b.bad::before { content: none; }
.mini-bar { height: 8px; border-radius: 8px; background: rgba(255,255,255,.06); overflow: hidden; }
.mini-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 10px var(--cyan); transition: width .25s; }
.answer { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(56,189,248,.25); background: rgba(56,189,248,.05); color: #d7e3f6; font-size: 13.5px; }
.ex-progress { height: 2px; background: rgba(255,255,255,.04); margin: 16px -18px -18px; }
.ex-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--cyan)); }

/* ───────── Signals ───────── */
.signals { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.sig-canvas-wrap { position: relative; min-height: 540px; overflow: hidden; background: radial-gradient(80% 80% at 50% 50%, #0b1426, #060a14); }
.sig-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sig-caption { position: absolute; left: 16px; bottom: 14px; font-size: 13px; color: var(--muted); padding: 6px 10px; border-radius: 9px; background: rgba(4,8,16,.7); border: 1px solid var(--line); }
.sig-side { display: flex; flex-direction: column; gap: 14px; }
.weights { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.weights-head { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; }
.stack { display: flex; height: 30px; border-radius: 9px; overflow: hidden; gap: 2px; }
.stack div { background: var(--c); display: grid; place-items: center; font: 600 11px var(--mono); color: #04121f; transition: filter .2s, opacity .2s; min-width: 0; }
.stack.focus div { opacity: .25; } .stack.focus div.on { opacity: 1; }
.sig-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sig { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); cursor: pointer; transition: .2s; }
.sig:hover, .sig.on { border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 7%, transparent); }
.sig-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sig-top b { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.sig-top b i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); box-shadow: 0 0 8px var(--c); }
.sig-top span { font: 600 13px var(--mono); color: var(--c); }
.sig p { margin: 6px 0 4px; font-size: 13px; color: #b6c0d6; line-height: 1.5; }
.sig small { font: 11.5px var(--mono); color: var(--dim); }

/* ───────── Spectral ───────── */
.spectral { display: grid; grid-template-columns: 1fr 1.15fr; gap: 0; overflow: hidden; }
.spec-text { padding: 40px; }
.spec-text h2 { font-size: clamp(28px, 3.4vw, 44px); }
.spec-text p { color: var(--muted); }
.spec-facts { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; font-size: 14.5px; color: #c2cbe0; }
.spec-facts li::before { content: "◆"; color: var(--sky); font-size: 10px; margin-right: 10px; vertical-align: 2px; }
.spec-viz { position: relative; min-height: 520px; border-left: 1px solid var(--line); background: radial-gradient(80% 80% at 50% 50%, #0b1426, #060a14); }
.spec-viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.eig { position: absolute; right: 14px; top: 14px; font: 12px var(--mono); color: var(--muted); padding: 8px 12px; border-radius: 10px; background: rgba(4,8,16,.75); border: 1px solid var(--line); line-height: 1.7; }
.eig b { color: var(--sky); font-weight: 500; }

/* ───────── Diffusion ───────── */
.diff-card { position: relative; overflow: hidden; background: radial-gradient(90% 90% at 50% 40%, #0b1426, #050810); }
.diff-card canvas { width: 100%; height: 520px; }
.diff-ui { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); }
.diff-row { display: flex; align-items: center; gap: 14px; grid-column: 1 / -1; }
.diff-row input { flex: 1; accent-color: var(--sky); height: 4px; }
.diff-t { min-width: 80px; text-align: right; color: #fff; }
.diff-legend { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.ramp { width: 120px; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #1e3a8a, #3b82f6, #38bdf8, #e0f2fe, #fbbf24); }
.sep { width: 1px; height: 14px; background: var(--line-2); margin: 0 6px; }
.seed-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 8px #fff; }

/* ───────── Results charts ───────── */
.sys-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin: -18px 0 26px; font-size: 14px; color: #c5cee3; }
.sys-legend span { display: inline-flex; align-items: center; gap: 8px; }
.sys-legend i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart { margin: 0; padding: 24px 24px 16px; display: flex; flex-direction: column; }
.chart h3 { margin: 0; font-size: 21px; }
.chart figcaption p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.chart svg { width: 100%; height: auto; margin-top: 12px; overflow: visible; }
.chart .src { color: var(--dim); font-size: 12px; margin-top: auto; padding-top: 8px; }
.chart text { font-family: Inter, sans-serif; }
.chart .tip { pointer-events: none; }

.ablation { margin-top: 18px; padding: 0; }
.ablation summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; cursor: pointer; }
.ablation summary::-webkit-details-marker { display: none; }
.ablation summary small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.ablation .chev { font-size: 20px; color: var(--muted); transition: transform .2s; }
.ablation[open] .chev { transform: rotate(180deg); }
.results { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; padding: 6px 28px 28px; }
.res-chart { display: flex; flex-direction: column; gap: 7px; position: relative; }
.res-row { display: grid; grid-template-columns: 140px 1fr 48px; gap: 12px; align-items: center; font-size: 13px; }
.res-row .name { font-family: var(--mono); color: #c5cee3; text-align: right; font-size: 12.5px; }
.res-row .track { position: relative; height: 18px; border-radius: 6px; background: rgba(255,255,255,.03); }
.res-row .track::after { content: ""; position: absolute; top: -4px; bottom: -4px; left: calc(50 / 70 * 100%); width: 1px; background: rgba(251,191,36,.6); }
.res-row .fill { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #1e3a8a, var(--blue)); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.res-row.win .fill { background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 14px rgba(56,189,248,.5); }
.res-row.lose .fill { background: linear-gradient(90deg, #3f1d38, #9f3a5e); }
.res-row .val { font: 600 13px var(--mono); }
.res-row.win .name { color: #fff; }
.res-axis { display: grid; grid-template-columns: 140px 1fr 48px; gap: 12px; font: 11px var(--mono); color: var(--dim); }
.res-axis div { position: relative; height: 14px; }
.res-axis div span { position: absolute; transform: translateX(-50%); }
.res-notes { display: flex; flex-direction: column; gap: 14px; }
.stat { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.stat b { display: block; font-size: 32px; letter-spacing: -.03em; background: linear-gradient(90deg, #fff, var(--sky)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: 13.5px; }
.caveat { margin: 0; font-size: 13px; color: var(--dim); border-left: 2px solid var(--amber); padding-left: 12px; }

/* ───────── Figure ───────── */
.figure { max-width: 1080px; margin: 18px auto 0; }
.figure summary { cursor: pointer; color: var(--muted); font-size: 14px; text-align: center; }
.figure img { margin-top: 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }

/* ───────── Stack ───────── */
.stack-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(13,19,34,.8), rgba(8,12,22,.8)); transition: .25s; }
.tile:hover { border-color: rgba(56,189,248,.35); transform: translateY(-2px); }
.tile span { display: block; font: 11.5px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.tile b { display: block; margin-top: 8px; font-size: 17px; }
.tile small { color: var(--muted); font-size: 13px; }

/* ───────── Quickstart ───────── */
.quick { display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px; align-items: center; }
.quick .seg { margin-top: 24px; }
.terminal pre { margin: 0; padding: 22px; min-height: 290px; font: 13.5px/1.75 var(--mono); color: #cfd8ea; overflow-x: auto; }
.terminal .c { color: var(--dim); } .terminal .p { color: var(--green); } .terminal .o { color: var(--sky); }
.terminal .cursor { display: inline-block; width: 8px; height: 16px; background: var(--sky); vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.copy { margin-left: auto; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.copy:hover { color: #fff; }

/* ───────── Cite ───────── */
.cite-card { display: grid; grid-template-columns: 1fr 1.2fr; gap: 30px; padding: 32px; align-items: start; }
.cite-card h3 { font-size: 22px; line-height: 1.35; margin: 12px 0 10px; }
.cite-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.bib { position: relative; }
.bib .copy { position: absolute; right: 10px; top: 10px; }
.bib pre { margin: 0; padding: 18px; border-radius: 14px; background: #050810; border: 1px solid var(--line); font: 12.5px/1.65 var(--mono); color: #b9c6e0; overflow-x: auto; }

.footer { max-width: 1240px; margin: 120px auto 0; padding: 30px 24px 50px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); font-size: 14px; }
.foot-links { display: flex; gap: 18px; }
.foot-links a { color: var(--muted); text-decoration: none; } .foot-links a:hover { color: #fff; }

/* ───────── Reveal ───────── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ───────── Responsive ───────── */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .mock-body { grid-template-columns: 1fr 280px; }
  .mock-side { display: none; }
  .ex-grid { grid-template-columns: 1fr; }
  .ex-steps { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .ex-steps li { flex: none; grid-template-columns: 28px auto; }
  .ex-steps li small { display: none; }
  .ex-stage { min-height: 440px; }
  .signals, .spectral, .charts, .results, .quick, .cite-card { grid-template-columns: 1fr; }
  .spec-viz { border-left: 0; border-top: 1px solid var(--line); }
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .hero { padding-top: 120px; }
  .hero-title .line { white-space: normal; }
  .pill { flex-direction: column; gap: 8px; padding: 12px 18px 14px; border-radius: 18px; max-width: 100%; text-align: center; line-height: 1.45; }
  .pill-arrow { display: none; }
  .nav { padding: 0 16px; }
  .msg { grid-template-columns: 1fr; }
  .msg .av { display: none; }
  .mock-chat { padding: 16px 18px; }
  .sys::before, .sys::after { display: none; }
  .ex-top { flex-direction: column; align-items: stretch; }
  .ex-top .seg { width: 100%; } .ex-top .seg-btn { flex: 1; }
  .ex-controls { justify-content: center; }
  .cite-links { flex-direction: column; }
  .cite-links .btn { white-space: normal; justify-content: center; text-align: center; width: 100%; }
  .bib { display: flex; flex-direction: column; gap: 8px; }
  .bib .copy { position: static; align-self: flex-end; }
  .hero-ctas .btn { width: 100%; max-width: 320px; justify-content: center; }
  .cite-card { padding: 22px; }
  .hero-stats { grid-template-columns: 1fr; }
  .mock-body { grid-template-columns: 1fr; }
  .mock-trace { border-left: 0; border-top: 1px solid var(--line); }
  .win-path, .win-right { display: none; }
  .cmp-foot { grid-template-columns: 1fr; }
  .cmp-foot .verdict + .verdict { border-left: 0; border-top: 1px solid var(--line); }
  .sig-cards { grid-template-columns: 1fr; }
  .spec-text { padding: 24px; }
  .res-row, .res-axis { grid-template-columns: 96px 1fr 40px; }
  .stack-grid { grid-template-columns: 1fr; }
  .diff-card canvas { height: 400px; }
  .diff-ui { grid-template-columns: 1fr; }
  .section { padding-top: 90px; }
  .btn { padding: 12px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* grid children must be allowed to shrink below their content (long <pre> lines, canvases) */
.cite-card > *, .quick > *, .charts > *, .results > *, .signals > *, .spectral > *, .ex-grid > * { min-width: 0; }
.nav { transition: background .3s, box-shadow .3s; }
.nav::before { content: ""; position: absolute; inset: -18px 0 -12px; z-index: -1; opacity: 0; transition: opacity .3s;
  background: linear-gradient(180deg, rgba(4,6,12,.92), rgba(4,6,12,.6)); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); left: calc(50% - 50vw); right: calc(50% - 50vw); }
.nav.scrolled::before { opacity: 1; }
