/* ============================================================
   KV EXPERT — Дизайн-система сайта-витрины
   Тёмная "космическая" тема. Indigo → Purple → Pink.
   ============================================================ */

:root {
  /* Фон и поверхности */
  --bg: #050016;
  --surface: #0A0025;
  --surface-2: #0D0A20;
  --card: #131028;
  --card-hi: #1A1535;
  --line: rgba(139, 92, 246, 0.14);
  --line-soft: rgba(160, 174, 192, 0.10);

  /* Бренд */
  --indigo: #6366F1;
  --purple: #A855F7;
  --primary: #8B5CF6;
  --pink: #EC4899;

  /* Текст */
  --text: #FFFFFF;
  --text-2: #A0AEC0;
  --muted: #64748B;

  /* Статусы */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;

  /* Градиенты (управляются Tweaks через --g1/--g2/--g3) */
  --g1: #6366F1;
  --g2: #A855F7;
  --g3: #EC4899;
  --grad: linear-gradient(120deg, var(--g1), var(--g2) 52%, var(--g3));
  --grad-soft: linear-gradient(120deg, rgba(99,102,241,0.16), rgba(236,72,153,0.16));

  /* Скругления (Tweaks: --r-scale) */
  --r-scale: 1;
  --r-sm: calc(8px * var(--r-scale));
  --r-md: calc(12px * var(--r-scale));
  --r-lg: calc(16px * var(--r-scale));
  --r-xl: calc(24px * var(--r-scale));
  --r-pill: 100px;

  /* Плотность (Tweaks: --density) — множитель вертикальных отступов */
  --density: 1;
  --section-y: calc(48px * var(--density));

  /* Свечение (Tweaks: --glow 0..1) */
  --glow: 1;

  /* Типографика */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Контейнер */
  --maxw: 1200px;
  --pad: clamp(20px, 5vw, 64px);

  /* Тени / эффекты */
  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 24px 60px -24px rgba(0,0,0,0.7);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 17px;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Космический фон: радиальные glow + тонкая сетка */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 78% -4%, rgba(168,85,247,calc(0.20 * var(--glow))), transparent 60%),
    radial-gradient(48% 42% at 6% 8%, rgba(99,102,241,calc(0.16 * var(--glow))), transparent 62%),
    radial-gradient(54% 50% at 50% 108%, rgba(236,72,153,calc(0.12 * var(--glow))), transparent 60%),
    var(--bg);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(139,92,246,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent 85%);
          mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent 85%);
  opacity: 0.7;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: 4px 48px; position: relative; }
.section--tight { padding-block: 4px 34px; }

/* ---------- Type ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--primary);
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(139,92,246,0.06);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 12px var(--primary); }

h1, h2, h3 { line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; }
.display {
  font-size: clamp(40px, 6.6vw, 84px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.04em;
}
.h2 { font-size: clamp(30px, 4.2vw, 52px); font-weight: 750; }
.h3 { font-size: clamp(21px, 2vw, 27px); font-weight: 700; letter-spacing: -0.025em; }
.lead { font-size: clamp(17px, 1.5vw, 21px); color: var(--text-2); line-height: 1.6; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.mono { font-family: var(--mono); }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.section-head { max-width: 760px; margin-bottom: 34px; }
.section-head .h2 { margin-top: 18px; text-wrap: balance; }
.section-head .lead { margin-top: 18px; text-wrap: pretty; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  padding: 14px 26px; border-radius: var(--r-pill);
  border: 1px solid transparent; transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.btn .arr { transition: transform 0.25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn--primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 30px -8px rgba(168,85,247,calc(0.7 * var(--glow))), 0 0 0 1px rgba(255,255,255,0.06) inset;
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -10px rgba(168,85,247,calc(0.85 * var(--glow))); }
.btn--ghost {
  background: rgba(255,255,255,0.03); color: var(--text);
  border-color: var(--line);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover { background: rgba(139,92,246,0.10); border-color: var(--primary); transform: translateY(-2px); }
.btn--lg { padding: 17px 32px; font-size: 17px; }
.btn--sm { padding: 10px 18px; font-size: 14px; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.card--pad { padding: 30px; }
.card:hover { border-color: rgba(139,92,246,0.30); }

/* Иконка-чип с градиентной рамкой */
.chip {
  width: 52px; height: 52px; border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--grad-soft);
  border: 1px solid var(--line);
  color: #fff;
}
.chip i { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

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

/* ---------- Reveal animation ---------- */
/* Opacity is toggled STATICALLY (no transition) so content is always shown
   once revealed, even in environments that freeze CSS animation frames.
   Only the decorative slide is a keyframe — if frozen it merely sits 22px
   lower but stays fully visible. */
.reveal { opacity: 0; }
.reveal.in { opacity: 1; animation: revealSlide 0.7s var(--ease) both; }
@keyframes revealSlide {
  from { transform: translateY(22px); }
  to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; }
  .reveal.in { animation: none; }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(5,0,22,0.72);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom-color: var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 28px; height: 76px; padding: 2px clamp(20px, 5vw, 43px) 0; }

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand .logo-mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 6px 18px -6px rgba(168,85,247,calc(0.9 * var(--glow)));
  position: relative;
}
.brand .logo-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand .logo-mark svg { width: 19px; height: 19px; }
.brand .logo-text { font-weight: 750; font-size: 17px; letter-spacing: -0.02em; line-height: 1; }
.brand .logo-text b { font-weight: 800; }
.brand .logo-text span { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.22em; color: var(--muted); margin-top: 3px; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a {
  font-size: 15px; color: var(--text-2); font-weight: 500;
  padding: 9px 14px; border-radius: var(--r-sm); transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav a.active { color: var(--text); }
.nav a.active::after { content: ""; display: block; height: 2px; margin-top: 5px; border-radius: 2px; background: var(--grad); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

/* Lang switcher */
.lang { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); background: rgba(255,255,255,0.02); }
.lang button {
  background: none; border: none; color: var(--muted); font-size: 12.5px; font-weight: 600;
  padding: 5px 11px; border-radius: var(--r-pill); letter-spacing: 0.04em; transition: all 0.2s;
}
.lang button.active { color: #fff; background: var(--grad); }
.lang button:not(.active):hover { color: var(--text); }

.burger { display: none; background: none; border: 1px solid var(--line); border-radius: var(--r-sm); width: 42px; height: 42px; color: #fff; font-size: 18px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); padding-block: 3px 36px; margin-top: 16px; position: relative; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.footer-about { grid-column: 1 / -1; margin-bottom: 4px; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 16px; font-weight: 600; }
.footer-col a { display: block; color: var(--text-2); font-size: 15px; padding: 5px 0; transition: color 0.2s; }
.footer-col a:hover { color: var(--text); }
.footer-about p { color: var(--text-2); font-size: 14.5px; margin-top: 10px; max-width: 760px; line-height: 1.5; }
.badge-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.support-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); border: 1px solid var(--line); padding: 7px 13px; border-radius: var(--r-pill); background: rgba(255,255,255,0.02); }
.support-badge .d { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
.footer-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.footer-bottom .socials { display: flex; gap: 8px; }
.footer-bottom .socials a { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-2); transition: all 0.2s; }
.footer-bottom .socials a:hover { color: #fff; border-color: var(--primary); background: rgba(139,92,246,0.12); }

/* ============================================================
   MOBILE NAV
   ============================================================ */
.mobile-menu { display: none; }

@media (max-width: 940px) {
  .nav { display: none; }
  .lang { display: none; }
  .header-right .btn { display: none; }
  .burger { display: grid; place-items: center; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .footer-about { grid-column: 1 / -1; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }

  .mobile-menu {
    position: fixed; top: 68px; right: var(--pad); z-index: 99;
    width: min(290px, 84vw);
    background: rgba(13,10,32,0.98); backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: 0 30px 70px -20px rgba(0,0,0,0.85);
    padding: 12px; display: none; flex-direction: column; gap: 2px;
  }
  .mobile-menu.open { display: flex; animation: mmIn 0.24s var(--ease); }
  @keyframes mmIn { from { transform: translateY(-10px); } to { transform: none; } }
  .mobile-menu a { font-size: 16px; font-weight: 600; padding: 12px 14px; border-radius: var(--r-sm); }
  .mobile-menu a + a { border-top: 1px solid var(--line-soft); border-radius: 0; }
  .mobile-menu a:hover { background: rgba(139,92,246,0.10); }
  .mobile-menu .btn { margin-top: 12px; justify-content: center; }
  .mobile-menu .lang { display: flex; align-self: flex-start; margin-top: 12px; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ============================================================
   UTIL
   ============================================================ */
.stack-sm > * + * { margin-top: 10px; }
.divider { height: 1px; background: var(--line); border: 0; }
.kicker-num { font-family: var(--mono); color: var(--primary); font-size: 13px; letter-spacing: 0.1em; }

/* скрытый заголовок для скринридеров */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
