/* ============================================================
   ENERGO RUTONICA — Глобальный CSS для всех страниц сайта
   Куда: Tilda → Настройки сайта → Вставка кода → 
   → Пользовательские CSS-стили (без тега )
   ============================================================ */

/* ── CSS-переменные (только реально используемые) ─────────── */
:root {
  --er-ink: #1a1a1a;
  --er-divider: #d8d8d3;
  --er-bg-alt: #f5f5f1;
  --er-accent: #21c3f1;
  --er-sans: 'Onest', system-ui, -apple-system, sans-serif;
  --er-ease: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ── Базовая типографика ──────────────────────────────────── */
body {
  font-family: var(--er-sans) !important;
  color: var(--er-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Сброс подчёркивания у ссылок — T123 блоки сами стилизуют */
a { text-decoration: none; }

/* Скрытие T123-обводки в превью-режиме Tilda */
.t123__wrapper { padding: 0 !important; }

/* ── Селекция текста — наш cyan ───────────────────────────── */
::selection,
::-moz-selection {
  background: var(--er-accent);
  color: #fff;
}

/* ── Кастомный скроллбар (только desktop) ─────────────────── */
@media (min-width: 768px) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: var(--er-bg-alt); }
  ::-webkit-scrollbar-thumb {
    background: var(--er-divider);
    border-radius: 5px;
    transition: background 0.25s var(--er-ease);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--er-accent); }
}

/* ── Focus-visible для accessibility ──────────────────────── */
*:focus-visible {
  outline: 2px solid var(--er-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Корректное масштабирование картинок ──────────────────── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Уважение к prefers-reduced-motion (a11y) ─────────────── */
@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;
  }
}
