:root {
  --bg: #0b0d12;
  --panel: rgba(22, 26, 35, 0.7);
  --panel-2: #1b202b;
  --text: #eef1f7;
  --muted: #97a1b4;
  --accent: #5b8cff;
  --accent-2: #35c28e;
  --grad: linear-gradient(135deg, #5b8cff 0%, #7a6cff 100%);
  --grad-2: linear-gradient(135deg, #35c28e 0%, #2fb3d6 100%);
  --border: #252b39;
  --radius: 18px;
  --radius-sm: 11px;
  --maxw: 1020px;
  --shadow: 0 14px 46px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 560px at 88% -12%, rgba(122, 108, 255, 0.16), transparent 60%),
    radial-gradient(900px 520px at -8% 4%, rgba(53, 194, 142, 0.12), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 28px); }

/* ── Header ─────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 0;
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; box-shadow: 0 6px 16px rgba(91, 140, 255, 0.4);
}
.logo-mark svg { width: 18px; height: 18px; }
.nav-links { display: flex; gap: 8px; align-items: center; }

/* ── Typography ─────────────────────────────────────── */
h1 {
  font-size: clamp(30px, 6.4vw, 50px); letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 14px;
  background: linear-gradient(180deg, #fff, #c4cee4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2 { font-size: clamp(19px, 3.6vw, 24px); letter-spacing: -0.02em; margin: 30px 0 12px; }
.muted { color: var(--muted); }
.lead { font-size: clamp(16px, 2.4vw, 19px); color: var(--muted); max-width: 60ch; }

/* ── Hero ───────────────────────────────────────────── */
.hero { padding: clamp(40px, 8vw, 76px) 0 clamp(24px, 4vw, 40px); }
.badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(91, 140, 255, 0.12); color: #b9c8ff; border: 1px solid rgba(91, 140, 255, 0.28);
}
.badge svg { width: 15px; height: 15px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

/* ── Features ───────────────────────────────────────── */
.features { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-top: 40px; }
.feature {
  padding: 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); backdrop-filter: blur(8px); display: flex; gap: 13px; align-items: flex-start;
}
.ficon {
  flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(91, 140, 255, 0.14); color: var(--accent);
}
.ficon svg { width: 20px; height: 20px; }
.feature .ft { font-weight: 600; font-size: 14px; }

/* ── Panels / cards ─────────────────────────────────── */
.panel {
  background: var(--panel); backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(16px, 3vw, 22px); box-shadow: var(--shadow);
}
.card-link {
  display: block; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); backdrop-filter: blur(8px); color: var(--text); box-shadow: var(--shadow);
  transition: transform 0.16s, border-color 0.16s;
}
.card-link:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card-link .t { font-weight: 700; font-size: 17px; }
.card-link .d { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ── Dropzone ───────────────────────────────────────── */
.dropzone { border: 1.5px dashed #38405400; outline: 1.5px dashed var(--border); outline-offset: -1.5px;
  transition: outline-color 0.16s, background 0.16s; text-align: center; }
.dropzone:hover { outline-color: var(--accent); background: rgba(91, 140, 255, 0.04); }
.dz-icon { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(91, 140, 255, 0.14); color: var(--accent); }
.dz-icon svg { width: 24px; height: 24px; }

/* ── Forms ──────────────────────────────────────────── */
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 500; }
input[type="text"], input[type="email"], input[type="url"], select {
  width: 100%; min-height: 46px; padding: 11px 13px; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.22); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="color"] { width: 52px; height: 40px; border: none; background: none; padding: 0; cursor: pointer; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 20px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: transform 0.12s, filter 0.12s, box-shadow 0.12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--grad); border: none; color: #fff; box-shadow: 0 8px 22px rgba(91, 140, 255, 0.38); }
.btn.success { background: var(--grad-2); border: none; color: #04231a; box-shadow: 0 8px 22px rgba(53, 194, 142, 0.32); }
.btn.lg { min-height: 54px; padding: 15px 26px; font-size: 16px; border-radius: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Chips (popular conversions) ────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-size: 14px; font-weight: 600;
}
.chip:hover { border-color: var(--accent); text-decoration: none; color: #fff; }
.chip svg { width: 13px; height: 13px; color: var(--muted); }

/* ── Misc ───────────────────────────────────────────── */
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > div { flex: 1 1 auto; }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: rgba(91, 140, 255, 0.16); color: #9db8ff; border: 1px solid rgba(91, 140, 255, 0.3); white-space: nowrap; }
.pill.paid { background: rgba(53, 194, 142, 0.16); color: #6fe0b6; border-color: rgba(53, 194, 142, 0.3); }
.preview { background: #fff; color: #111; border-radius: var(--radius-sm); padding: 20px; min-height: 120px; overflow: auto; }
.note { font-size: 13px; color: var(--muted); }
.toast { margin-top: 10px; font-size: 14px; min-height: 20px; }
.toast.ok { color: var(--accent-2); }
.toast.err { color: #ff6b6b; }
article p { max-width: 72ch; }

/* ── Footer ─────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); margin-top: 56px; padding: 28px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .cols { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer .langlist { display: flex; flex-wrap: wrap; gap: 6px 12px; max-width: 620px; }
.site-footer .langlist a { color: var(--muted); }

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 720px) {
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .row { gap: 10px; }
  .row > div { flex: 1 1 100%; }
  .btn { width: 100%; }
  .row .btn, .cta-row .btn { width: auto; }
  .cta-row .btn { flex: 1 1 auto; }
}

[dir="rtl"] .row, [dir="rtl"] .chips, [dir="rtl"] .cta-row { direction: rtl; }
[dir="rtl"] .badge svg { transform: scaleX(-1); }

/* ── Telegram funnel: floating button + post-conversion CTA ──────────── */
.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  background: var(--grad-2); color: #04231a; font-weight: 700; font-size: 15px;
  box-shadow: 0 12px 28px rgba(53, 194, 142, 0.45); text-decoration: none;
  transition: transform 0.12s, filter 0.12s;
}
.fab:hover { text-decoration: none; transform: translateY(-2px); filter: brightness(1.05); }
.fab svg { width: 18px; height: 18px; }
.postcta {
  display: none; margin-top: 16px; padding: 18px;
  border: 1px solid rgba(53, 194, 142, 0.5); border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(53, 194, 142, 0.14), rgba(47, 179, 214, 0.1));
}
@media (max-width: 640px) { .fab { right: 12px; bottom: 12px; padding: 10px 15px; font-size: 14px; } }
[dir="rtl"] .fab { right: auto; left: 18px; }

/* ── Motion & graphics: aurora background, entrance, hover polish ────── */
/* Контент над фоном (иначе fixed-псевдоэлементы с z-index:-1 прячутся за canvas) */
main, .site-footer { position: relative; z-index: 1; }
body::before, body::after {
  content: ""; position: fixed; z-index: 0; pointer-events: none;
  width: 65vmax; height: 65vmax; border-radius: 50%; filter: blur(90px); opacity: 0.32;
  will-change: transform;
}
body::before { top: -22vmax; right: -12vmax; background: radial-gradient(circle, #6b8cff, transparent 68%); animation: drift1 36s ease-in-out infinite alternate; }
body::after  { bottom: -26vmax; left: -16vmax; background: radial-gradient(circle, #35c28e, transparent 68%); animation: drift2 44s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-9vmax, 11vmax) scale(1.18); } }
@keyframes drift2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(11vmax, -9vmax) scale(1.22); } }

/* Entrance on load (above the fold) */
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.hero .badge, .hero h1, .hero .lead, .hero .cta-row, .features { animation: riseIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero h1 { animation-delay: 0.04s; }
.hero .lead { animation-delay: 0.09s; }
.hero .cta-row { animation-delay: 0.14s; }
.features { animation-delay: 0.2s; }

/* Scroll-reveal (below the fold — anim.js tags only off-screen elements) */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }

/* Hover polish */
.card-link::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity 0.3s; box-shadow: 0 0 0 1px rgba(91, 140, 255, 0.45), 0 18px 50px rgba(91, 140, 255, 0.18);
}
.card-link:hover::after { opacity: 1; }
.ficon, .dz-icon, .logo-mark { transition: transform 0.25s ease; }
.card-link:hover .ficon, .feature:hover .ficon { transform: translateY(-2px) scale(1.05); }
.dropzone:hover .dz-icon { transform: translateY(-3px); }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.05); }

/* Shine sweep on gradient buttons (hover) */
.btn.primary, .btn.success { position: relative; overflow: hidden; }
.btn.primary::after, .btn.success::after {
  content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent); transform: skewX(-20deg);
}
.btn.primary:hover::after, .btn.success:hover::after { animation: shimmer 0.85s ease; }
@keyframes shimmer { to { left: 130%; } }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
  .hero .badge, .hero h1, .hero .lead, .hero .cta-row, .features { animation: none; }
  .reveal, .reveal.in { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn.primary::after, .btn.success::after { display: none; }
}
