:root {
  --bg: #0b0d12;
  --surface: #131722;
  --surface-2: #1a1f2e;
  --border: #232a3d;
  --text: #e6e8ef;
  --muted: #8b91a5;
  --accent: #ffb01f;
  --accent-2: #ff8a1f;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 12px;
  --maxw: 1200px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f6f7fb;
  --surface-2: #eef1f8;
  --border: #e2e6ef;
  --text: #0e1320;
  --muted: #5a6376;
  --accent: #d97706;
  --accent-2: #b45309;
  --shadow: 0 8px 24px rgba(15,23,42,.08);
}

* { box-sizing: border-box; }
html, body { padding: 0; margin: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1em; color: var(--text); }
.muted { color: var(--muted); }
.container { 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) 85%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--text); font-size: 1.05rem;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; color: #0b0d12; font-weight: 800;
  box-shadow: 0 4px 14px rgba(255, 176, 31, .35);
}
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a {
  color: var(--muted); font-weight: 500; font-size: .95rem;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; cursor: pointer; color: var(--text);
  transition: background .15s ease;
}
.icon-btn:hover { background: var(--surface-2); }
.menu-toggle { display: none; }
@media (max-width: 880px) {
  .nav-links { display: none; }
  .menu-toggle { display: grid; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px 20px;
  }
  .nav-links.open a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-links.open a:last-child { border-bottom: 0; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-size: .95rem;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0d12;
}
.btn-primary:hover { color: #0b0d12; filter: brightness(1.05); }
.btn-secondary {
  background: var(--surface); color: var(--text); border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }

/* Hero */
.hero {
  padding: 80px 0 60px;
  background:
    radial-gradient(800px 400px at 80% -10%, rgba(255,176,31,.18), transparent 60%),
    radial-gradient(600px 300px at 0% 0%, rgba(255,138,31,.10), transparent 60%);
}
.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
}
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: .82rem; margin-bottom: 18px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 560px; }
.cta-row { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px;
  padding: 24px; box-shadow: var(--shadow);
}
.hero-card .product-shelf {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.product-tile {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
}
.product-tile .price { color: var(--accent); font-weight: 700; }
.product-tile h4 { margin: 0 0 6px; font-size: 1rem; }
.product-tile small { color: var(--muted); }

/* Sections */
section { padding: 64px 0; }
.section-title { text-align: center; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--muted); max-width: 680px; margin: 0 auto 40px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; text-align: center;
}
.stat .num { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.stat .lbl { color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* Cards / Features */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 920px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card .ico {
  width: 42px; height: 42px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-2));
  display: grid; place-items: center; margin-bottom: 14px;
  color: var(--accent);
}
.card h3 { margin-bottom: 6px; }
.card p { color: var(--muted); margin: 0; }

/* Pricing */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
@media (max-width: 920px) { .tiers { grid-template-columns: 1fr; } }
.tier {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
  display: flex; flex-direction: column;
}
.tier.popular { border-color: var(--accent); position: relative; }
.tier.popular::before {
  content: "Популярный"; position: absolute; top: -12px; right: 20px;
  background: var(--accent); color: #0b0d12; font-weight: 700; font-size: .75rem;
  padding: 4px 10px; border-radius: 999px;
}
.tier h3 { font-size: 1.3rem; }
.tier .price { font-size: 2.2rem; font-weight: 800; margin: 6px 0 4px; }
.tier .price small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.tier ul { list-style: none; padding: 0; margin: 18px 0 24px; flex-grow: 1; }
.tier ul li { padding: 8px 0; border-bottom: 1px dashed var(--border); color: var(--muted); display: flex; gap: 8px; }
.tier ul li::before { content: "✓"; color: var(--success); font-weight: 700; }
.tier ul li:last-child { border-bottom: 0; }

/* Compare table */
.table-wrap { overflow-x: auto; margin-top: 32px; }
table.compare {
  width: 100%; border-collapse: collapse; min-width: 600px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
table.compare th, table.compare td {
  padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border);
}
table.compare th { background: var(--surface-2); font-weight: 600; }
table.compare tr:last-child td { border-bottom: 0; }

/* CTA strip */
.cta-strip {
  margin-top: 48px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), var(--surface));
  border: 1px solid var(--border);
  border-radius: 18px; padding: 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
@media (max-width: 720px) { .cta-strip { flex-direction: column; text-align: center; } }
.cta-strip h3 { margin: 0 0 6px; }
.cta-strip p { margin: 0; color: var(--muted); }

/* Docs */
.doc-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
@media (max-width: 880px) { .doc-layout { grid-template-columns: 1fr; } }
.doc-aside {
  position: sticky; top: 80px; align-self: start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.doc-aside h4 { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 12px 0 6px; }
.doc-aside h4:first-child { margin-top: 0; }
.doc-aside a { display: block; padding: 6px 0; color: var(--text); font-size: .94rem; }
.doc-aside a:hover { color: var(--accent); }
.doc-content h2 { margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--border); }
.doc-content h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.doc-content code, .doc-content pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.doc-content code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.doc-content pre { background: var(--surface); border: 1px solid var(--border); padding: 16px; border-radius: var(--radius); overflow-x: auto; }

/* Blog */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 880px) { .posts { grid-template-columns: 1fr; } }
.post {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.post .thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--surface-2), var(--surface)); display: grid; place-items: center; color: var(--muted); font-size: 2rem; }
.post .body { padding: 20px; }
.post h3 { margin-bottom: 6px; }
.post .meta { color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.post p { color: var(--muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: .92rem; }
.form-control {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: .95rem; transition: border-color .15s ease;
}
.form-control:focus { outline: none; border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 130px; }
.contact-info {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.contact-info dl { margin: 0; }
.contact-info dt { color: var(--muted); font-size: .85rem; margin-top: 14px; }
.contact-info dt:first-child { margin-top: 0; }
.contact-info dd { margin: 4px 0 0; font-weight: 500; }

/* Legal pages */
.legal { max-width: 820px; margin: 0 auto; }
.legal h2 { margin-top: 36px; }
.legal h3 { margin-top: 22px; color: var(--text); }
.legal p, .legal li { color: var(--muted); }
.legal ul, .legal ol { padding-left: 22px; }

/* Footer */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  margin-top: 80px; padding: 48px 0 24px;
}
.foot-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 28px; margin-bottom: 32px;
}
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid h4 { font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.foot-grid a { display: block; color: var(--text); padding: 4px 0; font-size: .94rem; }
.foot-grid a:hover { color: var(--accent); }
.foot-legal {
  border-top: 1px solid var(--border); padding-top: 20px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--muted); font-size: .88rem;
}
.foot-legal address { font-style: normal; color: var(--muted); }

/* Cookie banner */
.cookie {
  position: fixed; bottom: 16px; left: 16px; right: 16px;
  max-width: 640px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow);
  display: flex; gap: 16px; align-items: center; z-index: 100;
}
@media (max-width: 600px) { .cookie { flex-direction: column; align-items: stretch; } }
.cookie p { margin: 0; font-size: .9rem; color: var(--muted); }
.cookie .actions { display: flex; gap: 8px; flex-shrink: 0; }
.hidden { display: none !important; }
