:root {
        --wood-dark: #4a3728;
        --wood-mid: #6b4c33;
        --wood-light: #8b6b4a;
        --foliage-dark: #1e3b2f;
        --foliage-mid: #2d5a3f;
        --foliage-light: #3e7548;
        --gold: #ffffff;
        --gold-light: #ffffff;
        --parchment: #ffffff;
        --parchment-dark: #ffffff;
        --shadow-forest: 0 8px 24px rgba(0,0,0,0.3);
        --radius: 4px;
        --transition: 0.3s ease;
    }

    .main-content,
    .main-content *,
    .main-content *::before,
    .main-content *::after {
        box-sizing: border-box;
    }

    .main-content {
        flex: 1;
        padding: clamp(1.25rem, 3vw, 2.5rem) 1.5rem;
        max-width: none;
        margin: 0;
        width: 100%;
        min-height: 100vh;
        overflow-x: hidden;
        position: relative;
        z-index: 1;
        font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
        background: linear-gradient(135deg, #1a2f1f 0%, #0f1f14 100%);
        background-attachment: fixed;
        color: #ffffff;
        line-height: 1.6;
    }
    .main-content::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(ellipse at 30% 20%, rgba(180,200,120,0.08) 0%, transparent 60%),
                    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" opacity="0.08"><path d="M50 20 Q80 5 100 30 Q120 10 150 25 Q160 50 140 70 Q150 100 120 120 Q90 140 60 120 Q30 130 20 100 Q5 70 30 50 Z" fill="%23a5d6a7"/></svg>') repeat;
        pointer-events: none;
        z-index: -1;
    }

    /* Анимация появления видов */
    .main-content > .view {
        width: min(1200px, 100%);
        margin: 0 auto;
    }

    .view {
        display: none;
        opacity: 0;
        transition: opacity 0.4s ease;
    }
    .view.active {
        display: block;
        opacity: 1;
    }

    .section-title {
        font-family: Georgia, 'Times New Roman', serif;
        font-size: clamp(2rem, 5vw, 2.8rem);
        font-weight: 700;
        color: var(--gold);
        text-align: center;
        margin-bottom: 2rem;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
        letter-spacing: 1px;
        overflow-wrap: anywhere;
    }

    /* Видео-блок */
    .hero-video {
        position: relative;
        width: 100%;
        height: clamp(180px, 32vw, 350px);
        overflow: hidden;
        border-radius: 8px;
        margin-bottom: 2.5rem;
        border: 3px solid var(--wood-light);
        box-shadow: 0 12px 28px rgba(0,0,0,0.5);
    }
    .hero-video__source {
        position: absolute;
        top: 50%;
        left: 50%;
        min-width: 100%;
        min-height: 100%;
        transform: translate(-50%, -50%);
        object-fit: cover;
    }
    .hero-video__overlay {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.4);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .hero-video__text {
        font-family: Georgia, 'Times New Roman', serif;
        font-size: 2rem;
        color: var(--gold);
        text-shadow: 2px 2px 4px black;
        padding: 1rem;
        text-align: center;
    }

    /* Поиск и фильтры */
    .tools {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 1.2rem;
        margin-bottom: 2.5rem;
    }
    .search-wrapper {
        position: relative;
        flex: 1 1 260px;
        min-width: 0;
    }
    .search-wrapper input {
        width: 100%;
        padding: 0.8rem 3rem 0.8rem 3rem;
        border-radius: 30px;
        border: 2px solid var(--wood-light);
        background: rgba(255, 255, 255, 0.9);
        font-size: 0.95rem;
        font-family: inherit;
        color: var(--wood-dark);
        transition: border-color var(--transition), box-shadow var(--transition);
    }
    .search-wrapper input:focus {
        border-color: var(--gold);
        outline: none;
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
        background: #fff;
    }
    .search-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--wood-mid);
        font-size: 1.2rem;
    }
    .search-clear {
        position: absolute;
        right: 0.8rem;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--wood-mid);
        cursor: pointer;
        padding: 0 0.2rem;
        line-height: 1;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
    }
    .search-clear.visible {
        opacity: 1;
        pointer-events: auto;
    }
    .filter-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 0.6rem;
        min-width: 0;
    }
    .chip {
        padding: 0.5rem 1.3rem;
        border-radius: 30px;
        border: 2px solid var(--wood-light);
        background: rgba(255, 255, 255, 0.25);
        color: var(--parchment);
        font-weight: 500;
        font-size: 0.9rem;
        font-family: inherit;
        cursor: pointer;
        transition: background var(--transition), color var(--transition), border-color var(--transition);
        backdrop-filter: blur(4px);
        white-space: normal;
    }
    .chip.active,
    .chip:hover {
        background: var(--gold);
        color: var(--wood-dark);
        border-color: var(--gold);
        font-weight: 700;
    }
    .chip:focus-visible {
        outline: 2px solid var(--gold);
        outline-offset: 2px;
    }

    /* Сетка карточек экспертов */
    .expert-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
        gap: 2rem;
    }
    .expert-card {
        background: linear-gradient(145deg, #ffffff 0%, #ffffff 100%);
        border-radius: 2px;
        box-shadow: 0 12px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
        overflow: hidden;
        cursor: pointer;
        transition: transform 0.4s ease, box-shadow 0.4s ease;
        display: flex;
        flex-direction: column;
        border: 2px solid var(--wood-light);
        outline: none;
        opacity: 0;
        transform: translateY(30px);
        position: relative;
        min-width: 0;
        color: inherit;
        text-decoration: none;
    }
    .expert-card::before {
        content: "";
        position: absolute;
        inset: 0;
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.07"><path d="M20 10 Q50 5 80 20 Q90 50 75 80 Q50 95 20 80 Q5 50 15 20 Z" fill="%234a3728"/></svg>') repeat;
        pointer-events: none;
    }
    .expert-card.visible {
        opacity: 1;
        transform: translateY(0);
    }
    .expert-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255, 255, 255, 0.8);
        border-color: var(--gold);
    }
    .expert-card:focus-visible {
        border-color: var(--gold);
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5);
    }
    .card-img {
        height: 180px;
        background: linear-gradient(135deg, #1e3b2f, #2d5a3f);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 3rem;
        font-weight: 700;
        color: var(--gold-light);
        text-transform: uppercase;
        position: relative;
        overflow: hidden;
        font-family: Georgia, 'Times New Roman', serif;
    }
    .card-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: relative;
        z-index: 1;
    }
    .card-img::after {
        content: "";
        position: absolute;
        top: -30%;
        left: -30%;
        width: 160%;
        height: 160%;
        background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    }
    .card-body {
        padding: 1.5rem;
        flex: 1;
        display: flex;
        flex-direction: column;
        position: relative;
        z-index: 1;
    }
    .card-body h3 {
        font-family: Georgia, 'Times New Roman', serif;
        font-size: 1.25rem;
        font-weight: 700;
        margin-bottom: 0.4rem;
        color: var(--wood-dark);
    }
    .card-body .role {
        font-size: 0.9rem;
        color: var(--wood-mid);
        margin-bottom: 1rem;
        font-style: italic;
    }
    .card-excerpt {
        margin: 0 0 1rem;
        color: #4c3b28;
        font-size: 0.88rem;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }
    .tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: auto;
    }
    .tag {
        background: rgba(107,76,51,0.2);
        color: var(--wood-dark);
        padding: 0.2rem 0.7rem;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
        border: 1px solid var(--wood-light);
    }

    /* Детальная страница эксперта */
    .expert-detail {
        background: var(--parchment);
        border-radius: 6px;
        box-shadow: var(--shadow-forest);
        overflow: hidden;
        display: grid;
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
        border: 3px solid var(--wood-light);
        position: relative;
        max-width: 100%;
    }
    .detail-sidebar {
        padding: 2rem;
        text-align: center;
        background: linear-gradient(160deg, #ffffff 0%, #ffffff 100%);
        border-right: 2px solid var(--wood-mid);
        min-width: 0;
    }
    .avatar {
        width: 150px;
        height: 150px;
        border-radius: 50%;
        background: linear-gradient(145deg, var(--foliage-dark), var(--foliage-mid));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 3rem;
        font-weight: 700;
        color: var(--gold-light);
        margin: 0 auto 1.5rem;
        border: 3px solid var(--gold);
        box-shadow: 0 4px 12px rgba(0,0,0,0.4);
        font-family: Georgia, 'Times New Roman', serif;
        overflow: hidden;
    }
    .avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .detail-sidebar h2 {
        font-family: Georgia, 'Times New Roman', serif;
        font-size: 1.6rem;
        color: var(--wood-dark);
        font-weight: 700;
        margin-bottom: 0.3rem;
    }
    .detail-sidebar h1 {
        font-family: Georgia, 'Times New Roman', serif;
        font-size: 1.6rem;
        color: var(--wood-dark);
        font-weight: 700;
        margin: 0 0 0.3rem;
    }
    .detail-sidebar .role {
        font-size: 1rem;
        color: var(--wood-mid);
        margin-bottom: 2rem;
        font-style: italic;
    }
    .contact-info {
        text-align: left;
        font-size: 0.9rem;
        color: var(--wood-dark);
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .contact-info p {
        margin-bottom: 0.6rem;
        display: flex;
        align-items: center;
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    .contact-info a {
        color: inherit;
        overflow-wrap: anywhere;
    }
    .detail-main {
        padding: 2.5rem 3rem;
        background: #ffffff;
        min-width: 0;
    }
    .detail-main h2 {
        font-family: Georgia, 'Times New Roman', serif;
        font-size: 1.5rem;
        font-weight: 700;
        margin-bottom: 1rem;
        color: var(--wood-dark);
        padding-bottom: 0.5rem;
        border-bottom: 2px solid var(--gold);
    }
    .bio {
        margin-bottom: 2.5rem;
        line-height: 1.7;
        color: #3a2c1c;
        overflow-wrap: anywhere;
    }
    .publications-list {
        list-style: none;
        color: #3a2c1c;
        padding-left: 0;
    }
    .publications-list li {
        margin-bottom: 0.8rem;
        padding-left: 2rem;
        position: relative;
        overflow-wrap: anywhere;
    }
    .publications-list li::before {
        content: "🌿";
        position: absolute;
        left: 0;
        font-size: 1rem;
    }
    .back-link {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        margin-bottom: 1.8rem;
        color: var(--gold);
        font-weight: 600;
        cursor: pointer;
        font-size: 1rem;
        background: none;
        border: none;
        padding: 0.5rem 0;
        font-family: inherit;
        transition: color var(--transition);
        text-decoration: none;
        max-width: 100%;
        text-align: left;
        flex-wrap: wrap;
    }
    .back-link::before {
        content: "←";
        font-size: 1.2rem;
    }
    .back-link:hover {
        color: var(--gold-light);
        text-decoration: underline;
    }
    .back-link:focus-visible {
        outline: 2px solid var(--gold);
        outline-offset: 2px;
        border-radius: 4px;
    }
    .no-results {
        text-align: center;
        padding: 3rem;
        color: var(--parchment-dark);
        font-size: 1.2rem;
        display: none;
    }
    .expert-card[hidden] {
        display: none;
    }

    /* Адаптивность */
    @media (max-width: 768px) {
        .main-content {
            padding: 1.5rem 1rem;
        }
        .section-title {
            font-size: 2rem;
        }
        .hero-video {
            height: 220px;
        }
        .hero-video__text {
            font-size: 1.5rem;
        }
        .expert-detail {
            grid-template-columns: 1fr;
        }
        .detail-sidebar {
            border-right: none;
            border-bottom: 2px solid var(--wood-mid);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 1.5rem;
        }
        .detail-main {
            padding: 1.5rem;
        }
        .avatar {
            width: 120px;
            height: 120px;
            font-size: 2.5rem;
        }
        .tools {
            flex-direction: column;
            align-items: stretch;
            gap: 0.9rem;
        }
        .search-wrapper {
            flex-basis: auto;
            width: 100%;
        }
        .filter-chips {
            width: 100%;
            justify-content: flex-start;
        }
    }
    @media (max-width: 480px) {
        .main-content {
            padding: 1rem 0.75rem;
        }
        .expert-grid {
            grid-template-columns: 1fr;
            gap: 1rem;
        }
        .card-body {
            padding: 1.15rem;
        }
        .card-img {
            height: 150px;
        }
        .section-title {
            font-size: 1.8rem;
        }
        .hero-video {
            height: 180px;
            border-width: 2px;
        }
        .hero-video__text {
            font-size: 1.2rem;
        }
        .filter-chips {
            justify-content: center;
        }
        .chip {
            flex: 1 1 calc(50% - 0.6rem);
            padding: 0.5rem 0.75rem;
            text-align: center;
        }
        .expert-detail {
            border-width: 2px;
        }
        .detail-sidebar {
            padding: 1.25rem 0.9rem;
        }
        .detail-main {
            padding: 1.25rem 0.9rem;
        }
        .detail-main h2 {
            font-size: 1.25rem;
        }
        .contact-info {
            width: 100%;
        }
    }
