* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Montserrat', sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
header {
    background: #1f2a40;
    color: white;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 28px;
    font-weight: 800;
}
.logo span {
    color: #f39c12;
}
nav a {
    margin-left: 20px;
    font-weight: 600;
    color: white;
    transition: color 0.3s;
    text-decoration: none;
}
nav a:hover {
    color: #f39c12;
}
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7)), url('../img/roof-bg.jpg') center/cover no-repeat;
    color: white;
    text-align: center;
    padding: 150px 20px;
}
.hero-content h1 {
    font-size: 38px;
    margin-bottom: 20px;
}
.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
}
.btn {
    display: inline-block;
    background: #f39c12;
    color: white;
    padding: 14px 30px;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.3s;
    cursor: pointer;
    border: none;
}
.btn:hover {
    background: #e67e22;
}
.services {
    padding: 80px 20px;
    background: #fff;
}
.services h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 32px;
}
.card-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}
.card {
    position: relative;
    background: #f7f9fb;
    padding: 30px;
    border-radius: 12px;
    flex: 1 1 30%;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    transition: transform 0.3s;
    cursor: default;
    min-height: 180px;
}
.card:hover {
    transform: translateY(-5px);
}

/* Tooltip с большой подробной информацией */
.card::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 62, 80, 0.95);
    color: #ecf0f1;
    padding: 20px 25px;
    border-radius: 15px;
    white-space: pre-wrap; /* перенос строк */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    font-size: 16px;
    width: 320px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 20;
    line-height: 1.4;
    font-weight: 500;
    text-align: left;
    user-select: none;
}

.card:hover::after {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(-10px);
}

.contact {
    background: #ecf0f1;
    padding: 80px 20px;
    text-align: center;
    position: relative;
    z-index: 1; /* ставим ниже */
}
.phone-link {
    color: #f39c12;
    font-weight: 700;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s;
}
.phone-link:hover {
    color: #d35400;
}
form {
    max-width: 600px;
    margin: 30px auto 0;
}
form input, form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}
form textarea {
    height: 120px;
    resize: none;
}
footer {
    background: #1f2a40;
    color: white;
    text-align: center;
    padding: 15px 0;
}

/* Анимации */
.fade-in, .fade-in-delay, .zoom-in, .slide-up {
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease-in-out;
}
.fade-in.animated, .fade-in-delay.animated, .zoom-in.animated, .slide-up.animated {
    opacity: 1;
    transform: translateY(0);
}
.pulse {
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
@media (max-width: 768px) {
   .header-flex {
    flex-direction: column;
    align-items: center; /* центрируем весь контент хедера */
    text-align: center;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center; /* центрируем ссылки */
    margin-top: 10px;
}

nav a {
    margin: 0;
    display: inline-block;
}



    .hero-content h1 {
        font-size: 28px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .btn {
        font-size: 16px;
        padding: 12px 24px;
    }

    .card-grid {
        flex-direction: column;
        gap: 20px;
    }

    .card {
        flex: 1 1 100%;
        padding: 20px;
    }

    .card::after {
        font-size: 14px;
        width: 90%;
        padding: 15px;
    }

    form input, form textarea {
        font-size: 14px;
        padding: 10px;
    }

    .services h2, .contact h2 {
        font-size: 26px;
    }

    .container {
        padding: 15px;
    }

    .logo {
        font-size: 22px;
    }

    .phone-link {
        font-size: 16px;
    }

    footer p {
        font-size: 14px;
    }
}
















.portfolio {
    padding: 80px 20px;
    background: #f5f6fa;
    text-align: center;
    padding-bottom: 120px;
}
.portfolio-title {
    font-size: 32px;
    margin-bottom: 10px;
}
.portfolio-subtitle {
    font-size: 18px;
    margin-bottom: 40px;
    color: #7f8c8d;
}
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    position: relative;
    z-index: 1;
}
.portfolio-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, z-index 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

/* Увеличение поверх всех при наведении */
.portfolio-grid img:hover {
    transform: scale(2.2);
    z-index: 999;
    position: relative;
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}
