/* 
File: assets/css/front-page.css (FINAL FIXED VERSION 3.0)
Description: 3 Cards in Hero, Sphere Visible, Equal Height Services
*/

:root {
    --fp-bg-dark: #0f0f11;
    --fp-bg-card: #151518;
    --fp-accent-gradient: linear-gradient(135deg, #7B61FF 0%, #5235E8 100%);
    --fp-text-main: #ffffff;
    --fp-text-muted: #d1d5db;
}

body.home { background-color: var(--fp-bg-dark); overflow-x: hidden; }

/* =========================================
   1. HERO SECTION (ШАР + 3 КАРТОЧКИ)
   ========================================= */
.fp-hero {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center;
    padding-top: 120px; padding-bottom: 60px;
    overflow: hidden;
}

/* Фон */
.fp-hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.fp-grid-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}
.fp-glow-center {
    position: absolute; top: 50%; left: 50%; width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(123, 97, 255, 0.15) 0%, rgba(0,0,0,0) 70%);
    transform: translate(-50%, -50%); filter: blur(80px);
}

/* Контент */
.fp-hero-content {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center;
}

/* Текст слева */
.fp-label {
    display: flex; align-items: center; gap: 10px; margin-bottom: 25px;
    font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.fp-badge {
    background: rgba(123, 97, 255, 0.15); color: #bfaaff;
    padding: 6px 12px; border-radius: 6px; border: 1px solid rgba(123, 97, 255, 0.3);
}
.fp-badge-text { color: var(--fp-text-muted); }

.fp-title {
    font-size: clamp(36px, 5vw, 68px);
    font-weight: 800; line-height: 1.1; color: #fff; margin-bottom: 25px;
}
.fp-title .text-gradient {
    background: var(--fp-accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.fp-subtitle {
    font-size: 18px; line-height: 1.6; color: var(--fp-text-muted);
    max-width: 550px; margin-bottom: 40px;
}
.fp-subtitle strong { color: #fff; }
.fp-actions { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 50px; }
.fp-stats {
    display: flex; gap: 40px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 30px;
}
.fp-stat-item { display: flex; flex-direction: column; }
.fp-stat-num { font-size: 24px; font-weight: 800; color: #fff; }
.fp-stat-desc { font-size: 13px; color: var(--fp-text-muted); margin-top: 5px; }


/* --- 3D ВИЗУАЛ (ШАР + КАРТОЧКИ) --- */
.fp-hero-visual {
    position: relative; height: 500px; 
    display: flex; align-items: center; justify-content: center;
    perspective: 1000px;
}

/* Шар (CSS Sphere) */
.css-sphere-wrap {
    position: relative; width: 380px; height: 380px;
    display: flex; align-items: center; justify-content: center;
    z-index: 1; /* Под карточками */
}
.css-sphere {
    width: 100%; height: 100%; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2a2a35 0%, #000 70%);
    box-shadow: inset -10px -10px 50px rgba(0,0,0,1), 
                0 0 60px rgba(123, 97, 255, 0.25); /* Свечение */
    position: relative;
    animation: spherePulse 4s infinite alternate;
}
.css-sphere-orbit {
    position: absolute; top: -10%; left: -10%; width: 120%; height: 120%;
    border-radius: 50%; border: 1px solid rgba(123, 97, 255, 0.15);
    transform: rotateX(70deg); animation: rotateOrbit 12s linear infinite;
}
@keyframes rotateOrbit { 0% { transform: rotateX(70deg) rotateZ(0deg); } 100% { transform: rotateX(70deg) rotateZ(360deg); } }
@keyframes spherePulse { 0% { transform: scale(1); } 100% { transform: scale(1.02); } }

/* Плавающие карточки */
.fp-card-float {
    position: absolute; z-index: 5;
    background: rgba(20, 20, 25, 0.9); /* Плотный фон */
    backdrop-filter: blur(10px); 
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 14px 24px; border-radius: 14px;
    color: #fff; font-weight: 700; font-size: 14px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    display: flex; align-items: center; gap: 10px;
    white-space: nowrap;
    animation: floatY 5s ease-in-out infinite;
}
.fp-card-float .icon { font-size: 20px; }

/* Позиционирование карточек */
.card-seo { 
    top: 15%; left: 0; 
    animation-delay: 0s; 
}
.card-ai { 
    bottom: 20%; right: 0; 
    animation-delay: 1s; 
}
/* Карточка ROMI (Таргет) - ИСПРАВЛЕНО */
.card-target { 
    top: 45%; right: -30px; 
    animation-delay: 2s; 
}

@keyframes floatY { 
    0%, 100% { transform: translateY(0); } 
    50% { transform: translateY(-15px); } 
}


/* =========================================
   2. TECH TICKER
   ========================================= */
.fp-tech-ticker {
    background: #0f0f11; border-top: 1px solid rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 20px 0; overflow: hidden; white-space: nowrap;
}
.fp-ticker-track { display: flex; gap: 50px; animation: tickerScroll 30s linear infinite; width: max-content; }
.fp-tech-item { font-size: 16px; font-weight: 700; color: rgba(255,255,255,0.3); text-transform: uppercase; }
@keyframes tickerScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }


/* =========================================
   3. ABOUT SECTION
   ========================================= */
.fp-about-section { padding: 100px 0; background: var(--fp-bg-dark); }
.fp-about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 60px; align-items: center; }

.fp-about-img-wrapper { position: relative; border-radius: 20px; display: inline-block; }
.fp-author-img { width: 100%; max-width: 400px; border-radius: 20px; filter: grayscale(100%); transition: 0.5s; }
.fp-author-img:hover { filter: grayscale(0%); }

.fp-exp-badge {
    position: absolute; bottom: 20px; right: 20px; /* Бейдж внутри фото в углу */
    background: var(--fp-accent-gradient);
    padding: 15px 25px; border-radius: 16px;
    color: #fff; text-align: center;
    box-shadow: 0 10px 30px rgba(123, 97, 255, 0.4);
    z-index: 2;
}
.fp-exp-badge .num { display: block; font-size: 28px; font-weight: 800; line-height: 1; }
.fp-exp-badge .txt { font-size: 11px; font-weight: 600; text-transform: uppercase; }

.fp-section-title { font-size: 36px; font-weight: 800; color: #fff; margin-bottom: 20px; }
.text-accent { color: #7B61FF; }
.fp-about-text p { font-size: 16px; line-height: 1.7; color: #ccc; margin-bottom: 20px; }
.fp-features-list { display: grid; grid-template-columns: 1fr; gap: 15px; margin-top: 30px; }
.fp-feat-item { display: flex; align-items: center; gap: 15px; font-weight: 600; color: #fff; background: rgba(255,255,255,0.03); padding: 15px; border-radius: 12px; }


//* =========================================
   5. SERVICES SECTION (BIG SPACING FIX)
   ========================================= */
.fp-services-section {
    padding: 100px 0;
    position: relative;
    z-index: 1;
}

/* ЗАГОЛОВОК СЕКЦИИ */
.fp-section-header { 
    text-align: center; 
    /* Отступ снизу от текста до сетки */
    margin-bottom: 0; 
    padding-bottom: 20px;
    max-width: 800px; 
    margin-left: auto; 
    margin-right: auto;
    position: relative;
    /* Поднимаем текст максимально высоко по слоям */
    z-index: 20; 
}

.fp-section-desc { 
    font-size: 18px; 
    color: var(--fp-text-muted); 
    margin-top: 20px; 
    line-height: 1.6;
}

/* СЕТКА КАРТОЧЕК */
.fp-services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 Колонки */
    gap: 40px;
    position: relative;
    z-index: 2;
    /* ВОТ ГЛАВНОЕ ИСПРАВЛЕНИЕ: Опускаем карточки вниз на 100px */
    margin-top: 100px; 
    /* Выравниваем карточки по верхнему краю, чтобы они стояли ровно */
    align-items: start;
}

/* Карточка услуги */
.fp-service-card {
    background: var(--fp-bg-card);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 24px; 
    padding: 50px; 
    transition: all 0.3s ease;
    position: relative; 
    overflow: hidden;
    display: flex; 
    flex-direction: column;
    /* Одинаковая высота */
    height: 100%; 
    min-height: 450px;
}

.fp-service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(123, 97, 255, 0.4);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    background: #1a1a1e;
    z-index: 15;
}

/* Флагманская карточка (AI) */
.card-ai {
    background: linear-gradient(145deg, #1f1f24 0%, #151518 100%);
    border: 1px solid rgba(123, 97, 255, 0.5);
    box-shadow: 0 0 40px rgba(123, 97, 255, 0.15);
}

/* Свечение */
.card-ai .svc-bg-glow {
    position: absolute; top: -150px; right: -150px; width: 400px; height: 400px;
    background: var(--fp-accent-gradient); filter: blur(120px); opacity: 0.2;
    pointer-events: none;
}

/* Контент карточки */
.svc-content { 
    position: relative; z-index: 2; height: 100%; 
    display: flex; flex-direction: column; 
}

/* Иконка */
.svc-icon-box { 
    font-size: 48px; 
    margin-bottom: 30px;
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.03);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.svc-title { 
    font-size: 28px; 
    font-weight: 800; 
    color: #fff; 
    margin: 0 0 15px 0; 
    line-height: 1.2;
}

.svc-desc { 
    font-size: 16px; 
    color: var(--fp-text-muted); 
    margin-bottom: 30px; 
    line-height: 1.6;
    max-width: 95%;
}

/* Список */
.svc-list {
    list-style: none; padding: 0; margin-bottom: 40px; flex-grow: 1;
    display: grid; 
    grid-template-columns: repeat(2, 1fr); /* 2 колонки внутри */
    gap: 15px;
}

.svc-list li {
    position: relative; padding-left: 20px;
    font-size: 15px; color: #e0e0e0; font-weight: 500;
}
.svc-list li::before {
    content: ''; position: absolute; left: 0; top: 9px;
    width: 6px; height: 6px; border-radius: 50%;
    background: #7B61FF; box-shadow: 0 0 10px #7B61FF;
}

/* Ссылка */
.svc-link {
    font-size: 16px; font-weight: 700; color: #fff;
    text-decoration: none; 
    display: inline-flex; align-items: center; gap: 10px;
    transition: 0.3s;
    align-self: flex-start;
    padding-bottom: 5px;
    border-bottom: 2px solid rgba(123, 97, 255, 0.5);
    margin-top: auto;
}
.svc-link:hover { color: #7B61FF; border-color: #7B61FF; padding-left: 10px; }

/* Кнопка */
.card-ai .btn { 
    align-self: flex-start; 
    width: auto; 
    padding: 16px 40px;
    margin-top: auto; 
}

/* --- АДАПТИВ УСЛУГ --- */
@media (max-width: 1200px) {
    .svc-list { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .fp-services-grid {
        grid-template-columns: 1fr; /* 1 колонка */
        gap: 30px;
        margin-top: 50px;
    }
    
    .fp-service-card {
        padding: 30px;
        min-height: auto;
    }
    
    .fp-section-header { margin-bottom: 40px; }
    
    .card-ai .btn { width: 100%; text-align: center; }
}


/* =========================================
   5. OTHER SECTIONS (AI, PORTFOLIO, CTA)
   ========================================= */
.fp-ai-details, .fp-portfolio-section, .fp-final-cta, .fp-blog-section { padding: 80px 0; }
.fp-ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; margin-top: 50px; }
.fp-ai-card { text-align: center; padding: 30px; background: var(--fp-bg-dark); border-radius: 20px; border: 1px solid rgba(255,255,255,0.05); }
.ai-card-icon { font-size: 32px; margin-bottom: 20px; background: rgba(123, 97, 255, 0.1); width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; border-radius: 50%; margin: 0 auto 20px; }

.fp-header-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 40px; }
.fp-portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }

.fp-case-card { position: relative; height: 350px; border-radius: 20px; overflow: hidden; background: #222; border: 1px solid rgba(255,255,255,0.05); }
.fp-case-link { display: block; width: 100%; height: 100%; position: relative; }
.fp-case-thumb { width: 100%; height: 100%; background-size: cover; background-position: center; transition: 0.5s; }
.fp-case-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.1) 60%); }
.fp-case-info { position: absolute; bottom: 0; left: 0; padding: 25px; width: 100%; z-index: 2; }
.fp-case-title { font-size: 20px; font-weight: 700; margin: 0 0 5px 0; color: #fff; }
.fp-case-result { display: inline-block; background: #2ecc71; color: #000; padding: 4px 8px; border-radius: 4px; font-weight: 800; font-size: 12px; }
.fp-case-badge {
    position: absolute; top: 20px; left: 20px; z-index: 5;
    background: rgba(123, 97, 255, 0.9); color: #fff;
    padding: 5px 12px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase;
}

.fp-cta-box { background: var(--fp-accent-gradient); border-radius: 24px; padding: 50px; display: flex; justify-content: space-between; align-items: center; }
.fp-cta-text h2 { font-size: 32px; font-weight: 800; color: #fff; margin: 0 0 10px 0; }
.fp-cta-btn .btn { background: #fff; color: #7B61FF; border: none; padding: 15px 35px; }


/* =========================================
   6. MOBILE ADAPTIVE (FIXED)
   ========================================= */
@media (max-width: 992px) {
    /* HERO */
    .fp-hero { padding-top: 100px; flex-direction: column; height: auto; min-height: auto; }
    .fp-hero-content { grid-template-columns: 1fr; text-align: center; }
    .fp-hero-text { order: 2; }
    
    /* Шар на мобильном */
    .fp-hero-visual { order: 1; height: 350px; margin-bottom: 20px; }
    .css-sphere-wrap { width: 280px; height: 280px; }
    
    /* Карточки на мобильном - ПОЗИЦИОНИРОВАНИЕ */
    .fp-card-float { 
        position: absolute; animation: floatY 5s ease-in-out infinite; 
        padding: 8px 15px; font-size: 11px; 
    }
    .card-seo { top: auto; bottom: 0; left: 0; }
    .card-ai { bottom: 0; right: 0; }
    .card-target { top: 0; right: 10px; } /* Третья карточка */

    .fp-actions { justify-content: center; flex-direction: column; }
    .fp-stats { justify-content: center; flex-wrap: wrap; gap: 20px; }

    /* SERVICES (MOBILE) */
    .fp-services-grid { 
        grid-template-columns: 1fr; /* 1 колонка */
        gap: 30px; margin-top: 40px; 
    }
    .fp-service-card { padding: 30px; min-height: auto; }
    .fp-section-header { margin-bottom: 40px; }
    .svc-list { grid-template-columns: 1fr; } /* Список в 1 колонку */
    .card-ai .btn { width: 100%; text-align: center; }

    /* OTHER */
    .fp-about-grid { grid-template-columns: 1fr; }
    .fp-about-visual { text-align: center; margin-bottom: 40px; }
    .fp-author-img { max-width: 300px; margin-left: auto; margin-right: auto; }
    .fp-exp-badge { right: 50%; transform: translateX(50%); bottom: -20px; }

    .fp-portfolio-grid { grid-template-columns: 1fr; }
    .fp-cta-box { flex-direction: column; text-align: center; padding: 30px; }
    .fp-cta-btn { margin-top: 20px; width: 100%; }
    .fp-cta-btn .btn { width: 100%; }
}