:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #17171a;
  --muted: #5c5c66;
  --line: #e4e1da;
  --accent: #1f5eff;
  --accent-ink: #ffffff;
  --accent-soft: #e8eeff;
  --ok: #0f8a5f;
  --warn: #b5541c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 8px 24px rgba(20, 20, 30, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1013;
    --surface: #17181d;
    --surface-2: #1e2026;
    --text: #ecebe8;
    --muted: #a3a3ad;
    --line: #2b2d35;
    --accent: #6b93ff;
    --accent-ink: #0b0c10;
    --accent-soft: #1b2440;
    --ok: #3ccf94;
    --warn: #f0965c;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--accent); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo { font-weight: 700; letter-spacing: -.01em; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-grid; place-items: center; }
.logo-mark svg { width: 14px; height: 14px; }
.beta { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 16px/1 var(--font);
  padding: 15px 22px; border-radius: 10px; border: 0; cursor: pointer;
  text-decoration: none; transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 10px 14px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn[disabled] { opacity: .6; cursor: wait; }

/* hero */
.hero { padding: 64px 0 40px; }
.hero h1 { font-size: clamp(32px, 5.2vw, 54px); line-height: 1.08; letter-spacing: -.025em; margin: 0 0 18px; max-width: 16ch; }
.hero .lead { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 58ch; margin: 0 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { font-size: 14px; color: var(--muted); margin-top: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.chips li { font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; color: var(--muted); }

/* sections */
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }
h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 32px; max-width: 62ch; }

.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .g3, .g2 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.num { font: 600 13px/1 var(--mono); color: var(--accent); margin-bottom: 12px; display: block; }

/* pain list */
.pain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pain li { padding-left: 28px; position: relative; color: var(--muted); }
.pain li::before { content: "×"; position: absolute; left: 0; top: -1px; font-weight: 700; color: var(--warn); font-size: 18px; }
.gain li::before { content: "✓"; color: var(--ok); font-size: 15px; top: 1px; }

/* sample table */
.sample { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.sample table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.sample th, .sample td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sample th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); font-weight: 600; }
.sample tr:last-child td { border-bottom: 0; }
.sample td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sample th.n { text-align: right; }
.tag { display: inline-block; font-size: 12px; border-radius: 6px; padding: 1px 8px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.tag.c { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.tag.g { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.kw { color: var(--muted); font-size: 13px; }
.caption { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* pricing */
.price-card { max-width: 520px; margin: 0 auto; text-align: left; }
.price { font-size: 44px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; }
.price small { font-size: 16px; color: var(--muted); font-weight: 500; }
.price-card ul { margin: 18px 0 24px; }
.price-card .btn { width: 100%; }
.fine { font-size: 13px; color: var(--muted); margin-top: 12px; text-align: center; }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: 16px 0; }
details summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); margin: 10px 0 0; }

/* form */
.form-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; font: 16px/1.4 var(--font); color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } .form-wrap { padding: 20px; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 4px 0 18px; }
.check input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin-top: 14px; font-size: 15px; display: none; }
.form-msg.err { display: block; color: var(--warn); }
.done { display: none; text-align: center; padding: 20px 0; }
.done h3 { font-size: 24px; margin: 0 0 8px; }
.done p { color: var(--muted); margin: 0; }
.form-wrap.is-done form { display: none; }
.form-wrap.is-done .done { display: block; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }

/* sticky mobile CTA */
.mcta { display: none; }
@media (max-width: 640px) {
  .mcta { display: block; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20; }
  .mcta .btn { width: 100%; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
  .mcta.hide { display: none; }
  body { padding-bottom: 76px; }
  .top .btn-sm { display: none; }
}

/* legal page */
.legal { padding: 48px 0 64px; }
.legal h1 { font-size: 32px; letter-spacing: -.02em; }
.legal h2 { font-size: 20px; margin-top: 28px; }
.legal p, .legal li { color: var(--muted); }

/* ---------- v2: навигация, пример-рекомендация, тарифы, переключатель ---------- */
.top-nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.top-nav a:not(.btn) { color: var(--muted); text-decoration: none; }
.top-nav a:not(.btn):hover { color: var(--text); }
@media (max-width: 640px) { .top-nav a:not(.btn) { display: none; } }

.hero-beta { font-size: 13px; color: var(--warn); margin: 6px 0 0; }

.reco { margin-top: 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; padding: 14px 18px; }
.reco-label { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.reco p { margin: 6px 0 0; }

.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr; } }
.for-line { margin: 22px 0 0; color: var(--muted); }

.tiers { align-items: stretch; }
.tier { display: flex; flex-direction: column; }
.tier .gain { flex: 1; margin: 16px 0 22px; }
.tier .btn { width: 100%; }
.tier-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tier-head h3 { font-size: 20px; margin: 0; }
.tier-badge { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; }
.tier-for { margin: 6px 0 4px !important; }
.tier-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
#price .fine { margin-top: 18px; }

.who p { color: var(--text); margin: 0 0 12px; }
.who p:last-child { margin: 0; }
.who-contact { color: var(--muted) !important; font-size: 15px; }

.plan-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .plan-switch { grid-template-columns: 1fr; } }
.plan-opt { position: relative; }
.plan-opt input { position: absolute; opacity: 0; pointer-events: none; }
.plan-opt span { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; cursor: pointer; background: var(--bg); font-size: 14px; line-height: 1.35; }
.plan-opt span b { display: block; font-size: 15px; }
.plan-opt input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.plan-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-note { font-size: 13px; color: var(--muted); text-align: center; margin: 12px 0 0; }
.form-alt { font-size: 14px; color: var(--muted); text-align: center; margin: 16px 0 0; }

/* v3: подпись исполнителя в шапке, блок связанного продукта */
.brand-box { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.byline { font-size: 13px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.byline:hover { color: var(--text); }
@media (max-width: 420px) { .byline { display: none; } }
section.related { padding-top: 0; border-top: 0; }
.related-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.related-card h3 { margin: 0 0 6px; }
.related-card p { margin: 0; color: var(--muted); max-width: 60ch; }

/* v4: данные сайта, доступы, подтверждение без доступов */
[hidden] { display: none !important; }
.hero-data { font-size: 15px; color: var(--muted); margin: 14px 0 0; max-width: 62ch; }
.hero-data b { color: var(--text); }
.data-grid h3 { margin-top: 0; }
.access-step { margin: 0 0 14px; font-size: 14px; }
.access-step ol { margin: 6px 0 0; padding-left: 20px; color: var(--muted); }
.access-step li { margin: 2px 0; }
.access-step code, .check-access code, .done-access code { font-size: 13px; background: var(--line); border-radius: 4px; padding: 1px 5px; color: var(--text); word-break: break-all; }
.check-access { color: var(--text); }
.check-access small { display: block; color: var(--muted); margin-top: 4px; }
.access-confirm { border: 1px solid var(--warn); border-radius: 12px; padding: 16px; margin: 4px 0 8px; }
.access-confirm .ac-h { font-weight: 700; margin: 0 0 6px; }
.access-confirm p { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.ac-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ac-actions .btn { flex: 1 1 200px; }
.done-access { display: none; text-align: left; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; color: var(--muted); }
.done-access b { color: var(--text); }
.form-wrap.no-access .done-access { display: block; }
.data-grid .fine { text-align: left; margin: 14px 0 0; }
section[id] { scroll-margin-top: 70px; }
