:root {
  --red: #DC2626;
  --red-hover: #EF4444;
  --red-dark: #991B1B;
  --red-subtle: rgba(220, 38, 38, 0.08);
  --red-border: rgba(220, 38, 38, 0.2);
  --black: #09090B;
  --surface: #111113;
  --surface-2: #18181B;
  --surface-3: #1F1F23;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --green: #22C55E;
  --amber: #F59E0B;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }

.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, black 10%, transparent 70%);
}
.bg-glow {
  position: fixed; top: -20%; left: 50%; transform: translateX(-50%);
  width: 80vw; height: 80vh; max-width: 900px;
  background: radial-gradient(closest-side, rgba(220,38,38,0.15), transparent 70%);
  pointer-events: none; z-index: 0;
  filter: blur(40px);
}

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

.header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  background: rgba(9,9,11,0.72);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.01em;
}
.brand-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 14px rgba(220,38,38,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.brand-text { color: var(--text); }
.support-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500;
  transition: all .2s ease;
}
.support-btn:hover { background: var(--surface-3); border-color: var(--border-hover); transform: translateY(-1px); }
.support-btn svg { color: var(--red); }

.main { padding: 48px 0 80px; }

.hero {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(17,17,19,0.4) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.03);
  margin-bottom: 40px;
}
.hero-title { font-size: clamp(28px, 5vw, 40px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.hero-title .accent { color: var(--red); }
.hero-sub { color: var(--text-secondary); font-size: 16px; max-width: 480px; margin-bottom: 28px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.25);
  color: var(--green); padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 500; margin-bottom: 20px;
}
.status-pill.inactive { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.25); color: var(--amber); }
.status-pill.expired { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.25); color: var(--red-hover); }
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent);
  animation: pulse 2s ease infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  min-width: 0;
}
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; font-weight: 600; }
.stat-value { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.stat-foot { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.hero-skel .skel-pill, .hero-skel .skel-title, .hero-skel .skel-stat {
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--radius-sm);
}
.skel-pill { width: 90px; height: 24px; border-radius: 999px; margin-bottom: 20px; }
.skel-title { width: 70%; height: 44px; margin-bottom: 28px; }
.skel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.skel-stat { height: 80px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.hero-error .hero-title { color: var(--red-hover); }

.section { margin: 40px 0; }
.section-head { margin-bottom: 20px; }
.section-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.section-sub { color: var(--text-secondary); font-size: 14px; }

.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 20px;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1; min-width: fit-content;
  padding: 10px 16px; border: none; background: transparent;
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  border-radius: 8px; cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: var(--surface-3); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.apps-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.apps-grid { grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 960px) { .apps-grid { grid-template-columns: 1fr 1fr; } }

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex; flex-direction: column; gap: 18px;
  transition: all .2s ease;
  position: relative; overflow: hidden;
}
.app-card.featured { border-color: var(--red-border); background: linear-gradient(180deg, var(--surface) 0%, rgba(220,38,38,0.02) 100%); }
.app-card.featured::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 160px; height: 160px;
  background: radial-gradient(closest-side, var(--red-subtle), transparent);
  pointer-events: none;
}
.app-card:hover { border-color: var(--border-hover); }
.app-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.app-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--surface-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: var(--text);
  flex-shrink: 0;
}
.app-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.app-badge {
  display: inline-block; margin-left: 8px;
  font-size: 11px; font-weight: 600; color: var(--red);
  background: var(--red-subtle); border: 1px solid var(--red-border);
  padding: 2px 8px; border-radius: 999px; vertical-align: middle;
}

.app-steps { display: flex; flex-direction: column; gap: 18px; }
.app-step { display: flex; gap: 14px; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--red-subtle); border: 1px solid var(--red-border);
  color: var(--red); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-body { flex: 1; min-width: 0; }
.step-title { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.step-desc { color: var(--text-secondary); font-size: 13px; line-height: 1.55; margin-bottom: 10px; }
.step-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer; transition: all .15s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--red); color: white;
  box-shadow: 0 4px 14px rgba(220,38,38,0.35);
}
.btn-primary:hover { background: var(--red-hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(220,38,38,0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface-2); color: var(--text); border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-hover); }
.btn svg { width: 16px; height: 16px; }
.btn.copied { background: var(--green) !important; color: white; border-color: var(--green); box-shadow: 0 4px 14px rgba(34,197,94,0.35); }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: all .2s ease;
}
.faq-item[open] { background: var(--surface-2); border-color: var(--border-hover); }
.faq-item summary {
  cursor: pointer; font-weight: 600; font-size: 15px;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::after {
  content: '+'; color: var(--red); font-size: 20px; font-weight: 300;
  transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { margin-top: 10px; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.faq-item code { background: var(--surface-3); padding: 1px 6px; border-radius: 4px; font-size: 12px; font-family: ui-monospace, monospace; }

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 40px;
}
.footer-inner { display: flex; flex-direction: column; gap: 16px; }
.footer-main { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { transition: color .15s ease; }
.footer-links a:hover { color: var(--text); }
.footer-legal { font-size: 11px; color: var(--text-muted); line-height: 1.6; max-width: 780px; opacity: 0.7; }

/* ─── Home (sub.r3xy.ru root) ─────────────────────────────── */
.header-nav { display: none; gap: 24px; margin: 0 auto 0 40px; }
@media (min-width: 760px) { .header-nav { display: flex; } }
.nav-link { font-size: 14px; color: var(--text-secondary); transition: color .15s; }
.nav-link:hover { color: var(--text); }

.home-hero { padding: 80px 0 60px; text-align: center; }
@media (min-width: 760px) { .home-hero { padding: 120px 0 80px; } }
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.2);
  color: var(--green); font-size: 12px; font-weight: 500;
  margin-bottom: 24px;
}
.hero-tag-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
  animation: pulse 2s ease infinite;
}
.home-title {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 20px;
}
.home-lead {
  color: var(--text-secondary);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
  max-width: 620px;
  margin: 0 auto 36px;
}
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-hover); }
.btn-full { width: 100%; }
.hero-note { color: var(--text-muted); font-size: 13px; }
.hero-note b { color: var(--text); }

.features { padding: 40px 0 60px; }
.features-grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .features-grid { grid-template-columns: repeat(4, 1fr); } }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: left;
  transition: border-color .2s, transform .2s;
}
.feature:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.feature-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--red-subtle); border: 1px solid var(--red-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--red); margin-bottom: 14px;
}
.feature-icon svg { width: 20px; height: 20px; }
.feature-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.feature-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }

.tariffs { padding: 80px 0; scroll-margin-top: 80px; }
.section-head-center { text-align: center; max-width: 600px; margin: 0 auto 40px; }
.section-title-lg { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.section-sub { color: var(--text-secondary); font-size: 15px; line-height: 1.55; }

.pricing-grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .pricing-grid { grid-template-columns: repeat(4, 1fr); } }
.pricing-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  display: flex; flex-direction: column; gap: 16px;
  transition: all .2s ease;
}
.pricing-card:hover { border-color: var(--border-hover); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pricing-popular {
  border-color: var(--red-border);
  background: linear-gradient(180deg, rgba(220,38,38,0.04), var(--surface) 80%);
  box-shadow: 0 0 0 1px var(--red-border), 0 20px 50px rgba(220,38,38,0.1);
}
.pricing-popular:hover { transform: translateY(-6px); box-shadow: 0 0 0 1px var(--red-border), 0 30px 60px rgba(220,38,38,0.15); }
.pricing-best { border-color: rgba(255,255,255,0.12); }

.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--red); color: white;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(220,38,38,0.4);
}
.pricing-badge-best {
  background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1f2937;
  box-shadow: 0 4px 14px rgba(251,191,36,0.3);
}

.pricing-period { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.pricing-price-wrap { display: flex; align-items: baseline; gap: 4px; }
.pricing-price { font-size: 42px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.pricing-currency { font-size: 22px; font-weight: 600; color: var(--text-secondary); }
.pricing-permo { font-size: 13px; color: var(--text-muted); }

.pricing-perks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.pricing-perks li {
  font-size: 13px; color: var(--text-secondary);
  padding-left: 22px; position: relative;
}
.pricing-perks li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  color: var(--green); font-weight: 700;
}

.tariffs-notice {
  margin-top: 28px;
  padding: 14px 18px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  max-width: 620px; margin-left: auto; margin-right: auto;
}
.tariffs-notice svg { color: var(--amber); flex-shrink: 0; }
.tariffs-notice a { color: var(--red-hover); border-bottom: 1px solid var(--red-border); }
.tariffs-notice a:hover { border-bottom-color: var(--red); }

.btn-disabled {
  background: var(--surface-2); color: var(--text-muted);
  border: 1px dashed var(--border);
  cursor: not-allowed;
  opacity: 0.7;
}
.btn-disabled:hover { background: var(--surface-2); transform: none; }

.how { padding: 60px 0; scroll-margin-top: 80px; }
.how-steps {
  display: flex; flex-direction: column; gap: 20px; align-items: stretch;
  max-width: 760px; margin: 0 auto;
}
@media (min-width: 900px) {
  .how-steps { flex-direction: row; gap: 12px; align-items: center; }
}
.how-step {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  flex: 1;
}
.how-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--red); color: white; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(220,38,38,0.3);
}
.how-content { flex: 1; min-width: 0; }
.how-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.how-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.how-arrow { color: var(--text-muted); display: flex; justify-content: center; }
.how-arrow svg { width: 22px; height: 22px; }
@media (max-width: 899px) {
  .how-arrow svg { transform: rotate(90deg); }
}

.faq-section { padding: 60px 0; scroll-margin-top: 80px; }
.faq-list { max-width: 760px; margin: 0 auto; }

.cta-band { padding: 40px 0 80px; }
.cta-band-inner {
  background: linear-gradient(135deg, rgba(220,38,38,0.08), rgba(17,17,19,0.8));
  border: 1px solid var(--red-border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex; flex-direction: column; gap: 20px;
  align-items: flex-start;
}
@media (min-width: 640px) {
  .cta-band-inner { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
}
.cta-band-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.cta-band-desc { color: var(--text-secondary); font-size: 14px; }

/* ─── Docs pages ──────────────────────────────────────────── */
.doc { max-width: 760px; padding-top: 32px; }
.doc h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.doc .meta { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.doc h2 { font-size: 18px; font-weight: 700; color: var(--text); margin: 28px 0 10px; }
.doc p, .doc ul { color: var(--text-secondary); font-size: 15px; line-height: 1.7; margin-bottom: 10px; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 4px; }
.doc a { color: var(--red-hover); border-bottom: 1px solid var(--red-border); }
.doc a:hover { border-bottom-color: var(--red); }
.doc code { background: var(--surface-3); padding: 1px 6px; border-radius: 4px; font-size: 13px; font-family: ui-monospace, monospace; }

@media (max-width: 640px) {
  .main { padding: 24px 0 60px; }
  .hero { padding: 28px 20px; border-radius: 12px; }
  .stats { grid-template-columns: 1fr; gap: 10px; }
  .skel-stats { grid-template-columns: 1fr; }
  .section { margin: 32px 0; }
  .section-title { font-size: 20px; }
}
