/* ===================================
  reference-decor.css
   Крупные декоративные элементы в стиле референса:
   полупрозрачные круги, точечные сетки-паттерны, мятные пятна.
   Подключается на страницах, где нужно "разбавить" фон.
   =================================== */

:root {
    --ig-dot-grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Ccircle cx='6' cy='6' r='3' fill='%2325A9B8' fill-opacity='0.18'/%3E%3Ccircle cx='24' cy='6' r='3' fill='%2325A9B8' fill-opacity='0.18'/%3E%3Ccircle cx='6' cy='24' r='3' fill='%2325A9B8' fill-opacity='0.18'/%3E%3Ccircle cx='24' cy='24' r='3' fill='%2325A9B8' fill-opacity='0.18'/%3E%3C/svg%3E");
}

/* ===================================
   32. КРУПНЫЙ ПОЛУПРОЗРАЧНЫЙ КРУГ (терракотовый акцент — точечно, 1 шт. на секцию)
   =================================== */
.ig-ref-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.ig-ref-circle--terracotta {
    background: rgba(238, 122, 93, 0.85);
}

.ig-ref-circle--mint {
    background: rgba(82, 204, 154, 0.35);
}

.ig-ref-circle--teal-outline {
    background: transparent;
    border: 3px solid rgba(37, 169, 184, 0.4);
}

/* Размеры-модификаторы */
.ig-ref-circle--lg  { width: 140px; height: 140px; }
.ig-ref-circle--md  { width: 90px;  height: 90px; }
.ig-ref-circle--sm  { width: 50px;  height: 50px; }

@media (max-width: 768px) {
    .ig-ref-circle--lg { width: 90px; height: 90px; }
    .ig-ref-circle--md { width: 60px; height: 60px; }
    .ig-ref-circle--sm { width: 34px; height: 34px; }
}

/* ===================================
   33. ТОЧЕЧНАЯ СЕТКА (как в углах референсной карточки)
   =================================== */
.ig-ref-dots {
    position: absolute;
    width: 90px;
    height: 90px;
    background: var(--ig-dot-grid) repeat;
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .ig-ref-dots {
        width: 60px;
        height: 60px;
        background-size: 22px 22px;
    }
}

/* ===================================
   34. МЯТНОЕ "ОБЛАКО"-ПЯТНО (крупная органическая форма снизу)
   =================================== */
.ig-ref-blob-mint {
    position: absolute;
    width: 220px;
    height: 160px;
    background: rgba(196, 233, 220, 0.55);
    border-radius: 60% 40% 55% 45% / 50% 55% 45% 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(1px);
}

@media (max-width: 768px) {
    .ig-ref-blob-mint {
        width: 140px;
        height: 100px;
    }
}

/* ===================================
   35. РАЗДЕЛИТЕЛЬНАЯ ПОЛОСА ИЗ ТРЁХ ЦВЕТОВ (как в референсе под "РЕЖИМ РАБОТЫ")
   =================================== */
.ig-tricolor-line {
    display: flex;
    width: 100%;
    max-width: 320px;
    height: 4px;
    margin: var(--space-4) auto;
    border-radius: 100px;
    overflow: hidden;
}

.ig-tricolor-line span {
    flex: 1;
}

.ig-tricolor-line span:nth-child(1) { background: var(--color-primary); }
.ig-tricolor-line span:nth-child(2) { background: var(--color-tertiary); }
.ig-tricolor-line span:nth-child(3) { background: var(--color-secondary); }

/* ===================================
   ПРИМЕНЕНИЕ: типовой набор для hero-секций
   Используется так:
   <span class="ig-ref-circle ig-ref-circle--terracotta ig-ref-circle--md" style="top:-20px; right:8%;"></span>
   <span class="ig-ref-dots" style="top:20px; left:4%;"></span>
   <span class="ig-ref-blob-mint" style="bottom:-40px; left:-5%;"></span>
   =================================== */

@media (prefers-reduced-motion: reduce) {
    .ig-ref-circle,
    .ig-ref-dots,
    .ig-ref-blob-mint {
        animation: none;
    }
}

@media print {
    .ig-ref-circle,
    .ig-ref-dots,
    .ig-ref-blob-mint,
    .ig-tricolor-line {
        display: none !important;
    }
}

/* ===================================
   ФИКС: видимость декора на мобильных
   Проблема: крупные doodle-элементы обрезаются
   или получают нулевые размеры на маленьких экранах
   =================================== */
@media (max-width: 768px) {
    .ig-ref-circle--lg { width: 70px; height: 70px; }
    .ig-ref-circle--md { width: 48px; height: 48px; }
    .ig-ref-circle--sm { width: 28px; height: 28px; }

    .ig-ref-dots {
        width: 48px;
        height: 48px;
        background-size: 18px 18px;
        opacity: 0.6;
    }

    .ig-ref-blob-mint {
        width: 110px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .ig-ref-circle--lg { width: 56px; height: 56px; }
    .ig-ref-circle--md { width: 40px; height: 40px; }
    .ig-ref-circle--sm { width: 22px; height: 22px; }

    .ig-ref-dots {
        width: 38px;
        height: 38px;
        background-size: 16px 16px;
    }

    .ig-ref-blob-mint {
        width: 90px;
        height: 64px;
    }
}

/* Гарантируем, что родительские секции не обрежут декор по краям,
   но и не создадут горизонтальный скролл */
.page-hero {
    overflow: hidden;
}

.ig-ref-circle,
.ig-ref-dots,
.ig-ref-blob-mint {
    max-width: 40vw;
    max-height: 40vw;
}
