/* Version: 20251204-optical-focus-full */
/* Version: 2024-12-19-adaptive-mobile */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Work+Sans:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Dark theme - яркий зеленый */
    --primary: #34d399;
    --primary-dark: #10b981;
    --primary-light: #6ee7b7;
    --secondary: #34d399;
    --secondary-dark: #10b981;
    --secondary-light: #6ee7b7;
    --accent: #a78bfa;
    --accent-dark: #8b5cf6;
    --accent-light: #c4b5fd;
    --dark: #0a0a0a;              /* Основной темный фон */
    --dark-2: #1a1a1a;            /* Вторичный темный */
    --dark-3: #252525;            /* Третичный темный */
    --gray: #888;                 /* Серый текст */
    --gray-light: #aaa;           /* Светлый серый */
    --white: #fff;
    --gold: #d4af37;

    /* Light theme variables - новая цветовая гамма */
    --light-bg: #f0f4f8;              /* Светло-голубой фон */
    --light-surface: #ffffff;         /* Чистый белый для поверхностей */
    --light-text: #1e293b;             /* Темно-синий для основного текста */
    --light-text-secondary: #475569;    /* Сине-серый для вторичного текста */
    --light-border: #cbd5e1;           /* Светло-синяя граница */
    --light-accent: #f97316;           /* Яркий оранжевый акцент */
    --light-accent-hover: #ea580c;     /* Темно-оранжевый для hover */
    --light-accent-light: #fb923c;     /* Светло-оранжевый */
    --light-secondary: #3b82f6;       /* Синий вторичный */
    --light-secondary-hover: #2563eb;  /* Темно-синий */
    --light-shadow: rgba(15, 23, 42, 0.08); /* Мягкие тени */
    --light-shadow-hover: rgba(249, 115, 22, 0.2); /* Оранжевые тени */
    --light-gradient-start: #e0f2fe;   /* Начало градиента */
    --light-gradient-end: #f0f9ff;     /* Конец градиента */
}

[data-theme="light"] {
    --dark: var(--light-bg);
    --dark-2: var(--light-surface);
    --dark-3: #e2e8f0;
    --white: var(--light-text);
    --gray: var(--light-text-secondary);
    --gray-light: #64748b;
    --primary: var(--light-accent);        /* Оранжевый акцент */
    --primary-dark: var(--light-accent-hover);
    --primary-light: var(--light-accent-light);
    --secondary: var(--light-secondary);
    --secondary-dark: var(--light-secondary-hover);
}

[data-theme="light"] body {
    background: linear-gradient(135deg, var(--light-gradient-start) 0%, var(--light-gradient-end) 50%, #f0f4f8 100%);
    color: var(--light-text);
}

[data-theme="light"] .navbar {
    background: rgba(248, 250, 252, 0.95);
    border-right: 1px solid var(--light-border);
}

[data-theme="light"] .nav-link {
    color: var(--light-text-secondary);
}

[data-theme="light"] .nav-link:hover {
    color: var(--light-text);
}

[data-theme="light"] .cookie-banner {
    background: var(--light-surface);
    border-top: 1px solid var(--light-border);
}

[data-theme="light"] .footer {
    background: var(--light-surface);
    border-top: 1px solid var(--light-border);
}

/* Light theme - улучшенные стили для основных элементов */
[data-theme="light"] .hero-title {
    color: var(--light-text);
    text-shadow: 0 2px 12px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .hero-title-word:nth-child(2) {
    color: var(--light-accent);
    text-shadow: 0 0 25px rgba(249, 115, 22, 0.4), 0 4px 12px rgba(249, 115, 22, 0.2);
}

[data-theme="light"] .hero-description {
    color: var(--light-text-secondary);
}

[data-theme="light"] .project-label {
    color: var(--light-text-secondary);
    text-shadow: 0 0 12px rgba(249, 115, 22, 0.3);
}

[data-theme="light"] .btn-primary {
    border: 1px solid rgba(249, 115, 22, 0.6);
    color: var(--light-accent);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.2), 0 0 20px rgba(249, 115, 22, 0.1);
}

[data-theme="light"] .btn-primary::before {
    background: rgba(249, 115, 22, 0.15);
}

[data-theme="light"] .btn-primary:hover {
    border-color: var(--light-accent);
    color: var(--light-accent-hover);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3), 0 0 30px rgba(249, 115, 22, 0.15);
    transform: translateY(-2px);
}

/* Light theme для модальных окон */
[data-theme="light"] .modal-overlay {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(15px);
}

[data-theme="light"] .modal-content {
    background: var(--light-surface);
    border: 2px solid rgba(249, 115, 22, 0.25);
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.2), 0 0 50px rgba(249, 115, 22, 0.15);
}

[data-theme="light"] .modal-header {
    border-bottom: 1px solid var(--light-border);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%);
}

[data-theme="light"] .modal-title,
[data-theme="light"] .modal-header h2,
[data-theme="light"] .modal-header h3 {
    color: var(--light-text);
}

[data-theme="light"] .modal-body {
    color: var(--light-text-secondary);
}

[data-theme="light"] .modal-body h1,
[data-theme="light"] .modal-body h2,
[data-theme="light"] .modal-body h3,
[data-theme="light"] .modal-body h4,
[data-theme="light"] .modal-body h5,
[data-theme="light"] .modal-body h6,
[data-theme="light"] .modal-body .section-title,
[data-theme="light"] .modal-body .principle h3,
[data-theme="light"] .modal-body .expertise-card h3 {
    color: var(--light-accent);
}

[data-theme="light"] .modal-close {
    color: var(--light-text-secondary);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--light-border);
}

[data-theme="light"] .modal-close:hover {
    color: var(--light-accent);
    background: rgba(249, 115, 22, 0.15);
    border-color: var(--light-accent);
}

/* Light theme для visual-item - улучшенные стили */
[data-theme="light"] .visual-item {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(249, 115, 22, 0.35);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1), 0 0 25px rgba(249, 115, 22, 0.2);
    backdrop-filter: blur(10px);
}

[data-theme="light"] .visual-item:hover {
    background: rgba(255, 255, 255, 1);
    border-color: var(--light-accent);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15), 0 0 40px rgba(249, 115, 22, 0.3);
    transform: translateY(-4px);
}

[data-theme="light"] .visual-icon {
    color: var(--light-accent);
    filter: drop-shadow(0 0 10px rgba(249, 115, 22, 0.4));
}

[data-theme="light"] .visual-label {
    color: var(--light-text);
    text-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .visual-item:hover .visual-icon {
    color: var(--light-accent-hover);
    filter: drop-shadow(0 0 15px rgba(249, 115, 22, 0.6));
}

[data-theme="light"] .visual-item:hover .visual-label {
    color: var(--light-accent-hover);
    text-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}

[data-theme="light"] .visual-item[data-modal].active,
[data-theme="light"] .visual-item[data-lang].active {
    border-color: var(--light-accent);
    background: rgba(249, 115, 22, 0.12);
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.4);
}

[data-theme="light"] .visual-item[data-modal].active .visual-icon,
[data-theme="light"] .visual-item[data-lang].active .visual-icon {
    color: var(--light-accent-hover);
}

[data-theme="light"] .visual-item[data-modal].active .visual-label,
[data-theme="light"] .visual-item[data-lang].active .visual-label {
    color: var(--light-accent-hover);
}

/* Light theme — мобильная главная и нижняя панель */
@media (max-width: 968px) {
    [data-theme="light"] .bottom-bar {
        background: rgba(255, 255, 255, 0.85);
        border-top-color: var(--light-border);
        backdrop-filter: blur(12px);
    }
    [data-theme="light"] .hero-actions .btn-primary {
        background: rgba(249, 115, 22, 0.15);
        border-color: var(--light-accent);
        color: var(--light-text);
    }
    [data-theme="light"] .hero-actions .btn-primary:hover {
        background: rgba(249, 115, 22, 0.25);
        color: var(--light-accent-hover);
    }
}

/* Light theme для top-controls */
[data-theme="light"] .top-controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--light-border);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .top-controls button {
    color: var(--light-text-secondary);
    background: transparent;
}

[data-theme="light"] .top-controls button:hover {
    color: var(--light-accent);
    background: rgba(249, 115, 22, 0.12);
}

[data-theme="light"] .top-controls .dropdown-menu {
    background: var(--light-surface);
    border: 1px solid var(--light-border);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .top-controls .dropdown-item {
    color: var(--light-text-secondary);
}

[data-theme="light"] .top-controls .dropdown-item:hover {
    color: var(--light-accent);
    background: rgba(249, 115, 22, 0.12);
}

[data-theme="light"] .top-controls .dropdown-item.active {
    color: var(--light-accent);
    background: rgba(249, 115, 22, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100%;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Instrument Serif', serif;
    background: var(--dark);
    color: var(--white);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

/* Украинский язык - используем Playfair Display для лучшей поддержки кириллицы */
html[lang="uk"] {
    font-family: 'Playfair Display', serif;
}

html[lang="uk"] body,
html[lang="uk"] h1,
html[lang="uk"] h2,
html[lang="uk"] h3,
html[lang="uk"] h4,
html[lang="uk"] h5,
html[lang="uk"] h6,
html[lang="uk"] p,
html[lang="uk"] span,
html[lang="uk"] div,
html[lang="uk"] a,
html[lang="uk"] button,
html[lang="uk"] input,
html[lang="uk"] textarea,
html[lang="uk"] label {
    font-family: 'Playfair Display', serif;
}

body {
    background: var(--dark);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    max-height: 100vh;
    width: 100%;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 60px;
}

/* Language Switcher - moved to navbar */
.language-switcher {
    display: none;
}

/* Project Label - Left Top Corner */
.project-label {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    color: var(--white);
    letter-spacing: 0.1em;
    text-transform: lowercase;
    pointer-events: none;
    user-select: none;
    animation: smoothBlink 2s ease-in-out infinite;
}


@keyframes smoothBlink {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 1;
    }
}


/* Top Controls - Language Dropdown and Theme Toggle */
.top-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 1rem;
    align-items: center;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
}

/* Language Dropdown */
.language-dropdown {
    position: relative;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--primary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-family: 'Instrument Serif', serif;
}

.lang-dropdown-btn:hover {
    background: rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.5);
}

.dropdown-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.language-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--dark);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 4px;
    min-width: 100px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.language-dropdown.active .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: left;
    font-family: 'Instrument Serif', serif;
}

.lang-dropdown-item:hover {
    background: rgba(52, 211, 153, 0.1);
    color: var(--primary);
}

.lang-dropdown-item.active {
    background: rgba(52, 211, 153, 0.2);
    color: var(--primary);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.theme-toggle-btn:hover {
    background: rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.5);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.theme-icon-light {
    display: none;
}

[data-theme="light"] .theme-icon-dark {
    display: none;
}

[data-theme="light"] .theme-icon-light {
    display: block !important;
}

/* Cookies Button */
.cookies-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.cookies-btn:hover {
    background: rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.5);
}

.cookies-btn svg {
    width: 20px;
    height: 20px;
}

.lang-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.75rem;
    font-family: 'Instrument Serif', serif;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.lang-btn:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.lang-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(255, 107, 107, 0.1);
}

/* Navigation - вертикальная боковая */
.navbar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 160px;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.nav-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    padding: 1.5rem 1rem;
    overflow: visible;
    height: 100%;
    justify-content: flex-start;
}

.logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    transform: none;
    margin-bottom: 1.5rem;
    margin-top: 0;
    width: 100%;
    height: auto;
    overflow: visible;
    position: relative;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-text {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--white);
    font-family: 'Instrument Serif', serif;
    white-space: nowrap;
    text-transform: uppercase;
    writing-mode: horizontal-tb;
    text-orientation: initial;
    transform: none;
    overflow: visible;
    display: block;
    transition: all 0.3s ease;
}

.logo:hover .logo-text {
    color: var(--primary);
    letter-spacing: 0.3em;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 0.25rem;
    align-items: flex-start;
    width: 100%;
    flex: 0 1 auto;
    padding: 0.5rem 0;
    overflow: visible;
    justify-content: flex-start;
}

.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.nav-link {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.4s ease;
    position: relative;
    writing-mode: horizontal-tb;
    text-orientation: initial;
    transform: none;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    display: block;
    width: 100%;
    text-align: left;
    letter-spacing: 0.05em;
}

.nav-external {
    opacity: 0.7;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    height: 0;
    background: var(--primary);
    transition: height 0.4s ease;
}

.nav-link:hover {
    color: var(--white);
    padding-left: 0.75rem;
}

.nav-link:hover::before {
    height: 100%;
}

.nav-controls {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem 0 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    width: 100%;
    flex-wrap: wrap;
}

.language-switcher-nav {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
}

.lang-btn-nav {
    padding: 0.35rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.65rem;
    font-family: 'Instrument Serif', serif;
    writing-mode: horizontal-tb;
    text-orientation: initial;
    transform: none;
    min-width: 32px;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.lang-btn-nav:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.lang-btn-nav.active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(13, 148, 136, 0.15);
}

.theme-toggle {
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-icon-light {
    display: none;
}

[data-theme="light"] .theme-icon-dark {
    display: none;
}

[data-theme="light"] .theme-icon-light {
    display: block;
}

.menu-toggle {
    display: none;
    z-index: 1002;
}

.menu-toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--white);
    transition: all 0.3s ease;
    margin: 4px 0;
}

/* Hero styles removed - now using hero-background as main container */

.hero-container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    align-items: center;
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: clamp(1rem, 3vh, 2rem);
    color: var(--white);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* --- ОБНОВЛЕННАЯ АНИМАЦИЯ ДЛЯ ЛЕЙБЛА --- */
.hero-label {
    display: none;
}

.label-text {
    font-size: 0.875rem;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    line-height: 0.95;
    margin: 0 auto clamp(1.5rem, 4vh, 3rem) auto;
    letter-spacing: -0.03em;
    font-family: 'Instrument Serif', serif;
    position: relative;
    text-align: center;
    width: 100%;
    color: var(--white);
}

/* Обертка для каждой строки */
.hero-title-line {
    display: block;
    overflow: hidden;
    text-align: center;
}

/* Анимация появления слов */
.hero-title-word {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    animation: slideUpWord 0.8s cubic-bezier(0.2, 0.0, 0.2, 1) forwards;
}

.hero-title-word:nth-child(1) { 
    animation-delay: 0.1s; 
}
.hero-title-word:nth-child(2) { 
    animation-delay: 0.3s;
    color: var(--primary);
}
.hero-title-word:nth-child(3) { 
    animation-delay: 0.5s; 
}

/* Старые классы для совместимости */
.title-word {
    display: block;
    position: relative;
    opacity: 0;
    animation: slideUpWord 0.8s cubic-bezier(0.2, 0.0, 0.2, 1) forwards;
}

.title-word:nth-child(1) {
    animation-delay: 0.1s;
    color: var(--white);
}
.title-word:nth-child(2) {
    animation-delay: 0.3s;
    color: var(--primary);
}
.title-word:nth-child(3) {
    animation-delay: 0.5s;
    color: var(--white);
}

/* Ключевые кадры анимации */
@keyframes slideUpWord {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- ОБНОВЛЕННАЯ АНИМАЦИЯ ДЛЯ ОПИСАНИЯ --- */
.hero-description {
    font-size: clamp(0.9rem, 2.5vw, 1.5rem);
    color: var(--white);
    margin: 0 auto clamp(1rem, 3vh, 4rem) auto;
    line-height: clamp(1.4, 2vh, 1.8);
    max-width: 600px;
    font-weight: 400;
    font-family: 'Instrument Serif', serif;
    transform: rotate(0.5deg);
    text-align: center;
    width: 100%;
}

/* Обертка для каждого слова - как у заголовка */
.hero-description-line {
    display: inline-block;
    overflow: hidden;
}

.hero-description-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: slideUpWord 0.8s cubic-bezier(0.2, 0.0, 0.2, 1) forwards;
    animation-delay: 1s; /* Все слова появляются одновременно */
}

.hero-actions {
    display: flex;
    gap: 2rem;
    margin-top: clamp(-1rem, -2vh, -0.5rem);
    margin-bottom: 0;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

/* Стильная кнопка в минималистичном стиле */
.btn {
    padding: clamp(0.75rem, 2vh, 1rem) clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 0;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
    border: 1px solid rgba(52, 211, 153, 0.3);
    cursor: pointer;
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-family: 'Instrument Serif', serif;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.05em;
    text-transform: none;
    background: transparent;
    color: var(--white);
    opacity: 0;
    transform: translateY(100%);
    animation: slideUpWord 0.8s cubic-bezier(0.2, 0.0, 0.2, 1) forwards;
    animation-delay: 1.2s;
    flex-shrink: 0;
}

.btn-primary {
    background: transparent;
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: var(--white);
    backdrop-filter: blur(10px);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(52, 211, 153, 0.1);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-primary:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.2);
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary svg {
    width: clamp(16px, 2.5vw, 18px);
    height: clamp(16px, 2.5vw, 18px);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.btn-primary:hover svg {
    transform: translateX(10px) rotate(15deg);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: var(--white);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(52, 211, 153, 0.1);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.2);
}

.btn-secondary:hover::before {
    left: 0;
}

.btn-secondary svg {
    width: clamp(16px, 2.5vw, 18px);
    height: clamp(16px, 2.5vw, 18px);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.btn-secondary:hover svg {
    transform: translateX(10px) rotate(15deg);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transform: rotate(1deg);
    transition: all 0.4s ease;
}

.btn-outline:hover {
    background: rgba(52, 211, 153, 0.1);
    color: var(--primary);
    border-color: var(--primary);
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 10px 30px rgba(52, 211, 153, 0.3);
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    padding-top: 4rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    transform: rotate(-0.5deg);
}

.metric {
    text-align: left;
    position: relative;
}

.metric:nth-child(2) {
    transform: translateY(-20px);
}

.metric:nth-child(3) {
    transform: translateY(20px);
}

.metric-value {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-family: 'Instrument Serif', serif;
    line-height: 1;
    letter-spacing: -0.03em;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 500;
    font-family: 'Instrument Serif', serif;
}

.hero-background {
    position: relative;
    height: 100vh;
    max-height: 100vh;
    width: 100%;
    max-width: 100vw;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, rgba(167, 139, 250, 0.08) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow-x: hidden;
    overflow-y: hidden; /* Сайт на одном экране — прокрутка только в модальных окнах */
    z-index: 1;
    padding: clamp(1rem, 3vh, 2rem);
    padding-bottom: clamp(0.5rem, 1.5vh, 1rem);
}

/* Light theme для hero-background */
[data-theme="light"] .hero-background {
    background: linear-gradient(135deg, 
        rgba(249, 115, 22, 0.08) 0%, 
        rgba(59, 130, 246, 0.06) 50%,
        rgba(249, 115, 22, 0.05) 100%);
}

.bottom-bar {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: transparent;
    border-top: none;
    z-index: 100;
    padding: clamp(0.75rem, 2vh, 1.5rem) clamp(0.5rem, 1.5vw, 1.5rem);
    height: auto;
    min-height: auto;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: visible;
    overflow-y: visible;
    box-shadow: none;
    box-sizing: border-box;
    margin-top: auto;
    flex-shrink: 0;
}

.bottom-bar::-webkit-scrollbar {
    height: 4px;
}

.bottom-bar::-webkit-scrollbar-track {
    background: transparent;
}

.bottom-bar::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.3);
    border-radius: 2px;
}

.bottom-bar .visual-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    grid: none !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: visible;
    overflow-y: visible;
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
    justify-content: center;
    align-items: center;
}

.bottom-bar .visual-item {
    aspect-ratio: unset !important;
    flex-direction: row !important;
    gap: clamp(0.4rem, 1.2vw, 0.6rem) !important;
    padding: clamp(0.4rem, 1.2vh, 0.6rem) clamp(0.6rem, 1.8vw, 1.2rem) !important;
    min-width: auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    max-height: clamp(45px, 7vh, 70px) !important;
    min-height: clamp(35px, 5.5vh, 55px) !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
    flex-shrink: 1 !important;
    flex-grow: 0 !important;
    display: flex !important;
    grid-column: auto !important;
    grid-row: auto !important;
    box-sizing: border-box !important;
}

.bottom-bar .visual-icon {
    width: clamp(24px, 4vw, 32px) !important;
    height: clamp(24px, 4vw, 32px) !important;
    flex-shrink: 0;
}

.bottom-bar .visual-label {
    font-size: clamp(0.75rem, 2vw, 1rem) !important;
    line-height: 1.2;
    margin: 0;
    font-weight: 500;
}

.bottom-bar .visual-item-medium {
    padding: clamp(0.3rem, 1vh, 0.35rem) clamp(0.5rem, 1.5vw, 0.7rem) !important;
}

.bottom-bar .visual-item-medium .visual-icon {
    width: clamp(16px, 3vw, 18px) !important;
    height: clamp(16px, 3vw, 18px) !important;
}

.bottom-bar .visual-item-small {
    padding: clamp(0.25rem, 0.8vh, 0.3rem) clamp(0.4rem, 1.2vw, 0.6rem) !important;
}

.bottom-bar .visual-item-small .visual-icon {
    width: clamp(14px, 2.5vw, 16px) !important;
    height: clamp(14px, 2.5vw, 16px) !important;
}

.visual-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    width: 100%;
    max-width: 1400px;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(52, 211, 153, 0.3) transparent;
}

.visual-grid::-webkit-scrollbar {
    height: 4px;
}

.visual-grid::-webkit-scrollbar-track {
    background: transparent;
}

.visual-grid::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.3);
    border-radius: 2px;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(52, 211, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(167, 139, 250, 0.1) 0%, transparent 50%);
    z-index: 1;
}

/* Light theme для hero-background::before */
[data-theme="light"] .hero-background::before {
    background:
        radial-gradient(circle at 30% 30%, rgba(249, 115, 22, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
}

.hero-visual-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
    overflow: hidden;
    box-sizing: border-box;
}

/* --- ОБНОВЛЕННАЯ АНИМАЦИЯ ДЛЯ ЗАГОЛОВКА SAMOUKY --- */
.site-title-animated {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-family: 'Instrument Serif', serif;
    text-align: center;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
    text-shadow:
        0 0 20px rgba(52, 211, 153, 0.6),
        0 0 40px rgba(52, 211, 153, 0.4);
    z-index: 5;
    position: relative;
    width: 100%;
    flex-shrink: 0;
}

/* Обертка для надписи Samouky - как у заголовка */
.site-title-line {
    display: inline-block;
    overflow: hidden;
}

.site-title-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: slideUpWord 0.8s cubic-bezier(0.2, 0.0, 0.2, 1) forwards;
    animation-delay: 1.5s;
}

.visual-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 0.7fr 0.7fr 0.6fr 0.55fr 0.55fr;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    align-items: stretch;
    align-content: start;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
    overflow: hidden;
    height: calc(100% - 3rem);
}

/* =================================================================
   ✨ OPTICAL FOCUS EFFECT (Оптическая фокусировка)
   Кнопки проявляются из размытия, как при настройке объектива.
   ================================================================= */
.visual-item {
    aspect-ratio: 1;
    background: transparent;
    border: 2px solid rgba(52, 211, 153, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;

    cursor: pointer !important;
    gap: 0.5rem;
    padding: 0.75rem;
    pointer-events: auto !important;
    z-index: 10;
    width: 100%;
    height: auto;
    border-radius: 8px;
    transform-origin: center;
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.3);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@keyframes opticalFocus {
    0% {
        opacity: 0;
        transform: scale(1.15);
        filter: blur(15px) brightness(2);
    }
    40% {
        opacity: 0.8;
        filter: blur(5px) brightness(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px) brightness(1);
    }
}

/* Для светлой темы - черные цвета и отключаем CSS анимацию */
/* Старые стили удалены - используются новые выше */

/* Transition только после завершения анимации */
.visual-item.animation-complete {
    transition: all 0.3s ease;
}

/* Medium size items (language, theme) - 2x smaller */
.visual-item-medium {
    padding: 1rem;
    gap: 0.6rem;
    transform-origin: center;
    min-width: 0;
    min-height: 0;
    border-radius: 6px;
}

.visual-item-medium .visual-icon {
    width: 42px;
    height: 42px;
}

.visual-item-medium .visual-label {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Small size items (footer links) - larger for readability */
.visual-item-small {
    padding: 0.3rem 0.4rem;
    gap: 0.15rem;
    transform-origin: center;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 1; /* Square shape */
    border-radius: 8px;
    justify-content: center;
    align-items: center;
    height: auto;
    min-height: calc(0.7rem * 1.3 + 0.1rem);
}

.visual-item-small .visual-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.visual-item-small .visual-label {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

.visual-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow:
            0 0 10px rgba(52, 211, 153, 0.4),
            0 0 20px rgba(52, 211, 153, 0.2),
            inset 0 0 10px rgba(52, 211, 153, 0.1);
    }
    50% {
        box-shadow:
            0 0 20px rgba(52, 211, 153, 0.6),
            0 0 40px rgba(52, 211, 153, 0.4),
            inset 0 0 15px rgba(52, 211, 153, 0.2);
    }
}

.visual-item:hover {
    background: rgba(52, 211, 153, 0.3);
    border-color: var(--secondary);
    transform: scale(1.1) rotate(5deg) !important;
    box-shadow:
        0 20px 40px rgba(52, 211, 153, 0.5),
        0 0 30px rgba(52, 211, 153, 0.6),
        inset 0 0 20px rgba(52, 211, 153, 0.2);
    filter: drop-shadow(0 0 25px rgba(52, 211, 153, 0.8));
    animation-play-state: paused;
}

/* Для светлой темы - черные цвета при hover */
[data-theme="light"] .visual-item:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: #000000;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.1);
    filter: drop-shadow(0 0 25px rgba(0, 0, 0, 0.5));
}

.visual-item:hover::before {
    opacity: 1;
}

/* Staggered animation delays for flowing effect - like sand/water pouring */

/* Reset margins for medium and small items */
.visual-item-medium,
.visual-item-small {
    margin-top: 0 !important;
}

.visual-item[data-lang].active .visual-icon,
.visual-item[data-lang].active {
    border-color: var(--primary);
    background: rgba(52, 211, 153, 0.2);
}

.visual-item[data-lang].active .visual-label {
    color: var(--primary);
    opacity: 1;
}

/* Для светлой темы - черные цвета для активных элементов */
/* Старые стили удалены - используются новые выше */

/* Theme icon visibility in visual items */
.visual-item[data-theme-toggle] .theme-icon-light {
    display: none;
    position: absolute;
}

.visual-item[data-theme-toggle] .theme-icon-dark {
    display: block;
    position: relative;
}

[data-theme="light"] .visual-item[data-theme-toggle] .theme-icon-dark {
    display: none;
}

[data-theme="light"] .visual-item[data-theme-toggle] .theme-icon-light {
    display: block;
    position: relative;
}

.visual-icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
    opacity: 0.7;
    transition: all 0.5s ease;
    z-index: 1;
    stroke-width: 2;
    filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.6));
    animation: iconGlow 2s ease-in-out infinite;
    flex-shrink: 0;
}

/* Для светлой темы - черные иконки */
/* Старые стили удалены - используются новые выше */

@keyframes iconGlowLight {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.4));
        opacity: 0.7;
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.6));
        opacity: 1;
    }
}

[data-theme="light"] .visual-icon {
    animation: iconGlowLight 2s ease-in-out infinite;
}

@keyframes iconGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.6));
        opacity: 0.7;
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(52, 211, 153, 0.9));
        opacity: 1;
    }
}

.visual-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    transition: all 0.3s ease;
    font-family: 'Instrument Serif', serif;
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
    z-index: 1;
    position: relative;
    margin-top: 0.5rem;
    line-height: 1.2;
    display: inline-block;
}


/* Для светлой темы - черные лейблы */
/* Старые стили удалены - используются новые выше */

.visual-item:hover .visual-label {
    opacity: 1;
    color: var(--white);
    text-shadow: 0 0 15px rgba(52, 211, 153, 0.8);
    transform: scale(1.1);
}

/* Для светлой темы - черные лейблы при hover */
[data-theme="light"] .visual-item:hover .visual-label {
    color: #000000;
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.visual-item:active {
    transform: scale(0.95) !important;
}

.visual-item:hover .visual-icon {
    opacity: 1;
    transform: scale(1.2) rotate(15deg);
    color: var(--white);
}

/* Для светлой темы - черные иконки при hover */
[data-theme="light"] .visual-item:hover .visual-icon {
    color: #000000;
}

.visual-lines {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.1;
}

/* --- СДЕЛАЛ ЛИНИИ ЕЛЕ ЗАМЕТНЫМИ --- */
.visual-line {
    position: absolute;
    background: rgba(52, 211, 153, 0.05); /* Очень прозрачный зеленый */
    animation: lineMove 8s ease-in-out infinite;
}

.visual-line:nth-child(1) {
    top: 20%;
    left: 0;
    width: 100%;
    height: 1px;
    animation-delay: 0s;
}

.visual-line:nth-child(2) {
    top: 0;
    left: 30%;
    width: 1px;
    height: 100%;
    animation-delay: 2s;
}

.visual-line:nth-child(3) {
    bottom: 30%;
    left: 0;
    width: 100%;
    height: 1px;
    animation-delay: 4s;
}

.visual-line:nth-child(4) {
    top: 0;
    right: 20%;
    width: 1px;
    height: 100%;
    animation-delay: 6s;
}

@keyframes lineMove {
    0%, 100% {
        opacity: 0.05;
        transform: scaleX(0.5);
    }
    50% {
        opacity: 0.15;
        transform: scaleX(1);
    }
}

.visual-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-element {
    display: none;
}


.scroll-hint {
    position: absolute;
    bottom: 4rem;
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

.scroll-line {
    width: 2px;
    height: 60px;
    background: var(--white);
    opacity: 0.5;
    animation: scrollLine 2s ease infinite;
}

@keyframes scrollLine {
    0%, 100% { opacity: 0.3; transform: scaleY(0.3); }
    50% { opacity: 0.8; transform: scaleY(1); }
}

.scroll-hint span {
    font-size: 0.6875rem;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-weight: 500;
    font-family: 'Instrument Serif', serif;
}

/* Vision - диагональная компоновка */
.vision {
    padding: 6rem 0;
    position: relative;
    z-index: 2;
    background: var(--dark-2);
    transform: skewY(-2deg);
    margin: 4rem 0 4rem 160px;
    overflow: hidden;
}

.vision > .container {
    transform: skewY(2deg);
}

.section-intro {
    display: flex;
    align-items: baseline;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-family: 'Instrument Serif', serif;
    position: relative;
    z-index: 1;
    transform: rotate(-1deg);
}

.vision-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 8rem;
    align-items: start;
}

.vision-text {
    position: sticky;
    top: 160px;
}

.vision-lead {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    line-height: 1.4;
    color: var(--white);
    font-family: 'Instrument Serif', serif;
    transform: rotate(0.5deg);
}

.vision-description {
    font-size: 1.25rem;
    color: var(--gray);
    line-height: 2;
    font-weight: 400;
}

.vision-principles {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.principle {
    padding: 0;
    background: transparent;
    border: none;
    border-left: 3px solid var(--primary);
    padding-left: 3rem;
    transition: all 0.4s ease;
    transform: rotate(-0.5deg);
    position: relative;
    z-index: 1;
}

.principle:hover {
    transform: rotate(0deg) translateX(20px);
    border-left-color: var(--primary);
    box-shadow: -10px 0 30px rgba(52, 211, 153, 0.25);
}

.principle:nth-child(2) {
    transform: rotate(0.5deg);
}

.principle:nth-child(2):hover {
    transform: rotate(0deg) translateX(20px);
}

.principle h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    font-family: 'Instrument Serif', serif;
}

.principle p {
    color: var(--gray);
    line-height: 1.9;
    font-size: 1.125rem;
}

/* Expertise - мозаичная сетка */
.expertise {
    padding: 6rem 0;
    position: relative;
    z-index: 3;
    background: var(--dark);
    overflow: hidden;
    margin-left: 160px;
}

.expertise-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    position: relative;
}

.expertise-card {
    padding: 2rem;
    background: var(--dark-2);
    border: 2px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    transform: rotate(-0.5deg);
}

.expertise-card:nth-child(even) {
    transform: rotate(0.5deg);
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.expertise-card:nth-child(odd) {
    position: relative;
    z-index: 1;
}

.expertise-card:hover {
    transform: rotate(0deg) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 20px 60px rgba(52, 211, 153, 0.25);
}

.expertise-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.5s ease;
}

.expertise-card:hover::before {
    transform: scaleX(1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.card-icon {
    width: 80px;
    height: 80px;
    background: rgba(52, 211, 153, 0.1);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all 0.4s ease;
    transform: rotate(-5deg);
}

.expertise-card:hover .card-icon {
    transform: rotate(0deg) scale(1.1);
    background: var(--primary);
    color: var(--dark);
}

.card-icon svg {
    width: 40px;
    height: 40px;
}

.expertise-card h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    font-family: 'Instrument Serif', serif;
    line-height: 1.3;
}

.expertise-card > p {
    color: var(--gray);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 1rem;
}

.card-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.card-features li {
    color: var(--gray);
    padding-left: 2rem;
    position: relative;
    font-size: 1rem;
}

.card-features li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 0.75rem;
}

.expertise-cta {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.expertise-cta .btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

/* Work - карусель с наклоном */
.work {
    padding: 12rem 0;
    position: relative;
    z-index: 2;
    background: var(--dark-2);
    transform: skewY(2deg);
    margin: 8rem 0 8rem 110px;
    overflow: hidden;
}

.work > .container {
    transform: skewY(-2deg);
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 6rem;
}

.work-item {
    aspect-ratio: 4/5;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.1);
    transition: all 0.5s ease;
    transform: rotate(-2deg);
    z-index: 1;
}

.work-item:nth-child(2) {
    transform: rotate(2deg) translateY(-2rem);
    z-index: 2;
}

.work-item:nth-child(3) {
    transform: rotate(-1deg) translateY(2rem);
    z-index: 1;
}

.work-item:hover {
    transform: rotate(0deg) scale(1.02) !important;
    border-color: var(--primary);
    z-index: 10 !important;
    box-shadow: 0 20px 60px rgba(52, 211, 153, 0.3);
}

.work-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.15) 0%, rgba(52, 211, 153, 0.05) 100%);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.work-item:nth-child(2) .work-image {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
    border-color: rgba(52, 211, 153, 0.25);
}

.work-item:nth-child(3) .work-image {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(52, 211, 153, 0.1) 100%);
    border-color: rgba(52, 211, 153, 0.3);
}

.work-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: flex-end;
    padding: 3rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.work-item:hover .work-overlay {
    opacity: 1;
}

.work-content {
    width: 100%;
    transform: translateY(30px);
    transition: transform 0.5s ease;
}

.work-item:hover .work-content {
    transform: translateY(0);
}

.work-category {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: var(--dark);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
    font-family: 'Instrument Serif', serif;
    clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%);
    box-shadow: 0 5px 15px rgba(52, 211, 153, 0.3);
}

.work-content h3 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1rem;
    font-family: 'Instrument Serif', serif;
    line-height: 1.2;
}

.work-content p {
    color: var(--gray);
    margin-bottom: 2rem;
    line-height: 1.8;
    font-size: 1.0625rem;
}

.work-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    transition: gap 0.4s ease;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Instrument Serif', serif;
}

.work-link:hover {
    gap: 1.5rem;
    color: var(--primary);
}

/* Contact - асимметричная форма */
.contact {
    padding: 4rem 0;
    position: relative;
    z-index: 3;
    background: var(--dark);
    overflow: hidden;
    margin-left: 160px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 4rem;
    align-items: start;
    width: 100%;
}

.contact-info {
    position: sticky;
    top: 160px;
    transform: rotate(-1deg);
    z-index: 1;
}

.contact-description {
    font-size: 1.125rem;
    color: var(--gray);
    margin: 1.5rem 0 2rem;
    line-height: 1.7;
    font-weight: 400;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    padding: 0;
    border: none;
    border-left: 3px solid var(--primary);
    padding-left: 2rem;
    transition: all 0.3s ease;
    transform: rotate(-0.5deg);
    position: relative;
    z-index: 1;
}

.contact-item:hover {
    border-left-color: var(--primary);
    transform: rotate(0deg) translateX(10px);
    box-shadow: -10px 0 20px rgba(52, 211, 153, 0.2);
}

.contact-label {
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 1rem;
    font-weight: 700;
    font-family: 'Instrument Serif', serif;
}

.contact-value {
    font-size: 1.5rem;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    font-weight: 500;
    font-family: 'Instrument Serif', serif;
}

.contact-value:hover {
    color: var(--primary);
}

.contact-form {
    padding: 0;
    background: transparent;
    border: none;
    transform: rotate(1deg);
    position: relative;
    z-index: 1;
}

/* Honeypot — скрытое поле для защиты от ботов (не удалять) */
.form-honeypot-wrap {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--gray);
    font-family: 'Instrument Serif', serif;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--dark-2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 400;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 107, 107, 0.05);
    transform: translateY(-2px);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

#formStatus {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(50px);
    animation: slideUpWord 0.8s cubic-bezier(0.2, 0.0, 0.2, 1) forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#submitBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Footer - минималистичный */
.footer {
    padding: 3rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1;
    background: var(--dark-2);
    margin-left: 160px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.footer-brand .logo-text {
    font-size: 1.25rem;
    font-family: 'Instrument Serif', serif;
    font-weight: 700;
    letter-spacing: 0.2em;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 400;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--gray);
    font-size: 0.75rem;
    font-weight: 400;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark-2);
    border-top: 2px solid var(--primary);
    padding: 1.5rem 2rem;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    box-shadow: 0 -4px 30px rgba(52, 211, 153, 0.3);
    margin-bottom: 0;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-content p {
    color: var(--gray);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
}

.btn-cookie-accept,
.btn-cookie-reject,
.btn-cookie-settings {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid;
    min-width: 120px;
    font-family: 'Work Sans', sans-serif;
}

.btn-cookie-accept {
    background: var(--primary);
    color: var(--dark);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(52, 211, 153, 0.4);
}

.btn-cookie-accept:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 211, 153, 0.5);
}

.btn-cookie-reject {
    background: transparent;
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-cookie-reject:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-cookie-settings {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-cookie-settings:hover {
    background: rgba(52, 211, 153, 0.1);
    border-color: var(--primary-light);
}

/* Cookie Banner Mobile */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 1rem 1.25rem;
        bottom: 0;
    }

    .cookie-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .cookie-text {
        min-width: 100%;
    }

    .cookie-buttons {
        width: 100%;
        flex-direction: column;
    }

    .btn-cookie-accept,
    .btn-cookie-reject,
    .btn-cookie-settings {
        width: 100%;
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        padding: 1rem;
    }

    .cookie-content p {
        font-size: 0.8rem;
    }

    .btn-cookie-accept,
    .btn-cookie-reject,
    .btn-cookie-settings {
        padding: 0.65rem 1.25rem;
        font-size: 0.85rem;
    }
}

.cookie-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: rgba(52, 211, 153, 0.1);
}

.cookie-link:hover {
    background: rgba(52, 211, 153, 0.2);
    border-color: var(--primary-light);
    color: var(--primary-light);
    text-decoration: none;
}

/* Particles */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.2;
}

.animated-gradient-bg,
.grid-overlay {
    display: none;
}

/* Responsive */
@media (max-width: 1400px) {
    .container {
        padding: 0 40px;
    }

    .hero-background {
        padding-left: 110px;
    }

    .navbar {
        width: 110px;
    }
}

@media (max-width: 1200px) {
    .hero-background {
        padding-left: 110px;
    }

    .vision,
    #advantage {
        margin-left: 160px;
    }

    .expertise,
    #learning,
    #services {
        margin-left: 160px;
    }

    .work {
        margin-left: 160px;
    }

    .contact {
        margin-left: 160px;
    }

    .footer {
        margin-left: 160px;
    }
}

@media (max-width: 1200px) {
    .hero-container {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .hero-visual {
        height: auto;
        min-height: 0;
        flex: 1;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
        margin-top: 0;
        border-left: none;
        border-top: 1px solid rgba(52, 211, 153, 0.2);
        padding-top: 2rem;
    }

    .hero-background {
        height: 100vh !important;
        max-height: 100vh !important;
        overflow: hidden !important;
        display: flex;
        flex-direction: column;
    }

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

    .expertise-card:nth-child(even) {
        margin-top: 0;
    }

    .work-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =================================================================
   МОБИЛЬНАЯ ВЕРСИЯ - БЕЗ ТРАПЕЦИИ
   Простая вертикальная компоновка
   ================================================================= */
@media (max-width: 968px) {
    html, body {
        overflow: hidden;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        position: fixed;
        width: 100%;
    }

    /* Верхние элементы — компактно и читаемо на мобильных */
    .project-label {
        top: 12px;
        left: 12px;
        font-size: 0.65rem;
        letter-spacing: 0.08em;
        opacity: 0.7;
    }

    .top-controls {
        top: 12px;
        right: 12px;
        gap: 0.5rem;
        max-width: calc(100vw - 24px);
    }

    .lang-dropdown-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .lang-dropdown-btn .dropdown-arrow {
        width: 14px;
        height: 14px;
    }

    .lang-dropdown-menu {
        min-width: 88px;
        padding: 0.25rem 0;
    }

    .lang-dropdown-item {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }

    .theme-toggle-btn,
    .cookies-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    .theme-toggle-btn svg,
    .cookies-btn svg {
        width: 18px;
        height: 18px;
    }

    .hero-background {
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        padding: clamp(8px, 1.5vh, 16px) clamp(1rem, 4vw, 1.5rem) 0 !important;
        padding-bottom: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch;
        box-sizing: border-box;
    }

    .hero-container {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        width: 100%;
        max-width: 100%;
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        bottom: auto;
    }

    .navbar .container {
        padding: 0;
        max-width: 100%;
    }

    .nav-wrapper {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
        gap: 1rem;
    }

    .logo {
        transform: rotate(0deg) !important;
        flex-direction: row;
        margin-bottom: 0;
        min-height: auto;
    }

    .logo-text {
        font-size: 1rem;
        writing-mode: horizontal-tb !important;
        text-orientation: initial !important;
        transform: rotate(0deg) !important;
        letter-spacing: 0.2em;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(20px);
        width: 100%;
        height: calc(100vh - 70px);
        padding: 3rem 2rem;
        transition: left 0.4s ease;
        z-index: 999;
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        writing-mode: horizontal-tb !important;
        transform: rotate(0deg) !important;
        padding: 1.25rem 0;
        font-size: 1rem;
        text-align: left;
        width: 100%;
    }

    .nav-link::before {
        left: -10px;
        top: 50%;
        width: 0;
        height: 2px;
    }

    .nav-link:hover {
        padding-left: 1.5rem;
    }

    .nav-link:hover::before {
        width: 10px;
    }

    /* Мобильная главная: контент сверху, нижняя панель ВСЕГДА видна и выше от края */
    .hero-content {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        max-height: calc(100dvh - 125px) !important;
        max-height: calc(100vh - 125px) !important;
        padding: clamp(0.6rem, 1.5vh, 1rem) clamp(1rem, 4vw, 1.5rem) clamp(0.4rem, 1vh, 0.6rem) !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        text-align: center;
    }

    .hero-title {
        font-size: clamp(2.6rem, 8.5vw, 3.5rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 0.6rem !important;
        letter-spacing: 0.02em;
    }

    .hero-description {
        font-size: clamp(1.5rem, 4.2vw, 1.75rem) !important;
        line-height: 1.45 !important;
        margin-bottom: clamp(0.7rem, 2vh, 1.1rem) !important;
        max-width: 95%;
        opacity: 0.95;
    }

    .hero-actions {
        margin-top: clamp(0.9rem, 2.5vh, 1.35rem) !important;
        margin-bottom: 0 !important;
    }

    .hero-actions .btn {
        min-height: 50px;
        padding: 0.85rem 1.4rem !important;
        font-size: clamp(1.05rem, 2.8vw, 1.15rem) !important;
        border-radius: 8px;
        font-weight: 500;
        gap: 0.5rem;
        box-shadow: 0 2px 12px rgba(52, 211, 153, 0.25);
    }

    .hero-actions .btn svg {
        width: 20px !important;
        height: 20px !important;
    }

    .bottom-bar {
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        min-height: 76px !important;
        margin: 0 !important;
        margin-top: auto !important;
        padding: clamp(1.35rem, 3.5vh, 1.9rem) clamp(0.85rem, 3vw, 1.35rem) !important;
        padding-bottom: max(clamp(1.35rem, 3.5vh, 1.9rem), env(safe-area-inset-bottom, 0)) !important;
        background: rgba(0, 0, 0, 0.25);
        backdrop-filter: blur(8px);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .bottom-bar .visual-grid {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.5rem !important;
        width: 100% !important;
        justify-content: center !important;
        align-items: stretch !important;
    }

    .bottom-bar .visual-item {
        flex: 1 1 0;
        min-width: min-content !important;
        flex-direction: row !important;
        padding: 0.6rem 0.7rem !important;
        gap: 0.4rem !important;
        min-height: 54px !important;
        max-height: none !important;
        border-radius: 12px;
        justify-content: center;
        align-items: center;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        overflow: visible;
    }

    .bottom-bar .visual-item:active {
        transform: scale(0.97);
    }

    .bottom-bar .visual-icon {
        width: 26px !important;
        height: 26px !important;
        flex-shrink: 0;
    }

    .bottom-bar .visual-label {
        font-size: clamp(1.15rem, 3.2vw, 1.3rem) !important;
        font-weight: 500;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
        overflow: visible;
        min-width: 0;
    }

    /* Удобные зоны нажатия на мобильных */
    .hero-actions .btn,
    .bottom-bar .visual-item {
        -webkit-tap-highlight-color: rgba(52, 211, 153, 0.2);
        tap-highlight-color: rgba(52, 211, 153, 0.2);
    }

    [data-theme="light"] .hero-actions .btn,
    [data-theme="light"] .bottom-bar .visual-item {
        -webkit-tap-highlight-color: rgba(249, 115, 22, 0.2);
        tap-highlight-color: rgba(249, 115, 22, 0.2);
    }

    .mobile-bottom-spacer {
        display: none !important;
    }

    .section-title {
        font-size: clamp(1.75rem, 10vw, 2.5rem);
    }

    .principle,
    .expertise-card,
    .work-item {
        padding: 1.5rem 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .hero-visual {
        padding-top: 0;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        max-height: calc(100vh - 180px);
        margin-top: clamp(0.1rem, 0.5vh, 0.25rem);
    }

    .hero-visual-content {
        padding: clamp(0.15rem, 0.7vw, 0.3rem);
        padding-top: clamp(0.06rem, 0.35vw, 0.12rem);
        height: 100%;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .hero-visual .visual-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: 0.48fr 0.48fr 0.43fr 0.38fr 0.4fr;
        gap: clamp(0.1rem, 0.5vw, 0.2rem);
        padding: clamp(0.1rem, 0.5vw, 0.18rem);
        padding-bottom: clamp(0.12rem, 0.7vw, 0.25rem);
        overflow: visible;
        flex: 1;
        min-height: 0;
        max-height: 100%;
    }

    .visual-item {
        padding: clamp(0.1rem, 0.5vw, 0.15rem);
        gap: clamp(0.05rem, 0.3vw, 0.08rem);
    }

    .visual-icon {
        font-size: clamp(0.4rem, 1.2vw, 0.5rem);
        width: clamp(9px, 2.5vw, 12px);
        height: clamp(9px, 2.5vw, 12px);
    }

    .visual-label {
        font-size: clamp(0.35rem, 1vw, 0.45rem);
        line-height: 1.2;
    }

    .visual-item-medium {
        padding: 0.1rem;
        gap: 0.05rem;
    }

    .visual-item-medium .visual-label {
        font-size: 0.45rem;
    }

    .visual-item-medium .visual-icon {
        width: clamp(22px, 5.5vw, 28px);
        height: clamp(22px, 5.5vw, 28px);
    }

    .visual-item-medium .visual-label {
        font-size: clamp(0.65rem, 2vw, 0.8rem);
    }

    .visual-item-small {
        padding: clamp(0.4rem, 1.5vw, 0.6rem);
        gap: clamp(0.25rem, 1vw, 0.4rem);
        aspect-ratio: auto;
        min-height: auto;
        width: auto;
        height: auto;
    }

    .visual-item-small .visual-icon {
        width: clamp(24px, 6vw, 32px);
        height: clamp(24px, 6vw, 32px);
    }

    .visual-item-small .visual-label {
        font-size: clamp(0.7rem, 2.2vw, 0.85rem);
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    z-index: 10001;
    background: var(--dark-2);
    border: 2px solid rgba(52, 211, 153, 0.3);
    width: 1200px;
    height: 850px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10002;
    background: rgba(52, 211, 153, 0.1);
    border: 2px solid var(--primary);
    color: var(--primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.modal-close:hover {
    background: var(--primary);
    color: var(--dark);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 1.5rem;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.modal-title,
.modal-header h2,
.modal-header h3,
.modal-body h1,
.modal-body h2,
.modal-body h3,
.modal-body h4,
.modal-body h5,
.modal-body h6 {
    color: var(--primary);
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.01em;
}

.modal-body p,
.modal-body li,
.modal-body span,
.modal-body div,
.modal-body label,
.modal-body input,
.modal-body textarea,
.modal-body button,
.modal-body a {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-weight: 400;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Allow scrolling in modals when content overflows (desktop). On mobile — only modals scroll. */
#modal-privacy .modal-body,
#modal-terms .modal-body,
#modal-cookies .modal-body,
#modal-learning .modal-body,
#modal-vision .modal-body,
#modal-services .modal-body,
#modal-contact .modal-body {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Allow scrolling for all modals in mobile */
/* Модальные окна - прокрутка разрешена на мобильных */
@media (max-width: 768px) {
    .modal-body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    /* При открытом модальном окне разрешаем прокрутку только в модальном окне */
    body.modal-open,
    html.modal-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Главная страница без модального окна - без прокрутки */
    body:not(.modal-open),
    html:not(.modal-open) {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }

    .modal-content {
        overflow: hidden;
    }

    /* Custom scrollbar for mobile modals */
    .modal-body::-webkit-scrollbar {
        width: 6px;
    }

    .modal-body::-webkit-scrollbar-track {
        background: var(--dark-3);
    }

    .modal-body::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 3px;
    }

    .modal-body::-webkit-scrollbar-thumb:hover {
        background: var(--primary-light);
    }
}

#modal-privacy .modal-content,
#modal-terms .modal-content,
#modal-cookies .modal-content {
    overflow: hidden;
}

/* Scrollbar for privacy/terms/cookies modals */
#modal-privacy .modal-body::-webkit-scrollbar,
#modal-terms .modal-body::-webkit-scrollbar,
#modal-cookies .modal-body::-webkit-scrollbar,
#modal-learning .modal-body::-webkit-scrollbar,
#modal-vision .modal-body::-webkit-scrollbar,
#modal-services .modal-body::-webkit-scrollbar,
#modal-contact .modal-body::-webkit-scrollbar {
    width: 8px;
}

#modal-privacy .modal-body::-webkit-scrollbar-track,
#modal-terms .modal-body::-webkit-scrollbar-track,
#modal-cookies .modal-body::-webkit-scrollbar-track,
#modal-learning .modal-body::-webkit-scrollbar-track,
#modal-vision .modal-body::-webkit-scrollbar-track,
#modal-services .modal-body::-webkit-scrollbar-track,
#modal-contact .modal-body::-webkit-scrollbar-track {
    background: var(--dark-3);
}

#modal-privacy .modal-body::-webkit-scrollbar-thumb,
#modal-terms .modal-body::-webkit-scrollbar-thumb,
#modal-cookies .modal-body::-webkit-scrollbar-thumb,
#modal-learning .modal-body::-webkit-scrollbar-thumb,
#modal-vision .modal-body::-webkit-scrollbar-thumb,
#modal-services .modal-body::-webkit-scrollbar-thumb,
#modal-contact .modal-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

#modal-privacy .modal-body::-webkit-scrollbar-thumb:hover,
#modal-terms .modal-body::-webkit-scrollbar-thumb:hover,
#modal-cookies .modal-body::-webkit-scrollbar-thumb:hover,
#modal-learning .modal-body::-webkit-scrollbar-thumb:hover,
#modal-vision .modal-body::-webkit-scrollbar-thumb:hover,
#modal-services .modal-body::-webkit-scrollbar-thumb:hover,
#modal-contact .modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Enhanced styles for Privacy, Terms, Cookies modals */
#modal-privacy .modal-body h2,
#modal-terms .modal-body h2,
#modal-cookies .modal-body h2,
#modal-privacy .modal-body h3,
#modal-terms .modal-body h3,
#modal-cookies .modal-body h3 {
    color: var(--primary);
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.01em;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

#modal-privacy .modal-body h2:first-child,
#modal-terms .modal-body h2:first-child,
#modal-cookies .modal-body h2:first-child {
    margin-top: 0;
}

#modal-privacy .modal-body p,
#modal-terms .modal-body p,
#modal-cookies .modal-body p {
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 1rem;
    font-weight: 400;
    letter-spacing: -0.005em;
}

#modal-privacy .modal-body ul,
#modal-terms .modal-body ul,
#modal-cookies .modal-body ul,
#modal-privacy .modal-body ol,
#modal-terms .modal-body ol,
#modal-cookies .modal-body ol {
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.005em;
}

#modal-privacy .modal-body li,
#modal-terms .modal-body li,
#modal-cookies .modal-body li {
    margin-bottom: 0.5rem;
    position: relative;
}

#modal-privacy .modal-body ul li::before,
#modal-terms .modal-body ul li::before,
#modal-cookies .modal-body ul li::before {
    content: '▶';
    position: absolute;
    left: -1.25rem;
    color: var(--primary);
    font-size: 0.7rem;
}

#modal-privacy .modal-body a,
#modal-terms .modal-body a,
#modal-cookies .modal-body a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

#modal-privacy .modal-body a:hover,
#modal-terms .modal-body a:hover,
#modal-cookies .modal-body a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.modal-body .learning-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 1rem;
    width: 100%;
}

/* Кнопки в модальных окнах — без эффекта появления */
.modal-body .btn {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

.modal-body .learning-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
    align-items: center;
    grid-column: 2;
    justify-self: center;
}

.modal-body .learning-buttons .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: auto;
    max-width: none;
}

.modal-body .learning-buttons .btn span {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-body .learning-buttons .btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    margin-left: 0.25rem;
}

.modal-body .section-title {
    margin-bottom: 0;
    transform: none;
    font-size: 1.75rem;
    line-height: 1.2;
    font-weight: 700;
    grid-column: 1;
    justify-self: start;
}

.modal-body .section-description {
    font-size: 0.9rem;
    margin-top: 1.5rem;
    margin-bottom: 0;
    line-height: 1.5;
    color: var(--primary);
    text-align: center;
    font-weight: 500;
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.02em;
}

.modal-body .vision-content {
    margin-top: 0.75rem;
    gap: 1rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

.modal-body .vision-text {
    position: static;
}

.modal-body .vision-lead {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-weight: 600;
    color: var(--white);
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.01em;
}

.modal-body .vision-description {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0;
    color: var(--gray);
    font-weight: 400;
    letter-spacing: -0.005em;
}

.modal-body .vision-principles {
    gap: 0.75rem;
    display: flex;
    flex-direction: column;
}

.modal-body .principle {
    padding: 1rem;
    margin-bottom: 0;
    background: var(--dark-2);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modal-body .principle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.modal-body .principle:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(52, 211, 153, 0.15);
}

.modal-body .principle:hover::before {
    transform: scaleX(1);
}

.modal-body .principle h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    font-weight: 600;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.01em;
}

.modal-body .principle p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--gray);
    margin: 0;
}

.modal-body .expertise-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    margin-top: 0.75rem;
}

.modal-body .expertise-card {
    transform: none;
    margin-top: 0;
    padding: 0.875rem;
    display: flex;
    flex-direction: column;
    background: var(--dark-2);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.modal-body .expertise-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.modal-body .expertise-card:hover::before {
    transform: scaleX(1);
}

.modal-body .expertise-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    line-height: 1.3;
    font-weight: 600;
    color: var(--white);
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.01em;
}

.modal-body .expertise-card > p {
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    line-height: 1.45;
    flex: 1;
    color: var(--gray);
    min-height: 0;
}

.modal-body .card-header {
    margin-bottom: 0.4rem;
}

.modal-body .card-icon {
    width: 40px;
    height: 40px;
    background: rgba(52, 211, 153, 0.1);
    border: 2px solid var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all 0.3s ease;
}

.modal-body .expertise-card:hover .card-icon {
    background: var(--primary);
    color: var(--dark);
    transform: scale(1.05);
}

.modal-body .card-icon svg {
    width: 20px;
    height: 20px;
}

.modal-body .card-features {
    gap: 0.4rem;
    margin-top: auto;
    list-style: none;
    padding: 0;
    flex-shrink: 0;
}

.modal-body .card-features li {
    font-size: 0.75rem;
    padding-left: 1.1rem;
    line-height: 1.35;
    color: var(--gray);
    position: relative;
    margin-bottom: 0;
}

.modal-body .card-features li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 0.7rem;
}

.modal-body .expertise-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(52, 211, 153, 0.15);
}

.modal-body .expertise-card[onclick] {
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-body .expertise-card[onclick]:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(52, 211, 153, 0.15);
}

.modal-body .contact-wrapper {
    grid-template-columns: 1fr 1.2fr;
    gap: 1.25rem;
    margin-top: 0.75rem;
    display: grid;
}

.modal-body .contact-info {
    position: static;
    transform: none;
}

.modal-body .contact-description {
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem;
    line-height: 1.6;
    color: var(--gray);
}

.modal-body .contact-details {
    gap: 0.75rem;
}

.modal-body .contact-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: var(--dark-2);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.modal-body .contact-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.1);
}

.modal-body .contact-label {
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-body .contact-value {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--white);
}

.modal-body .contact-value a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.modal-body .contact-value a:hover {
    color: var(--primary);
}

.modal-body .contact-form {
    transform: none;
}

.modal-body .form-row {
    gap: 0.75rem;
    margin-bottom: 0;
}

.modal-body .form-group {
    margin-bottom: 0.75rem;
}

.modal-body .form-group label {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

.modal-body .form-group input,
.modal-body .form-group textarea {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    background: var(--dark-2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--white);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.1);
}

.modal-body .form-group input::placeholder,
.modal-body .form-group textarea::placeholder {
    color: var(--gray);
    opacity: 0.6;
}

.modal-body .form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: 'Work Sans', sans-serif;
}

.modal-body .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.modal-body .expertise-cta {
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.modal-body #formStatusModal {
    margin-top: 0.75rem;
    padding: 0.75rem;
    font-size: 0.8rem;
}

@media (max-width: 968px) {
    .modal {
        padding: 0.5rem;
    }

    .modal-body .learning-header {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-body .section-title {
        grid-column: 1;
        justify-self: start;
    }

    .modal-body .learning-buttons {
        grid-column: 1;
        width: 100%;
        flex-direction: row;
        gap: 0.5rem;
        justify-self: center;
    }

    .modal-body .learning-buttons .btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
        font-size: 0.7rem;
        padding: 0.5rem 0.75rem;
    }

    .modal-content {
        width: 98vw;
        height: 95vh;
        max-width: 98vw;
        max-height: 95vh;
    }

    .modal-body {
        padding: 1rem;
        overflow-y: auto;
        overflow-x: hidden;
        font-size: 0.85rem;
    }

    .modal-body .section-title {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
        margin-bottom: 0.75rem;
    }

    .modal-body h3 {
        font-size: clamp(1rem, 4vw, 1.125rem);
        margin-bottom: 0.5rem;
    }

    .modal-body p,
    .modal-body li {
        font-size: clamp(0.75rem, 3vw, 0.85rem);
        line-height: 1.5;
        margin-bottom: 0.5rem;
    }

    .modal-body ul,
    .modal-body ol {
        padding-left: 1rem;
        margin-bottom: 0.5rem;
    }

    .modal-body li {
        margin-bottom: 0.25rem;
    }

    .modal-body .vision-content,
    .modal-body .expertise-grid,
    .modal-body .contact-wrapper {
        gap: 0.75rem;
        margin-top: 0.5rem;
    }

    .modal-body .principle,
    .modal-body .expertise-card {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .modal-body .principle h3,
    .modal-body .expertise-card h3 {
        font-size: clamp(0.9rem, 3.5vw, 1rem);
        margin-bottom: 0.375rem;
    }

    .modal-body .contact-item {
        padding: 0.5rem 0 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
    }

    .modal-body .form-group {
        margin-bottom: 0.5rem;
    }

    .modal-body .form-group input,
    .modal-body .form-group textarea {
        padding: 0.4rem 0.5rem;
        font-size: clamp(0.75rem, 3vw, 0.8rem);
    }

    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 30px;
        height: 30px;
    }

    .modal-close svg {
        width: 16px;
        height: 16px;
    }

    /* Site title in mobile */
    .site-title-animated {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        margin-bottom: clamp(0.5rem, 2vw, 1rem);
        animation-delay: 1.2s;
    }

    /* Smaller buttons, larger text in mobile */
    .btn {
        padding: clamp(0.6rem, 2.5vw, 1rem) clamp(1.2rem, 5vw, 2rem);
        font-size: clamp(0.75rem, 3vw, 0.9rem);
    }

    .btn-primary svg {
        width: clamp(16px, 4vw, 20px);
        height: clamp(16px, 4vw, 20px);
    }

    /* Language buttons smaller in mobile */
    .lang-btn {
        padding: clamp(0.3rem, 1.2vw, 0.5rem) clamp(0.5rem, 2vw, 0.8rem);
        font-size: clamp(0.7rem, 2.8vw, 0.85rem);
    }

    .lang-btn-nav {
        padding: clamp(0.4rem, 1.5vw, 0.6rem) clamp(0.6rem, 2.5vw, 1rem);
        font-size: clamp(0.75rem, 3vw, 0.9rem);
    }
}

/* =====================================================================
   КОМПАКТНАЯ СЕТКА ДЛЯ МАЛЕНЬКИХ ЭКРАНОВ
   Уменьшаем высоту ВЕРХНИХ рядов, чтобы влезли НИЖНИЕ
   ===================================================================== */

/* Маленькие и средние телефоны с низкими экранами */
@media (max-width: 768px) and (max-height: 740px) {
    .hero-background {
        padding: 0.8rem;
        height: 100vh !important;
        max-height: 100vh !important;
        overflow-x: hidden !important;
        overflow-y: hidden !important;
    }

    .hero-content {
        padding: 0.5rem 0;
    }

    .hero-label {
        margin: 0.5rem 0;
        padding: 0.4rem 0.9rem;
        font-size: clamp(0.55rem, 2.2vw, 0.7rem);
    }

    .hero-title {
        font-size: clamp(1.3rem, 7.5vw, 2.2rem);
        margin-bottom: 1rem;
    }

    .hero-description {
        font-size: clamp(0.85rem, 3.2vw, 1.1rem);
        margin-bottom: 1.5rem;
    }

    .site-title-animated {
        font-size: clamp(1.1rem, 4.8vw, 1.6rem);
        margin-bottom: 0.7rem;
    }

    .btn {
        padding: 0.9rem 1.8rem;
        font-size: clamp(0.75rem, 2.3vw, 0.85rem);
    }

    .hero-visual {
        padding-top: 1rem;
    }

    .hero-visual-content {
        padding: 0.3rem;
        height: calc(100vh - 80px);
    }

    /* КЛЮЧЕВОЕ: Пропорциональная высота рядов */
    /* Row 1-2: большие кнопки - уменьшаем */
    /* Row 3: контакт - средний */
    /* Row 4: языки - маленький */
    /* Row 5: footer - совсем маленький */
    .visual-grid {
        grid-template-rows: 0.75fr 0.75fr 0.65fr 0.55fr 0.45fr;
        gap: 0.3rem;
        padding: 0.3rem;
        height: 100%;
    }

    .visual-item {
        padding: 0.5rem;
    }

    .visual-item .visual-icon {
        width: 26px;
        height: 26px;
    }

    .visual-item .visual-label {
        font-size: 0.75rem;
    }

    .visual-item-medium {
        padding: 0.4rem;
    }

    .visual-item-small {
        padding: 0.3rem;
    }

    .visual-item-small .visual-icon {
        width: 18px;
        height: 18px;
    }

    .visual-item-small .visual-label {
        font-size: 0.65rem;
    }
}

/* iPhone SE и mini (375×667 и 375×812) */
@media (max-width: 390px) and (max-height: 680px) {
    .hero-visual {
        padding-top: 0.7rem;
    }

    .hero-visual-content {
        padding: 0.25rem;
        height: calc(100vh - 60px);
    }

    .visual-grid {
        grid-template-rows: 0.7fr 0.7fr 0.6fr 0.5fr 0.42fr;
        gap: 0.25rem;
        padding: 0.25rem;
    }

    .visual-item {
        padding: 0.4rem;
    }

    .visual-item .visual-icon {
        width: 22px;
        height: 22px;
    }

    .visual-item .visual-label {
        font-size: 0.7rem;
    }

    .visual-item-medium {
        padding: 0.3rem;
    }

    .visual-item-medium .visual-label {
        font-size: 0.75rem;
    }

    .visual-item-small {
        padding: 0.22rem;
    }

    .visual-item-small .visual-icon {
        width: 16px;
        height: 16px;
    }

    .visual-item-small .visual-label {
        font-size: 0.6rem;
    }
}

/* Маленькие телефоны — значительно крупнее текст, нижняя панель выше и кнопки больше */
@media (max-width: 480px) {
    .hero-content {
        padding: 0.5rem 1rem 0.4rem !important;
        max-height: calc(100dvh - 115px) !important;
        max-height: calc(100vh - 115px) !important;
    }

    .hero-title {
        font-size: clamp(2.25rem, 8vw, 2.75rem) !important;
        margin-bottom: 0.5rem !important;
    }

    .hero-description {
        font-size: clamp(1.4rem, 4vw, 1.6rem) !important;
        margin-bottom: 0.55rem !important;
    }

    .hero-actions {
        margin-top: 0.75rem !important;
    }

    .hero-actions .btn {
        min-height: 52px;
        padding: 0.8rem 1.25rem !important;
        font-size: clamp(1.15rem, 3.2vw, 1.25rem) !important;
    }

    .bottom-bar {
        padding: clamp(1.2rem, 3.2vh, 1.7rem) clamp(0.65rem, 2.5vw, 1rem) !important;
        padding-bottom: max(clamp(1.2rem, 3.2vh, 1.7rem), env(safe-area-inset-bottom, 0)) !important;
        min-height: 72px !important;
    }

    .bottom-bar .visual-item {
        padding: 0.7rem 0.75rem !important;
        min-height: 58px !important;
    }

    .bottom-bar .visual-icon {
        width: 24px !important;
        height: 24px !important;
    }

    .bottom-bar .visual-label {
        font-size: clamp(1.1rem, 3vw, 1.22rem) !important;
    }
}

@media (max-width: 360px) and (max-height: 670px) {
    .hero-background {
        padding: 0.4rem;
        height: 100vh !important;
        max-height: 100vh !important;
        overflow-x: hidden !important;
        overflow-y: hidden !important;
    }

    .hero-content {
        padding: 0.2rem 0;
    }

    .hero-label {
        margin: 0.3rem 0;
        padding: 0.3rem 0.6rem;
        font-size: clamp(0.45rem, 2vw, 0.55rem);
    }

    .hero-title {
        font-size: clamp(1rem, 6vw, 1.6rem);
        margin-bottom: 0.6rem;
    }

    .hero-description {
        font-size: clamp(0.75rem, 2.5vw, 0.9rem);
        margin-bottom: 1rem;
    }

    .site-title-animated {
        font-size: clamp(0.8rem, 3.5vw, 1.2rem);
        margin-bottom: 0.5rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: clamp(0.65rem, 1.8vw, 0.75rem);
    }

    .hero-visual-content {
        padding: 0.2rem;
        height: calc(100vh - 55px);
    }

    .visual-grid {
        grid-template-rows: 0.65fr 0.65fr 0.55fr 0.48fr 0.4fr;
        gap: 0.2rem;
        padding: 0.2rem;
    }

    .visual-item {
        padding: 0.35rem;
    }

    .visual-item .visual-icon {
        width: 20px;
        height: 20px;
    }

    .visual-item .visual-label {
        font-size: 0.65rem;
    }

    .visual-item-small {
        padding: 0.2rem;
    }

    .visual-item-small .visual-icon {
        width: 14px;
        height: 14px;
    }

    .visual-item-small .visual-label {
        font-size: 0.55rem;
    }
}




/* ===== УНИВЕРСАЛЬНЫЙ ФИКС для ВСЕХ мобильных ===== */
@media (max-width: 768px) {
    .hero-visual .visual-grid {
        grid-template-rows: 0.6fr 0.6fr 0.55fr 0.5fr 0.6fr;
    }

    .hero-visual .visual-item {
        aspect-ratio: unset;
    }
}

@media (max-width: 400px) {
    .project-label {
        font-size: 0.6rem;
        top: 10px;
        left: 10px;
    }

    .top-controls {
        top: 10px;
        right: 10px;
        gap: 0.4rem;
    }

    .theme-toggle-btn,
    .cookies-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
    }

    .hero-content {
        padding: 0.4rem 0.9rem 0.3rem !important;
        max-height: calc(100dvh - 105px) !important;
        max-height: calc(100vh - 105px) !important;
    }

    .hero-title {
        font-size: clamp(2rem, 7.5vw, 2.4rem) !important;
        margin-bottom: 0.45rem !important;
    }

    .hero-description {
        font-size: clamp(1.3rem, 3.8vw, 1.5rem) !important;
        margin-bottom: 0.5rem !important;
    }

    .hero-actions {
        margin-top: 0.6rem !important;
    }

    .hero-actions .btn {
        min-height: 50px;
        padding: 0.75rem 1.1rem !important;
        font-size: clamp(1.1rem, 3vw, 1.2rem) !important;
    }

    .bottom-bar {
        padding: clamp(1.1rem, 3vh, 1.55rem) clamp(0.5rem, 2vw, 0.85rem) !important;
        padding-bottom: max(clamp(1.1rem, 3vh, 1.55rem), env(safe-area-inset-bottom, 0)) !important;
        min-height: 68px !important;
    }

    .bottom-bar .visual-item {
        padding: 0.65rem 0.6rem !important;
        min-height: 54px !important;
    }

    .bottom-bar .visual-icon {
        width: 22px !important;
        height: 22px !important;
    }

    .bottom-bar .visual-label {
        font-size: clamp(1.05rem, 2.8vw, 1.15rem) !important;
    }
}


@media (max-width: 768px) {
    .hero-visual {
        max-height: calc(100vh - 100px);
        height: auto;
        padding-top: 0.5rem;
    }

    .hero-visual-content {
        max-height: calc(100vh - 120px);
        height: auto;
        padding: 0.5rem;
    }
}


/* =================================================================
   СИСТЕМА УПРАВЛЕНИЯ РАЗМЕРАМИ КНОПОК
   CSS переменные для гибкой настройки каждого ряда и кнопки
   ================================================================= */

/* МОБИЛЬНЫЕ переменные - уменьшенные значения */
@media (max-width: 768px) {
    :root {
        --row1-height: 1fr;
        --row2-height: 0.9fr;
        --row3-height: 0.9fr;
        --row4-height: 0.7fr;
        --row5-height: 0.7fr;

        --btn-padding: 0.35rem;
        --btn-font-size: 0.65rem;
        --btn-icon-size: 20px;

        --row5-padding: 0.3rem 0.5rem;  /* Прямоугольные */
        --row5-font-size: 0.5rem;
        --row5-icon-size: 14px;

        --grid-gap: 0.25rem;
        --grid-padding: 0.25rem;
    }
}


/* =================================================================
   ИНДИВИДУАЛЬНЫЕ СТИЛИ ДЛЯ КАЖДОГО РЯДА
   Используют CSS переменные, можно менять отдельно каждый ряд
   ================================================================= */

/* РЯД 1 - Vize, Vzdělávání */
.visual-item[style*="grid-row: 1"] {
    padding: var(--row1-padding);
    font-size: var(--row1-font-size);
}

.visual-item[style*="grid-row: 1"] .visual-icon {
    width: var(--row1-icon-size);
    height: var(--row1-icon-size);
}

/* РЯД 2 - Contact */
.visual-item[style*="grid-row: 2"] {
    padding: var(--row2-padding);
    font-size: var(--row2-font-size);
}

.visual-item[style*="grid-row: 2"] .visual-icon {
    width: var(--row2-icon-size);
    height: var(--row2-icon-size);
}

/* РЯД 3 - Služby, Výhoda */
.visual-item[style*="grid-row: 3"] {
    padding: var(--row3-padding);
    font-size: var(--row3-font-size);
}

.visual-item[style*="grid-row: 3"] .visual-icon {
    width: var(--row3-icon-size);
    height: var(--row3-icon-size);
}

/* РЯД 4 - CZ, UA, EN */
.visual-item[style*="grid-row: 4"] {
    padding: var(--row4-padding);
    font-size: var(--row4-font-size);
}

.visual-item[style*="grid-row: 4"] .visual-icon {
    width: var(--row4-icon-size);
    height: var(--row4-icon-size);
}

/* РЯД 5 - Privacy, Terms, Cookies (МАЛЕНЬКИЕ) */
.visual-item[style*="grid-row: 5"] {
    padding: var(--row5-padding);
    font-size: var(--row5-font-size);
    aspect-ratio: unset;     /* Прямоугольные */
    width: 100%;             /* Растянуты по ширине */
}

.visual-item[style*="grid-row: 5"] .visual-icon {
    width: var(--row5-icon-size);
    height: var(--row5-icon-size);
}


/* =================================================================
   ДЕСКТОПНАЯ ВЕРСИЯ - 5-Й РЯД ШИРОКИЙ И НИЗКИЙ
   Кнопки Privacy/Terms/Cookies растянуты на всю ширину
   ================================================================= */
@media (min-width: 769px) {
    /* 5-й ряд ниже остальных */
    .visual-grid {
        grid-template-rows: 1fr 1fr 1fr 0.8fr 0.5fr;  /* Ряд 5 низкий */
    }

    /* Кнопки 5-го ряда: низкие и широкие */
    .visual-item[style*="grid-row: 5"] {
        aspect-ratio: unset;     /* НЕ квадратные */
        padding: 0.4rem 1rem;    /* Низкие (0.4) но широкий padding */
        font-size: 0.65rem;      /* Текст меньше */
    }

    .visual-item[style*="grid-row: 5"] .visual-icon {
        width: 18px;             /* Иконки меньше */
        height: 18px;
    }
}


/* =================================================================
   МОБИЛЬНАЯ ВЕРСИЯ - 5-Й РЯД ПО 1 КОЛОНКЕ
   Переопределяем grid-column для мобильных
   ================================================================= */
@media (max-width: 768px) {
    .visual-item[data-modal="privacy"] {
        grid-column: 1;  /* Первая колонка */
    }

    .visual-item[data-modal="terms"] {
        grid-column: 2;  /* Вторая колонка */
    }

    .visual-item[data-modal="cookies"] {
        grid-column: 3;  /* Третья колонка */
    }
}
