:root { 
    --keyrace-color: #00ffcc;
    --button-color: linear-gradient(45deg, #00ffb7c0, #6bff6bc0);
}

.page-content {
    overflow: hidden;
}

li {
    list-style-type: none;
}

section {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

section h1 {
    top: 20px;
    position: absolute;
}

/* Hero Section (Главная секция) */
.hero {
    position: relative;
    text-align: center;
    color: white;
    scroll-snap-align: start;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img/poster.jpg') center/cover no-repeat;
    z-index: -2;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.hero-video.loaded {
    opacity: 1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 0 20px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 20px;
    position: relative;
}

.hero h2 {
    display: none;
}

.hero p {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Слайдер для последних новостей */
.slider-section {
    background: #000000;
    scroll-snap-align: start;
    overflow: hidden;
}

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

.card {
    width: calc(100vh - 150px);
    height: calc(100vh - 150px);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: absolute;
    transition: transform 1.2s ease-in-out, opacity 1.2s ease-in-out;
    cursor: pointer;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5));
    color: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

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

.card p {
    font-size: 0.9em;
    color: #ddd;
}

/* Позиции карточек */
.card[data-index="0"] { transform: translateX(-150%) scale(0.8); opacity: 0; }
.card[data-index="1"] { transform: translateX(-50%) scale(0.8); opacity: 0.7; }
.card[data-index="2"] { transform: translateX(0) scale(1); opacity: 1; }
.card[data-index="3"] { transform: translateX(50%) scale(0.8); opacity: 0.7; }
.card[data-index="4"] { transform: translateX(150%) scale(0.8); opacity: 0; }

/* Анимация перехода */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

/* Стили для главной карточки */
.main-card {
    transform: scale(1.2);
    z-index: 10;
}

/* Стили для боковых карточек */
.side-card {
    transform: scale(0.8);
    opacity: 0.7;
}

/* Стили для карточек слева и справа */
.left-card {
    transform: translateX(-50%) scale(0.8);
}

.right-card {
    transform: translateX(50%) scale(0.8);
}

/* Блок с кейсами */
#cases {
    background: linear-gradient(0deg, #121212, #000000);
    padding: 60px 20px 20px;
    overflow: hidden;
}

.cases-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.case-card {
    background: #000000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(114, 113, 113, 0.1);
    transition: transform 0.3s ease-in-out;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 300px;
    opacity: 0; /* Начальное состояние */
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.case-card[data-direction="top-left"] {
    transform: translate(-100%, -100%);
}

.case-card[data-direction="bottom-right"] {
    transform: translate(100%, 100%);
}

.case-card[data-direction="top-right"] {
    transform: translate(100%, -100%);
}

.case-card[data-direction="bottom-left"] {
    transform: translate(-100%, 100%);
}

.case-card.visible {
    opacity: 1;
    transform: translate(0, 0);
}

.case-card:hover {
    transform: scale(1.05);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.case-card img {
    width: 100%;
    height: 60%;
    object-fit: cover;
}

.case-card-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.case-card h3 {
    font-size: clamp(1em, 3vw, 1.2em);
    margin: 0;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #fff; /* Добавлен цвет для лучшей видимости */
}

/* Блок с событиями */
#events {
    background: #000000;
    padding: 40px 20px;
    flex-direction: column;
}

.events-container {
    height: 100%;
}

@media (max-width: 768px) {
    .events-container {
        height: 90%;
    }
}

.event {
    display: flex;
    align-items: center;
    width: 95%;
    gap: 20px;
    margin-bottom: 40px;
    background: linear-gradient(90deg, #000000, #353333);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
    position: relative;
    opacity: 0; /* Начальное состояние для анимации */
    transition: opacity 1.2s ease-out, transform 1.2s ease-out; /* Добавлено для плавного исчезновения */
}

.event[data-direction="left"] {
    transform: translateX(-100%); /* Слева */
}

.event[data-direction="right"] {
    transform: translateX(100%); /* Справа */
}

.event.visible {
    opacity: 1;
    transform: translateX(0); /* Конечное положение */
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.event:hover {
    transform: translateY(-5px);
}

.event-image {
    width: 200px;
    flex: 1;
    max-width: 40%;
    position: relative; /* Для заголовка поверх изображения */
}

.event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-title {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    margin: 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7); /* Темная плашка под заголовком */
    color: white;
    font-size: clamp(1em, 3vw, 1.2em);
    word-wrap: break-word;
    display: none; /* Скрыто по умолчанию, видно только на мобильных */
}

.event-content {
    flex: 2;
    padding: 20px;
}

.event-content h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
}

.event-content p {
    font-size: 1em;
    color: #666;
    line-height: 1.6;
}

/* Секция "О нас" */
.about-section {
    padding: 60px 20px;
    background: linear-gradient(135deg, #000000, #121212);
    color: #E0E0E0;
    text-align: center;
    height: calc(100vh - 50px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
}

.about-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 50%;
}

.about-item.reverse {
    flex-direction: row-reverse;
}

.about-text {
    flex: 1;
    text-align: justify;
    padding: 20px;
    max-height: 80vh; /* Ограничение высоты с прокруткой */
    overflow-y: auto; /* Прокрутка, если контент длинный */
    opacity: 0; /* Начальное состояние */
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.about-text h2 {
    font-size: 1.4em;
    margin-bottom: 10px;
    color: var(--keyrace-color);
}

.about-text p, .about-text ul, .about-text ol {
    font-size: 1em;
    line-height: 1.2;
    margin-bottom: 10px;
}

.about-text ul {
    padding-inline-start: 10px;
}

.about-text[data-direction="left"] {
    transform: translateX(-100%);
}

.about-text[data-direction="right"] {
    transform: translateX(100%);
}

.about-text.visible {
    opacity: 1;
    transform: translateX(0);
}

.about-image {
    flex: 1;
    max-width: 50%;
    height: 100%;
    opacity: 0; /* Начальное состояние */
    transition: opacity 1.2s ease-out; /* Только прозрачность */
}

.about-image.visible {
    opacity: 1;
}

.about-image img {
    width: auto;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: block;
}

/* Секция "Команда" */
#team {
    padding: 60px 0;
    background: linear-gradient(135deg, #000000, #121212);
    color: #E0E0E0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#team h1 {
    z-index: 1;
}

.team-images {
    width: 100%;
    height: 100%;
    justify-content: center;
    display: flex;  
    align-items: flex-end;
    background: url('../img/team_back.jpg') center/cover no-repeat;
    gap: 20px; /* Добавлен отступ между изображениями */
    flex-wrap: wrap; /* Для адаптивности */
    position: relative; /* Для позиционирования на мобильных */
}

.team-member {
    position: relative; /* Для позиционирования описания */
    height: 70%;
}

.team-member p {
    text-align: left;
}

.team-images img {
    width: auto;
    height: 100%;
    transition: transform 0.6s ease-out;
}

.team-images img:hover {
    transform: scale(1.2);
}

.team-description {
    position: absolute;
    top: -200px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px;
    font-size: 1em;
    opacity: 0;
    transform: translateY(-100%); /* Скрыто выше изображения */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    pointer-events: none; /* Чтобы текст не мешал наведению */
    border: 1px solid #ff00b7;
    box-shadow: 0 0 20px rgba(255, 0, 183, 0.5);
    border-radius: 10px;
}

.team-member:hover .team-description {
    opacity: 1;
    transform: translateY(0); /* Появляется сверху */
}

/* Секция "СМИ" */
#media {
    padding: 0;
    background: linear-gradient(135deg, #000000, #121212);
    color: #333;
    perspective: 1000px; /* 3D-перспектива для анимации поворота */
    z-index: 1;
}

.media-title {
    position: fixed;
    left: 20%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.media-title h2 {
    color: white;
    font-size: 3em;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transform-origin: left center;
    white-space: nowrap;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.newspaper {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.newspaper.zoomed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    overflow: auto;
    cursor: zoom-out;
    /* Стилизация скроллбара для Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 204, 0.5) rgba(0, 0, 0, 0.2);
}

/* Стилизация скроллбара для Chrome/Safari/Edge */
.newspaper.zoomed::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.newspaper.zoomed::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.newspaper.zoomed::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 204, 0.5);
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.newspaper.zoomed::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 204, 0.7);
}

.newspaper.zoomed::-webkit-scrollbar-corner {
    background: rgba(0, 0, 0, 0.2);
}

.newspaper.zoomed .page:not(.flipped) {
    animation: none;
    transform: scale(2);
    transition: transform 0.3s ease;
}

.newspaper:not(.zoomed) {
    cursor: zoom-in;
}

.page {
    position: absolute;
    left: 50%;
    margin-left: auto;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s ease-in-out;
    transform-origin: left center;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.2);
}

.page-content {
    width: 100%;
    height: 100%;
    padding: 40px 0;
    box-sizing: border-box;
    background: inherit;
}

.page img {
    max-height: 95vh; /* Ограничиваем высоту изображений */
    object-fit: contain; /* Сохраняем пропорции */
}

/* Анимация для обратного перелистывания */
@keyframes pageInBack {
    from { transform: rotateY(-180deg); }
    to { transform: translateX(0); }
}

@keyframes pageOutBack {
    0% { transform: translateX(0); }
    50% { transform: rotateY(-180deg); }
    100% { transform: rotateY(-180deg); z-index: 0; }
}

/* Применяем анимацию к страницам */
.page.flipped {
    animation: pageOutBack 1s ease-in-out forwards;
}

.white-page {
    position: absolute; /* Позиционирование относительно родителя */
    top: 40px; /* Прикрепляем к верхней части */
    left: 0; /* Прикрепляем к левой части */
    width: 100%; /* Ширина 100% от родителя */
    height: 100%; /* Высота 100% от родителя */
    background-color: white; /* Белый фон */
    transition: opacity 0.5s; /* Плавный переход для анимации */
    opacity: 0; /* Начальное состояние */
    z-index: 2; /* Устанавливаем z-index выше изображения */
}

.page.flipped .page-content .white-page {
    transition: opacity 0.5s;
    opacity: 1;
}

.page.flipped .page-content img {
    transition: opacity 0.5s;
    opacity: 0;
}

.page:not(.flipped) {
    animation: pageInBack 1s ease-in-out forwards;
}

/* Кнопки перелистывания */
.newspaper-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.newspaper.zoomed .newspaper-controls {
    display: none;
}

.newspaper-controls button {
    width: 20%;
    height: 100%;
    background: rgba(0, 0, 0, 0.0);
    color: white;
    border: none;
    font-size: 2em;
    cursor: pointer;
    transition: background 0.3s ease;
    pointer-events: auto; /* Включаем кликабельность только для кнопок */
}

#prev-page {
    border-radius: 0 5px 5px 0;
}

#next-page {
    border-radius: 5px 0 0 5px;
}

#prev-page:hover {
    background: linear-gradient(270deg, rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.2));
}

#next-page:hover {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.2));
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
    .media-title {
        display: none;
    }
}

/* Секция "Волонтерство" */
#volunteering {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), 
                url('../img/volunteer_back.png') center/cover;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px 20px;
    position: relative;    
    scroll-snap-align: start;
}

.volunteers-grid {
    position: relative;
    width: 100%;
    height: 50vh;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
}

.volunteer-card {
    width: 60px;
    height: 60px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 1;
    margin: auto;
}

.volunteer-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(80, 80, 80, 0.3);
}

/* Десктопная версия */
@media (min-width: 769px) {
    .volunteer-card {
        transform-origin: center;
    }
    
    .volunteer-card:hover {
        z-index: 10;
    }
    
    /* Сохраняем начальную трансформацию при наведении и добавляем scale */
    .volunteer-card:hover {
        transform: translate(var(--offset-x, 0), var(--offset-y, 0)) scale(3) !important;
    }

    .volunteer-card:hover .volunteer-name {
        opacity: 1;
    }
}

.volunteer-name {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.7em;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .volunteers-grid {
        display: block;
        height: 50vh;
    }

    .volunteer-card {
        position: absolute;
        width: 50px;
        height: 50px;
    }

    .volunteer-card.active {
        transform: scale(3);
        z-index: 100;
    }

    .volunteer-card.active .volunteer-name {
        opacity: 1;
    }

    .volunteer-name {
        font-size: 0.6em;
    }
}

.volunteer-description {
    max-width: 800px;
    text-align: center;
    color: white;
    font-size: 1.6em;
    line-height: 1.2em;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.volunteer-description p {
    margin: 0;
}

.volunteer-button {
    background: var(--button-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 20px;
}

.volunteer-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
    color: #aaa;
}

iframe {
    width: 100%;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    border: 1px solid #00ffcc;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.modal h2 {
    color: white;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: white;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #00ffcc;
    border-radius: 5px;
    background: #2a2a2a;
    color: white;
}

.form-group input:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
}

.modal button[type="submit"] {
    width: 100%;
    padding: 10px;
    background: var(--button-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.modal button[type="submit"]:hover {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    section {
        height: 100vh;
        padding: 40px 10px;
    }

    section h1 {
        display: none;
    }

    .hero {
        padding: 40px 15px;
    }

    .hero h2 {
        display: block;
    }

    .slider-section, #cases, #events {
        padding-top: 50px;
    }

    .card {
        width: 90%;
        min-height: 250px;
    }

    .cases-container {
        grid-template-columns: repeat(1, 1fr); /* Одна колонка для мобильных */
        max-width: 90%; /* Уменьшена ширина для мобильных */
    }

    .case-card {
        height: 250px; /* Уменьшена высота для мобильных */
        transform: translateY(50px); /* Упрощаем анимацию для мобильных */
    }

    .case-card.visible {
        transform: translateY(0);
    }

    .event {
        flex-direction: column;
        margin-bottom: 20px;
    }

    .event-image {
        width: 100%;
        max-width: 100%;
    }

    .event-title {
        display: block; /* Показываем заголовок поверх картинки */
    }

    .event-content {
        display: none; /* Скрываем весь контент (заголовок и описание) */
    }

    .about-section {
        padding: auto 10px;
        height: 100vh; /* Убираем фиксированную высоту */
        justify-content: flex-start;
    }

    .about-item, .about-item.reverse {
        flex-direction: column;
        margin-bottom: 0; /* Убираем отступ между элементами */
        position: relative;
        text-align: left;
        height: auto;
        gap: 0;
    }

    .about-item h2{
        text-align: center;
        font-size: medium;
    }

    .about-item ul, .about-item ol, .about-item p {
        margin-block-start: 0;
        margin-block-end: 0;
        padding-inline-start: 10px;
    }

    .about-item p {
        padding-inline-start: 0;
        text-indent: 1.5em;
    }

    .about-item img {
        width: 80%;
        height: 100%;
        object-fit: cover; /* Растягиваем изображение как фон */
        border-radius: 0; /* Убираем скругление углов */
        box-shadow: none; /* Убираем тень */
        opacity: 0.8; /* Легкое затемнение */
        margin-bottom: 10px;
    }

    /* Специфические фоны для каждого блока */
    #about1 .about-item:nth-child(1) .about-image {
        background: url('../img/about_cybersecurity.png') center/cover no-repeat;
    }
        
    #about1 .about-item:nth-child(2) .about-image {
        background: url('../img/about_cyberspace.jpg') center/cover no-repeat;
    }

    #about2 .about-item:nth-child(1) .about-image {
        background: url('../img/about_audience.jpg') center/cover no-repeat;
    }

    #about2 .about-item:nth-child(2) .about-image {
        background: url('../img/about_event.jpg') center/cover no-repeat;
    }

    .team-images {
        gap: 0;
        justify-content: center;
    }

    .team-member {
        width: 50%;
        position: relative;
        bottom: 50px;
        height: auto;
    }

    /* Позиционируем каждую фотографию с наложением */
    .team-member:nth-child(1) {
        z-index: 2;
    }

    .team-member:nth-child(1).active {
        transform: scale(1.8) translate(27%, -23%);
        transition: transform 500ms ease-in-out;
        z-index: 1;
    }

    .team-member:nth-child(2) {
        z-index: 3;
        margin-left: -27%;
    }

    .team-member:nth-child(2).active {
        transform: scale(1.8) translate(0, -23%);
        transition: transform 500ms ease-in-out;
        z-index: 1;
    }

    .team-member:nth-child(3) {
        z-index: 2;
        margin-left: -27%;
    }

    .team-member:nth-child(3).active {
        transform: scale(1.8) translate(-27%, -23%);
        transition: transform 500ms ease-in-out;
        z-index: 1;
    }

    .team-images img {
        width: auto;
        max-height: 250px;
        object-fit: cover;
    }

    .team-description {
        font-size: 0.5em;
        top: -120px;
        padding: 6px;
    }

    /* Убираем hover эффекты на мобильных */
    .team-images img:hover {
        transform: none;
    }

    .team-member:hover .team-description {
        opacity: 0;
        transform: translateY(-100%);
    }

    /* Показываем описание только для активного элемента */
    .team-member.active .team-description {
        opacity: 1;
        transform: translateY(0);
    }

    .page {
        padding-top: 20px;
        left: 0;
        width: 100%;
    }

    .page img {
        width: 100%;
    }

    #prev-page {
        background: linear-gradient(270deg, rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.3));
    }
    
    #next-page {
        background: linear-gradient(90deg, rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.3));
    }

    .newspaper.zoomed .page:not(.flipped) {
        transform: scale(2);
    }

    .volunteers-grid {
        display: block;
        height: 50vh;
    }

    .volunteer-card {
        position: absolute;
        width: 50px;
        height: 50px;
    }

    .volunteer-name {
        font-size: 0.6em;
    }

    .volunteer-description {
        font-size: 1em;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

.animate {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.animate.visible {
    opacity: 1;
    transform: translateY(50px);
}

/* Секция "Партнеры" */
#partners {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), 
                url('../img/partners_back.jpg') center/cover;
    padding: 80px 5px 40px;
    min-height: 100vh;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    position: relative;
    top: -50px;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    height: calc(100vh - 200px);
}

.partner-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.partner-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 255, 204, 0.3);
    border-color: var(--keyrace-color);
}

.partner-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.partner-card:hover img {
    transform: scale(1.1);
}

.partner-name {
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 0.9em;
    padding: 5px;
    opacity: 1;
    background: transparent;
    transform: none;
    white-space: normal;
    line-height: 1.2;
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
    .partners-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 10px;
        top: -100px;
        height: calc(100vh - 200px);
        padding: 10px;
    }

    .partner-card {
        padding: 10px;
    }

    .partner-card img {
        width: 60px;
        height: 60px;
    }

    .partner-name {
        font-size: 0.6em;
    }
}

/* Анимация появления карточек */
.partner-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Добавляем задержку для каждой карточки */
.partner-card:nth-child(1) { animation-delay: 0.1s; }
.partner-card:nth-child(2) { animation-delay: 0.2s; }
.partner-card:nth-child(3) { animation-delay: 0.3s; }
.partner-card:nth-child(4) { animation-delay: 0.4s; }
.partner-card:nth-child(5) { animation-delay: 0.5s; }
.partner-card:nth-child(6) { animation-delay: 0.6s; }
.partner-card:nth-child(7) { animation-delay: 0.7s; }
.partner-card:nth-child(8) { animation-delay: 0.8s; }
.partner-card:nth-child(9) { animation-delay: 0.9s; }
.partner-card:nth-child(10) { animation-delay: 1s; }
.partner-card:nth-child(11) { animation-delay: 1.1s; }
.partner-card:nth-child(12) { animation-delay: 1.2s; }
.partner-card:nth-child(13) { animation-delay: 1.3s; }
.partner-card:nth-child(14) { animation-delay: 1.4s; }

/* Секция "Гонки на клавиатуре" */
#keyrace {
    background: linear-gradient(135deg, #000000, #121212);
    color: #E0E0E0;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.keyrace-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.keyrace-content {
    display: flex;
    gap: 40px;
    align-items: center;
    width: 100%;
}

.keyrace-description {
    flex: 1;
    text-align: left;
    padding: 20px;
}

.keyrace-description h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: var(--keyrace-color);
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.keyrace-description p {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #E0E0E0;
}

.keyrace-stats {
    display: flex;
    gap: 30px;
    margin-top: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--keyrace-color);
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}

.stat-label {
    font-size: 0.9em;
    color: #E0E0E0;
    margin-top: 5px;
}

.keyrace-game {
    flex: 2;
    height: 600px;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.2);
    border: 1px solid rgba(0, 255, 204, 0.3);
    margin: auto;
    position: relative; /* Для позиционирования кнопки */
    overflow: hidden; /* Скрываем все, что выходит за пределы блока */
}

.keyrace-game video {
    position: absolute; /* Абсолютное позиционирование видео */
    top: 0; /* Прикрепляем к верхней части */
    left: 0; /* Прикрепляем к левой части */
    width: 100%; /* Ширина видео */
    height: 100%; /* Высота видео */
    object-fit: cover; /* Обеспечиваем, чтобы видео заполняло весь блок */
    z-index: 1; /* Устанавливаем z-index ниже кнопки */
}

.play-button-container {
    position: absolute; /* Относительное позиционирование для кнопки */
    z-index: 2; /* Устанавливаем z-index выше видео */
    text-align: center; /* Центрирование кнопки */
    width: 25%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.play-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #E0E0E0;
    background: var(--button-color);
    padding: 30px 60px;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.3);
}

.play-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 255, 204, 0.5);
    color: #aaa;
}

.play-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.play-text {
    font-size: 1.5em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .keyrace-content {
        flex-direction: column;
    }

    .keyrace-description {
        text-align: center;
        width: 90%;
    }

    .keyrace-stats {
        justify-content: center;
    }

    .keyrace-game {
        width: 100%;
        height: 300px;
        background: none;
        box-shadow: none;
        border: none;
    }

    .keyrace-description h2 {
        font-size: 1.5em;
    }

    .keyrace-description p {
        font-size: 1em;
    }

    .stat-item {
        padding: 10px;
    }

    .stat-number {
        font-size: 1.5em;
    }

    .play-button {
        padding: 20px 40px;
    }

    .play-button-container {
        position: relative;
        top: 0;
        transform: translate(-50%, 0);
        width: 50%;
    }

    .play-icon {
        font-size: 2.5em;
    }

    .play-text {
        font-size: 1.2em;
    }
}

.lazy {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.lazy.loaded {
    opacity: 1;
}

/* Плейсхолдеры для изображений */
.card img.lazy,
.case-card img.lazy,
.event-image img.lazy {
    background: linear-gradient(110deg, #1a1a1a 8%, #222 18%, #1a1a1a 33%);
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

/* Оптимизация загрузки секций */
section[data-section-type] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

section[data-section-type][data-loaded="true"] {
    opacity: 1;
    transform: translateY(50px);
}

/* Секция обратной связи */
.feedback-section {
    background: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.8)), 
                url('../img/feedback_back.jpg') center/cover;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.feedback-container {
    gap: 40px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.feedback-form {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 204, 0.3);
}

.feedback-form h2 {
    color: var(--keyrace-color);
    margin-bottom: 10px;
    text-align: center;
}

.feedback-form > p {
    color: #E0E0E0;
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: white;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 0 12px 12px;
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1em;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--keyrace-color);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
}

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

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
}

.submit-button {
    width: 100%;
    padding: 15px;
    background: var(--button-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 204, 0.4);
}

.feedback-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feedback-info h3 {
    color: var(--keyrace-color);
    margin-bottom: 20px;
}

.feedback-info ul {
    list-style: none;
    padding: 0;
}

.feedback-info li {
    color: #E0E0E0;
    margin-bottom: 15px;
    padding-left: 0;
    line-height: 1.4;
}

.privacy-notice {
    margin-top: 30px;
    padding: 20px;
    background: rgba(0, 255, 204, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 204, 0.2);
}

.privacy-notice h4 {
    color: var(--keyrace-color);
    margin-bottom: 10px;
}

.privacy-notice p {
    color: #E0E0E0;
    font-size: 0.9em;
    line-height: 1.4;
}

.success-message {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid rgba(0, 255, 204, 0.3);
}

.success-message h2 {
    color: var(--keyrace-color);
    margin-bottom: 20px;
}

.success-message p {
    color: #E0E0E0;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.success-message button {
    background: var(--button-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.success-message button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 255, 204, 0.4);
}

/* Мобильная версия */
@media (max-width: 768px) {
    .feedback-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feedback-form {
        padding: 20px;
    }
    
    .feedback-info {
        padding: 20px;
    }
    
    .success-message {
        padding: 30px 20px;
    }
}