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

/* Hero секция */
.hero {
    position: relative;
    overflow: hidden;
    color: #333;
    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,.12);
    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);
}

/* Сетка 2x2 для услуг */
.home-services .services-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
    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: var(--p-brand);
    color: #333;
    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 {
    background: var(--p-brand-2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74,144,226,0.36);
    color: #333;
}

/* Проекты на главной странице */
.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.12);
    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.18);
}

/* Прямоугольные изображения для главной */
.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.18);
    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: var(--p-brand-dark);
    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: block;
    width: 100%;
    background: var(--p-brand);
    color: #333;
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    margin-top: auto;
}

.home-project-card .project-detail-btn:hover {
    background: var(--p-brand-2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.36);
    color: #333;
    text-decoration: none;
}

/* Cтиль для кнопки Смотреть все проекты*/
.see-all-projects-btn {
    display: inline-block;
    background: var(--p-brand);
    color: #333;
    font-size: 2em;
    font-weight: 600;
    padding: 0.7em 1.2em;
    border-radius: 26px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 2.5rem;
}
.see-all-projects-btn:hover {
    background: var(--p-brand-2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.36);
    color: #333;
    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;
}
