/* ═══════════════════════════════════════════════
   0. ПАЛИТРА И БАЗА
   ═══════════════════════════════════════════════ */
:root {
  --cb-violet:  #7c3aed;
  --cb-magenta: #d9289c;
  --cb-pink:    #ff5fa2;
  --cb-cyan:    #22d3ee;
  --cb-gold:    #fbbf24;
  --cb-ink:     #160d2b;
  --cb-spring:  cubic-bezier(.34, 1.56, .64, 1);
  --cb-out:     cubic-bezier(.2, .8, .2, 1);
}

/* системный курсор — обычный, видимый */
html, body, a, button, input, textarea, select, [role="button"] {
  cursor: auto !important;
}
a, button, [role="button"], summary, .btn, [class*="btn"] {
  cursor: pointer !important;
}
.cb-cursor-dot, .cb-cursor-ring, .cb-spark { display: none !important; }

/* горизонтальные «въезды» блоков не создают прокрутку вбок
   (clip, а не hidden — чтобы не ломать sticky-хедер) */
body { overflow-x: clip; }

/* якоря не уезжают под липкий хедер (72px) */
section[id], footer[id] { scroll-margin-top: 84px; }

/* текст только для скринридеров */
.cb-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}


/* ═══════════════════════════════════════════════
   1. ВИДИМЫЙ ФОКУС С КЛАВИАТУРЫ
   ═══════════════════════════════════════════════ */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--cb-violet) !important;
  outline-offset: 3px;
}
.footer a:focus-visible { outline-color: var(--cb-pink) !important; }
.btn:focus-visible { outline-offset: 4px; }


/* ═══════════════════════════════════════════════
   2. ВОЛНА ЗА КУРСОРОМ (рисует wave.js)
   ═══════════════════════════════════════════════ */
#cbWave {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* лента идёт ПОД контентом (z-index 2+), но НАД фоном (пятна -2, сетка -1) */
  z-index: 1;
  /* multiply: на светлом сиренево-розовом фоне цвета ленты становятся насыщеннее,
     а белые участки просто исчезают — без «выжигания» и каши */
  mix-blend-mode: multiply;
}

/* весь контент — выше ленты */
header, .header { z-index: 100; }
section, footer, .footer {
  position: relative;
  z-index: 2;
}
article, .step, .guide, details, .disclaimer, .fact, .btn, .badge {
  position: relative;
  z-index: 2;
}


/* ═══════════════════════════════════════════════
   3. ФОН: ПЯТНА, СЕТКА, ЗЕРНО
   ═══════════════════════════════════════════════ */
/* секции становятся полупрозрачными, чтобы фон просвечивал */
.hero {
  background:
    radial-gradient(1100px 420px at 85% -10%, rgba(236,72,153,.14), transparent 60%),
    radial-gradient(900px 400px at 5% 10%, rgba(139,92,246,.14), transparent 60%),
    rgba(250, 247, 255, .18);
}
.alt { background: rgba(250, 247, 255, .28); }

.cb-orbs {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.cb-orb-wrap {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.cb-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  will-change: transform;
}
.cb-orb-violet {
  width: max(46vw, 360px); height: max(46vw, 360px);
  left: -12vw; top: -14vh;
  background: radial-gradient(circle, var(--cb-violet), transparent 70%);
  animation: cb-float-a 23s ease-in-out infinite alternate;
}
.cb-orb-magenta {
  width: max(40vw, 320px); height: max(40vw, 320px);
  right: -10vw; top: 22vh;
  background: radial-gradient(circle, var(--cb-magenta), transparent 70%);
  animation: cb-float-b 29s ease-in-out infinite alternate;
}
.cb-orb-cyan {
  width: max(42vw, 340px); height: max(42vw, 340px);
  left: 22vw; bottom: -16vh;
  background: radial-gradient(circle, var(--cb-cyan), transparent 70%);
  animation: cb-float-c 32s ease-in-out infinite alternate-reverse;
  opacity: .38;
}
.cb-orb-gold {
  width: max(30vw, 260px); height: max(30vw, 260px);
  left: 52vw; top: 40vh;
  background: radial-gradient(circle, var(--cb-gold), transparent 70%);
  animation: cb-float-d 26s ease-in-out infinite alternate;
  opacity: .34;
}
@keyframes cb-float-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(14vw, 12vh, 0) scale(1.2); }
}
@keyframes cb-float-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(-16vw, 18vh, 0) scale(.88); }
}
@keyframes cb-float-c {
  from { transform: translate3d(0, 0, 0) scale(.95); }
  to   { transform: translate3d(12vw, -18vh, 0) scale(1.22); }
}
@keyframes cb-float-d {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-22vw, -14vh, 0) scale(1.15); }
}

/* тонкая светящаяся сетка с радиальной маской */
.cb-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, #000 15%, transparent 78%);
          mask-image: radial-gradient(ellipse 75% 65% at 50% 50%, #000 15%, transparent 78%);
}
.cb-grid::before {
  content: "";
  position: absolute;
  inset: -54px;
  background-image:
    linear-gradient(rgba(124,58,237,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,.07) 1px, transparent 1px);
  background-size: 54px 54px;
  filter: drop-shadow(0 0 3px rgba(124,58,237,.45));
  animation: cb-grid-move 16s linear infinite;
  will-change: transform;
}
@keyframes cb-grid-move {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(54px, 54px, 0); }
}

/* зерно поверх страницы */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'>\
<filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter>\
<rect width='160' height='160' filter='url(%23n)'/></svg>");
}


/* ═══════════════════════════════════════════════
   4. СТЕКЛЯННЫЕ КАРТОЧКИ + 3D-НАКЛОН
   ═══════════════════════════════════════════════ */
article {
  position: relative;
  isolation: isolate;
  background: rgba(255,255,255,.74) !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255,255,255,.65) !important;
  border-radius: 22px !important;
  overflow: hidden;
}
article.offer {
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(0) scale(1);
  transition: transform .55s var(--cb-out), box-shadow .4s ease, border-color .3s ease;
}

/* фирменная полоска сверху (.offer::before) остаётся */
article.offer::before {
  inset: 0 0 auto;
  height: 5px;
  z-index: 1;
}

/* блик, следующий за курсором */
article::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    320px circle at var(--cb-mx, 50%) var(--cb-my, 50%),
    rgba(255, 95, 162, .2), rgba(124, 58, 237, .08) 45%, transparent 70%);
  opacity: 0;
  transition: opacity .35s ease;
}
article:hover::after { opacity: 1; }

article.offer:hover,
article.offer:focus-within {
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(-10px) scale(1.02);
  border-color: rgba(192, 38, 211, .45) !important;
  box-shadow:
    -14px 26px 50px -18px rgba(124, 58, 237, .5),
    14px 18px 44px -18px rgba(217, 40, 156, .45);
}

@media (hover: hover) {
  article.offer.cb-tilt {
    transform: perspective(1000px)
               rotateX(var(--cb-rx, 0deg)) rotateY(var(--cb-ry, 0deg))
               translateY(-10px) scale(1.02);
    transition: transform .14s ease-out, box-shadow .4s ease, border-color .3s ease;
  }
}

/* остальные карточки — лёгкий подъём */
.step, .guide {
  transition: transform .35s var(--cb-out), box-shadow .35s ease;
}
.step:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px -18px rgba(124, 58, 237, .4);
}


/* ═══════════════════════════════════════════════
   5. КНОПКИ: ПОЛОСА СВЕТА, ВОЛНА, СВЕЧЕНИЕ, ПУЛЬС
   ═══════════════════════════════════════════════ */
.cb-shine {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .3s var(--cb-spring), box-shadow .3s ease, filter .3s ease;
}
.cb-shine:hover {
  transform: translateY(-3px);
  filter: saturate(118%);
  box-shadow:
    0 14px 32px -8px rgba(217, 40, 156, .6),
    0 0 22px rgba(124, 58, 237, .35);
}
.btn-ghost.cb-shine:hover {
  box-shadow: 0 12px 28px -10px rgba(124, 58, 237, .45), 0 0 18px rgba(124, 58, 237, .18);
}
.cb-shine:active { transform: translateY(-1px) scale(.98); }

/* полоса света */
.cb-shine::before {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 55%; height: 100%;
  background: linear-gradient(100deg,
    transparent, rgba(255, 255, 255, .6), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
.btn-ghost.cb-shine::before {
  background: linear-gradient(100deg,
    transparent, rgba(217, 40, 156, .16), transparent);
}
.cb-shine:hover::before { animation: cb-sheen .85s ease; }
@keyframes cb-sheen { to { left: 150%; } }

/* волна от точки нажатия */
.cb-ink {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  animation: cb-ink .7s var(--cb-out) forwards;
}
.btn-ghost .cb-ink { background: rgba(217, 40, 156, .25); }
@keyframes cb-ink {
  to { transform: translate(-50%, -50%) scale(26); opacity: 0; }
}

/* главная кнопка мягко пульсирует тенью */
.cb-pulse { animation: cb-pulse 2.8s ease-in-out infinite; }
.cb-pulse:hover, .cb-pulse:focus-visible { animation: none; }
@keyframes cb-pulse {
  0%, 100% {
    box-shadow: 0 8px 22px rgba(192, 38, 211, .28), 0 0 0 0 rgba(217, 40, 156, .45);
  }
  50% {
    box-shadow: 0 12px 34px rgba(192, 38, 211, .5), 0 0 0 12px rgba(217, 40, 156, 0);
  }
}

/* конфетти */
.cb-confetti {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2147482800;
}
.cb-confetti span {
  position: absolute;
  display: block;
  will-change: transform, opacity;
}


/* ═══════════════════════════════════════════════
   6. ЗАГОЛОВОК H1
   ═══════════════════════════════════════════════ */
h1 {
  background: linear-gradient(100deg,
    var(--cb-ink) 0%, var(--cb-violet) 45%,
    var(--cb-magenta) 70%, var(--cb-ink) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cb-hue 9s ease-in-out infinite alternate;
}
@keyframes cb-hue {
  from { background-position: 0% center; }
  to   { background-position: 100% center; }
}

/* по буквам: у каждой буквы свой цвет из градиента (ставит JS) */
h1.cb-split {
  background: none;
  -webkit-text-fill-color: currentColor;
  animation: none;
}
.cb-word {
  display: inline-block;
  white-space: nowrap;
}
.cb-ch {
  display: inline-block;
  transform-origin: 0 100%;
  animation: cb-letter .7s var(--cb-out) both;
}
@keyframes cb-letter {
  from { opacity: 0; transform: translateY(.75em) rotate(6deg); }
  to   { opacity: 1; transform: none; }
}


/* ═══════════════════════════════════════════════
   7. ПЛАВАЮЩИЕ ЭМОДЗИ В ГЕРОЕ
   ═══════════════════════════════════════════════ */
.cb-coins {
  --cb-h: 800px;
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.cb-coin {
  position: absolute;
  top: 100%;
  line-height: 1;
  opacity: 0;
  filter: drop-shadow(0 6px 14px rgba(124, 58, 237, .55));
  animation-name: cb-float-up;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}
@keyframes cb-float-up {
  0%   { transform: translate3d(0, 20px, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: .85; }
  50%  { transform: translate3d(var(--cb-sway, 20px), calc(var(--cb-h) * -.5), 0) rotate(210deg); }
  88%  { opacity: .85; }
  100% { transform: translate3d(0, calc(var(--cb-h) * -1), 0) rotate(420deg); opacity: 0; }
}


/* ═══════════════════════════════════════════════
   8. ЧИПЫ СТАТИСТИКИ
   ═══════════════════════════════════════════════ */
.cb-pop {
  transition: transform .4s var(--cb-spring), box-shadow .3s ease, border-color .3s ease;
}
.cb-pop:hover {
  transform: translateY(-6px) scale(1.07) rotate(-1.5deg);
  border-color: rgba(192, 38, 211, .35);
  box-shadow: 0 14px 30px -12px rgba(124, 58, 237, .55);
}


/* ═══════════════════════════════════════════════
   9. ПОЯВЛЕНИЕ ПРИ СКРОЛЛЕ
   ═══════════════════════════════════════════════ */
.cb-rise.cb-from-b,
.cb-rise.cb-from-l,
.cb-rise.cb-from-r {
  opacity: 0;
  transition: opacity .75s var(--cb-out), transform .75s var(--cb-out);
}
.cb-rise.cb-from-b { transform: translateY(40px) scale(.98); }
.cb-rise.cb-from-l { transform: translateX(-48px); }
.cb-rise.cb-from-r { transform: translateX(48px); }
.cb-rise.cb-on { opacity: 1; transform: none; }


/* ═══════════════════════════════════════════════
   10. ПОДЧЁРКИВАНИЕ МЕНЮ
   ═══════════════════════════════════════════════ */
nav a {
  position: relative;
  transition: color .25s ease;
}
nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -5px;
  height: 2px; width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cb-violet), var(--cb-magenta));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--cb-out);
}
nav a:hover::after, nav a:focus-visible::after { transform: scaleX(1); }


/* ═══════════════════════════════════════════════
   11. ПРОГРЕСС ЧТЕНИЯ + КНОПКА НАВЕРХ
   ═══════════════════════════════════════════════ */
#cbBar {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 4px;
  z-index: 2147482500;
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg,
    var(--cb-violet), var(--cb-magenta), var(--cb-cyan), var(--cb-gold));
  box-shadow: 0 0 12px rgba(217, 40, 156, .75), 0 0 4px rgba(34, 211, 238, .6);
  border-radius: 0 4px 4px 0;
}

#cbTop {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  font-size: 20px; color: #fff;
  background: linear-gradient(135deg, var(--cb-violet), var(--cb-magenta));
  box-shadow: 0 14px 30px -10px rgba(124, 58, 237, .7);
  opacity: 0; transform: translateY(14px) scale(.9);
  pointer-events: none;
  transition: opacity .35s ease, transform .35s var(--cb-out);
  z-index: 2147482400;
}
#cbTop.cb-on { opacity: 1; transform: none; pointer-events: auto; }
#cbTop:hover { transform: translateY(-3px) scale(1.06); }


/* ═══════════════════════════════════════════════
   12. ЛИПКИЙ ХЕДЕР
   ═══════════════════════════════════════════════ */
header {
  transition: background .35s ease, box-shadow .35s ease;
}
header.cb-stuck {
  background: rgba(255, 255, 255, .8) !important;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 10px 34px -16px rgba(22, 13, 43, .45);
}


/* ═══════════════════════════════════════════════
   13. ДОСТУПНОСТЬ И ТАЧ-УСТРОЙСТВА
   ═══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  #cbWave, .cb-coins, .cb-grid, .cb-confetti { display: none !important; }
  .cb-orb, h1, .cb-pulse { animation: none !important; }
  .cb-ch { animation: none !important; opacity: 1 !important; transform: none !important; }
  .cb-rise { opacity: 1 !important; transform: none !important; }
  article.offer:hover, article.offer:focus-within, article.offer.cb-tilt {
    transform: translateY(-4px) !important;
  }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* на тач-устройствах — без волны и без 3D */
@media (hover: none) {
  #cbWave { display: none !important; }
  article { backdrop-filter: none; -webkit-backdrop-filter: none; }
  article.offer,
  article.offer:hover,
  article.offer.cb-tilt { transform: none; }
}

@media (max-width: 640px) {
  .cb-orb { filter: blur(60px); opacity: .4; }
  #cbTop { right: 14px; bottom: 14px; width: 46px; height: 46px; }
}
