/* Страница проектов — подход C: компактный hero + асимметричная сетка */

.projects-page {
    padding: 0 0 100px;
    background-color: var(--bg-dark, #0c0c0c);
}

/* Hero компактный — типографика и оранжевая линия */
.projects-hero-minimal {
    background: none;
    background-color: var(--bg-dark, #0c0c0c);
    padding: 100px 0 72px;
    text-align: center;
    margin-bottom: 0;
    min-height: 0;
    height: auto;
}

.projects-hero-minimal::before {
    display: none;
}

.projects-hero-minimal .container {
    position: relative;
    z-index: 1;
}

.projects-hero-title {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--text, #fafafa);
}

.projects-hero-subtitle {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-muted, #a1a1aa);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.projects-hero-line {
    display: block;
    width: 60px;
    height: 2px;
    margin-top: 24px;
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(90deg, transparent, var(--orange, #FF6B35), transparent);
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.4);
}

/* Сетка — 3 карточки в ряд */
.projects-grid-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 80px;
}

.project-card .project-card-inner {
    padding-bottom: 75%;
}

/* Карточки — скругления, hover, оранжевый акцент */
.project-card {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 107, 53, 0.2);
}

.project-card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--orange);
}

.project-card-inner {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
}

.project-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
    border-radius: 16px;
}

.project-card:hover .project-card-image {
    transform: scale(1.05);
}

.project-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 50%, rgba(0, 0, 0, 0.15) 100%);
    border-radius: 16px;
    transition: background 0.3s ease;
    z-index: 1;
}

.project-card:hover .project-card-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.45) 50%, rgba(0, 0, 0, 0.2) 100%);
}

.project-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 20px 24px;
    z-index: 2;
    color: #fff;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.project-card-title {
    font-size: clamp(15px, 1.4vw, 18px);
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    flex: 1;
    min-width: 0;
}

.project-card-arrow {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 107, 53, 0.9);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.project-card:hover .project-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Адаптив hero */
@media (max-width: 768px) {
    .projects-hero-minimal {
        padding: 80px 0 56px;
    }
    .projects-hero-title {
        font-size: 28px;
    }
    .projects-hero-subtitle {
        font-size: 15px;
    }
    .projects-hero-line {
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .projects-hero-minimal {
        padding: 64px 0 40px;
    }
    .projects-hero-title {
        font-size: 24px;
    }
    .projects-hero-subtitle {
        font-size: 14px;
    }
}

/* Адаптив сетки: планшет — 2 в ряд, мобильный — 1 в ряд */
@media (max-width: 992px) {
    .projects-grid-three {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .projects-grid-three {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 60px;
    }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 80px;
}

.project-card-large {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card-large:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 107, 53, 0.15);
    border-color: rgba(255, 107, 53, 0.3);
}

.project-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.project-content {
    padding: 30px;
}

.project-category {
    color: var(--teal);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-title {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 15px;
}

.project-link {
    color: var(--teal);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s;
}

.project-link:hover {
    gap: 12px;
}

/* Адаптивность */
@media (max-width: 992px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .nav-menu {
        display: none;
    }
}

@media (max-width: 768px) {
    .projects-page {
        padding: 120px 0 80px;
    }
    
    .projects-hero-title {
        font-size: 36px;
    }
    
    .project-content {
        padding: 25px;
    }
    
    .project-title {
        font-size: 22px;
    }
}



/* Модальное окно проекта — современный стиль */
.project-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    padding: 0;
    margin: 0;
    overflow: auto;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
}

.project-modal-content {
    position: relative;
    background: #0c0c0c;
    margin: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    overflow: auto;
    box-shadow: none;
    border: none;
    display: flex;
    flex-direction: column;
}

.project-modal-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.project-info {
    flex: 0 0 auto;
    padding: 28px 24px;
    overflow-y: auto;
    background: #0c0c0c;
    max-height: 50vh;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.project-description {
    max-width: 560px;
}

.project-features {
    list-style: none;
    margin: 0;
    padding: 0;
}

.project-features li {
    margin-bottom: 24px;
    padding: 20px 0 20px 20px;
    border-left: 3px solid var(--orange);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 8px 8px 0;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.65;
    font-size: 15px;
}

.project-features li:last-child {
    margin-bottom: 0;
}

.project-features li strong {
    color: var(--orange);
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.project-gallery {
    flex: 1;
    background: #000;
    position: relative;
    min-height: 50vh;
}

.gallery-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-slide.active {
    opacity: 1;
}

.gallery-image {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000;
}

.gallery-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.gallery-control:hover {
    background: var(--orange);
    border-color: var(--orange);
    transform: translateY(-50%) scale(1.08);
}

.gallery-prev {
    left: 16px;
}

.gallery-next {
    right: 16px;
}

.gallery-control svg {
    width: 22px;
    height: 22px;
}

.gallery-control svg path {
    stroke: #fff;
}

/* Кнопка закрытия */
.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

/* Адаптивность для модальных окон на мобильных устройствах */
@media (max-width: 768px) {
    .project-modal-content {
        height: 100vh;
        max-height: 100vh;
    }
    
    .project-modal-body {
        flex-direction: column;
        height: 100vh;
    }
    
    .project-info {
        max-height: 40vh;
        padding: 15px;
        overflow-y: auto;
    }
    
    .project-gallery {
        height: 60vh;
        min-height: 60vh;
    }
    
    .project-info .project-category {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .project-features {
        margin-bottom: 20px;
    }
    
    .project-features li {
        margin-bottom: 15px;
        font-size: 14px;
        line-height: 1.5;
    }
    
    .project-features li strong {
        display: block;
        margin-bottom: 5px;
        font-size: 15px;
    }
    
    .gallery-control {
        width: 45px;
        height: 45px;
    }
    
    .gallery-control svg {
        width: 20px;
        height: 20px;
    }
    
    .modal-close-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .project-info {
        max-height: 45vh;
        padding: 12px;
    }
    
    .project-gallery {
        height: 55vh;
        min-height: 55vh;
    }
    
    .project-info .project-category {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .project-features li {
        margin-bottom: 12px;
        font-size: 13px;
    }
    
    .project-features li strong {
        font-size: 14px;
    }
    
    .gallery-control {
        width: 40px;
        height: 40px;
    }
    
    .gallery-control svg {
        width: 18px;
        height: 18px;
    }
    
    .gallery-prev {
        left: 8px;
    }
    
    .gallery-next {
        right: 8px;
    }
    
    .modal-close-btn {
        top: 8px;
        right: 8px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

@media (max-width: 360px) {
    .project-info {
        max-height: 50vh;
        padding: 10px;
    }
    
    .project-gallery {
        height: 50vh;
        min-height: 50vh;
    }
    
    .project-features li {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .project-features li strong {
        font-size: 13px;
    }
    
    .gallery-control {
        width: 35px;
        height: 35px;
    }
    
    .gallery-control svg {
        width: 16px;
        height: 16px;
    }
}

/* Горизонтальная ориентация на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .project-modal-body {
        flex-direction: row;
    }
    
    .project-info {
        flex: 1;
        max-height: 100vh;
        padding: 15px;
    }
    
    .project-gallery {
        flex: 1;
        height: 100vh;
        min-height: auto;
    }
    
    .modal-close-btn {
        top: 10px;
        right: 10px;
    }
}

/* Для планшетов и десктопов — карточка по центру */
@media (min-width: 769px) {
    .project-modal {
        display: none;
        padding: 24px;
        align-items: center;
        justify-content: center;
    }
    
    .project-modal[style*="display: block"] {
        display: flex !important;
    }
    
    .project-modal-content {
        margin: 0;
        width: 100%;
        max-width: 1100px;
        max-height: 88vh;
        height: auto;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.08);
        animation: projectModalIn 0.3s ease-out;
    }
    
    @keyframes projectModalIn {
        from {
            opacity: 0;
            transform: scale(0.96);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }
    
    .project-modal-body {
        flex-direction: row;
        height: 88vh;
        max-height: 720px;
    }
    
    .project-info {
        flex: 0 0 42%;
        padding: 36px 32px;
        max-height: none;
        overflow-y: auto;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .project-features li {
        padding: 18px 0 18px 18px;
        font-size: 14px;
    }
    
    .project-gallery {
        flex: 1;
        min-height: auto;
    }
    
    .modal-close-btn {
        top: 16px;
        right: 16px;
    }
}

/* Улучшения для жестов на мобильных устройствах */
.gallery-slider {
    -webkit-overflow-scrolling: touch;
}

.project-info {
    -webkit-overflow-scrolling: touch;
}

/* Предотвращение масштабирования при касании на мобильных */
@media (max-width: 768px) {
    .project-modal-content {
        touch-action: pan-y;
    }
}

/* Анимация открытия модального окна */
@keyframes modalOpen {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal[style*="display: block"] .project-modal-content {
    animation: modalOpen 0.3s ease-out;
}


/* Мобильное меню для страницы проектов */
.mobile-menu-btn {
    display: none;
    cursor: pointer;
    z-index: 1002;
    position: relative;
    width: 30px;
    height: 30px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.mobile-menu-btn i {
    color: #e0e0e0;
    font-size: 18px;
    transition: color 0.3s ease;
}

.mobile-menu-btn.active {
    background-color: rgba(0, 0, 0, 0.9);
}

.mobile-menu-btn.active i {
    color: #fff;
    transform: rotate(90deg);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background-color: var(--bg-dark);
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-container {
    padding: 80px 30px 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.mobile-nav-menu {
    list-style: none;
    flex: 1;
}

.mobile-nav-menu li {
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-menu li:last-child {
    border-bottom: none;
}

.mobile-nav-menu a {
    display: block;
    padding: 15px 0;
    color: #fff;
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 1px;
    transition: color 0.3s ease;
    border: none;
}

.mobile-nav-menu a:hover {
    color: var(--teal);
}

.mobile-menu-contact {
    background-color: var(--teal);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    text-align: center;
    margin-top: 10px;
    display: inline-block;
}

.mobile-menu-footer {
    margin-top: auto;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.mobile-copyright {
    text-align: center;
    color: #c2c2c4;
    font-size: 14px;
}

/* Адаптивность для мобильного меню */
@media (max-width: 768px) {
    .nav, .header-buttons {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .header-container {
        position: relative;
    }
}

@media (max-width: 480px) {
    .mobile-menu {
        width: 280px;
    }
    
    .mobile-menu-container {
        padding: 70px 20px 20px;
    }
    
    .mobile-nav-menu a {
        font-size: 16px;
        padding: 12px 0;
    }
    
    .mobile-menu-btn {
        width: 28px;
        height: 28px;
    }
    
    .mobile-menu-btn i {
        font-size: 16px;
    }
}

/* Улучшения для шапки на странице проектов */
.projects-page {
    padding: 100px 0 100px;
}

/* Адаптивность для шапки проектов */
@media (max-width: 768px) {
    .projects-page {
        padding: 120px 0 80px;
    }
}

/* Улучшения для мобильного меню */
.mobile-menu, .mobile-menu-overlay {
    transform: translateZ(0);
    backface-visibility: hidden;
}

body.no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Плавные переходы */
.mobile-nav-menu a,
.mobile-menu-contact,
.social-link {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Улучшения для иконки меню на разных устройствах */
@media (max-width: 768px) {
    .mobile-menu-btn {
        background-color: rgba(0, 0, 0, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .mobile-menu-btn i {
        color: #d0d0d0;
    }
}

/* Улучшение доступности */
.mobile-menu-btn:focus {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

/* Плавная анимация иконки */
.mobile-menu-btn i {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Стили для иконок соцсетей в шапке */
.header-social-links {
    display: flex;
    gap: 10px;
    margin-right: 15px;
}

.header-social-link {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #fff;
    font-size: 16px;
}

.header-social-link:hover {
    background-color: var(--teal);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

/* Адаптивность для иконок в шапке */
@media (max-width: 768px) {
    .header-social-links {
        display: none; /* Скрываем на мобильных, так как они есть в мобильном меню */
    }
}