/* =====================================================
   ПЕРЕГРУЗ — Design Tokens (Ф2.1)
   Единый источник правды. Зеркало figma-tokens.md.
   Подключать в GeneratePress child-теме (functions.php,
   wp_enqueue_style ПОСЛЕ родительской темы).
   Все контрасты проверены ≥ WCAG 2.2 AA (см. figma-tokens.md §1.5).
   ⚠ Шрифты — локальный @font-face на боевом (НЕ Google CDN: 152-ФЗ/CSP/LCP).
   ===================================================== */

:root {
  /* ── Brand / neutral ─────────────────────────────── */
  --navy:            #0C1B2E;
  --navy-2:          #142236;
  --navy-3:          #1C3050;
  --white:           #FFFFFF;
  --bg:              #F3F6FB;
  --bg-2:            #E8EDF6;
  --border:          #D0DAE8;
  --border-2:        #EAEFF9;

  /* ── Accent (оранжевый) ──────────────────────────── */
  --orange:          #E05A20;            /* заливки/иконки/границы/декор (нетекст, порог 3:1) */
  --orange-ink:      #B8470F;            /* ТЕКСТ оранжевым / метка CTA на белом / ссылка-CTA / focus ring (5.32 на white) */
  --orange-h:        #C84E18;            /* hover заливки кнопки, белый текст (4.61) */
  --orange-bg:       rgba(224,90,32,0.10);
  --orange-on-navy:  #F5A06A;            /* оранжевый ТЕКСТ на navy (8.35) */

  /* ── Semantic ────────────────────────────────────── */
  --red:             #C03030;            /* опасность/штраф/срок (5.67 на white, white на нём 5.67) */
  --red-bg:          #FEF2F2;
  --green:           #1A7F5A;            /* успех/проверено (4.97) */
  --green-bg:        #F0FAF5;
  --tg:              #0077B3;            /* Telegram (white на нём 4.90) */
  --tg-h:            #006699;
  --link:            #1B54B0;            /* ссылка в прозе (7.14) */

  /* ── Text ────────────────────────────────────────── */
  --text:            #0C1B2E;            /* 16.0 на bg */
  --text-2:          #3A5270;            /* 7.40 на bg — тело прозы */
  --text-muted:      #54708F;            /* 5.13 на white / 4.74 на bg — мета/caption */
  --text-on-dark:    #FFFFFF;            /* 17.33 на navy */
  --text-on-dark-2:  #B7C2D0;            /* 8.71 на navy — вторичный на тёмном */

  /* ── Typography ──────────────────────────────────── */
  --f-head: 'Manrope', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --f-body: 'PT Sans', system-ui, -apple-system, Arial, sans-serif;

  --fs-h1:   clamp(1.875rem, 1.4rem + 2.2vw, 3rem);     /* 30→48 */
  --fs-h2:   clamp(1.375rem, 1.1rem + 1.2vw, 2rem);     /* 22→32 */
  --fs-h3:   1.1875rem;                                  /* 19 */
  --fs-h4:   1rem;                                       /* 16 */
  --fs-lead: 1.0625rem;                                  /* 17 */
  --fs-body: 1rem;                                       /* 16 */
  --fs-sm:   0.9375rem;                                  /* 15 */
  --fs-xs:   0.8125rem;                                  /* 13 */
  --fs-cap:  0.75rem;                                    /* 12 */

  --lh-tight: 1.2;
  --lh-ui:    1.65;
  --lh-prose: 1.75;

  --measure-prose: 68ch;   /* длина строки лонгрида 60–75 симв. */

  /* ── Spacing (8px база) ──────────────────────────── */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 20px;  --space-6: 24px;  --space-8: 32px;  --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px;
  --section-y: clamp(40px, 6vw, 80px);
  --container: 1180px;
  --gutter: 24px;

  /* ── Radius ──────────────────────────────────────── */
  --r-sm: 6px;  --r: 8px;  --r-lg: 14px;  --r-xl: 20px;  --r-full: 100px;

  /* ── Shadow ──────────────────────────────────────── */
  --shadow-sm:  0 1px 4px rgba(12,27,46,0.07);
  --shadow-md:  0 4px 16px rgba(12,27,46,0.11);
  --shadow-lg:  0 8px 32px rgba(12,27,46,0.15);
  --shadow-cta: 0 4px 14px rgba(184,71,15,0.35);

  /* ── Z-index ─────────────────────────────────────── */
  --z-base: 0; --z-dropdown: 100; --z-sticky: 200; --z-modal: 300; --z-toast: 400;

  /* ── Focus (WCAG 2.2 — видимый фокус, нетекст ≥3:1) ─ */
  --focus-ring: 2px solid var(--orange-ink);
  --focus-offset: 2px;
}

/* Фокус на тёмных поверхностях — светлый ring */
.navy, .hero, .footer, [data-theme="dark"] {
  --focus-ring: 2px solid var(--orange-on-navy);
}

/* Базовое правило фокуса — НИКОГДА outline:none без замены */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* Reduced motion (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
