/* ============================================================================
   find-lead.ru — design system
   Заметка: используется в прототипе вместе с Tailwind CDN.
   На прод: либо собранный Tailwind + этот файл, либо чистый CSS без Tailwind.
   ============================================================================ */


/* ── 1. TOKENS ─────────────────────────────────────────────────────────── */

:root {
  /* color — палитра find-lead (перенесена с Тильды) */
  --accent:        #0566aa;   /* фирменный синий FindLead */
  --accent-soft:   #e2f6fe;   /* светло-голубой фон секций */
  --accent-dark:   #044a7f;   /* тёмно-синий */
  --cta:           #fdc615;   /* жёлтая кнопка-CTA */
  --cta-hover:     #f0bb00;
  --cta-ink:       #1a1a1a;   /* текст на жёлтой кнопке */
  --hot:           #f50000;   /* красный бейдж «+AI-проверка» */
  --ink:           #111111;
  --ink-soft:      #4b5563;
  --ink-mute:      #737373;
  --line:          #e5e5e5;
  --line-strong:   #d4d4d4;
  --bg:            #ffffff;
  --bg-soft:       #fbfbfb;
  --bg-dark:       #0a1f2e;
  --success:       #10b981;
  --danger:        #ef4444;

  /* radii */
  --r-sm:  6px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-full: 9999px;

  /* shadow */
  --shadow-card:  0 18px 40px -20px rgba(0,0,0,.18);
  --shadow-glow:  0 10px 24px -8px rgba(253,198,21,.55);
  --shadow-glow-strong: 0 14px 30px -8px rgba(253,198,21,.7);

  /* typography */
  --font-sans: 'Golos Text', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* motion */
  --t-fast: .15s;
  --t-base: .25s;
  --t-slow: .8s;
  --easing: cubic-bezier(.4, 0, .2, 1);

  /* layout */
  --nav-h: 72px;
}


/* ── 2. BASE ───────────────────────────────────────────────────────────── */

html {
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  color: var(--ink);
  background: var(--bg);
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

/* h1 — display, slightly tighter. Меньшие заголовки и body — нейтральный tracking. */
h1 { letter-spacing: -0.022em; }
h2, h3 { letter-spacing: -0.012em; }

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

/* Skip-link для screen reader / keyboard */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--bg-dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--r-md) 0;
  z-index: 100;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
}

/* Глобальный focus-visible */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}


/* ── 2b. ТИПОГРАФИКА (ЕДИНЫЕ стили заголовков — эталон главной) ─────────
   ЕДИНСТВЕННЫЙ источник размеров заголовков на сайте. В шаблонах НЕ писать
   размерные утилиты (text-4xl и т.п.) на заголовках — только эти классы:
     .eyebrow    — надзаголовок секции («КАК ЭТО РАБОТАЕТ»)
     .h-display  — H1 страницы/hero
     .h-section  — H2 секции
     .h-cta      — H2 финальных CTA-полос (крупнее)
     .lead       — лид-абзац под заголовком секции                        */

.eyebrow {
  font-size: .875rem;            /* text-sm */
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .1em;          /* tracking-widest */
}

.h-display {
  font-size: 2.25rem;            /* text-4xl */
  font-weight: 800;              /* extrabold */
  line-height: 1.08;
}
@media (min-width: 768px)  { .h-display { font-size: 3rem; } }      /* md:text-5xl */
@media (min-width: 1024px) { .h-display { font-size: 3.4rem; } }    /* lg — как hero главной */

.h-section {
  font-size: 2.25rem;            /* text-4xl */
  font-weight: 700;              /* bold */
  line-height: 1.15;
}
@media (min-width: 768px) { .h-section { font-size: 3rem; } }        /* md:text-5xl */

.h-cta {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
}
@media (min-width: 768px) { .h-cta { font-size: 3.75rem; } }         /* md:text-6xl */

.lead {
  font-size: 1.125rem;           /* text-lg */
  color: var(--ink-soft);
  line-height: 1.6;
}


/* ── 3. UTILITIES ──────────────────────────────────────────────────────── */

.ink-soft  { color: var(--ink-soft); }
.ink-mute  { color: var(--ink-mute); }
.accent-text { color: var(--accent); }
.accent-bg   { background: var(--accent); }
.accent-soft-bg { background: var(--accent-soft); }
.line-bg     { background: var(--line); }

.marker {
  background: linear-gradient(transparent 60%, rgba(253,198,21,.55) 60%);
  padding: 0 .1em;
}

.dots {
  background-image: radial-gradient(rgba(0,0,0,0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}


/* ── 4. COMPONENTS ─────────────────────────────────────────────────────── */

/* AI gradient — для USP-маркеров. Использовать умеренно. */
.ai-badge {
  background: linear-gradient(90deg, #0566aa, #2a9fd6);
  color: #fff;
}

/* Жёлтая кнопка-CTA (главный призыв — как на Тильде) */
.btn-cta {
  background: var(--cta);
  color: var(--cta-ink);
  font-weight: 700;
}
.btn-cta:hover { background: var(--cta-hover); color: var(--cta-ink); }

/* Красный бейдж «+AI-проверка лидов» */
.badge-hot {
  background: var(--hot);
  color: #fff;
}

/* Glow button */
.btn-glow {
  box-shadow: var(--shadow-glow);
  transition: box-shadow var(--t-base) var(--easing), transform var(--t-base) var(--easing);
}
.btn-glow:hover { box-shadow: var(--shadow-glow-strong); }

/* Card hover (тонкое поднятие) */
.card {
  transition: transform var(--t-base) var(--easing),
              box-shadow var(--t-base) var(--easing),
              border-color var(--t-base) var(--easing);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
  border-color: var(--line-strong);
}

/* Chip (для категорий, тегов) */
.chip {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: #f5f5f5;
  color: var(--ink-soft);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  cursor: pointer;
  transition: background var(--t-base), color var(--t-base);
}
.chip:hover { background: #ececec; color: var(--ink); }
.chip-active { background: var(--accent); color: #fff; }
.chip-active:hover { background: var(--accent-dark); color: #fff; }

/* Decorative gradient orb. Используем умеренно. */
.orb {
  position: absolute;
  border-radius: var(--r-full);
  filter: blur(80px);
  opacity: .45;
  pointer-events: none;
}
/* На мобильных blur очень дорогой — отключаем */
@media (max-width: 640px) {
  .orb { filter: blur(40px); opacity: .25; }
}

/* Header nav — сплошной синий бар find-lead (как на Тильде), всегда solid */
.site-nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px -4px rgba(0,0,0,.25);
}
.site-nav.is-solid { background: var(--accent); }
/* Ссылки меню — белые, при ховере/активе — жёлтые */
.site-nav nav a { color: #fff; }
.site-nav nav a:hover,
.site-nav nav a[aria-current="page"] { color: var(--cta); }
/* Бургер на синем фоне — белые полоски */
.site-nav .burger-icon,
.site-nav .burger-icon::before,
.site-nav .burger-icon::after { background: #fff; }
.site-nav .burger:hover { background: rgba(255,255,255,.12); }

/* Залипающее видео-виджет (угол экрана, как на Тильде) */
.sticky-video {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 132px;
  z-index: 45;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,.45);
  background: #000;
  cursor: pointer;
  transition: transform var(--t-base) var(--easing);
}
.sticky-video:hover { transform: scale(1.03); }
.sticky-video video { width: 100%; height: auto; display: block; }
.sticky-video .sv-close {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
}
.sticky-video .sv-sound {
  position: absolute;
  bottom: 6px; left: 6px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  pointer-events: none;
}
.sticky-video.is-hidden { display: none; }
@media (max-width: 640px) {
  .sticky-video { width: 104px; left: 12px; bottom: 12px; }
}

/* Mobile burger toggle */
.burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.burger:hover { background: rgba(0,0,0,.06); }
.burger-icon, .burger-icon::before, .burger-icon::after {
  display: block;
  height: 2px;
  width: 22px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--t-base) var(--easing), opacity var(--t-fast);
}
.burger-icon::before, .burger-icon::after {
  content: '';
  position: absolute;
}
.burger-icon { position: relative; }
.burger-icon::before { transform: translateY(-7px); }
.burger-icon::after  { transform: translateY(7px); }
.burger[aria-expanded="true"] .burger-icon            { background: transparent; }
.burger[aria-expanded="true"] .burger-icon::before    { transform: rotate(45deg); }
.burger[aria-expanded="true"] .burger-icon::after     { transform: rotate(-45deg); }

/* Mobile menu drawer */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 49;
  padding: calc(var(--nav-h) + 24px) 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity var(--t-base) var(--easing),
              transform var(--t-base) var(--easing),
              visibility 0s linear var(--t-base);
  overflow-y: auto;
}
.mobile-menu.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--t-base) var(--easing),
              transform var(--t-base) var(--easing),
              visibility 0s linear 0s;
}
.mobile-menu a {
  display: block;
  padding: 16px 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--r-md);
}
.mobile-menu a:hover, .mobile-menu a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.mobile-menu .menu-meta {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.menu-open { overflow: hidden; }

/* Marquee (бегущая строка логотипов) */
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee {
  display: flex;
  width: max-content;
  animation: marquee-scroll 30s linear infinite;
  will-change: transform;
}
.marquee:hover { animation-play-state: paused; }


/* ── 5. PROSE (типографика статьи) ─────────────────────────────────────── */

.prose {
  color: #33383d;
  line-height: 1.8;
  max-width: 720px;
  font-size: 1.09rem;
}
/* Лид — первый абзац статьи: крупнее и чуть темнее, задаёт вход в текст. */
.prose > p:first-of-type {
  font-size: 1.28rem;
  line-height: 1.6;
  color: #1c2126;
  margin: 0 0 1.75rem;
}
.prose > p:first-of-type strong { font-weight: 700; }

.prose h2 {
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 800;
  color: #101820;
  margin: 3.25rem 0 1.1rem;
  padding-top: 2rem;
  border-top: 1px solid #ececec;   /* тонкий разделитель секций — ломает «простыню» */
  letter-spacing: -0.015em;
}
.prose h2:first-child { padding-top: 0; border-top: 0; margin-top: 0; }
.prose h3 {
  font-size: 1.35rem;
  line-height: 1.3;
  font-weight: 700;
  color: #101820;
  margin: 2.5rem 0 .9rem;
  letter-spacing: -0.012em;
}
.prose p { margin: 1.15rem 0; }
/* Жирный тезис в начале абзаца (приём seo-copywriter) — визуальный якорь для
   сканирования: чуть темнее и плотнее, без пестроты. */
.prose p strong, .prose li strong { color: #101820; font-weight: 700; }

/* Списки уважают opt-out: блоки дизайн-системы (карточки-шаги, «Коротко», хлебные
   крошки) помечены list-none/not-prose — иначе нативный маркер + бейдж дают ДВЕ цифры,
   а padding-left перебивает p-0. См. templates/partials/article-blocks.php. */
.prose ul:not(.list-none):not(.not-prose),
.prose ol:not(.list-none):not(.not-prose) { margin: 1.4rem 0; padding-left: 1.5rem; }
.prose ol:not(.list-none):not(.not-prose) { list-style: decimal; }
/* Ненумерованные списки — свой аккуратный маркер акцентом вместо серого диска. */
.prose ul:not(.list-none):not(.not-prose) { list-style: none; padding-left: 1.65rem; }
.prose ul:not(.list-none):not(.not-prose) > li { position: relative; }
.prose ul:not(.list-none):not(.not-prose) > li::before {
  content: ""; position: absolute; left: -1.35rem; top: .72em;
  width: .5rem; height: .5rem; border-radius: 2px; background: var(--accent);
}
.prose li { margin: .55rem 0; }
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  font-weight: 600;
}
.prose a:hover { text-decoration-thickness: 2px; }
.prose code {
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .9em;
  font-family: ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, monospace;
}
.prose pre {
  background: var(--bg-dark);
  color: #e5e5e5;
  padding: 1.5rem;
  border-radius: var(--r-md);
  overflow-x: auto;
  font-size: .9em;
  line-height: 1.6;
}
.prose pre code { background: transparent; padding: 0; color: inherit; }
.prose blockquote {
  border: 0;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft, #eaf3fa);
  border-radius: 0 12px 12px 0;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-size: 1.18rem;
  line-height: 1.55;
  font-weight: 600;
  color: #1c2126;
  font-style: normal;
}
.prose blockquote p { margin: 0; }
.prose img {
  border-radius: var(--r-md);
  margin: 2rem 0;
  height: auto;
}

/* TOC */
.toc-item {
  display: block;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color var(--t-fast);
  padding: 4px 0;
}
.toc-item:hover, .toc-item:focus-visible { color: var(--accent); }
.toc-item.is-active {
  color: var(--accent);
  font-weight: 600;
}
/* Mobile TOC accordion */
.toc-mobile { display: none; }
@media (max-width: 1023px) {
  .toc-desktop { display: none; }
  .toc-mobile { display: block; }
  .toc-mobile summary {
    cursor: pointer;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    font-weight: 600;
    list-style: none;
  }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile[open] summary { border-color: var(--accent); color: var(--accent); }
  .toc-mobile .toc-list { padding: 12px 16px 4px; }
}


/* ── 6. FORM ──────────────────────────────────────────────────────────── */

.form-control {
  width: 100%;
  padding: 16px 20px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--t-base);
}
.form-control::placeholder { color: rgba(255,255,255,.4); }
.form-control:focus { outline: none; border-color: #fff; }
.form-control:invalid:not(:placeholder-shown) { border-color: var(--danger); }
.form-control.is-valid { border-color: var(--success); }

.form-success {
  background: rgba(16,185,129,.12);
  color: #d1fae5;
  border: 1px solid rgba(16,185,129,.3);
  border-radius: var(--r-md);
  padding: 16px 20px;
  display: none;
}
.form-success.is-shown { display: block; }
.form-error {
  display: none;
  color: #fecaca;
  font-size: .875rem;
  margin-top: 8px;
}
.form-error.is-shown { display: block; }


/* ── 7. MOTION ────────────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--easing),
              transform var(--t-slow) var(--easing);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion preference: останавливаем все анимации */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .marquee {
    animation: none;
  }
}


/* ── 8. AUX ───────────────────────────────────────────────────────────── */

/* visually-hidden, но доступен скринридерам */
.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;
}
