/* =========================================
   Site Footer
   ========================================= */

.site-footer {
    position: relative;
    background: var(--color-dark-footer);
    color: #ffffff;
    padding: 72px 0 0;
}

/* --- Grid --- */
.site-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Col title — brush underline --- */
.site-footer__col-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #ffffff;
    margin-bottom: 20px;
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
}

.site-footer__col-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 8' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0,5 C8,2 15,7 25,4 C35,1 42,6 55,4 C65,2 72,7 85,4 C92,2 97,6 100,4' stroke='%2354bb90' stroke-width='2.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

/* --- Contact --- */
.site-footer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13px;
    font-family: var(--font-data);
    line-height: 1.6;
    color: #ffffff;
    margin-bottom: 10px;
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer__contact-item svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--color-primary);
}

@media (hover: hover) { a.site-footer__contact-item:hover { color: var(--color-primary); } }

/* --- Social icons with texture + paint drip hover --- */
.site-footer__socials {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.site-footer__socials a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.3s ease;
    /* Текстура: шум + градиент */
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='0.25'/%3E%3C/svg%3E"),
        linear-gradient(145deg, #2a2e35 0%, #1a1d22 100%);
}

@media (hover: hover) {
    .site-footer__socials a::before {
        content: '';
        position: absolute;
        top: -175%;
        left: -15%;
        width: 130%;
        height: 160%;
        background: var(--color-primary);
        border-radius: 50%;
        transition: top 0.5s cubic-bezier(0.33, 1, 0.68, 1);
        z-index: 0;
    }

    .site-footer__socials a:hover::before { top: -25%; }
    .site-footer__socials a:hover { color: #ffffff; }
}

.site-footer__socials a svg {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
}

/* --- Footer links --- */
.site-footer__link,
.site-footer__menu li a {
    display: block;
    font-size: 13px;
    padding: 4px 0;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.15s ease;
}

@media (hover: hover) {
    .site-footer__link:hover,
    .site-footer__menu li a:hover { color: var(--color-primary); }
}

.site-footer__menu { list-style: none; }

/* --- Legal --- */
.site-footer__legal-text {
    font-size: 12px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.65);
}

/* --- Bottom copyright под watermark --- */
.site-footer__bottom {
    padding: 10px 0;
    background: rgba(0,0,0,0.25);
    position: relative;
    z-index: 1;
}

.site-footer__copyright {
    font-size: 11px;
    font-family: var(--font-data);
    color: rgba(255, 255, 255, 0.22);
    text-align: center;
}

/* =========================================
   Brand watermark — своё пространство
   ========================================= */

.site-footer__brand {
    padding: 24px 0 0;
    overflow: hidden;
    line-height: 0.82;
    text-align: center;
}

.site-footer__watermark {
    display: block;
    font-family: 'Barlow Condensed', var(--font-primary);
    font-weight: 900;
    /*
     * Barlow Condensed 900: ширина ≈ 0.52em
     * 7 × 0.52 = 3.64em → 1184px / 3.64 ≈ 325px → ~22.6vw
     */
    font-size: clamp(150px, 22.6vw, 325px);
    letter-spacing: 0.02em;
    white-space: nowrap;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    /* Белый сверху → полупрозрачный снизу */
    background: linear-gradient(
        to bottom,
        #ffffff        0%,
        rgba(255, 255, 255, 0.75) 35%,
        rgba(255, 255, 255, 0.25) 75%,
        rgba(255, 255, 255, 0.05) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    /* background-clip переносим на отдельные буквы */
    background: none;
    -webkit-text-fill-color: inherit;
    color: transparent;
}

/* Обёртка каждой буквы — клипает подъём */
.site-footer__letter-wrap {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    line-height: 1;
}

/* Сама буква с градиентом */
.site-footer__letter {
    display: inline-block;
    background: linear-gradient(
        to bottom,
        #ffffff 0%,
        rgba(255,255,255,0.75) 35%,
        rgba(255,255,255,0.25) 75%,
        rgba(255,255,255,0.05) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: translateY(105%);
    opacity: 0;
}

@keyframes letter-rise {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.site-footer__watermark.is-visible .site-footer__letter {
    animation: letter-rise 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Accordion: скрыт на десктопе --- */
.site-footer__accordion-btn { display: none; }
.site-footer__accordion-body { display: block; } /* десктоп: всегда виден */

/* --- Responsive --- */
@media (max-width: 1024px) {
    .site-footer__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

@media (max-width: 600px) {
    .site-footer { padding-top: 40px; }

    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    /* Contact — нижняя разделительная линия */
    .site-footer__col:first-child {
        padding-bottom: 28px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    /* Accordion-колонки */
    .site-footer__col--accordion {
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    /* Скрываем desktop-заголовок, показываем кнопку */
    .site-footer__col-title--desktop { display: none; }

    .site-footer__accordion-btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: none;
        border: none;
        cursor: pointer;
        font-family: var(--font-primary);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: #ffffff;
        padding: 18px 0;
        -webkit-tap-highlight-color: transparent;
    }

    .site-footer__accordion-icon {
        display: block;
        transition: transform 0.25s ease;
        flex-shrink: 0;
        opacity: 0.6;
    }

    /* Тело: max-height анимация (grid 0fr trick не работает в Safari < 16) */
    .site-footer__accordion-body {
        display: block;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.35s ease;
    }

    .site-footer__accordion-inner {
        overflow: hidden;
        min-height: 0;
        padding-bottom: 0;
        transition: padding-bottom 0.3s ease;
    }

    /* Открытое состояние */
    .site-footer__col--accordion.is-open .site-footer__accordion-body {
        max-height: 400px;
    }

    .site-footer__col--accordion.is-open .site-footer__accordion-inner {
        padding-bottom: 16px;
    }

    .site-footer__col--accordion.is-open .site-footer__accordion-icon {
        transform: rotate(180deg);
        opacity: 1;
    }

    .site-footer__col--accordion.is-open .site-footer__accordion-btn {
        color: var(--color-primary);
    }

    /* PERLITE — меньший размер на мобиле чтобы вписывался */
    .site-footer__watermark { font-size: 24vw; letter-spacing: 0.01em; }

    .site-footer__brand { padding-top: 12px; }

    /* Contact tap targets */
    .site-footer__contact-item { font-size: 15px; margin-bottom: 14px; }
    .site-footer__link,
    .site-footer__menu li a { font-size: 14px; padding: 5px 0; }
    .site-footer__socials a { width: 44px; height: 44px; }
}
