/* ============================================================
   Институт химии и фитотехнологий НАН КР
   Строгая академическая стилистика + креативные молекулярные мотивы
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,500;0,600;0,700;0,800;1,500&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    /* Академическая палитра */
    --navy: #0b2545;
    --navy-2: #10365c;
    --navy-3: #164a7a;
    --emerald: #0e7c5b;
    --emerald-dark: #0a5c44;
    --gold: #c6a34f;
    --gold-light: #e3c987;

    --text-primary: #14202e;
    --text-secondary: #4b5a6b;
    --text-tertiary: #7d8a99;

    --bg-page: #f4f7fa;
    --bg-card: #ffffff;
    --bg-alt: #eaf0f5;
    --bg-dark-section: var(--navy);

    --border: #dbe4ec;
    --border-strong: #c3d0dd;

    --shadow-sm: 0 1px 3px rgba(11, 37, 69, .08);
    --shadow-md: 0 6px 18px rgba(11, 37, 69, .10);
    --shadow-lg: 0 18px 40px rgba(11, 37, 69, .16);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;

    --header-h: 196px;
    --transition: all .3s cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
    --text-primary: #e8eef5;
    --text-secondary: #aebdcc;
    --text-tertiary: #7d8fa1;
    --bg-page: #0a1626;
    --bg-card: #102338;
    --bg-alt: #0c1c30;
    --border: #1e3a55;
    --border-strong: #2a4a6b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .3);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, .35);
    --shadow-lg: 0 18px 40px rgba(0, 0, 0, .45);
}

/* ---------- База ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Manrope', -apple-system, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background .3s ease, color .3s ease;
}

body.no-scroll { overflow: hidden; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

p { color: var(--text-secondary); margin-bottom: 1.25rem; }

img { max-width: 100%; display: block; }

a { color: var(--navy-3); }
[data-theme="dark"] a { color: var(--gold-light); }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Индикатор чтения ---------- */
.reading-progress {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: linear-gradient(90deg, var(--emerald), var(--gold));
    z-index: 2000; transition: width .1s linear;
}

/* ---------- Верхняя служебная полоса ---------- */
.topbar {
    background: var(--navy);
    color: rgba(255, 255, 255, .82);
    font-size: .85rem;
    letter-spacing: .02em;
}

.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding-top: .5rem; padding-bottom: .5rem;
    flex-wrap: wrap;
}

.topbar-left { display: flex; align-items: center; gap: .75rem; }
.topbar-left .hex-icon { color: var(--gold); }
.nan-logo {
    width: 40px; height: 40px; object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
    flex-shrink: 0;
}
.topbar-left span {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: .04em;
}

.topbar-right { display: flex; align-items: center; gap: 1.25rem; }

.topbar-link {
    color: rgba(255, 255, 255, .82); text-decoration: none;
    transition: var(--transition); font-weight: 500;
}
.topbar-link:hover { color: var(--gold-light); }

/* Переключатель темы */
.theme-toggle { cursor: pointer; display: inline-flex; }
.theme-toggle input { display: none; }
.toggle-slider {
    position: relative; width: 44px; height: 22px; border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 5px; transition: var(--transition);
}
.toggle-slider::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--gold); transition: var(--transition);
}
.theme-toggle input:checked + .toggle-slider::after { transform: translateX(22px); }
.toggle-icon { color: rgba(255, 255, 255, .85); display: flex; z-index: 1; }

/* ---------- Шапка ---------- */
#header {
    position: sticky; top: 0; z-index: 1000;
    background: color-mix(in srgb, var(--bg-card) 88%, transparent);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
#header.compact {
    background: color-mix(in srgb, var(--bg-card) 94%, transparent);
    box-shadow: 0 10px 30px rgba(11, 37, 69, .08);
}

.header-inner {
    display: flex; align-items: center; gap: 1.75rem;
    padding-top: 1.5rem; padding-bottom: 1.5rem;
    transition: var(--transition);
}

#header.compact .header-inner { padding-top: .6rem; padding-bottom: .6rem; }

.brand { display: flex; align-items: center; gap: 1.25rem; text-decoration: none; flex: 1; min-width: 0; }

.logo {
    width: 96px; height: 96px; object-fit: contain;
    transition: var(--transition); flex-shrink: 0;
}
#header.compact .logo { width: 64px; height: 64px; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
/* Футер всегда тёмный — всегда белый логотип */
footer .logo-light { display: none; }
footer .logo-dark { display: block; }

.brand-text { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.brand-text strong {
    font-family: 'Playfair Display', serif;
    font-size: 1.72rem; line-height: 1.12; color: var(--navy);
    transition: var(--transition);
}
[data-theme="dark"] .brand-text strong { color: #fff; }
#header.compact .brand-text strong { font-size: 1.25rem; }
.brand-text small {
    color: var(--text-tertiary); font-size: .85rem;
    letter-spacing: .05em; text-transform: uppercase;
}

/* Поиск */
.site-search {
    display: flex; align-items: center;
    border: 1px solid var(--border-strong); border-radius: 999px;
    padding: .3rem .3rem .3rem 1rem; background: var(--bg-page);
    min-width: 240px; transition: var(--transition);
}
.site-search:focus-within { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(14, 124, 91, .15); }
.site-search input {
    border: none; outline: none; background: transparent;
    font: inherit; font-size: .9rem; color: var(--text-primary); flex: 1; min-width: 0;
}
.site-search input::placeholder { color: var(--text-tertiary); }
.site-search button {
    border: none; cursor: pointer; border-radius: 50%;
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    background: var(--navy); color: #fff; transition: var(--transition);
}
.site-search button:hover { background: var(--emerald); }

/* Навигация */
.header-nav {
    background: var(--navy);
    position: relative;
}
.header-nav::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.main-nav {
    list-style: none; display: flex; justify-content: center;
    gap: .25rem; flex-wrap: wrap;
}
.main-nav a {
    display: block; color: rgba(255, 255, 255, .88); text-decoration: none;
    padding: 1.2rem 1.15rem; font-size: .95rem; font-weight: 600;
    letter-spacing: .02em; position: relative; transition: var(--transition);
}
.main-nav a::after {
    content: ''; position: absolute; left: 50%; bottom: 6px;
    width: 0; height: 2px; background: var(--gold);
    transform: translateX(-50%); transition: var(--transition);
}
.main-nav a:hover { color: #fff; }
.main-nav a:hover::after, .main-nav a.active::after { width: 55%; }
.main-nav a.active { color: var(--gold-light); }

/* Dropdown меню */
.main-nav li.has-dropdown { position: relative; }
.main-nav li.has-dropdown > a {
    display: flex; align-items: center; gap: .35rem;
}
.main-nav li.has-dropdown > a::before {
    content: '';
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255,255,255,.7);
    margin-left: .15rem;
    transition: transform .25s ease;
    flex-shrink: 0;
}
.main-nav li.has-dropdown:hover > a::before,
.main-nav li.has-dropdown:focus-within > a::before,
.main-nav li.has-dropdown.open > a::before { transform: rotate(180deg); }

/* Крестик закрытия — только в мобильной панели, не в десктопной шапке */
.mobile-nav-close {
    display: none !important;
}

.dropdown {
    position: absolute; top: 100%; left: 0;
    background: var(--navy-2); min-width: 300px;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: all .25s cubic-bezier(.4,0,.2,1);
    z-index: 100; list-style: none; padding: .4rem 0;
    border-top: 2px solid var(--gold);
}
.main-nav li.has-dropdown:hover .dropdown,
.main-nav li.has-dropdown:focus-within .dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown li { width: 100%; }
.dropdown a {
    padding: .75rem 1.25rem; font-size: .88rem; font-weight: 500;
    white-space: nowrap; border-bottom: 1px solid rgba(255,255,255,.06);
    display: block; transition: var(--transition);
}
.dropdown a:hover {
    background: rgba(255,255,255,.08); color: var(--gold-light);
    padding-left: 1.5rem;
}
.dropdown a.active { color: var(--gold-light); background: rgba(255,255,255,.06); }

/* Гамбургер */
.hamburger-menu {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: .5rem;
}
.hamburger-menu span {
    width: 26px; height: 2px; background: var(--navy);
    transition: var(--transition); display: block;
}
[data-theme="dark"] .hamburger-menu span { background: #fff; }
.hamburger-menu.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-menu.active span:nth-child(2) { opacity: 0; }
.hamburger-menu.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---------- HERO ---------- */
.hero {
    position: relative; min-height: calc(100vh - var(--header-h));
    display: flex; flex-direction: column; justify-content: center;
    color: #fff; overflow: hidden;
}

.hero-background { position: absolute; inset: 0; z-index: 0; }
.hero-bg-image {
    width: 100%; height: 100%; object-fit: cover;
    filter: brightness(1.18) saturate(1.1) contrast(1.04);
    transform: scale(1.06);
    animation: heroKenBurns 28s ease-in-out infinite alternate;
}
.hero-overlay {
    position: absolute; inset: 0;
    background:
        linear-gradient(105deg, rgba(8, 26, 48, .46) 0%, rgba(8, 26, 48, .18) 46%, rgba(14, 124, 91, .08) 100%),
        radial-gradient(ellipse at 78% 38%, rgba(255, 255, 255, .16), transparent 58%);
}
.molecule-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-content {
    position: relative; z-index: 2;
    padding-top: 5.5rem; padding-bottom: 3rem;
    max-width: 1240px;
}

.hero-kicker {
    color: var(--gold-light); text-transform: uppercase;
    letter-spacing: .22em; font-size: .8rem; font-weight: 700;
    margin-bottom: 1.25rem; display: flex; align-items: center; gap: .75rem;
}
.hero-kicker::before {
    content: ''; width: 42px; height: 1px; background: var(--gold);
}

.hero-title {
    font-size: clamp(2.4rem, 5.4vw, 4.2rem);
    color: #fff; margin-bottom: 1.5rem; line-height: 1.08;
}
.hero-title em {
    font-style: italic; color: var(--gold-light);
    position: relative;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: rgba(255, 255, 255, .85);
    max-width: 620px; margin-bottom: 2.5rem;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Кнопки */
.btn {
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .9rem 2rem; border-radius: 4px;
    font-weight: 700; font-size: .95rem; letter-spacing: .04em;
    text-transform: uppercase; text-decoration: none;
    transition: var(--transition); border: 1px solid transparent;
    cursor: pointer;
}
.btn-gold {
    background: var(--gold); color: var(--navy);
}
.btn-gold:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(198, 163, 79, .35); }
.btn-ghost {
    border-color: rgba(255, 255, 255, .5); color: #fff;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }

/* Статистика hero */
.hero-stats {
    position: relative; z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, .18);
    background: rgba(11, 37, 69, .45);
    backdrop-filter: blur(8px);
}
.hero-stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
}
.hero-stat {
    padding: 1.6rem 1rem; text-align: center;
    border-left: 1px solid rgba(255, 255, 255, .12);
}
.hero-stat:first-child { border-left: none; }
.stat-number {
    display: block; font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 700;
    color: var(--gold-light);
}
.stat-number::after { content: '+'; font-size: .6em; opacity: .75; }
.hero-stat:last-child .stat-number::after { content: ''; }
.stat-caption {
    font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
    color: rgba(255, 255, 255, .75);
}

/* Подсказка скролла */
.scroll-hint {
    position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%);
    width: 26px; height: 42px; border: 2px solid rgba(255, 255, 255, .5);
    border-radius: 14px; z-index: 2;
}
.scroll-hint span {
    position: absolute; top: 7px; left: 50%; margin-left: -2px;
    width: 4px; height: 8px; border-radius: 2px; background: var(--gold);
    animation: scrollHint 1.8s ease-in-out infinite;
}
@keyframes scrollHint {
    0%, 100% { transform: translateY(0); opacity: 1; }
    60% { transform: translateY(12px); opacity: .2; }
}

/* ---------- Секции ---------- */
.section { padding: 6rem 0; background: var(--bg-page); transition: background .3s ease; }
.section-alt { background: var(--bg-alt); }

.section-head { margin-bottom: 3.5rem; max-width: 720px; }
.section-eyebrow {
    display: inline-flex; align-items: center; gap: .6rem;
    color: var(--emerald); font-size: .78rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .2em; margin-bottom: 1rem;
}
.section-eyebrow::before {
    content: ''; width: 12px; height: 12px; background: none;
    border: 2px solid var(--gold);
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.section-title {
    font-size: clamp(1.8rem, 3.4vw, 2.7rem);
    position: relative; padding-bottom: 1.25rem;
}
.section-title::after {
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 84px; height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--emerald));
}
.section-head--light .section-title { color: #fff; }
.section-head--light .section-eyebrow { color: var(--gold-light); }

/* Анимация появления */
.reveal {
    opacity: 0; transform: translateY(36px);
    transition: opacity .8s cubic-bezier(.4, 0, .2, 1), transform .8s cubic-bezier(.4, 0, .2, 1);
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------- О нас ---------- */
.lead { font-size: 1.18rem; color: var(--text-primary); font-weight: 500; }

.about-grid {
    display: grid; grid-template-columns: 1.1fr .9fr;
    gap: 4rem; align-items: center;
}

.about-facts { list-style: none; margin-top: 2rem; display: grid; gap: 1.4rem; }
.about-facts li { display: flex; gap: 1rem; align-items: flex-start; }
.about-facts svg { color: var(--gold); flex-shrink: 0; margin-top: .2rem; }
.about-facts strong { display: block; color: var(--text-primary); font-size: 1.02rem; }
.about-facts span { color: var(--text-secondary); font-size: .95rem; }

.about-figure {
    position: relative; z-index: 0; border-radius: var(--radius-lg); overflow: visible;
}
.about-figure img {
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    aspect-ratio: 4/3.4; object-fit: cover; width: 100%;
}
.about-figure::before {
    content: ''; position: absolute; inset: -14px 14px 14px -14px;
    border: 2px solid var(--gold); border-radius: var(--radius-lg);
    z-index: -1;
}
.about-figure figcaption {
    position: absolute; left: 1.25rem; bottom: 1.25rem;
    background: rgba(11, 37, 69, .85); color: #fff;
    padding: .5rem 1rem; font-size: .82rem; border-radius: var(--radius-sm);
    border-left: 3px solid var(--gold);
    backdrop-filter: blur(4px);
}

/* ---------- Направления ---------- */
.directions-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem;
}

.dir-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: var(--transition); position: relative;
    display: flex; flex-direction: column;
}
.dir-card:hover, .dir-card:focus-visible {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--gold);
    outline: none;
}
.dir-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--emerald), var(--gold));
    transform: scaleX(0); transform-origin: left; transition: transform .45s ease;
}
.dir-card:hover::after { transform: scaleX(1); }

.dir-card-img { height: 190px; overflow: hidden; }
.dir-card-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .6s cubic-bezier(.4, 0, .2, 1);
}
.dir-card:hover .dir-card-img img { transform: scale(1.08); }

.dir-card-body { padding: 1.75rem; position: relative; flex: 1; }
.dir-num {
    font-family: 'JetBrains Mono', monospace; font-size: .8rem;
    color: var(--gold); font-weight: 700; letter-spacing: .15em;
    display: block; margin-bottom: .6rem;
}
.dir-card h3 { font-size: 1.28rem; margin-bottom: .7rem; }
.dir-card p { font-size: .95rem; margin: 0; }

.dir-card--plain {
    background: linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 100%);
    border-color: var(--navy-3);
}
.dir-card--plain h3 { color: #fff; }
.dir-card--plain p { color: rgba(255, 255, 255, .75); }
.dir-hex {
    position: absolute; right: 1.25rem; bottom: 1.25rem;
    color: rgba(198, 163, 79, .35);
    transition: var(--transition);
}
.dir-card--plain:hover .dir-hex { color: var(--gold); transform: rotate(30deg); }

/* ---------- Тёмные секции ---------- */
.section-dark {
    background:
        radial-gradient(circle at 85% 15%, rgba(14, 124, 91, .22) 0%, transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(198, 163, 79, .12) 0%, transparent 40%),
        var(--navy);
    padding: 6rem 0; color: #fff;
    position: relative; overflow: hidden;
}
.section-dark::before {
    content: ''; position: absolute; inset: 0; opacity: .05;
    background-image:
        linear-gradient(30deg, transparent 48%, rgba(255,255,255,.6) 49%, transparent 51%),
        linear-gradient(150deg, transparent 48%, rgba(255,255,255,.6) 49%, transparent 51%);
    background-size: 90px 156px;
    pointer-events: none;
}

.achievements-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem;
    position: relative; z-index: 1;
}
.achievement {
    border: 1px solid rgba(255, 255, 255, .16);
    border-top: 3px solid var(--gold);
    padding: 2.25rem; border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .04);
    transition: var(--transition);
}
.achievement:hover { background: rgba(255, 255, 255, .08); transform: translateY(-6px); }
.achievement h3 { color: var(--gold-light); font-size: 1.2rem; margin-bottom: .9rem; }
.achievement p { color: rgba(255, 255, 255, .78); margin: 0; font-size: .98rem; }
.achievement strong { color: #fff; }

/* ---------- Новости ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }

.news-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: var(--transition); display: flex; flex-direction: column;
}
.news-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }

.news-card-img { position: relative; height: 200px; overflow: hidden; }
.news-card-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .6s ease;
}
.news-card:hover .news-card-img img { transform: scale(1.07); }
.news-badge {
    position: absolute; left: 1rem; bottom: 1rem;
    background: var(--navy); color: var(--gold-light);
    font-size: .75rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; padding: .35rem .8rem; border-radius: 3px;
}

.news-card-body { padding: 1.75rem; display: flex; flex-direction: column; flex: 1; }
.news-card h3 { font-size: 1.18rem; margin-bottom: .75rem; }
.news-card p { font-size: .94rem; flex: 1; }
.news-card h3 a {
    color: inherit;
    text-decoration: none;
}
.news-card h3 a:hover { color: var(--emerald); }

.news-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--text-tertiary);
    font-size: .86rem;
    margin-bottom: .8rem;
}
.news-date {
    font-weight: 700;
    color: var(--emerald);
}
.news-tag {
    display: inline-block;
    padding: .28rem .65rem;
    border-radius: 999px;
    background: #e3f0eb;
    color: var(--emerald);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.news-feature { grid-column: span 2; }
.news-list {
    display: grid;
    gap: 1rem;
}
.news-list li {
    list-style: none;
    padding: 1.1rem 1.2rem;
    border-left: 3px solid var(--emerald);
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--emerald);
    border-radius: 0 10px 10px 0;
}
.news-list li strong {
    display: block;
    margin-bottom: .35rem;
    color: var(--text-primary);
}

.news-link {
    display: inline-flex; align-items: center; gap: .35rem;
    color: var(--emerald); font-weight: 700; font-size: .9rem;
    text-transform: uppercase; letter-spacing: .06em;
    transition: var(--transition); cursor: pointer;
}
.news-card:hover .news-link { gap: .7rem; color: var(--emerald-dark); }
[data-theme="dark"] .news-card:hover .news-link { color: var(--gold-light); }

.news-image {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    background: var(--bg-alt);
}
.news-feature .news-image { height: 320px; }

/* ---------- Коллектив ---------- */
.team-grid {
    display: grid; grid-template-columns: .95fr 1.05fr; gap: 4rem; align-items: center;
}
.team-figure { position: relative; z-index: 0; }
.team-figure img {
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    aspect-ratio: 4/4.4; object-fit: cover; width: 100%;
}
.team-figure::after {
    content: ''; position: absolute; inset: 14px -14px -14px 14px;
    border: 2px solid var(--emerald); border-radius: var(--radius-lg); z-index: -1;
}

.team-stats {
    display: flex; gap: 2.5rem; margin: 2rem 0;
    padding: 1.5rem 0; border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.team-stat { display: flex; flex-direction: column; }
.team-stat .stat-number { color: var(--emerald); }
.team-stat span:last-child {
    font-size: .82rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--text-tertiary);
}

/* ---------- Сотрудничество ---------- */
.cooperation-inner { max-width: 760px; text-align: center; position: relative; z-index: 1; }
.cooperation-inner .section-head {
    margin-left: auto; margin-right: auto; text-align: center;
}
.cooperation-inner .section-title::after { left: 50%; transform: translateX(-50%); }
.cooperation-inner .section-eyebrow { justify-content: center; }
.cooperation-inner p { color: rgba(255, 255, 255, .8); font-size: 1.1rem; margin-bottom: 2rem; }

/* ---------- Футер ---------- */
footer { background: #081a30; color: rgba(255, 255, 255, .75); }
.footer-grid {
    display: grid; grid-template-columns: 1.4fr 1fr 1fr;
    gap: 3rem; padding-top: 4rem; padding-bottom: 3rem;
}
.footer-brand { display: flex; gap: 1rem; align-items: flex-start; }
.footer-logo { filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.footer-brand strong { display: block; color: #fff; font-family: 'Playfair Display', serif; font-size: 1.05rem; }
.footer-brand span { font-size: .82rem; color: rgba(255, 255, 255, .55); }

.footer-col h4 {
    color: var(--gold-light); font-size: .85rem; text-transform: uppercase;
    letter-spacing: .14em; margin-bottom: 1.1rem; font-family: 'Manrope', sans-serif;
    font-weight: 800;
}
.footer-col ul { list-style: none; display: grid; gap: .6rem; font-size: .92rem; }
.footer-col a { color: rgba(255, 255, 255, .75); text-decoration: none; transition: var(--transition); }
.footer-col a:hover { color: var(--gold-light); padding-left: 4px; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding: 1.25rem 0; font-size: .82rem;
}
.footer-bottom .container { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-bottom p { margin: 0; color: rgba(255, 255, 255, .5); }
.footer-dev { color: rgba(255, 255, 255, .35); }

/* ---------- Кнопка наверх ---------- */
.scroll-top-btn {
    position: fixed; right: 1.75rem; bottom: 1.75rem; z-index: 900;
    width: 46px; height: 46px; border-radius: 4px; border: none; cursor: pointer;
    background: var(--navy); color: var(--gold-light);
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.scroll-top-btn.visible { opacity: 1; visibility: visible; transform: none; }
.scroll-top-btn:hover { background: var(--emerald); color: #fff; }

/* ---------- Подсветка поиска ---------- */
mark.search-highlight {
    background: var(--gold); color: var(--navy);
    padding: 0 .2rem; border-radius: 2px; font-weight: 600;
}

/* ---------- Адаптивность ---------- */
@media (max-width: 1024px) {
    .directions-grid, .news-grid, .achievements-grid { grid-template-columns: repeat(2, 1fr); }
    .about-grid, .team-grid { grid-template-columns: 1fr; gap: 3rem; }
    .about-figure, .team-figure { max-width: 560px; }
    .site-search { min-width: 180px; }
}

@media (max-width: 768px) {
    .section { padding: 4rem 0; }
    .section-dark { padding: 4rem 0; }
    .directions-grid, .news-grid, .achievements-grid { grid-template-columns: 1fr; }
    .hero-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-stat:nth-child(3) { border-left: none; }
    .hero-stat { border-top: 1px solid rgba(255,255,255,.12); }
    .hamburger-menu { display: flex; }
    .brand-text small { display: none; }
    .brand-text strong { font-size: 1.1rem; }
    .logo { width: 60px; height: 60px; }
    .header-inner { padding-top: .9rem; padding-bottom: .9rem; gap: 1rem; }

    .header-nav {
        position: fixed; top: 0; right: 0; bottom: 0;
        width: min(320px, 85vw); z-index: 1500;
        transform: translateX(100%); transition: transform .35s cubic-bezier(.4,0,.2,1);
        box-shadow: -10px 0 40px rgba(0,0,0,.35);
        overflow-y: auto;
    }
    .header-nav.active { transform: translateX(0); }
    .header-nav .container { padding: 4.75rem 1.5rem; }
    .main-nav { flex-direction: column; gap: 0; }
    .main-nav a { padding: 1.1rem .5rem; border-bottom: 1px solid rgba(255,255,255,.12); }
    .main-nav a::after { display: none; }
    .mobile-nav-close { display: flex !important; }

    .scroll-hint { display: none; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .team-stats { gap: 1.5rem; flex-wrap: wrap; }
}

@media (max-width: 560px) {
    .topbar-left span { display: none; }
    .hero-content { padding-top: 4rem; }
    .hero-actions .btn { width: 100%; justify-content: center; }
}

/* ---------- Доступность ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}

/* Мобильное dropdown */
@media (max-width: 768px) {
    .dropdown {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: none; border-left: 2px solid var(--gold);
        margin: 0 0 0 1rem; display: none;
        background: transparent; min-width: auto; padding: 0;
    }
    .main-nav li.has-dropdown.open > .dropdown { display: block; }
    .main-nav li.has-dropdown > a::after { transition: transform .2s; }
    .main-nav li.has-dropdown.open > a::after { transform: rotate(180deg); }
    .dropdown a { padding: .7rem 1rem; font-size: .9rem; border-bottom: none; }
}

/* ---------- Hero внутренних страниц ---------- */
.page-hero {
    position: relative; min-height: 340px;
    display: flex; align-items: center;
    color: #fff; overflow: hidden;
}
.page-hero .hero-background { position: absolute; inset: 0; z-index: 0; }
.page-hero .hero-bg-image {
    width: 100%; height: 100%; object-fit: cover;
    filter: brightness(.5) saturate(1.05);
}
.page-hero .hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(160deg, rgba(11, 37, 69, .92) 0%, rgba(11, 37, 69, .6) 55%, rgba(14, 124, 91, .45) 100%);
}
.page-hero .hero-content { position: relative; z-index: 2; padding: 4.5rem 1.5rem; }
.page-hero-title {
    font-size: clamp(2rem, 4.5vw, 3.2rem); color: #fff;
    margin-bottom: .9rem; line-height: 1.1;
}
.page-hero-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: rgba(255, 255, 255, .85); max-width: 640px; margin: 0;
}

/* ---------- Двухколоночный блок «текст + фото» ---------- */
.split-grid {
    display: grid; grid-template-columns: .95fr 1.05fr;
    gap: 3.5rem; align-items: center;
}
.split-grid figure img {
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    aspect-ratio: 4/3.2; object-fit: cover; width: 100%;
}
.split-grid ul { color: var(--text-secondary); margin: 0 0 1.25rem 1.2rem; }
.split-grid li { margin-bottom: .5rem; }

/* ---------- Карточки-инфо (миссия, гранты, контакты) ---------- */
.cards-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem;
}
.info-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-top: 3px solid var(--gold);
    border-radius: var(--radius); padding: 2rem;
    transition: var(--transition);
}
.info-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.info-card h4 {
    font-size: 1.15rem; margin-bottom: .9rem; color: var(--navy);
    display: flex; align-items: center; gap: .6rem;
}
[data-theme="dark"] .info-card h4 { color: var(--gold-light); }
.info-card p { font-size: .95rem; margin-bottom: .75rem; }
.info-card p:last-child { margin-bottom: 0; }
.info-card ul { margin: 0 0 0 1.2rem; color: var(--text-secondary); font-size: .95rem; }
.info-card li { margin-bottom: .45rem; }

/* ---------- Карточки с фото (направления, лаборатории, партнёры) ---------- */
.photo-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem;
}
.card-list {
    list-style: none; margin-top: 1rem; display: grid; gap: .4rem;
}
.card-list li {
    position: relative; padding-left: 1.1rem;
    color: var(--text-secondary); font-size: .9rem;
}
.card-list li::before {
    content: ''; position: absolute; left: 0; top: .5em;
    width: 7px; height: 7px;
    background: var(--gold);
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.card-equip {
    margin-top: 1rem; padding-top: 1rem;
    border-top: 1px dashed var(--border-strong);
}
.card-equip h5 {
    font-family: 'Manrope', sans-serif; font-size: .8rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--emerald); margin-bottom: .5rem;
}
.card-equip ul { list-style: none; display: grid; gap: .3rem; }
.card-equip li {
    position: relative; padding-left: 1.1rem;
    color: var(--text-secondary); font-size: .88rem;
}
.card-equip li::before {
    content: ''; position: absolute; left: 0; top: .52em;
    width: 6px; height: 6px; border-radius: 50%; background: var(--emerald);
}

/* ---------- Карточки руководства ---------- */
.leader-card {
    display: grid; grid-template-columns: 280px 1fr; gap: 2.5rem;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 2.5rem;
    margin-bottom: 2rem; transition: var(--transition);
}
.leader-card:hover { box-shadow: var(--shadow-lg); border-color: var(--gold); }
.leader-photo img {
    border-radius: var(--radius); box-shadow: var(--shadow-md);
    aspect-ratio: 3/3.6; object-fit: cover; width: 100%;
}
.leader-info h4 {
    font-family: 'Manrope', sans-serif; font-size: .82rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .1em;
    color: var(--emerald); margin-bottom: .5rem;
}
.leader-info h3 { font-size: 1.55rem; margin-bottom: .4rem; }
.leader-position { color: var(--gold); font-weight: 700; margin-bottom: 1rem; }
.leader-bio { color: var(--text-secondary); }
.leader-contacts p { margin-bottom: .3rem; font-size: .92rem; }

/* ---------- Таймлайн ---------- */
.timeline { position: relative; max-width: 820px; margin: 0 auto; }
.timeline::before {
    content: ''; position: absolute; left: 27px; top: 10px; bottom: 10px;
    width: 2px; background: linear-gradient(180deg, var(--gold), var(--emerald));
}
.timeline-item {
    position: relative; padding-left: 78px; padding-bottom: 2.4rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
    position: absolute; left: 0; top: 0;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--navy); color: var(--gold-light);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 700;
    border: 3px solid var(--gold); z-index: 1;
}
.timeline-content {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.5rem 1.75rem;
    transition: var(--transition);
}
.timeline-content:hover { box-shadow: var(--shadow-md); border-color: var(--gold); }
.timeline-content h4 { font-size: 1.15rem; margin-bottom: .5rem; }
.timeline-content p { margin: 0; font-size: .95rem; }

/* ---------- Форма обратной связи ---------- */
.feedback-section {
    display: grid; grid-template-columns: .9fr 1.1fr; gap: 3rem; align-items: start;
}
.feedback-info {
    background: var(--bg-alt); border-radius: var(--radius-lg);
    padding: 2.25rem;
}
.feedback-info h4 { font-size: 1.25rem; margin-bottom: 1rem; }
.working-hours {
    margin-top: 1.5rem; padding-top: 1.25rem;
    border-top: 1px dashed var(--border-strong);
}
.working-hours h5 {
    font-family: 'Manrope', sans-serif; font-size: .82rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--emerald); margin-bottom: .5rem;
}
.working-hours p { margin-bottom: .25rem; }
.feedback-form form {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 2.25rem;
    box-shadow: var(--shadow-sm);
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block; font-weight: 700; font-size: .9rem;
    margin-bottom: .45rem; color: var(--text-primary);
}
.form-group input, .form-group textarea {
    width: 100%; font: inherit; font-size: .95rem;
    color: var(--text-primary); background: var(--bg-page);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: .75rem 1rem; transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(14, 124, 91, .15);
}
.form-group textarea { resize: vertical; }
.btn-submit {
    background: var(--gold); color: var(--navy);
    border: none; width: 100%; justify-content: center;
}
.btn-submit:hover { background: var(--gold-light); transform: translateY(-2px); }

/* ---------- Карта ---------- */
.map-container {
    border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.map-container iframe { display: block; width: 100%; }

/* ---------- Карточки сотрудников ---------- */
.staff-card { overflow: hidden; }

.staff-photo {
    display: block;
    width: 180px;
    height: 220px;
    margin: 0 auto 1.25rem;
    border-radius: 12px;
    object-fit: cover;
    object-position: center top;
    background: #eef1f4;
}

.staff-photo--pishugin { object-position: 35% center; }

/* ---------- Адаптивность внутренних страниц ---------- */
@media (max-width: 1024px) {
    .cards-grid, .photo-grid { grid-template-columns: repeat(2, 1fr); }
    .split-grid, .feedback-section { grid-template-columns: 1fr; gap: 2.5rem; }
    .split-grid figure { max-width: 560px; }
}

@media (max-width: 768px) {
    .cards-grid, .photo-grid { grid-template-columns: 1fr; }
    .leader-card { grid-template-columns: 1fr; padding: 1.75rem; }
    .leader-photo { max-width: 280px; }
    .topbar-right { gap: .8rem; flex-wrap: wrap; }
    .page-hero .hero-content { padding: 3.5rem 1.5rem; }
}

@media (max-width: 560px) {
    .topbar-inner { justify-content: center; }
    .brand-text strong { font-size: .95rem; }
    .logo { width: 52px; height: 52px; }
}

@media (max-width: 640px) {
    .staff-photo {
        width: 160px;
        height: 200px;
    }
}

@media (max-width: 760px) {
    .news-feature { grid-column: span 1; }
    .news-feature .news-image { height: 230px; }
}

/* ============================================================
   Современные эффекты (2026)
   ============================================================ */

::selection {
    background: rgba(198, 163, 79, .35);
    color: var(--navy);
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
}
.lang-switch button {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .78);
    font: inherit;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .04em;
    padding: 3px 7px 3px 4px;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    line-height: 1;
}
.lang-switch button:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}
.lang-switch button.active {
    background: rgba(198, 163, 79, .22);
    color: var(--gold-light);
    box-shadow: inset 0 0 0 1px rgba(227, 201, 135, .45);
}
.lang-switch .flag {
    width: 22px;
    height: 15px;
    display: inline-flex;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 2px 6px rgba(0,0,0,.25);
    flex-shrink: 0;
}
.lang-switch .flag svg {
    width: 22px;
    height: 15px;
    display: block;
}
.lang-switch button.active .flag {
    box-shadow: 0 0 0 1.5px var(--gold-light), 0 3px 8px rgba(198, 163, 79, .35);
    transform: translateY(-0.5px);
}
.lang-switch .lang-code { transform: translateY(0.5px); }

@media (max-width: 560px) {
    .lang-switch .lang-code { display: none; }
    .lang-switch button { padding: 4px; }
}

@keyframes heroKenBurns {
    from { transform: scale(1.04) translate3d(0, 0, 0); }
    to { transform: scale(1.12) translate3d(-1.4%, -1%, 0); }
}

/* Более светлый главный экран только на index */
body[data-page="index"] .hero-bg-image {
    filter: brightness(1.32) saturate(1.12) contrast(1.05);
}
body[data-page="index"] .hero-overlay {
    background:
        linear-gradient(108deg, rgba(6, 22, 42, .38) 0%, rgba(8, 32, 52, .14) 48%, rgba(16, 90, 72, .06) 100%),
        radial-gradient(ellipse at 72% 42%, rgba(255, 255, 255, .22), transparent 60%);
}
body[data-page="index"] .hero-title {
    text-shadow: 0 10px 34px rgba(6, 18, 34, .35);
}
body[data-page="index"] .hero-subtitle {
    text-shadow: 0 6px 20px rgba(6, 18, 34, .28);
}
body[data-page="index"] .hero-stats {
    background: rgba(11, 37, 69, .28);
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

.hero-title em {
    background: linear-gradient(120deg, var(--gold-light), #fff4d2 45%, var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 6px 16px rgba(198, 163, 79, .28));
}

.btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,.38) 48%, transparent 72%);
    transform: translateX(-130%);
    transition: transform .7s ease;
    pointer-events: none;
}
.btn:hover::after { transform: translateX(130%); }
.btn-gold {
    box-shadow: 0 8px 22px rgba(198, 163, 79, .22);
}
.btn-gold:hover {
    box-shadow: 0 14px 32px rgba(198, 163, 79, .42);
}

.dir-card, .news-card, .info-card, .achievement, .leader-card {
    position: relative;
}
.dir-card::before,
.news-card::before,
.info-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.16) 50%, transparent 70%);
    transform: translateX(-140%);
    transition: transform .8s ease;
    pointer-events: none;
    z-index: 2;
}
.dir-card:hover::before,
.news-card:hover::before,
.info-card:hover::before {
    transform: translateX(140%);
}

.dir-card, .news-card {
    transform-style: preserve-3d;
    will-change: transform;
}
.dir-card.is-tilting,
.news-card.is-tilting {
    transition: transform .12s ease-out, box-shadow .3s ease;
}

.hero-stat, .team-stat {
    transition: transform .35s ease, background .35s ease;
}
.hero-stat:hover {
    background: rgba(255, 255, 255, .06);
    transform: translateY(-3px);
}

.section-title::after {
    width: 0;
    animation: titleLine .9s .2s cubic-bezier(.4,0,.2,1) forwards;
}
.reveal.visible .section-title::after,
.section-head .section-title::after {
    animation: titleLine .9s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes titleLine {
    to { width: 84px; }
}

/* Мягкое свечение тёмных секций */
.section-dark::after {
    content: '';
    position: absolute;
    width: 420px; height: 420px;
    right: -120px; top: -80px;
    background: radial-gradient(circle, rgba(198, 163, 79, .18), transparent 68%);
    pointer-events: none;
    animation: glowDrift 12s ease-in-out infinite alternate;
}
@keyframes glowDrift {
    from { transform: translate(0, 0) scale(1); opacity: .7; }
    to { transform: translate(-40px, 30px) scale(1.15); opacity: 1; }
}

.document-image, .event-photo {
    display: block;
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: var(--bg-alt);
}

@media (prefers-reduced-motion: reduce) {
    .hero-bg-image,
    .section-dark::after,
    .section-title::after {
        animation: none !important;
    }
    .btn::after, .dir-card::before, .news-card::before, .info-card::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-bg-image { animation: none; transform: scale(1.04); }
}


/* ============================================================
   Тёмная тема: читаемость текста и карточек
   ============================================================ */
[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5 {
    color: var(--text-primary);
}

[data-theme="dark"] p,
[data-theme="dark"] li,
[data-theme="dark"] span,
[data-theme="dark"] label,
[data-theme="dark"] figcaption,
[data-theme="dark"] td,
[data-theme="dark"] th {
    color: inherit;
}

[data-theme="dark"] .section p,
[data-theme="dark"] .info-card p,
[data-theme="dark"] .info-card li,
[data-theme="dark"] .dir-card p,
[data-theme="dark"] .dir-card li,
[data-theme="dark"] .news-card p,
[data-theme="dark"] .leader-bio,
[data-theme="dark"] .leader-contacts p,
[data-theme="dark"] .timeline-content p,
[data-theme="dark"] .feedback-info p,
[data-theme="dark"] .card-list li,
[data-theme="dark"] .card-equip li,
[data-theme="dark"] .split-grid p,
[data-theme="dark"] .split-grid li,
[data-theme="dark"] .publication-list,
[data-theme="dark"] .publication-list li,
[data-theme="dark"] ol.card-list li {
    color: var(--text-secondary);
}

[data-theme="dark"] .info-card,
[data-theme="dark"] .dir-card,
[data-theme="dark"] .news-card,
[data-theme="dark"] .leader-card,
[data-theme="dark"] .timeline-content,
[data-theme="dark"] .feedback-form form,
[data-theme="dark"] .staff-card,
[data-theme="dark"] .map-container {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-secondary);
}

[data-theme="dark"] .info-card h3,
[data-theme="dark"] .info-card h4,
[data-theme="dark"] .dir-card h3,
[data-theme="dark"] .news-card h3,
[data-theme="dark"] .leader-info h3,
[data-theme="dark"] .staff-card h4,
[data-theme="dark"] .timeline-content h4,
[data-theme="dark"] .feedback-info h4,
[data-theme="dark"] .stat-card h4 {
    color: var(--gold-light);
}

[data-theme="dark"] .news-list li {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border);
    border-left-color: var(--emerald);
}
[data-theme="dark"] .news-list li strong {
    color: var(--gold-light);
}

[data-theme="dark"] .news-tag {
    background: rgba(14, 124, 91, .22);
    color: #8ee0c4;
}
[data-theme="dark"] .news-date {
    color: var(--gold-light);
}

[data-theme="dark"] .feedback-info,
[data-theme="dark"] .working-hours {
    background: var(--bg-alt);
    color: var(--text-secondary);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .site-search {
    background: #0a1626;
    color: var(--text-primary);
    border-color: var(--border-strong);
}

[data-theme="dark"] .dir-card--plain {
    background: linear-gradient(150deg, #102338 0%, #0c1c30 100%);
    border-color: var(--border-strong);
}
[data-theme="dark"] .dir-card--plain h3 { color: #fff; }
[data-theme="dark"] .dir-card--plain p { color: rgba(255, 255, 255, .78); }

[data-theme="dark"] .staff-initials {
    background: linear-gradient(135deg, #163528, #1c3d45);
    color: var(--gold-light);
}

[data-theme="dark"] .staff-photo,
[data-theme="dark"] .gallery-photo,
[data-theme="dark"] .document-image {
    background: #163049;
}

[data-theme="dark"] .section-title,
[data-theme="dark"] .page-hero-title {
    color: #fff;
}
[data-theme="dark"] .section:not(.section-dark) .section-title {
    color: var(--text-primary);
}

[data-theme="dark"] .lead {
    color: var(--text-primary);
}

[data-theme="dark"] .about-facts strong,
[data-theme="dark"] .team-content .lead {
    color: var(--text-primary);
}
[data-theme="dark"] .about-facts span {
    color: var(--text-secondary);
}

[data-theme="dark"] mark.search-highlight {
    background: var(--gold);
    color: #0b2545;
}

[data-theme="dark"] .contact-link,
[data-theme="dark"] .info-card a,
[data-theme="dark"] .split-grid a {
    color: var(--gold-light);
}

[data-theme="dark"] .hero,
[data-theme="dark"] .page-hero,
[data-theme="dark"] .section-dark,
[data-theme="dark"] .section-dark p,
[data-theme="dark"] .section-head--light .section-title,
[data-theme="dark"] footer,
[data-theme="dark"] .topbar {
    color: inherit;
}
[data-theme="dark"] .section-dark p,
[data-theme="dark"] .cooperation-inner p {
    color: rgba(255, 255, 255, .82);
}
[data-theme="dark"] .achievement p {
    color: rgba(255, 255, 255, .8);
}
[data-theme="dark"] .achievement h3 {
    color: var(--gold-light);
}


.academy-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .12rem;
    line-height: 1.25;
}
.academy-name .academy-sub,
.academy-sub {
    display: block;
    font-size: inherit;
    font-weight: inherit;
    opacity: 1;
}
.brand-text .academy-name {
    font-size: inherit;
}
.topbar-left .academy-name {
    max-width: min(520px, 52vw);
}
@media (max-width: 900px) {
    .topbar-left .academy-name { max-width: 42vw; }
}

.site-search { position: relative; }
.search-suggest {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 80;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-width: 260px;
}
.search-item {
    display: block;
    padding: .7rem .9rem;
    color: var(--text-primary) !important;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}
.search-item:last-child { border-bottom: 0; }
.search-item:hover,
.search-item:focus {
    background: var(--bg-alt);
    color: var(--navy) !important;
}
[data-theme="dark"] .search-item:hover,
[data-theme="dark"] .search-item:focus {
    color: var(--gold-light) !important;
}
.search-item strong { display: block; font-size: .92rem; }
.search-empty {
    padding: .8rem .9rem;
    color: var(--text-secondary);
    font-size: .9rem;
}

.search-item em {
    display: block;
    font-style: normal;
    font-size: .68rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--emerald);
    margin-bottom: .15rem;
}
[data-theme="dark"] .search-item em { color: var(--gold-light); }


/* ---------- Галерея: большое фото + миниатюры ---------- */
.media-gallery { max-width: 980px; margin: 0 auto; }
.media-stage {
    position: relative;
    background: #0b1220;
    border-radius: 16px;
    overflow: hidden;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-main {
    display: block;
    width: 100%;
    max-height: 620px;
    object-fit: contain;
    background: #0b1220;
}
.media-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    color: #0b2545;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,.22);
    z-index: 2;
}
.media-prev { left: 14px; }
.media-next { right: 14px; }
.media-nav:hover { background: #fff; }
.media-thumbs {
    display: flex;
    gap: .65rem;
    overflow-x: auto;
    padding: 1rem 2px 0;
    scroll-snap-type: x mandatory;
}
.media-thumb {
    flex: 0 0 118px;
    height: 78px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #e8edf2;
    scroll-snap-align: start;
}
.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.media-thumb.is-active {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(198,163,79,.25);
}
@media (max-width: 640px) {
    .media-main { max-height: 360px; }
    .media-thumb { flex-basis: 92px; height: 64px; }
    .media-nav { width: 36px; height: 36px; font-size: 1.4rem; }
}

/* ============================================================
   Мобильная адаптация и исправление бургер-меню
   backdrop-filter / filter на #header создаёт containing block
   для position:fixed — панель меню уезжала за край шапки.
   ============================================================ */
@media (max-width: 768px) {
    #header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        overflow: visible;
        z-index: 1200;
    }
    #header.compact {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: .75rem;
    }

    .brand {
        flex: 1 1 auto;
        min-width: 0;
        gap: .7rem;
    }
    .brand-text strong {
        font-size: 1rem;
        line-height: 1.15;
    }
    .logo, #header.compact .logo {
        width: 52px;
        height: 52px;
    }

    .site-search {
        display: none;
    }

    .hamburger-menu {
        display: flex;
        position: relative;
        z-index: 1600;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        margin-left: auto;
        border-radius: 8px;
        background: rgba(11, 37, 69, .06);
    }
    [data-theme="dark"] .hamburger-menu {
        background: rgba(255,255,255,.08);
    }
    .hamburger-menu span {
        width: 22px;
        height: 2px;
        transform-origin: center;
    }

    .header-nav {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        bottom: 0 !important;
        width: min(340px, 86vw) !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        z-index: 1700 !important;
        transform: translateX(110%) !important;
        transition: transform .32s cubic-bezier(.4,0,.2,1) !important;
        background: var(--navy) !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-shadow: -16px 0 40px rgba(0,0,0,.35);
        pointer-events: none;
    }
    .header-nav.active {
        transform: translateX(0) !important;
        pointer-events: auto;
    }
    .header-nav .container {
        padding: 4.75rem 1.25rem 2rem !important;
        max-width: none;
    }
    .main-nav {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
    }
    .main-nav > li { width: 100%; }
    .main-nav a {
        padding: 1.1rem .5rem;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255,255,255,.1);
    }
    .mobile-nav-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 14px;
        right: 14px;
        width: 42px;
        height: 42px;
        border: 0;
        border-radius: 8px;
        background: rgba(255,255,255,.12);
        color: #fff;
        font-size: 1.8rem;
        line-height: 1;
        cursor: pointer;
        z-index: 2;
    }

    .dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border-radius: 0;
        min-width: 0;
        width: 100%;
        display: none;
        background: rgba(0,0,0,.18);
        border-top: 0;
        margin: 0;
        padding: 0 0 .35rem 0;
    }
    .main-nav li.has-dropdown.open > .dropdown { display: block; }
    .dropdown a {
        padding: .7rem .75rem .7rem 1.1rem;
        font-size: .9rem;
        white-space: normal;
        border-bottom: 1px solid rgba(255,255,255,.06);
    }

    .topbar-inner {
        gap: .5rem;
    }
    .topbar-right {
        gap: .55rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .topbar-link { display: none; }

    .hero {
        min-height: auto;
        padding-bottom: 0;
    }
    .hero-content {
        padding-top: 3.2rem;
        padding-bottom: 2rem;
    }
    .hero-title { font-size: clamp(1.85rem, 8vw, 2.6rem); }
    .hero-subtitle { margin-bottom: 1.5rem; }
    .hero-stats-grid { grid-template-columns: 1fr 1fr; }
    .page-hero { min-height: 240px; }
    .page-hero .hero-content { padding: 3rem 1.25rem 2.2rem; }

    .about-grid,
    .team-grid,
    .split-grid,
    .feedback-section,
    .leader-card {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .cards-grid,
    .photo-grid,
    .directions-grid,
    .news-grid,
    .achievements-grid {
        grid-template-columns: 1fr !important;
    }

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

@media (max-width: 560px) {
    .topbar-left .academy-name { display: none; }
    .brand-text strong { font-size: .92rem; }
    .hero-actions { width: 100%; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .lang-switch .lang-code { display: none; }
}

body.no-scroll { overflow: hidden; touch-action: none; }
