:root {
  --bg: #0a0e14;
  --bg-alt: #0e131b;
  --panel: #10161f;
  --text: #e6ebf1;
  --muted: #7d8a9b;
  --line: rgba(255,255,255,0.08);
  --accent: #3ddc97;
  --accent-2: #4d9fff;
  --accent-soft: rgba(61,220,151,0.12);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 12px;
  --ease: cubic-bezier(.22,1,.36,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

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

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 28px; }

a { color: inherit; }

/* grid backdrop */
.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(61,220,151,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61,220,151,0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10,14,20,0.78);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 16.5px; letter-spacing: -0.01em; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-block;
}
.nav { display: flex; gap: 28px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s var(--ease); }
.nav a:hover, .nav a.active { color: var(--text); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(61,220,151,0.3);
  padding: 8px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
  text-decoration: none; transition: background .2s var(--ease);
}
.nav-cta:hover { background: rgba(61,220,151,0.2); }

main { position: relative; z-index: 1; }

/* hero */
.hero { padding: 96px 0 72px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; color: var(--accent);
  background: var(--accent-soft); border: 1px solid rgba(61,220,151,0.25);
  padding: 5px 12px; border-radius: 20px; margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px 1px var(--accent); }
h1 { font-size: 46px; line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 20px; max-width: 680px; }
h1 .grad { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 17px; color: var(--muted); max-width: 560px; margin: 0 0 34px; }
.hero-actions { display: flex; gap: 14px; margin-bottom: 56px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 9px; font-size: 14.5px; font-weight: 600;
  text-decoration: none; transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #06110c; }
.btn-primary:hover { opacity: .92; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: rgba(255,255,255,0.22); }

.code-window {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  max-width: 620px; overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.6);
}
.code-window .bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.code-window .dot { width: 10px; height: 10px; border-radius: 50%; background: #3a4250; }
.code-window pre { margin: 0; padding: 18px 20px; font-family: var(--mono); font-size: 13px; line-height: 1.7; overflow-x: auto; }
.tok-key { color: #7dd3fc; } .tok-str { color: #86efac; } .tok-com { color: #6b7484; } .tok-num { color: #fbbf24; }

/* sections */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 560px; margin-bottom: 40px; }
.section-head h2 { font-size: 28px; letter-spacing: -0.01em; margin: 0 0 12px; }
.section-head p { color: var(--muted); margin: 0; font-size: 15px; }

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

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
}
.card .icon { width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.card h3 { font-size: 16px; margin: 0 0 8px; }
.card p { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.6; }

.stat-row { display: flex; gap: 48px; flex-wrap: wrap; }
.stat b { display: block; font-size: 30px; font-family: var(--mono); color: var(--text); }
.stat span { font-size: 13px; color: var(--muted); }

table.endpoints { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.endpoints th { text-align: left; color: var(--muted); font-weight: 500; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.endpoints td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); }
.method { padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.method.get { background: rgba(77,159,255,0.15); color: #7db8ff; }
.method.post { background: rgba(61,220,151,0.15); color: var(--accent); }
.status-ok { color: var(--accent); }

.badge-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.badge { font-family: var(--mono); font-size: 12px; background: var(--panel); border: 1px solid var(--line); padding: 4px 10px; border-radius: 6px; color: var(--muted); }

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; }
.plan.featured { border-color: rgba(61,220,151,0.4); box-shadow: 0 0 0 1px rgba(61,220,151,0.15), 0 20px 50px -25px rgba(61,220,151,0.3); position: relative; }
.plan.featured::before { content: "Популярный"; position: absolute; top: -11px; left: 24px; background: var(--accent); color: #06110c; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.plan h3 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 6px 0 4px; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
.plan .price { font-size: 32px; font-weight: 700; margin: 4px 0 18px; }
.plan .price span { font-size: 14px; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 10px; }
.plan li { font-size: 13.5px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.plan li::before { content: "✓"; color: var(--accent); flex-shrink: 0; }

.post-list { display: flex; flex-direction: column; gap: 0; }
.post { padding: 26px 0; border-bottom: 1px solid var(--line); display: flex; gap: 24px; }
.post:first-child { padding-top: 0; }
.post .date { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 90px; flex-shrink: 0; padding-top: 3px; }
.post h3 { font-size: 17px; margin: 0 0 8px; }
.post p { font-size: 14px; color: var(--muted); margin: 0; max-width: 560px; }
.post .tag { font-family: var(--mono); font-size: 11px; color: var(--accent-2); margin-left: 10px; }

.map-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.region-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.region-row:last-child { border-bottom: none; }
.region-row .dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px 1px var(--accent); display: inline-block; margin-right: 10px; }
.region-lat { font-family: var(--mono); color: var(--muted); font-size: 12.5px; }

.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

@media (max-width: 760px) {
  .nav { display: none; }
  h1 { font-size: 32px; }
  .grid-3, .pricing-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .post { flex-direction: column; gap: 6px; }
  .post .date { width: auto; }
}

/* --- decor: ambient blobs --- */
.blob-field { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .22; will-change: transform; }
.blob-a { width: 420px; height: 420px; top: -120px; left: -80px; background: var(--accent); animation: drift1 22s ease-in-out infinite; }
.blob-b { width: 360px; height: 360px; top: 220px; right: -120px; background: var(--accent-2); animation: drift2 26s ease-in-out infinite; }
.blob-c { width: 300px; height: 300px; top: 640px; left: 30%; background: var(--accent); opacity: .14; animation: drift1 30s ease-in-out infinite reverse; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px,30px) scale(1.08); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-30px,40px) scale(0.94); } }

/* --- reveal-on-scroll --- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1); }
.reveal.in-view { opacity: 1; transform: none; }
.reveal-stagger.in-view > * { animation: none; }
.reveal-stagger > * { opacity: 0; transform: translateY(14px); transition: opacity .6s cubic-bezier(.22,1,.36,1), transform .6s cubic-bezier(.22,1,.36,1); }
.reveal-stagger.in-view > *:nth-child(1) { transition-delay: .02s; }
.reveal-stagger.in-view > *:nth-child(2) { transition-delay: .08s; }
.reveal-stagger.in-view > *:nth-child(3) { transition-delay: .14s; }
.reveal-stagger.in-view > *:nth-child(4) { transition-delay: .2s; }
.reveal-stagger.in-view > *:nth-child(5) { transition-delay: .26s; }
.reveal-stagger.in-view > *:nth-child(6) { transition-delay: .32s; }
.reveal-stagger.in-view > * { opacity: 1; transform: none; }

/* --- card hover lift --- */
.card { transition: transform .25s cubic-bezier(.22,1,.36,1), border-color .25s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); border-color: rgba(61,220,151,0.3); box-shadow: 0 16px 40px -20px rgba(61,220,151,0.25); }

/* --- live dot pulse --- */
@keyframes pulse-dot { 0%,100% { box-shadow: 0 0 6px 1px var(--accent); } 50% { box-shadow: 0 0 12px 4px var(--accent); } }
.dot-live, .eyebrow::before { animation: pulse-dot 2.2s ease-in-out infinite; }

/* --- blinking terminal cursor in code window --- */
.code-window pre::after { content: "▌"; color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- animated counters --- */
.stat b, .plan .price { font-variant-numeric: tabular-nums; }

/* --- modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6,8,12,0.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  max-width: 420px; width: 100%; padding: 30px; position: relative;
  transform: translateY(14px) scale(.98); transition: transform .3s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.6);
}
.modal-overlay.open .modal-panel { transform: translateY(0) scale(1); }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-panel h3 { margin: 0 0 8px; font-size: 20px; }
.modal-panel p.modal-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }
.modal-panel label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-family: var(--mono); }
.modal-panel input, .modal-panel select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 10px 12px; font-size: 14px; margin-bottom: 16px; font-family: inherit;
}
.modal-panel input:focus, .modal-panel select:focus { outline: none; border-color: var(--accent); }
.modal-panel .btn { width: 100%; justify-content: center; border: none; cursor: pointer; font-family: inherit; }
.modal-success { display: none; text-align: center; }
.modal-success.show { display: block; }
.modal-success .check { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 22px; }
.modal-key { font-family: var(--mono); background: var(--bg); border: 1px dashed var(--line); border-radius: 8px; padding: 12px 14px; font-size: 13px; color: var(--accent); margin: 14px 0; word-break: break-all; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-key button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 4px 9px; font-size: 11.5px; cursor: pointer; flex-shrink: 0; }
.modal-key button:hover { color: var(--text); border-color: var(--accent); }
.form-step, .success-step { display: block; }
.success-step { display: none; }
.modal-panel.success .form-step { display: none; }
.modal-panel.success .success-step { display: block; }

@media (prefers-reduced-motion: reduce) {
  .blob, .dot-live, .eyebrow::before, .code-window pre::after { animation: none !important; }
  .reveal, .reveal-stagger > * { transition: none !important; opacity: 1 !important; transform: none !important; }
}
