:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --bg-alt: #f5f7fb;
  --bg-panel: #0e1726;
  --text: #1a2233;
  --muted: #5b6577;
  --line: #e3e8f1;
  --accent: #2f6bff;
  --accent-soft: #e7efff;
  --accent-2: #12c2a0;
  --success: #15a15c;
  --code-bg: #0f1a2e;
  --header-h: 64px;
  --radius: 14px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
ul { margin: 0; padding: 0 0 0 1.1em; }
code {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.9em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}
pre code {
  background: none;
  padding: 0;
  color: #d6e0f5;
  font-size: 0.86rem;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}
.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo-mark { color: var(--accent); font-size: 1.3rem; }

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.site-nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover { background: var(--bg-alt); color: var(--text); }
.site-nav a.active { color: var(--text); background: var(--accent-soft); }

.nav-cta { white-space: nowrap; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  background: none;
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(47, 107, 255, 0.25); }
.btn-primary:hover { background: #245be4; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-light { background: var(--surface); color: var(--text); }

/* Hero */
.hero {
  padding: 72px 0 64px;
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(47, 107, 255, 0.14), transparent 60%),
    radial-gradient(600px 300px at 10% 120%, rgba(18, 194, 160, 0.10), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero p { color: var(--muted); font-size: 1.08rem; max-width: 34em; }
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero-badges li {
  font-size: 0.85rem;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}

.hero-panel {
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 20px;
  color: #cfe0ff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  box-shadow: 0 20px 50px rgba(14, 23, 38, 0.25);
}
.panel-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.panel-row:last-child { border-bottom: none; }
.panel-row .ok { color: var(--accent-2); }

/* Page hero (interior) */
.page-hero {
  padding: 56px 0 8px;
  text-align: center;
}
.page-hero p {
  max-width: 40em;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Grid */
.grid {
  display: grid;
  gap: 20px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: 0 12px 30px rgba(20, 30, 60, 0.08); transform: translateY(-2px); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* Steps */
.steps {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  counter-reset: step;
  display: grid;
  gap: 12px;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 18px 14px 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 12px;
  width: 28px; height: 28px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* CTA */
.cta {
  background: linear-gradient(120deg, #14203d 0%, #0e1726 60%, #122a45 100%);
  color: #e9f0ff;
  border-radius: 0;
}
.cta-inner { text-align: center; }
.cta p { color: #a8bcdd; max-width: 32em; margin: 0 auto 24px; }

/* Image containers */
img { max-width: 100%; height: auto; display: block; }
.hero-visual {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 20px 50px rgba(14, 23, 38, 0.10);
}
.hero-visual-caption {
  text-align: center;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
.hero-visual-caption .ok { color: var(--accent-2); }
.how-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}
.how-visual {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.how-visual-cap {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.feature-visual {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: center;
  max-width: none;
}
.feature-fig {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.feature-fig figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.page-hero-visual { text-align: center; }
.page-hero-fig {
  margin: 0 auto 8px;
  max-width: 360px;
  display: flex;
  justify-content: center;
}
.page-hero-visual h1 { margin-top: 8px; }
.page-hero-visual p { margin-top: 8px; }
.cta-visual {
  display: flex;
  justify-content: center;
  margin: 12px 0 20px;
}
.cta-visual img { max-width: 280px; }
.api-fig {
  margin: 16px 0 0;
  display: flex;
  justify-content: flex-end;
}
.api-fig img { max-width: 220px; }
@media (max-width: 820px) {
  .how-grid { grid-template-columns: 1fr; }
  .feature-visual { grid-template-columns: 1fr; }
  .api-fig { justify-content: flex-start; }
  .api-fig img { max-width: 180px; }
}

/* Features */
.feature {
  border-bottom: 1px dashed var(--line);
  padding: 32px 0;
  max-width: 42em;
}
.feature-rev { margin-left: auto; }
.feature ul { margin: 16px 0 16px 1.2em; color: var(--muted); }
.feature li { padding: 3px 0; }

/* Pricing */
.billing-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.billing-toggle-wrap { text-align: center; }
.billing-option {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 9px;
  font: inherit;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.billing-option.active { background: var(--accent-soft); color: var(--text); }
.save {
  margin-left: 6px;
  font-size: 0.72em;
  color: var(--accent);
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--accent-soft);
}
.pricing { margin-top: 30px; align-items: stretch; }
.plan { display: flex; flex-direction: column; }
.plan h3 { font-size: 1.2rem; }
.price {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 12px 0 18px;
}
.price .amount { font-variant-numeric: tabular-nums; }
.price .per { font-size: 0.85rem; color: var(--muted); font-weight: 500; margin-left: 4px; }
.plan.featured {
  border: 2px solid var(--accent);
  box-shadow: 0 14px 36px rgba(47, 107, 255, 0.15);
  position: relative;
}
.plan.featured::before {
  content: "Популярный";
  position: absolute;
  top: -12px;
  left: 22px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.plan-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex: 1;
}
.plan-list li { padding: 7px 0; color: var(--muted); font-size: 0.94rem; }
.plan-list li::before { content: "✓  "; color: var(--success); }
.plan-cta { text-align: center; }
.fineprint { margin-top: 20px; color: var(--muted); font-size: 0.85rem; }

/* FAQ */
.faq details {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 12px;
  background: var(--surface);
  padding: 2px 0;
}
.faq summary {
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  display: inline-block;
  width: 22px;
  color: var(--accent);
  font-weight: 700;
}
.faq details[open] summary::before { content: "−"; }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--muted); }

/* API layout */
.api-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}
.api-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.api-nav {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
}
.api-nav a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.api-nav a:hover { background: var(--bg-alt); color: var(--text); }
.api-main { display: grid; gap: 24px; }
.api-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.api-block p { color: var(--muted); }
.api-block pre {
  margin: 16px 0 0;
  background: var(--code-bg);
  padding: 16px 18px;
  border-radius: 10px;
  overflow-x: auto;
}
.api-block code {
  background: transparent;
  padding: 0;
  color: var(--text);
}
.api-block pre code { color: #d6e0f5; }
.api-block code.inline { background: var(--accent-soft); color: var(--text); padding: 0.1em 0.35em; border-radius: 6px; }

/* Footer */
.site-footer {
  background: #0e1726;
  color: #a8bcdd;
  padding: 40px 0;
  margin-top: 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 30px;
  align-items: start;
}
.footer-inner .logo { color: #fff; }
.footer-inner p { color: #7e94b6; margin: 0; font-size: 0.94rem; }
.footer-inner nav { display: flex; flex-direction: column; gap: 8px; }
.footer-inner nav a { color: #cfe0ff; font-size: 0.95rem; }
.copyright { margin: 0; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-panel { display: none; }
  .api-layout { grid-template-columns: 1fr; }
  .api-aside { position: static; }
  .footer-inner { grid-template-columns: 1fr; text-align: left; }
}
@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px;
    box-shadow: 0 12px 24px rgba(10, 20, 40, 0.08);
  }
  .site-nav.open { display: flex; }
  .nav-cta { display: none; }
  .hero { padding: 52px 0 44px; }
  .billing-toggle { width: 100%; justify-content: center; }
}

/* Theme toggle button */
.theme-toggle {
  width: 38px; height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.theme-toggle:hover { background: var(--bg-alt); }
.hero { border-bottom-color: var(--line); }
.hero-panel { border: 1px solid rgba(255, 255, 255, 0.08); }

/* Dark theme */
[data-theme="dark"] {
  --bg: #0a0f1c;
  --surface: #101a2e;
  --bg-alt: #0e1726;
  --text: #e6edf7;
  --muted: #95a4bd;
  --line: #1c2941;
  --accent: #4d82ff;
  --accent-soft: #14233f;
  --code-bg: #060c18;
}
[data-theme="dark"] .card:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }
[data-theme="dark"] .hero {
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(77, 130, 255, 0.18), transparent 60%),
    radial-gradient(600px 300px at 10% 120%, rgba(18, 194, 160, 0.14), transparent 60%),
    var(--bg);
}
