/* ──────────────────────────────────────────────────────────────
   VDole — Classic v2 (overlay over compiled static.css)
   Hand-crafted, не через Tailwind компилятор. Лежит рядом с
   /assets/static.css, подключается ВТОРЫМ <link>, добавляет
   уникальные оверлеи: glass-эффекты, body radials, chips, sheen,
   to-top, app-shell (dormant), hover-underline на nav.

   Все --vd-* токены и базовые .vd-* классы (glow, card, reveal,
   grad-text, btn-grad, step-num, faq, cta-section) — в static.css
   (single source). Дубли тут удалены, оставлено только уникальное.
   ────────────────────────────────────────────────────────────── */

/* ── Frosted glass: cards / faq / chips ───────────────────────────
   Стеклянный эффект — полупрозрачный фон + backdrop-blur + тонкий
   highlight по верхней грани. Body-градиент проступает сквозь.
   Применяется автоматически ко ВСЕМ .vd-card и .vd-faq на сайте. */
html.dark .vd-card,
html.dark .vd-faq {
  background-color: rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-color: rgba(255, 255, 255, 0.10) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.30);
}
html.dark .vd-card--hover:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--vd-brand-700) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 24px rgba(37, 99, 235, .25),
    0 2px 6px rgba(0, 0, 0, 0.40);
}

html:not(.dark) .vd-card,
html:not(.dark) .vd-faq {
  background-color: rgba(255, 255, 255, 0.55) !important;
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-color: rgba(255, 255, 255, 0.7) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 1px 2px rgba(15, 26, 43, 0.05);
}
html:not(.dark) .vd-card--hover:hover {
  background-color: rgba(255, 255, 255, 0.78) !important;
  border-color: var(--vd-brand-100) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 24px rgba(37, 99, 235, .15),
    0 2px 6px rgba(15, 26, 43, 0.08);
}

/* Чипы под hero — тоже стеклянные (микро-вариант) */
html.dark .vd-chip {
  background-color: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-color: rgba(255, 255, 255, 0.14) !important;
}
html.dark .vd-chip--mint  { background-color: rgba(16, 185, 129, 0.12) !important; border-color: rgba(16, 185, 129, 0.30) !important; color: oklch(0.85 0.15 155); }
html.dark .vd-chip--amber { background-color: rgba(245, 158, 11, 0.10) !important; border-color: rgba(245, 158, 11, 0.30) !important;  color: oklch(0.85 0.13 80); }

/* ── Hero chips ───────────────────────────────────────────────── */
.vd-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--vd-r-pill);
  font-size: 13px;
  font-weight: 600;
  background: var(--vd-brand-50);
  color: var(--vd-brand-700);
  border: 1px solid var(--vd-brand-100);
}
.vd-chip--mint  { background: oklch(0.96 0.05 155); color: oklch(0.40 0.10 155); border-color: oklch(0.85 0.08 155); }
.vd-chip--amber { background: oklch(0.96 0.05 90);  color: oklch(0.45 0.10 70);  border-color: oklch(0.85 0.10 90);  }

/* ── Feature dot indicator (dormant — не используется) ───────── */
.vd-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--vd-brand-50);
  flex: none;
}

/* ── Logo gradient — переопределяет 4-color палитру через токен.
   Используем background-image (не shorthand!), чтобы не сбросить
   background-clip:text + -webkit-text-fill-color:transparent из static.css */
.logo-gradient {
  background-image: var(--vd-grad-logo) !important;
  background-size: 300% 300% !important;
}

/* ── Hand-rolled Tailwind utilities used in HTML but not in compiled CSS ── */
.bg-vd-brand-50 { background-color: var(--vd-brand-50); }
.hover\:bg-vd-brand-50:hover { background-color: var(--vd-brand-50); }
.tabular-nums { font-variant-numeric: tabular-nums; }
.list-none-vd { list-style: none; padding: 0; margin: 0; }
.list-none-vd > li { list-style: none; }

/* ── App shell: glass-header поверх scroll-area (DORMANT) ────────
   На статике не используется (ADR-2 решил вариант B — sticky+native).
   Оставлено для возможного использования в React-app в Stage 2. */
.vd-app-shell {
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}
.vd-app-shell > header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.55) !important;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(15, 26, 43, 0.06) !important;
}
html.dark .vd-app-shell > header {
  background: rgba(255, 255, 255, 0.04) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
.vd-scroll-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 64px;
  -webkit-overflow-scrolling: touch;
}

/* ── Auto-hide scrollbar (DORMANT) ────────────────────────────── */
.vd-scroll-area { scrollbar-width: none; }
.vd-scroll-area::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ── Custom overlay scrollbar (DORMANT) ───────────────────────── */
.vd-scroll-indicator {
  position: fixed;
  right: 4px;
  width: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 350ms var(--vd-ease);
  z-index: 60;
}
.vd-scroll-indicator.is-active { opacity: 1; }
.vd-scroll-thumb {
  position: absolute;
  left: 0;
  right: 0;
  background: rgba(15, 26, 43, 0.40);
  border-radius: 3px;
  pointer-events: auto;
  transition: background 200ms var(--vd-ease);
  cursor: grab;
}
.vd-scroll-thumb:hover  { background: rgba(15, 26, 43, 0.60); }
.vd-scroll-thumb:active { background: rgba(15, 26, 43, 0.75); cursor: grabbing; }
html.dark .vd-scroll-thumb        { background: rgba(255, 255, 255, 0.35); }
html.dark .vd-scroll-thumb:hover  { background: rgba(255, 255, 255, 0.55); }
html.dark .vd-scroll-thumb:active { background: rgba(255, 255, 255, 0.70); }

/* ── Back-to-top button ──────────────────────────────────────────
   Появляется после ~1 viewport скролла, на клик плавно везёт в начало. */
.vd-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--vd-grad-cta);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--vd-shadow-brand);
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  pointer-events: none;
  transition:
    opacity 300ms var(--vd-ease),
    transform 300ms var(--vd-ease-out),
    box-shadow 220ms var(--vd-ease),
    background 220ms var(--vd-ease);
  z-index: 55;
}
.vd-to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.vd-to-top:hover {
  background: var(--vd-grad-cta-hover);
  transform: translateY(-2px) scale(1);
  box-shadow: 0 14px 30px rgba(37, 99, 235, .40);
  color: #fff;
}
.vd-to-top:active {
  transform: translateY(0) scale(0.95);
}
.vd-to-top svg { display: block; }

/* ── Sheen overlay ────────────────────────────────────────────
   Тонкий радиальный белый блик на тёмных или градиентных секциях.
   Добавляет «профессионализм» — лёгкий объём, как у CTA-плашки.
   Используется на footer, hero на тёмной теме, любых dark-блоках. */
.vd-sheen { position: relative; overflow: hidden; }
.vd-sheen::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(45% 85% at 18% 22%, rgba(255, 255, 255, .10), transparent 60%);
}
.vd-sheen > * { position: relative; z-index: 1; }

/* Альтернативный вариант: тёплый блик из правого нижнего угла */
.vd-sheen--corner-br::before {
  background:
    radial-gradient(45% 85% at 18% 22%, rgba(255, 255, 255, .10), transparent 60%),
    radial-gradient(35% 60% at 85% 90%, rgba(37, 99, 235, .14), transparent 70%);
}

/* На светлой теме: мягкий двухсторонний blue-tinted блик. */
.vd-sheen--light::before {
  background:
    radial-gradient(50% 100% at 12% 0%, rgba(37, 99, 235, .08), transparent 55%),
    radial-gradient(40% 70% at 95% 100%, rgba(14, 165, 233, .06), transparent 60%);
}

/* Stats-полоса: мягкий горизонтальный градиент с тонкой подсветкой */
.vd-sheen--stats::before {
  background:
    linear-gradient(to right, rgba(37, 99, 235, .06) 0%, transparent 30%, transparent 70%, rgba(14, 165, 233, .05) 100%),
    radial-gradient(40% 90% at 50% 0%, rgba(37, 99, 235, .04), transparent 70%);
}
html.dark .vd-sheen--light::before {
  background:
    radial-gradient(50% 100% at 12% 0%, rgba(37, 99, 235, .15), transparent 55%),
    radial-gradient(40% 70% at 95% 100%, rgba(14, 165, 233, .10), transparent 60%);
}
html.dark .vd-sheen--stats::before {
  background:
    linear-gradient(to right, rgba(37, 99, 235, .12) 0%, transparent 30%, transparent 70%, rgba(14, 165, 233, .10) 100%),
    radial-gradient(40% 90% at 50% 0%, rgba(37, 99, 235, .08), transparent 70%);
}

/* ── Section depth: единая синяя палитра, без cyan/indigo пятен ──
   2–3 крупных радиала на body — даёт глубину через всю длину
   страницы. Только brand-color. На bg-surface — тонкий top-fade
   overlay, чтобы блок не был плоский. */

/* DARK theme */
html.dark body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 70% at 10% 5%,  rgba(37, 99, 235, .22), transparent 70%),
    radial-gradient(ellipse 90% 70% at 95% 50%, rgba(37, 99, 235, .14), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 95%, rgba(37, 99, 235, .18), transparent 70%);
  background-attachment: fixed;
}
html.dark .bg-surface {
  background-color: oklch(0.18 0.018 250) !important;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .025) 0%, transparent 50%);
}
html.dark .bg-bg {
  background-color: transparent !important;
}

/* LIGHT theme */
html:not(.dark) body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 70% at 10% 5%,  rgba(37, 99, 235, .14), transparent 70%),
    radial-gradient(ellipse 90% 70% at 95% 50%, rgba(37, 99, 235, .09), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 95%, rgba(37, 99, 235, .12), transparent 70%);
  background-attachment: fixed;
}
html:not(.dark) .bg-surface {
  background-color: oklch(0.97 0.018 250) !important;
  background-image: linear-gradient(180deg, rgba(37, 99, 235, .04) 0%, transparent 50%);
}
html:not(.dark) .bg-bg {
  background-color: transparent !important;
}

/* ── Header nav hover: подчёркивание из центра + brand-color ─────
   Стандартный premium-паттерн (Stripe, Apple, Linear). На статике
   используем селектор `nav[aria-label="Primary"]` — он стабилен
   независимо от .vd-app-shell обёртки (на статике её нет, см. ADR-2). */
@media (min-width: 768px) {
  nav[aria-label="Primary"] a:not(.vd-btn-grad) {
    position: relative;
    transition: color var(--vd-d-base) var(--vd-ease);
  }
  nav[aria-label="Primary"] a:not(.vd-btn-grad)::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: var(--brand);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width var(--vd-d-base) var(--vd-ease-out);
    pointer-events: none;
  }
  nav[aria-label="Primary"] a:not(.vd-btn-grad):hover {
    color: var(--brand) !important;
  }
  nav[aria-label="Primary"] a:not(.vd-btn-grad):hover::after {
    width: 100%;
  }

  /* На тёмной теме делаем линию чуть ярче — иначе теряется на синем body-фоне. */
  html.dark nav[aria-label="Primary"] a:not(.vd-btn-grad)::after {
    background: oklch(0.78 0.14 250);
    box-shadow: 0 0 8px rgba(37, 99, 235, .4);
  }
}

/* prefers-reduced-motion — выключаем все vd-анимации в этом файле */
@media (prefers-reduced-motion: reduce) {
  .vd-to-top,
  .vd-scroll-indicator,
  .vd-scroll-thumb {
    transition: none !important;
    animation: none !important;
  }
}
