/* BigDataWeb Storage — общая тема */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-code: #0f1420;
  --surface: #ffffff;
  --border: #e3e6ea;
  --border-strong: #d0d5dc;
  --text: #14181f;
  --text-dim: #5b6472;
  --text-faint: #8b95a3;
  --accent: #1f6feb;
  --accent-soft: rgba(31, 111, 235, .1);
  --ok: #17845a;
  --ok-soft: rgba(23, 132, 90, .12);
  --warn: #b06a00;
  --warn-soft: rgba(176, 106, 0, .12);
  --radius: 10px;
  --radius-lg: 16px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f14;
    --bg-soft: #12161d;
    --bg-code: #0a0d13;
    --surface: #12161d;
    --border: #222834;
    --border-strong: #2e3644;
    --text: #e7ebf1;
    --text-dim: #9aa5b4;
    --text-faint: #6c7787;
    --accent: #4d90ff;
    --accent-soft: rgba(77, 144, 255, .14);
    --ok: #35c48c;
    --ok-soft: rgba(53, 196, 140, .14);
    --warn: #e0a33a;
    --warn-soft: rgba(224, 163, 58, .14);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img, svg { max-width: 100%; }

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

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 62px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--text);
  font-size: 16px;
  flex: 0 0 auto;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: linear-gradient(140deg, var(--accent), #7a4dff);
  display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 700; font-family: var(--mono);
}
.logo span.dim { color: var(--text-faint); font-weight: 500; }

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  font-size: 14.5px;
}
.nav a { color: var(--text-dim); }
.nav a:hover, .nav a.active { color: var(--text); text-decoration: none; }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; }
.nav a.btn-ghost { color: var(--text); }
.nav button.btn { font-family: inherit; }
.nav button.btn-coffee, .nav button.btn-coffee:hover { color: #fff; text-decoration: none; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  cursor: pointer;
}

@media (max-width: 820px) {
  .nav {
    display: none;
    position: absolute;
    top: 62px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 6px 20px 14px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 0; border-bottom: 1px solid var(--border); }
  .nav a:last-child { border-bottom: 0; }
  .nav .btn, .nav button.btn { margin-top: 12px; text-align: center; width: 100%; }
  .nav-toggle { display: block; }
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s, transform .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: .9; }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-coffee {
  background: linear-gradient(135deg, #e0a045 0%, #c27830 55%, #a86428 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-coffee:hover {
  filter: brightness(1.07);
  box-shadow: 0 4px 14px rgba(194, 120, 48, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
  transform: translateY(-1px);
}

/* ---------- Секции ---------- */

section { padding: 74px 0; }
section.tight { padding: 52px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 14px;
}

h1, h2, h3 { letter-spacing: -.02em; line-height: 1.2; margin: 0 0 16px; }
h1 { font-size: clamp(30px, 5.2vw, 47px); font-weight: 680; }
h2 { font-size: clamp(23px, 3.4vw, 31px); font-weight: 650; }
h3 { font-size: 17px; font-weight: 620; }

.lead { font-size: clamp(16px, 2.2vw, 18.5px); color: var(--text-dim); margin: 0 0 28px; max-width: 60ch; }
p { margin: 0 0 16px; }
.muted { color: var(--text-dim); }
.small { font-size: 14px; }

/* ---------- Hero ---------- */

.hero { padding: 78px 0 64px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 46px;
  align-items: start;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero { padding: 46px 0 40px; }
  section { padding: 52px 0; }
}

.hero-grid > * { min-width: 0; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.fact-value { font-size: 22px; font-weight: 640; letter-spacing: -.02em; }
.fact-label { font-size: 13.5px; color: var(--text-faint); }

.fact-live .fact-value { font-variant-numeric: tabular-nums; }
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--ok);
  vertical-align: middle;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.85); }
}
.fact-live.is-stale .live-dot { background: var(--warn); animation: none; }
.fact-live.is-stale .fact-value { color: var(--text-dim); }

/* ---------- Код ---------- */

.code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  font-family: var(--mono);
  font-size: 12.5px;
  color: #7d8798;
}
.code-head .dot { width: 9px; height: 9px; border-radius: 50%; background: #2c3444; }
.code-head .name { margin-left: 6px; }
.code-head .copy {
  margin-left: auto;
  background: none; border: 1px solid #262e3c; color: #8894a6;
  border-radius: 6px; padding: 3px 9px; font-size: 12px; cursor: pointer;
  font-family: var(--mono);
}
.code-head .copy:hover { color: #cfd7e3; border-color: #384254; }
.code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.2px;
  line-height: 1.65;
  color: #cdd6e4;
}
.code pre .c { color: #5f6b7d; }
.code pre .k { color: #7aa2ff; }
.code pre .s { color: #7fd39b; }
.code pre .v { color: #e0b978; }

/* ---------- Карточки ---------- */

.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--text-dim); font-size: 15px; }
.card-ico {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 14px;
  font-family: var(--mono); font-size: 14px; font-weight: 700;
}

/* ---------- Таблицы ---------- */

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--text-dim); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; background: var(--bg-soft); }
tr:last-child td { border-bottom: 0; }
td code, p code, li code { font-family: var(--mono); font-size: 13px; background: var(--accent-soft); color: var(--accent); padding: 1.5px 6px; border-radius: 5px; }

/* ---------- Тарифы ---------- */

.price-value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.price-unit { font-size: 14px; color: var(--text-faint); font-weight: 400; }

/* ---------- FAQ ---------- */

.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 34px 18px 0;
  font-weight: 550;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 6px; top: 16px;
  color: var(--text-faint); font-size: 20px; font-weight: 400;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--text-dim); padding-bottom: 18px; margin: 0; max-width: 78ch; }

/* ---------- Статусы ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-family: var(--mono);
  padding: 4px 10px; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok);
}
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.status-row {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.status-row:last-child { border-bottom: 0; }
.status-row .nm { font-weight: 550; }
.status-row .rt { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--text-faint); }

.uptime-bars { display: flex; gap: 2px; margin-top: 14px; }
.uptime-bars i {
  flex: 1 1 auto; height: 26px; border-radius: 2px;
  background: var(--ok); opacity: .75;
}
.uptime-bars i.deg { background: var(--warn); }

/* ---------- Changelog ---------- */

.log-entry { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--border); }
.log-entry:last-child { border-bottom: 0; }
.log-date { font-family: var(--mono); font-size: 13.5px; color: var(--text-faint); padding-top: 3px; }
.log-body h3 { margin-bottom: 10px; }
.log-body ul { margin: 0; padding-left: 20px; color: var(--text-dim); }
.log-body li { margin-bottom: 6px; }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 11.5px;
  padding: 2px 8px; border-radius: 5px; border: 1px solid var(--border-strong);
  color: var(--text-dim); margin-bottom: 10px;
}
@media (max-width: 700px) {
  .log-entry { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Документация ---------- */

.docs-layout { display: grid; grid-template-columns: 220px 1fr; gap: 44px; align-items: start; padding: 42px 0 80px; }
.docs-nav { position: sticky; top: 86px; font-size: 14.5px; }
.docs-nav p { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); margin: 20px 0 8px; }
.docs-nav p:first-child { margin-top: 0; }
.docs-nav a { display: block; padding: 5px 0; color: var(--text-dim); }
.docs-nav a:hover { color: var(--text); text-decoration: none; }
.docs-body { min-width: 0; }
.docs-body h2 { margin-top: 44px; padding-top: 10px; }
.docs-body h2:first-child { margin-top: 0; }
.docs-body h3 { margin-top: 28px; }
.docs-body ul { color: var(--text-dim); padding-left: 20px; }
.docs-body .code { margin: 18px 0; }
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .docs-nav { position: static; display: none; }
}

/* ---------- CTA ---------- */

.cta-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 38px;
  display: flex; align-items: center; gap: 30px; flex-wrap: wrap;
}
.cta-box h2 { margin-bottom: 8px; }
.cta-box .grow { flex: 1 1 320px; }

/* ---------- Подвал ---------- */

.site-footer { border-top: 1px solid var(--border); padding: 44px 0 54px; color: var(--text-dim); font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin: 0 0 12px; font-weight: 600; }
.footer-grid a { display: block; color: var(--text-dim); padding: 4px 0; }
.footer-grid a:hover { color: var(--text); text-decoration: none; }
.footer-bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--text-faint); }
.footer-legal {
  margin-top: 28px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-dim);
}
.footer-legal p { margin: 0; }
.footer-legal strong { color: var(--text); font-weight: 600; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 16px 20px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .08);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.cookie-banner-text {
  flex: 1 1 280px;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}
.cookie-banner-text strong { color: var(--text); }
.cookie-banner-text code { font-size: .92em; }
.cookie-banner-actions { flex: 0 0 auto; }

/* ---------- Донат (криpto) ---------- */

body.donate-open { overflow: hidden; }

.donate-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  place-items: center;
  padding: 16px;
}
.donate-modal.is-open {
  display: grid;
}
.donate-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  border: none;
  padding: 0;
  cursor: pointer;
}
.donate-modal-panel {
  position: relative;
  z-index: 1;
  width: min(480px, calc(100vw - 32px));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .35);
  padding: 32px 28px 28px;
  outline: none;
}
.donate-modal-panel h2 { margin: 0 0 12px; font-size: 24px; }
.donate-modal-panel p { margin: 0 0 10px; line-height: 1.55; color: var(--text-dim); }
.donate-modal-panel p strong { color: var(--text); }
.donate-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-faint);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.donate-close:hover { background: var(--bg-soft); color: var(--text); }
.donate-wallet {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
  margin-top: 0;
}
.donate-pay {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 18px;
}
.donate-qr {
  flex: 0 0 auto;
  text-align: center;
}
.donate-qr img {
  display: block;
  width: 148px;
  height: 148px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px;
}
.donate-qr p { margin: 8px 0 0; max-width: 148px; }
.donate-pay-main { flex: 1 1 220px; min-width: 0; }
.donate-pay-main .donate-wallet { margin-top: 0; }

.compat-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.compat-badge.yes { background: var(--ok-soft); color: var(--ok); }
.compat-badge.part { background: var(--warn-soft); color: var(--warn); }
.compat-badge.no { background: color-mix(in srgb, var(--text-faint) 16%, transparent); color: var(--text-faint); }
.donate-addr {
  flex: 1 1 220px;
  word-break: break-all;
  padding: 11px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}

/* ---------- Форма ---------- */

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .form-row { grid-template-columns: 1fr; } }
label { display: block; font-size: 13.5px; color: var(--text-dim); margin-bottom: 6px; }
input, textarea, select {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 15px;
  color: var(--text); background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field { margin-bottom: 14px; }
.form-note { font-size: 13px; color: var(--text-faint); }
