/* Стили для главной страницы */
body:has(.hero) .main-content {
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
}

/* Hero секция */
.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 7rem 0 4rem 0;
    text-align: center;
    background: linear-gradient(135deg, var(--p-brand) 0%, var(--p-brand-2) 100%);
    box-shadow:
        inset 0 18px 36px rgba(0,0,0,.12),
        inset 0 -18px 36px rgba(0,0,0,.10);
    margin-top: 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* Секция услуг */
.services {
    padding: 4rem 0;
    background: var(--p-bg-alt);
}

.services h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--p-text-700);
}

/* Пирамидальная компоновка 2-3 */
.home-services .services-pyramid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.home-services .services-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: stretch; /* Все карточки одной высоты */
}

/* Верхний ряд: 2 карточки (крупнее) */
.home-services .services-row-top .service-card {
    flex: 0 1 450px;
    max-width: 450px;
    min-width: 320px;
}

/* Нижний ряд: 3 карточки (стандарт) */
.home-services .services-row-bottom .service-card {
    flex: 0 1 350px;
    max-width: 350px;
    min-width: 280px;
}

/* Карточки внутри рядов растягиваются на всю высоту ряда */
.home-services .services-row .service-card {
    height: auto; /* Позволяем stretch работать естественно */
    min-height: 0; /* Сбрасываем min-height чтобы stretch работал */
    display: flex;
    flex-direction: column;
}

/* Параграф в карточках услуг растягивается, кнопка прижимается к низу */
.home-services .services-row .service-card p {
    flex-grow: 1;
}

.home-services .services-row .service-card .service-btn {
    margin-top: auto;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 280px;
}

.service-card h3 {
    margin-bottom: 1rem;
    color: var(--p-text-700);
    font-size: 1.3rem;
    min-height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card p {
    color: var(--p-text-500);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.service-btn {
    display: flex;
    background: linear-gradient(90deg, var(--p-brand), var(--p-brand-2));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    margin-top: auto;
    text-decoration: none;
    min-height: 70px;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.service-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
    color: white;
}
.service-btn-secondary { background: linear-gradient(90deg, #ff6b6b, #ee5a5a); }

/* Проекты на главной странице */
.projects { padding: 0 0 3rem 0; }
.projects h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--p-text-700);
}

.home-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    justify-items: center;
    justify-content: center;
    align-items: stretch;
}

.home-project-card {
    background: white;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    padding: 1rem 1rem 1.3rem 1rem;
    max-width: 320px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.home-project-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Прямоугольные изображения для главной */
.project-image-rect {
    width: 280px;
    height: 190px;
    max-width: 100%;
    aspect-ratio: 25/18;
    overflow: hidden;
    margin: 0 auto 1.2rem auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-radius: 10px;
    position: relative;
    background: #fff9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-image-rect img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Контент карточек проектов на главной */
.project-card-content {
    padding: 0 1rem;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.home-project-card h3 {
    margin-bottom: 0.5rem;
    color: var(--p-text-700);
    font-size: 1.4rem;
}
.projects .project-size {
    color: #4A90E2;
    font-weight: bold;
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

/* Контейнер для нижних элементов */
.home-project-card .project-bottom {
    margin-top: auto;
}

/* Категории на главной */
.home-project-card .project-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: flex-start;
}

.home-project-card .category-tag {
    background: #f0f0f0;
    padding: 0.35rem 0.9rem;
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--p-text-500);
}

/* Кнопка "Подробнее" на главной */
.home-project-card .project-detail-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--p-brand) 0%, var(--p-brand-2) 100%);
    color: white;
    padding: 0.65rem 1.3rem;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    margin-top: auto;
}

.home-project-card .project-detail-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

/* Cтиль для кнопки Смотреть все проекты*/
.see-all-projects-btn {
    background: linear-gradient(90deg, var(--p-brand), var(--p-brand-2) 90%);
    color: #fff;
    font-size: 2em;
    font-weight: 600;
    border: none;
    padding: 0.7em 1.2em;
    border-radius: 26px;
    box-shadow: 0 2px 18px rgba(102,126,234,0.11);
    transition: background 0.25s, transform 0.17s;
    margin-top: 2.5rem;
    text-decoration: none;
}
.see-all-projects-btn:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px) scale(1.04);
    color: #fff;
    text-decoration: none;
}

/* Контейнер для кнопки "Больше проектов" */
.see-all-projects-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* Утилитарный класс для flex контейнеров */
.project-info-flex {
    display: flex;
    align-items: center;
    gap: 1rem;
}
