:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --text: #181c29;
    --muted-text: #5f6472;
    --primary: #3956f5;
    --primary-dark: #2c45cd;
    --border: #dfe3ef;
    --shadow: 0 12px 35px rgba(24, 28, 41, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: radial-gradient(circle at top right, #ecf0ff 0%, var(--bg) 42%, #eef2ff 100%);
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.section {
    padding: 92px 0;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h2 {
    margin-bottom: 18px;
    font-size: clamp(1.7rem, 2vw, 2.3rem);
    line-height: 1.2;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
    background: rgba(244, 246, 251, 0.84);
    border-bottom: 1px solid rgba(223, 227, 239, 0.75);
}

.site-header .container {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    color: var(--text);
    text-decoration: none;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-quick-contacts {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-phone {
    color: var(--muted-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.header-phone:hover {
    color: var(--primary);
}

.site-header .header-quick-contacts .social-icon {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    border-radius: 0;
}

.site-header .header-quick-contacts .social-icon:hover {
    border: 0;
    background: transparent;
    transform: none;
}

nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 22px;
    margin: 0;
    padding: 0;
}

nav a {
    position: relative;
    display: inline-block;
    color: var(--muted-text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

nav a:hover {
    color: var(--primary);
}

nav a:hover::after,
nav a.is-active::after {
    transform: scaleX(1);
}

nav a.is-active {
    color: var(--primary);
    font-weight: 700;
}

.nav-toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
}

.hero {
    padding-top: 108px;
    background-image: linear-gradient(rgba(244, 246, 251, 0.78), rgba(244, 246, 251, 0.78)),
        url('assets/images/hero-bg.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.inner-hero {
    padding-bottom: 56px;
}

.badge {
    display: inline-block;
    margin-bottom: 22px;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--primary);
    border: 1px solid #cfdaff;
    background: #eaf0ff;
    font-size: 0.93rem;
    font-weight: 600;
}

.hero h1 {
    max-width: 900px;
    font-size: clamp(2rem, 4.1vw, 3.25rem);
    line-height: 1.08;
    margin-bottom: 20px;
}

.hero p {
    max-width: 760px;
    color: var(--muted-text);
    font-size: clamp(1rem, 1.45vw, 1.2rem);
    margin-bottom: 34px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 38px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    padding: 12px 20px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface);
}

.stats-grid,
.cards-grid,
.about-grid,
.contact-grid {
    display: grid;
    gap: 20px;
}

.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card,
.card,
.profile-card,
#consultForm,
.contact-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 24px;
}

.stat-card h3 {
    color: var(--primary);
    font-size: 1.7rem;
    margin-bottom: 4px;
}

.stat-card p {
    color: var(--muted-text);
}

.about-grid {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
}

.about-grid p {
    color: var(--muted-text);
    margin-bottom: 14px;
}

.features-list {
    margin: 22px 0 0;
    padding-left: 18px;
}

.features-list li {
    margin-bottom: 8px;
}

.profile-card {
    padding: 28px;
    text-align: center;
}

.profile-avatar {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 14px;
    object-fit: cover;
    object-position: center;
    border: 2px solid #fff;
    box-shadow: 0 10px 24px rgba(24, 28, 41, 0.16);
}

.profile-card p {
    margin: 6px 0 14px;
    color: var(--muted-text);
}

.text-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}

.muted {
    background: linear-gradient(180deg, rgba(234, 240, 255, 0.55), rgba(234, 240, 255, 0.24));
}

.cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
    padding: 26px;
}

.service-image {
    width: 100%;
    height: 170px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 14px;
}

.card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.card p {
    color: var(--muted-text);
    margin-bottom: 14px;
}

.review p {
    font-style: italic;
}

.review cite {
    color: var(--primary);
    font-style: normal;
    font-weight: 600;
}

.review-image {
    padding: 0;
    overflow: hidden;
}

.review-image img {
    display: block;
    width: 100%;
    height: auto;
}

@media (hover: hover) and (pointer: fine) {
    #services .card {
        transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    }

    #services .card:hover {
        transform: translateY(-4px);
        border-color: #c9d4ff;
        box-shadow: 0 16px 34px rgba(24, 28, 41, 0.12);
    }

    .reviews-grid .review {
        transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    }

    .reviews-grid .review:hover {
        transform: translateY(-4px);
        border-color: #c9d4ff;
        box-shadow: 0 16px 34px rgba(24, 28, 41, 0.12);
    }
}

.consult {
    background: linear-gradient(180deg, #eef3ff 0%, #f7f9ff 100%);
}

.section-subtitle {
    margin-bottom: 22px;
    color: var(--muted-text);
}

#consultForm {
    max-width: none;
    width: 100%;
    margin: 0 auto;
    padding: 28px;
    display: block;
}

.consult-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

#consultForm .form-group {
    display: grid;
    gap: 8px;
}

.form-group-full {
    grid-column: 1 / -1;
}

#consultForm .form-group label {
    margin: 0;
    font-weight: 600;
}

#consultForm input:not([type='checkbox']),
#consultForm textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    color: var(--text);
    background: #fff;
}

#consultForm input:not([type='checkbox']):focus,
#consultForm textarea:focus {
    outline: none;
    border-color: #a7b8ff;
    box-shadow: 0 0 0 3px rgba(57, 86, 245, 0.16);
}

.consent-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    color: var(--muted-text);
    font-size: 0.95rem;
}

.consent-row input[type='checkbox'] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--primary);
}

.consent-row span {
    display: block;
    line-height: 1.4;
}

.consent-row a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent-row a:hover {
    color: var(--primary);
}

#consultForm button {
    display: flex;
    margin-top: 18px;
    margin-left: auto;
    padding: 14px 28px;
    min-width: 260px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(57, 86, 245, 0.28);
}

.form-status {
    min-height: 24px;
    margin-top: 6px;
    color: var(--primary);
    font-weight: 600;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
    will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.contact {
    padding-top: 76px;
}

.contacts-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        'phone phone'
        'details map';
    gap: 22px;
    align-items: stretch;
}

.contact-phone-panel {
    grid-area: phone;
}

.contact-details-panel {
    grid-area: details;
}

.contact-map-panel {
    grid-area: map;
    height: 100%;
}

.contact-map-panel>div {
    width: 100% !important;
    height: 100% !important;
}

.contact-info-stack {
    display: grid;
    gap: 14px;
}

.contact-panel {
    display: grid;
    gap: 14px;
}

.contact-topline {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.panel-divider {
    height: 1px;
    width: 100%;
    background: var(--border);
}

.details-list {
    display: grid;
    gap: 12px;
}

.contact-line {
    display: grid;
    gap: 8px;
}

.phone-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.phone-link,
.email-link {
    color: var(--text);
    text-decoration: none;
}

.phone-link:hover,
.email-link:hover {
    color: var(--primary);
}

.messenger-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

.messenger-link {
    position: relative;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    line-height: 0;
    flex: 0 0 auto;
}

.messenger-badge {
    display: block;
    width: auto;
    height: auto;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.messenger-badge img {
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
    object-position: center;
}

.messenger-link:hover .messenger-badge,
.messenger-link:focus-visible .messenger-badge {
    transform: translateY(-1px);
}

.qr-popover {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(8px);
    opacity: 0;
    pointer-events: none;
    width: 170px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 8px;
    text-align: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 5;
}

.qr-popover img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.qr-popover span {
    margin-top: 6px;
    display: block;
    font-size: 0.8rem;
    color: var(--muted-text);
}

.messenger-link:hover .qr-popover,
.messenger-link:focus-visible .qr-popover {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.media-strip {
    gap: 10px;
}

.media-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.media-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    line-height: 0;
}

.media-icon img {
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
    object-position: center;
}

.media-icon:hover {
    transform: translateY(-1px);
}

.contact-inline-cta {
    margin-top: 6px;
}

.contact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-item {
    text-decoration: none;
    color: var(--text);
    padding: 20px;
}

.contact-item span {
    display: block;
    color: var(--muted-text);
    margin-bottom: 6px;
}

.inline-cta {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.inline-cta p {
    color: var(--muted-text);
}

.map-wrap {
    margin-top: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--surface);
}

.contacts-layout .map-wrap {
    margin-top: 0;
    min-height: 100%;
}

.map-link {
    display: block;
    width: 100%;
    height: 100%;
}

.map-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
    object-position: center;
}

.map-wrap iframe {
    display: block;
    width: 100%;
    border: 0;
}

.map-wrap [class*='ymaps'] {
    width: 100% !important;
    height: 100% !important;
}

footer {
    padding: 26px 0 34px;
    text-align: center;
    color: var(--muted-text);
}

.footer-contact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.footer-phone {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.footer-phone:hover {
    color: var(--primary);
}

.footer-socials {
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.82rem;
    display: grid;
    place-items: center;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.social-icon:hover {
    color: var(--primary);
    border-color: #c9d4ff;
    transform: translateY(-1px);
}

.social-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.social-icon img {
    width: 18px;
    height: 18px;
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

@media (max-width: 1024px) {

    .qr-popover,
    .messenger-link:hover .qr-popover,
    .messenger-link:focus-visible .qr-popover {
        display: none;
        opacity: 0;
        transform: translateX(-50%) translateY(8px);
    }

    .stats-grid,
    .cards-grid,
    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .contacts-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            'phone'
            'map'
            'details';
    }

}

@media (hover: none),
(pointer: coarse) {

    .qr-popover,
    .messenger-link:hover .qr-popover,
    .messenger-link:focus-visible .qr-popover {
        display: none;
        opacity: 0;
        transform: translateX(-50%) translateY(8px);
    }
}

@media (max-width: 760px) {
    .section {
        padding: 72px 0;
    }

    .site-header .container {
        min-height: 70px;
    }

    .header-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding-top: 4px;
    }

    .header-quick-contacts {
        display: flex;
        gap: 6px;
    }

    .header-phone {
        font-size: 0.88rem;
    }

    .nav-toggle {
        display: grid;
        place-items: center;
    }

    nav {
        position: absolute;
        left: 0;
        right: 0;
        top: 70px;
        background: rgba(244, 246, 251, 0.98);
        border-bottom: 1px solid var(--border);
        transform: translateY(-130%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    nav ul {
        padding: 16px 20px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .stats-grid,
    .cards-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    #consultForm {
        padding: 20px;
    }

    .consult-fields {
        grid-template-columns: 1fr;
    }

    #consultForm button {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    .inline-cta {
        justify-content: flex-start;
    }

    .phone-line {
        align-items: flex-start;
    }

    .footer-contact-row {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

}