:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --glass: rgba(255, 255, 255, 0.78);
  --line: #e3e8ef;
  --text: #0e1525;
  --muted: #5b6476;
  --accent: #2f6bff;
  --accent-soft: #e7eeff;
  --bad: #ef4e45;
  --bad-soft: #fdeceb;
  --warn: #e39408;
  --warn-soft: #fff3dc;
  --good: #12a873;
  --good-soft: #e1f6ec;
  --stage-a: #ffffff;
  --stage-b: #e6ecf5;
  --shadow: 0 1px 2px rgba(14, 21, 37, .04), 0 8px 24px rgba(14, 21, 37, .06);
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a; --surface: #141414; --surface-2: #1c1c1c; --glass: rgba(20, 20, 20, .78);
    --line: #262626; --text: #f2f2f2; --muted: #9a9a9a;
    --accent: #5b8cff; --accent-soft: rgba(91, 140, 255, .14);
    --bad: #ff6b62; --bad-soft: rgba(255, 107, 98, .14);
    --warn: #f5b13a; --warn-soft: rgba(245, 177, 58, .14);
    --good: #2fca8f; --good-soft: rgba(47, 202, 143, .14);
    --stage-a: #171717; --stage-b: #0b0b0b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --surface: #141414; --surface-2: #1c1c1c; --glass: rgba(20, 20, 20, .78);
  --line: #262626; --text: #f2f2f2; --muted: #9a9a9a;
  --accent: #5b8cff; --accent-soft: rgba(91, 140, 255, .14);
  --bad: #ff6b62; --bad-soft: rgba(255, 107, 98, .14);
  --warn: #f5b13a; --warn-soft: rgba(245, 177, 58, .14);
  --good: #2fca8f; --good-soft: rgba(47, 202, 143, .14);
  --stage-a: #171717; --stage-b: #0b0b0b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text);
}
.icon-btn.glass { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.nav-in { height: 64px; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 28px; margin-left: auto; font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; gap: 10px; align-items: center; margin-left: 12px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding-top: 72px; padding-bottom: 40px; display: flex; flex-direction: column; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); font-weight: 700; margin-top: 22px; letter-spacing: -0.035em; }
.lead { max-width: 640px; margin-top: 20px; font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; justify-content: center; }

/* ---------- stage ---------- */
.stage {
  position: relative; height: 740px; border-radius: 36px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 35%, var(--stage-a) 0%, var(--stage-b) 75%);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.stage-canvas { position: absolute; inset: 0; }
.stage-canvas canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.stage-loading {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  color: var(--muted); font-size: 14px; pointer-events: none; transition: opacity .5s ease;
}
.stage-loading span {
  width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.stage-loading.hide { opacity: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.stage-top {
  position: absolute; top: 18px; left: 18px; right: 18px; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; z-index: 5; pointer-events: none;
}
.stage-top > * { pointer-events: auto; }
.stage-top-r { display: flex; gap: 8px; align-items: center; }
.seg {
  display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.seg button {
  border: 0; background: transparent; height: 34px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--muted); transition: background .2s, color .2s;
  white-space: nowrap;
}
.seg button.on { background: var(--text); color: var(--bg); }
.seg-sm button { padding: 0 13px; }

.panel {
  position: absolute; z-index: 4; top: 72px; bottom: 50px;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  overflow: auto; scrollbar-width: thin;
}
.panel-list { left: 18px; width: 300px; padding: 10px; }
.panel-detail { right: 18px; width: 330px; padding: 22px; }
.stage-loading em { font-style: normal; font-variant-numeric: tabular-nums; }
.seg-style { position: absolute; z-index: 5; left: 50%; bottom: 40px; transform: translateX(-50%); }
/* «Рентген» всегда на тёмном фоне, независимо от темы сайта */
.stage.xray {
  --glass: rgba(16, 20, 30, .72); --line: #242b3a; --text: #eef2ff; --muted: #97a0b5; --surface: #161b26; --surface-2: #1e2431;
  --bg: #0b0e15; --accent: #5b8cff; --accent-soft: rgba(91, 140, 255, .16);
  --bad: #ff6b62; --bad-soft: rgba(255, 107, 98, .16); --warn: #f5b13a; --warn-soft: rgba(245, 177, 58, .16);
  --good: #2fca8f; --good-soft: rgba(47, 202, 143, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color: var(--text); color-scheme: dark;
  background: radial-gradient(120% 90% at 50% 40%, #121722 0%, #050608 75%);
}
.stage { transition: background .4s ease; }
.stage-foot { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); z-index: 3; pointer-events: none; }

/* list items */
.list-h { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 10px 10px; }
.list-h b { font-size: 15px; }
.list-h span { font-size: 13px; color: var(--muted); }
.item {
  display: block; width: 100%; text-align: left; border: 1px solid transparent; background: transparent;
  border-radius: var(--r-sm); padding: 12px; cursor: pointer; transition: background .15s, border-color .15s;
}
.item:hover { background: var(--surface); }
.item.on { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.item-name { font-weight: 600; font-size: 15px; }
.item-val { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; white-space: nowrap; }
.item-val small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 3px; }
.item-sub { font-size: 13px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sdot.bad { background: var(--bad); } .sdot.warn { background: var(--warn); } .sdot.good { background: var(--good); }

.bar { position: relative; height: 6px; border-radius: 6px; background: var(--surface-2); margin-top: 10px; }
.bar-ref { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: color-mix(in srgb, var(--good) 28%, transparent); }
.bar-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid var(--surface); }
.bar-dot.bad { background: var(--bad); } .bar-dot.warn { background: var(--warn); } .bar-dot.good { background: var(--good); }

/* chips */
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.neutral { background: var(--surface-2); color: var(--muted); }

/* detail */
.d-anim { animation: dIn .35s ease both; }
@keyframes dIn { from { opacity: 0; transform: translateY(6px); } }
.d-title { font-size: 24px; font-weight: 700; margin-top: 12px; }
.d-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.d-val { margin-top: 18px; font-variant-numeric: tabular-nums; }
.d-val b { font-size: 40px; letter-spacing: -0.03em; }
.d-val span { color: var(--muted); margin-left: 4px; }
.d-ref { font-size: 13px; color: var(--muted); }
.d-text { margin-top: 16px; font-size: 15px; }
.d-h { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 8px; font-weight: 600; }
.d-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.d-list li { position: relative; padding-left: 18px; font-size: 14.5px; }
.d-list li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.d-ask li::before { content: "?"; width: auto; height: auto; background: none; top: 0; left: 0; font-weight: 700; color: var(--accent); }
.d-note { margin-top: 18px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-sm); font-size: 13px; color: var(--muted); }
.summary-ring { display: flex; gap: 16px; align-items: center; margin-top: 16px; }
.summary-ring svg { flex: none; }
.summary-legend { display: grid; gap: 6px; font-size: 14px; }
.summary-legend span { display: flex; align-items: center; gap: 8px; }

.horizon { display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface-2); margin-top: 18px; }
.horizon button { border: 0; background: transparent; border-radius: 999px; height: 32px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.horizon button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.effects { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.effects li { display: flex; gap: 10px; font-size: 14.5px; align-items: flex-start; }
.eff-i { flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.eff-i.bad { background: var(--bad-soft); color: var(--bad); }
.eff-i.good { background: var(--good-soft); color: var(--good); }
.eff-i.neutral { background: var(--surface-2); color: var(--muted); }
.feel { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--accent-soft); font-size: 14px; }
.feel b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 2px; }
.intro-q { font-style: italic; color: var(--muted); font-size: 14px; margin-top: 10px; }

/* labels & tooltip */
.labels { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.olabel {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); will-change: transform;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 5px 10px 5px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity .3s;
}
.tip {
  position: absolute; z-index: 6; pointer-events: none; padding: 6px 10px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 500; opacity: 0; transform: translate(-50%, -130%);
  transition: opacity .15s; white-space: nowrap;
}

/* ---------- sections ---------- */
.section { padding-top: 120px; }
.section-head { max-width: 720px; margin-bottom: 36px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 12px; }
h2 { font-size: clamp(28px, 3.6vw, 44px); font-weight: 700; letter-spacing: -0.03em; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow); }
.card h3 { font-size: 19px; margin-bottom: 8px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; margin-bottom: 22px; }
.step p { color: var(--muted); font-size: 15px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split-text p { margin-top: 16px; }
.ticks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 32px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--good-soft); color: var(--good); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.chat { display: flex; flex-direction: column; gap: 14px; padding: 24px; }
.msg { max-width: 88%; padding: 14px 16px; border-radius: 20px; font-size: 15px; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; display: grid; gap: 10px; }
.msg.ai .btn { justify-self: start; margin-top: 4px; }
.chat-input { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; height: 50px; padding: 0 8px 0 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 14px; }
.chat-input i { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-style: normal; }

.dash { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.chart { width: 100%; height: auto; margin-top: 12px; }
.chart-band { fill: var(--good-soft); }
.chart-band-t { fill: var(--good); font-size: 12px; font-weight: 600; }
.chart-ref { stroke: var(--good); stroke-dasharray: 4 5; stroke-width: 1.2; opacity: .6; }
.chart-axis { stroke: var(--line); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.chart-dot { stroke: var(--surface); stroke-width: 3; }
.chart-dot.bad { fill: var(--bad); } .chart-dot.warn { fill: var(--warn); } .chart-dot.good { fill: var(--good); }
.chart-v { fill: var(--text); font-size: 15px; font-weight: 700; font-family: inherit; }
.chart-x { fill: var(--muted); font-size: 13px; font-family: inherit; }
.dash-side { display: grid; gap: 16px; }
.tile { padding: 22px; }
.tile-v { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.tile-v span { color: var(--muted); font-weight: 400; }
.tile-v small { font-size: 14px; color: var(--muted); font-weight: 500; }
.tile-accent { background: var(--accent); color: #fff; border-color: transparent; }
.tile-accent .tile-v { margin-bottom: 6px; }
.tile-accent p { opacity: .92; }

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.waitlist { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 48px; }
.waitlist-text p { margin-top: 14px; }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.field > span, .field legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 8px; }
.field input {
  height: 52px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg);
  padding: 0 16px; font: inherit; color: var(--text);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.chips-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-select label { cursor: pointer; }
.chips-select input { position: absolute; opacity: 0; pointer-events: none; }
.chips-select span { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; transition: all .15s; }
.chips-select input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chips-select input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.consent input { margin-top: 3px; accent-color: var(--accent); }
.form-msg { font-size: 14px; min-height: 20px; }
.form-msg.err { color: var(--bad); }
.form-msg.ok { color: var(--good); font-weight: 600; }

.foot { padding-top: 80px; padding-bottom: 48px; display: grid; gap: 8px; font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .panel-list { width: 270px; }
  .panel-detail { width: 290px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .stage { height: auto; display: flex; flex-direction: column; border-radius: 28px; }
  .stage-canvas { position: relative; height: 460px; order: 1; }
  .stage-top { order: 0; }
  .stage-loading { height: 460px; bottom: auto; }
  .labels { height: 460px; bottom: auto; }
  .panel { position: static; width: auto; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; border: 0; border-top: 1px solid var(--line); background: var(--surface); }
  .panel-list { order: 2; display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px; scroll-snap-type: x mandatory; }
  .panel-list .list-h { display: none; }
  .panel-list .item { flex: 0 0 210px; scroll-snap-align: start; background: var(--bg); border-color: var(--line); }
  .panel-list .item.on { border-color: var(--accent); }
  .panel-detail { order: 3; padding: 22px 20px; }
  .stage-foot { position: static; order: 4; padding: 0 16px 16px; background: var(--surface); }
  .seg-style { top: 410px; bottom: auto; }
  .split, .dash, .waitlist { grid-template-columns: 1fr; }
  .waitlist { padding: 28px; gap: 28px; }
  .cards3 { grid-template-columns: 1fr; }
  .section { padding-top: 88px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .hero { padding-top: 48px; }
  .steps { grid-template-columns: 1fr; }
  .stage-canvas, .stage-loading, .labels { height: 420px; }
  .seg-style { top: 370px; }
}
@media (max-width: 400px) {
  #resetBtn { display: none; }
  .nav-login { display: none; }
  .seg button { padding: 0 11px; font-size: 13px; }
  .seg-sm button { padding: 0 10px; }
  .stage-top { top: 12px; left: 12px; right: 12px; }
  .card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .d-anim { animation: none; }
}
