:root {
    --page-gap: 12px;
    --header-radius: 20px;
    --brand-primary: #313830;
    --brand-primary-hover: #252b28;
    --brand-accent: #56705F;
    --brand-accent-hover: #455A4D;
    --brand-accent-soft: #D7E0D9;
    --brand-warm: #D5C7B7;
    --brand-secondary: #A8B69F;
    --brand-primary-shadow: rgba(86, 112, 95, 0.22);
    --bg-main: #F6F3EE;
    --bg-canvas: #e4ded6;
    --bg-card: #efeeeb;
    --bg-dark: #313830;
    --bg-dark-card: #455A4D;
    --text-main: #313830;
    --text-muted: #5C6159;
    --text-dark-muted: #A8B69F;
    --font-primary: 'M PLUS 1p', sans-serif;
    --font-heading: 'Exo 2', sans-serif;
    --font-secondary: 'Host Grotesk', 'Hanken Grotesk', sans-serif;
}

body {
    font-family: var(--font-primary);
    color: var(--text-main);
    padding: var(--page-gap);
}

[data-site-header] {
    position: relative;
    width: 100%;
    height: 68px;
    flex: 0 0 auto;
    z-index: 9999;
}

.site-header-shell {
    position: fixed;
    top: var(--page-gap);
    left: var(--page-gap);
    right: var(--page-gap);
    width: calc(100vw - (var(--page-gap) * 2));
    max-width: calc(100vw - (var(--page-gap) * 2));
    z-index: 9999;
    isolation: isolate;
    box-sizing: border-box;
}

.site-header-frame {
    position: relative;
    width: 100%;
    z-index: 9999;
}

.site-header-panel {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    min-height: 68px;
    border-radius: var(--header-radius);
    transition: height 500ms ease-in-out, box-shadow 300ms ease-in-out;
    box-sizing: border-box;
}

h1, h2, h3 {
    font-family: var(--font-heading);
}

.font-heading {
    font-family: var(--font-heading);
}

[data-animate-words] .word {
    display: inline-block;
    opacity: 0;
    filter: blur(12px);
    transform: translateY(16px);
    will-change: opacity, filter, transform;
}

[data-animate-words].is-visible .word {
    animation: wordIn 0.7s ease-out forwards;
    animation-delay: var(--word-delay, 0s);
}

@keyframes wordIn {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

.font-secondary {
    font-family: var(--font-secondary);
}

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* FAQ styles */
.faq-item[open] .faq-icon { transform: rotate(45deg); }
.faq-item summary { list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.pill { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; background: #D5C7B7; color: #313830; }
.faq-answer {
    height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    margin-top: 0;
    transition: height 380ms ease, opacity 280ms ease, transform 280ms ease, margin-top 280ms ease;
    will-change: height, opacity, transform;
}
.faq-item[open] .faq-answer {
    opacity: 1;
    transform: translateY(0);
    margin-top: 1rem;
}

/* Молочные панели на подложке #e4ded6 — без обводки, только тень */
.surface-panel {
    background-color: #efeeeb;
    box-shadow:
        0 1px 2px rgba(49, 56, 48, 0.05),
        0 8px 28px rgba(49, 56, 48, 0.07);
}

.float-chip {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 28px rgba(49, 56, 48, 0.12);
}

.card-gradient {
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
}

@media (min-width: 1024px) {
    .why-grid {
        height: 516px;
    }

    .why-side {
        height: 100%;
    }

    .why-card {
        flex: 1 1 0;
        min-height: 0;
    }

    .why-media {
        height: 100%;
        min-height: 0;
    }
}

@media (min-width: 1280px) {
    .why-grid {
        height: 556px;
    }
}

.slider-edge-fade {
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        black 24px,
        black calc(100% - 24px),
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0,
        black 24px,
        black calc(100% - 24px),
        transparent 100%
    );
}

@media (min-width: 640px) {
    .slider-edge-fade {
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0,
            black 36px,
            black calc(100% - 36px),
            transparent 100%
        );
        mask-image: linear-gradient(
            to right,
            transparent 0,
            black 36px,
            black calc(100% - 36px),
            transparent 100%
        );
    }
}

@media (min-width: 1024px) {
    .slider-edge-fade {
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0,
            black 56px,
            black calc(100% - 56px),
            transparent 100%
        );
        mask-image: linear-gradient(
            to right,
            transparent 0,
            black 56px,
            black calc(100% - 56px),
            transparent 100%
        );
    }
}

.tool-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 2rem;
    overflow: hidden;
    background-color: #F6F3EE;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 4px 20px rgba(49, 56, 48, 0.08);
}

.tool-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.tool-card-overlay {
    position: relative;
    z-index: 2;
    padding: 1.5rem;
    width: 100%;
    text-align: center;
    background: linear-gradient(to top, rgba(246, 243, 238, 0.96) 0%, rgba(246, 243, 238, 0.18) 72%, rgba(246, 243, 238, 0) 100%);
}

@media (min-width: 768px) {
    .tool-card {
        border-radius: 2.5rem;
    }

    .tool-card-overlay {
        padding: 2rem;
    }
}

.service-media-card {
    position: relative;
    display: block;
    min-height: 320px;
    border-radius: 1.75rem;
    overflow: hidden;
    background-color: #d9d1c8;
    box-shadow: 0 10px 32px rgba(49, 56, 48, 0.1);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.service-media-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 42px rgba(49, 56, 48, 0.14);
}

.service-media-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-media-card:hover .service-media-image {
    transform: scale(1.04);
}

.service-media-fade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(49, 56, 48, 0.06) 0%, rgba(49, 56, 48, 0.16) 55%, rgba(49, 56, 48, 0.56) 100%);
}

.service-media-content {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 2;
    padding: 1.25rem;
}

.service-media-blur {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 1;
    height: 42%;
    background: linear-gradient(180deg, rgba(49, 56, 48, 0) 0%, rgba(49, 56, 48, 0.2) 30%, rgba(49, 56, 48, 0.5) 68%, rgba(49, 56, 48, 0.74) 100%);
}

.specialist-directory-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    width: 100%;
    max-width: none;
}

.specialist-directory-media {
    flex-shrink: 0;
    aspect-ratio: 4 / 5;
    background: #d7e0d9;
}

.specialist-directory-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.specialist-directory-name {
    min-height: 2.5em;
}

.specialist-directory-role {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: calc(1.4em * 2);
}

.specialist-directory-link {
    white-space: nowrap;
}

.spec-list-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: calc(1.2em * 2);
}

.spec-list-card-role {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: calc(1.45em * 2);
}

.specialist-directory-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    justify-content: center;
}

.specialist-directory-grid > .specialist-directory-card {
    margin-inline: auto;
}

.specialist-mini-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.specialist-profile-aside {
    top: calc(68px + (var(--page-gap) * 2) + 12px);
}

@media (min-width: 768px) {
    .service-media-content {
        padding: 1.5rem;
    }
}

@media (min-width: 640px) {
    .specialist-directory-card {
        max-width: 224px;
    }

    .specialist-directory-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 224px));
    }

    .specialist-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .specialist-mini-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.pill.is-active {
    background: #56705F;
    color: #fff;
}

.blog-search-input {
    width: 100%;
    background: #f6f3ee;
    border-radius: 999px;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    font-size: 14px;
    color: #313830;
    outline: none;
    transition: box-shadow 0.2s ease;
}

.blog-search-input::placeholder {
    color: #a8b69f;
}

.blog-search-input:focus {
    box-shadow: 0 0 0 2px rgba(86, 112, 95, 0.28);
}

.cert-card img {
    transition: transform 0.5s ease;
}

.cert-card:hover img {
    transform: scale(1.05);
}

.blog-article-content p {
    margin-bottom: 1.5rem;
    color: #5C6159;
    font-size: 1rem;
    line-height: 1.75;
}

.blog-article-content h2 {
    margin-top: 2.75rem;
    margin-bottom: 1.15rem;
    color: #313830;
    font-size: 1.65rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.blog-article-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #313830;
    font-size: 1.3rem;
    font-weight: 500;
}

.blog-article-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.4rem;
    color: #5C6159;
    font-size: 1rem;
    line-height: 1.75;
    list-style: disc;
}

.blog-article-content li {
    margin-bottom: 0.5rem;
}

.blog-article-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem;
    border-left: 4px solid #56705F;
    border-radius: 0 1rem 1rem 0;
    background: rgba(215, 224, 217, 0.4);
    color: #313830;
    font-size: 1.08rem;
    font-style: italic;
}

.form-input:focus {
    outline: none;
    border-color: #56705f;
    box-shadow: 0 0 0 3px rgba(86, 112, 95, 0.15);
}

@media (min-width: 768px) {
    .blog-article-content p,
    .blog-article-content ul {
        font-size: 1.0625rem;
    }

    .blog-article-content h2 {
        font-size: 1.75rem;
    }

    .blog-article-content h3 {
        font-size: 1.35rem;
    }

    .blog-article-content blockquote {
        font-size: 1.125rem;
    }
}

.testimonials-edge-fade {
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0,
        black 28px,
        black calc(100% - 28px),
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0,
        black 28px,
        black calc(100% - 28px),
        transparent 100%
    );
}

@media (min-width: 768px) {
    .testimonials-edge-fade {
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0,
            black 120px,
            black calc(100% - 120px),
            transparent 100%
        );
        mask-image: linear-gradient(
            to right,
            transparent 0,
            black 120px,
            black calc(100% - 120px),
            transparent 100%
        );
    }
}

@media (min-width: 1024px) {
    .testimonials-edge-fade {
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0,
            black 180px,
            black calc(100% - 180px),
            transparent 100%
        );
        mask-image: linear-gradient(
            to right,
            transparent 0,
            black 180px,
            black calc(100% - 180px),
            transparent 100%
        );
    }
}

.testimonials-track {
    display: flex;
    gap: 0.75rem;
    width: max-content;
    animation: marquee-scroll 60s linear infinite;
}

.testimonials-wrapper:hover .testimonials-track {
    animation-play-state: paused;
}

@keyframes marquee-scroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .testimonials-track {
        animation: none;
    }
}

.testimonial-card {
    flex: 0 0 auto;
    width: 304px;
}

@media (min-width: 640px) {
    .testimonials-track {
        gap: 1rem;
    }

    .testimonial-card {
        width: 344px;
    }
}

@media (min-width: 1024px) {
    .testimonials-track {
        gap: 1.25rem;
    }

    .testimonial-card {
        width: 360px;
    }
}

.slider-section-height {
    min-height: clamp(540px, calc(88vh - 24px), 820px);
}

.slider-card-height {
    min-height: clamp(240px, 36vh, 360px);
}

@supports (height: 100dvh) {
    .slider-section-height {
        min-height: clamp(540px, calc(88dvh - 24px), 820px);
    }

    .slider-card-height {
        min-height: clamp(240px, 36dvh, 360px);
    }
}

@media (min-width: 768px) {
    .slider-section-height {
        min-height: clamp(600px, calc(82vh - 24px), 860px);
    }

    .slider-card-height {
        min-height: clamp(280px, 34vh, 380px);
    }
}

@supports (height: 100dvh) {
    @media (min-width: 768px) {
        .slider-section-height {
            min-height: clamp(600px, calc(82dvh - 24px), 860px);
        }

        .slider-card-height {
            min-height: clamp(280px, 34dvh, 380px);
        }
    }
}
