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

body {
    background-color: #0a0c10f2;
    font-family: 'Inter', sans-serif;
    color: #E8EDF2;
}

a {
  text-decoration: none; /* Убираем underline */
}

img {
  max-width: 100%; /* Автоматическое масштабирование */
  height: auto; /* Исправление автоматического роста высоты */
  vertical-align: middle; /* Выравнивание */
}

/* Дополнительные стили для кликаемого элемента */
a:hover {
  cursor: pointer; /* Курсор при наведении */
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 200px));
    gap: 10px;
}

/* Контейнер на всю ширину */
.container {
    width: 100%;
    margin: 0.4rem auto;
    padding: 0 2%;
}

@media (min-width: 1600px) {
    .container {
        padding: 0 10%;
    }
}

/* Титул */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0 40px;
    overflow: hidden;
    
}

/* Георгиевская лента справа */
.hero::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('images/george-ribbon.png') no-repeat right center;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
}

/* ===== АНИМАЦИЯ ДЛЯ ТИТУЛЬНОГО ЭКРАНА ===== */
@keyframes fadeInBlur {
    0% {
        opacity: 0;
        filter: blur(12px);
        transform: scale(0.92);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

img {
    position: relative;
    opacity: 0;
    animation: fadeInBlur 0.6s ease-out forwards;
    z-index: 0;
}

.hero::before {
    position: absolute;
    opacity: 0;
    animation: fadeInBlur 0.8s ease-out forwards;
    z-index: 0;
}

.hero .subhead {
    position: relative;
    z-index: 1;
    animation: fadeInBlur 1s ease-out forwards;
    opacity: 0;
}

.hero-subtitle {
    position: relative;
    z-index: 1;
    animation: fadeInBlur 0.8s ease-out forwards;
    opacity: 0;
}

.hero h1 {
    position: relative;
    z-index: 1;
    animation: fadeInBlur 1.2s ease-out 0.2s forwards;
    opacity: 0;
}

.hero-description {
    position: relative;
    z-index: 1;
    animation: fadeInBlur 1.2s ease-out 0.4s forwards;
    opacity: 0;
}

.hero .years {
    position: relative;
    z-index: 1;
    animation: fadeInBlur 1s ease-out 0.6s forwards;
    opacity: 0;
}

.author-section {
    animation: fadeInBlur 1s ease-out 0.6s forwards;
    opacity: 0;
}

.subhead {
    font-size: 0.95rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 500;
    color: #B89B6B;
    margin-bottom: 24px;
}

.subhead2 {
    font-size: 1.25rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 50;
    color: #B89B6B;
    margin: 30px;
}

.author-text .subhead2 {
    margin-left: 0;
}

.heroes-section > .subhead2,
.excursion-section > .subhead2,
.about-section > .subhead2 {
    margin-left: 1.25rem;
}

.hero-subtitle {
    font-size: 0.99rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    font-weight: 500;
    color: #d1bb98;
    margin-bottom: 12px;
}

.hero h1 {
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(135deg, #FFFFFF 30%, #c29c5e 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 24px;
}

.hero-description {
    font-size: 1.25rem;
    font-weight: 400;
    color: #E0E4F0;
    max-width: 800px;
    margin-bottom: 22px;
    line-height: 1.5;
}

.years {
    font-size: 1rem;
    font-weight: 500;
    color: #A0A8BB;
    border-left: 3px solid #B89B6B;
    padding-left: 20px;
    margin-top: 8px;
}

/* ===== РАЗДЕЛ "ОТ АВТОРА" ===== */
.author-section {
    padding: 30px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.author-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
    justify-content: space-between;
}

.author-image {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.author-image img {
    max-width: 100%;
    width: 280px;
    height: 280px;
    transition: transform 0.3s ease;
}


.author-text {
    flex: 3;
    margin: 1.25rem;
}

.author-text p {
    font-size: 1rem;
    line-height: 1.5;
    color: #C5CCE0;
    margin-bottom: 16px;
}

.author-sign {
    margin-top: 20px;
    font-style: italic;
    border-left: 3px solid #B89B6B;
    padding-left: 20px;
}

@media (max-width: 768px) {
    .author-container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .author-text {
        text-align: center;
    }
    .author-sign {
        border-left: none;
        padding-left: 0;
    }
    .author-image img {
        width: 180px;
        height: 180px;
    }
}

/* Сетка героев */
.heroes-section {
    padding: 30px 2%;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.heroes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    margin-top: 10px;
}

.heroes-list {
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.heroes-list--expanded {
    max-height: none;
}

.heroes-toggle {
    display: block;
    margin: 25px auto 25px;
    padding: 14px 32px;
    background: transparent;
    border: 2px solid #B89B6B;
    color: #B89B6B;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.heroes-toggle:hover {
    background: #B89B6B;
    color: #0A0C10;
    
}

.heroes-toggle[hidden] {
    display: none;
}

/* Карточка героя */
.hero-card {
    background: rgba(20, 24, 32, 0.6);
    backdrop-filter: blur(2px);
    border-radius: 24px;
    padding: 16px 16px 12px;          /* уменьшили отступы, фото будет вплотную сверху */
    transition: all 0.25s ease;
    border: 2px solid rgba(255,255,255,0.05);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.hero-card:hover {
    background: rgba(30, 34, 44, 0.8);
    border-color: rgba(184, 155, 107, 0.3);
    transform: translateY(-4px);
}

/* Прямоугольный контейнер для фото */
.portrait-placeholder {
    width: 100%;
    height: 320px;                     /* фиксированная высота для единообразия */
    background: #1E232E;
    border-radius: 12px;               /* лёгкое скругление */
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    border: 1px solid rgba(184,155,107,0.3);
}

/* Само изображение */
.portrait-placeholder img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;                 /* заполняет контейнер, обрезая лишнее */
    border-radius: 12px;               /* такое же скругление, как у контейнера */
    transition: transform 0.3s ease;
}

.hero-card:hover .portrait-placeholder img {
    transform: scale(1.02);            /* лёгкое приближение при наведении */
}

/* Запасной вариант, если фото нет (инициалы) */
.portrait-placeholder .initials-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1E232E;
    color: #B89B6B;
    font-size: 3rem;
    font-weight: 500;
    border-radius: 12px;
}

/* Текстовая часть карточки */
.hero-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.hero-years {
    font-size: 0.85rem;
    color: #B89B6B;
    margin-bottom: 12px;
    font-family: monospace;
}

.hero-rank {
    font-size: 0.85rem;
    font-weight: 500;
    color: #C0C7DD;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .portrait-placeholder {
        height: 250px;                 /* на телефонах чуть ниже */
    }
    .hero-card {
        padding: 12px 12px 20px;
    }
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.26) 0%, rgba(0, 0, 0, 0.62) 58%, rgba(0, 0, 0, 0.96) 100%);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s ease, visibility 0.2s ease;
    pointer-events: none;
}

.modal--active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal--active .modal-content {
    animation: modalContentIn 0.15s ease-out forwards;
}

@keyframes modalContentIn {
    from {
        opacity: 0.7;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    width: min(1180px, 90vw);
    /* Fix modal height to viewport so it doesn't grow with text */
    height: min(90vh, 760px);
    max-height: 90vh;
    border-radius: 32px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.65);
    border: 0;
    cursor: default;
    background: rgba(5, 6, 7, 0.78);
    backdrop-filter: blur(10px);
    overflow: hidden; /* prevent modal growing; let panels scroll internally */
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-mobile-tabs {
    display: none;
}

.modal-layout {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
    min-height: 0;
}

/* Ensure layout fills the fixed modal height and panels handle their own scrolling */
.modal-layout {
    height: 100%;
}

.modal-photo-panel {
    height: 100%;
}

.modal-image-viewport {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.modal-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    opacity: 1;
    animation: none;
    border-radius: 0;
    cursor: default;
    transition: transform 0.08s ease-out;
    user-select: none;
    -webkit-user-drag: none;
    flex-shrink: 0;
    transform-origin: center center;
    will-change: transform;
}

.modal-photo-panel,
.modal-info-panel {
    min-width: 0;
}

.modal-photo-panel {
    position: relative;
    min-height: min(85vh, 760px);
    background: rgba(0, 0, 0, 0.62);
}

.modal-image-viewport {
    width: 100%;
    height: 100%;
    min-height: min(85vh, 760px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.modal-image-viewport:active {
    cursor: grabbing;
}

.modal-img {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    opacity: 1;
    animation: none;
    border-radius: 0;
    cursor: default;
    transition: transform 0.08s ease-out;
    user-select: none;
    -webkit-user-drag: none;
    flex-shrink: 0;
    transform-origin: center center;
    will-change: transform;
}

.modal-info-panel {
    background: rgba(10, 12, 16, 0.72);
    border-left: 0;
    padding: 32px;
    overflow-y: auto;
}

.modal-info-title {
    color: #B89B6B;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 22px;
}

.modal-info-text {
    min-height: 320px;
    color: #C5CCE0;
    font-size: 1rem;
    line-height: 1.55;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 1px;
    white-space: pre-wrap;
}

.modal-placeholder {
    background: #1E232E;
    border-radius: 28px;
    padding: 40px;
    text-align: center;
    color: #B89B6B;
    font-size: 1.4rem;
    max-width: 500px;
}

/* ===== КНОПКИ НАВИГАЦИИ МОДАЛЬНОГО ОКНА ===== */

/* Общий стиль для всех кнопок навигации */
.modal-nav-btn,
.close-modal,
.zoom-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-weight: 300;
    user-select: none;
}

/* Эффект при наведении — масштабирование */
.modal-nav-btn:hover,
.close-modal:hover,
.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.12);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
}

/* Активное состояние (клик) */
.modal-nav-btn:active,
.close-modal:active,
.zoom-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.35);
}

/* ===== КНОПКИ ПЕРЕЛИСТЫВАНИЯ ===== */
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
    font-size: 1rem;
    font-weight: 200;
    width: 52px;
    height: 52px;
}

.modal-nav-btn:hover {
    transform: translateY(-50%) scale(1.12);
}

.modal-nav-btn:active {
    transform: translateY(-50%) scale(0.92);
}

.modal-nav-btn--prev {
    left: 36px;
}

.modal-nav-btn--next {
    right: 16px;
}

/* SVG arrows: use stroke for visibility and subtle hover */
.modal-nav-btn svg {
    display: block;
    width: 28px;
    height: 28px;
}
.modal-nav-btn svg path {
    stroke: currentColor;
    fill: none;
    stroke-width: 2px;
}
.modal-nav-btn {
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.06);
}
.modal-nav-btn:hover {
    background: rgba(255,255,255,0.18);
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
}

/* ===== КНОПКА ЗАКРЫТИЯ (ПРАВЫЙ ВЕРХНИЙ УГОЛ) ===== */
.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1003;
    font-size: 1.4rem;
    font-weight: 300;
    width: 44px;
    height: 44px;
}

.close-modal:hover {
    transform: scale(1.12);
    background: rgba(255, 255, 255, 0.12);
    border-color: 1px solid rgba(255, 255, 255, 0.15);
}

.close-modal:active {
    transform: scale(0.92);
}

/* ===== КНОПКИ ЗУМА ===== */
.zoom-controls {
    position: absolute;
    right: 20px;
    bottom: 20px;
    display: flex;
    gap: 10px;
    z-index: 1001;
}

.zoom-btn {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.12);
}

.zoom-btn:active {
    transform: scale(0.92);
}

.zoom-btn--reset {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 768px) {
    .heroes-toggle {
        width: 100%;
    }

    .modal {
        align-items: stretch;
        padding: 12px;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        margin: auto 0;
        border-radius: 24px;
    }

    .modal-mobile-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        background: #0A0C10;
        border-bottom: 1px solid rgba(184,155,107,0.28);
        flex-shrink: 0;
    }

    .modal-tab-btn {
        padding: 14px;
        background: transparent;
        border: 0;
        color: #B89B6B;
        font-family: 'Inter', sans-serif;
        font-size: 0.95rem;
        font-weight: 500;
        cursor: pointer;
        transition: background 0.25s ease, color 0.25s ease;
    }

    .modal-tab-btn--active {
        background: #B89B6B;
        color: #0A0C10;
    }

    .modal-layout {
        width: 200%;
        grid-template-columns: 1fr 1fr;
        transform: translateX(0);
        transition: transform 0.35s ease;
        flex: 1;
        min-height: 0;
    }

    .modal-content[data-active-panel="text"] .modal-layout {
        transform: translateX(-50%);
    }

    .modal-photo-panel,
    .modal-info-panel {
        width: 100%;
        min-height: 0;
    }

    .modal-photo-panel {
        min-height: 0;
    }

    .modal-image-viewport {
        min-height: 0;
        height: calc(100vh - 130px);
        max-height: 72vh;
    }

    .modal-info-panel {
        border-left: 0;
        padding: 24px;
        height: calc(100vh - 130px);
        max-height: 72vh;
    }

    .modal-info-text {
        min-height: 260px;
    }

    /* Мобильные кнопки навигации */
    .modal-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }

    .modal-nav-btn--prev {
        left: 8px;
    }

    .modal-nav-btn--next {
        right: 8px;
    }

    .close-modal {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
        top: 12px;
        right: 12px;
    }

    .zoom-controls {
        right: 12px;
        bottom: 12px;
        gap: 8px;
    }

    .zoom-btn {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }
}

/* ===== СЕКЦИЯ "О ПРОЕКТЕ" ===== */
.about-section {
    padding: 30px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.about-text {
    font-size: 1rem;
    margin: 1.25rem;
    line-height: 1.5;
    color: #C5CCE0;
}

.about-text p + p {
    margin-top: 18px;
}

/* ===== ФУТЕР ===== */
.footer {
    padding: 50px 0 40px;
    text-align: center;
}

.lest {
    font-size: 0.7rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    font-weight: 500;
    color: #7E879E;
    margin-bottom: 16px;
}

.copyright {
    font-size: 0.8rem;
    color: #5A637C;
}

@media (max-width: 768px) {
    .container {
        padding: 0 4%;
    }
    .hero {
        min-height: auto;
        padding: 40px 0;
    }
    .hero h1 {
        font-size: 2.8rem;
    }
    .heroes-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== СЕКЦИЯ "ЗАПИСАТЬСЯ НА ЭКСКУРСИЮ" ===== */
.excursion-section {
    padding: 30px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.excursion-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: stretch;
}

.excursion-info {
    flex: 1;
    min-width: 300px;
}

.excursion-intro {
    font-size: 1rem;
    margin: 1.25rem;
    line-height: 1.5;
    color: #C5CCE0;
}

.excursion-details {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

.detail-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 15px;
    width: auto;
}

.detail-icon {
    font-size: 1.3rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    min-height: 32px;
}

.detail-text {
    display: block;
    font-size: 1rem;
    line-height: 1.5;
    color: #C5CCE0;
}

.excursion-btn {
    display: inline-block;
    padding: 14px 32px;
    background: transparent;
    border: 2px solid #B89B6B;
    color: #B89B6B;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 1.25rem;
    margin-top: 30px;
}

.excursion-btn:hover {
    background: #B89B6B;
    color: #0A0C10;
}

.excursion-map {
    flex: none;
    width: min(420px, 100%);
    min-width: 100px;
    min-height: 0;
    align-self: stretch;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(184, 155, 107, 0.6);
    background: #1E232E;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.excursion-map a {
    display: block;
    width: 100%;
    height: 100%;
}

.excursion-map img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

@media (max-width: 768px) {
    .excursion-section {
        padding: 40px 0;
    }
    
    .excursion-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .excursion-map {
        width: 100%;
        height: 220px;
        min-height: 0;
    }
    
    .excursion-btn {
        width: calc(100% - 2.5rem);
        text-align: center;
    }
}