/* ============================================================
   GLOBAL FIXES — убираем горизонтальную прокрутку
   ============================================================ */
   html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

img, svg, video {
    max-width: 100%;
    height: auto;
}

* {
    min-width: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .iceberg-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Скрываем текстовые карточки айсберга — оставляем только SVG с выносками */
    .iceberg-text {
        display: none !important;
    }

    .iceberg-visual {
        justify-content: center;
    }

    .iceberg-svg {
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-content {
        align-items: center;
    }

    .hero-desc {
        max-width: 100%;
    }

    .hero-btn {
        align-self: center;
    }

    .hero-visual {
        min-height: 200px;
    }

    .outline-shape {
        width: 200px;
        height: 200px;
    }

    .aura {
        display: none !important;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-left {
        align-items: center;
        text-align: center;
    }

    .about-left p {
        max-width: 100%;
    }

    .stats-grid {
        width: 100%;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    .about-image {
        max-width: 600px;
        margin: 0 auto;
        width: 100%;
    }

    .cards-grid {
        grid-template-columns: 1fr 1fr;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 600px;
    }

    .join-card {
        flex-direction: column;
        text-align: center;
        padding: 32px;
    }

    .join-content p {
        max-width: 100%;
    }

    .join-features {
        justify-content: center;
    }

    .join-buttons {
        justify-content: center;
    }

    .join-img {
        max-width: 200px;
    }

    /* Скрываем длинные выноски от айсберга, если не хватает места */
    .info-branch .branch-line,
    .info-branch .branch-dot {
        display: none !important;
    }

    .info-branch rect {
        filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.06));
    }

    .footer-card__main {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .footer-card {
        padding: 2.5rem 2rem 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    /* NAVBAR */
    .navbar {
        padding: 10px 0;
    }

    .logo {
        font-size: 1.3rem;
    }

    .nav-cta {
        padding: 5px 14px;
        font-size: 0.75rem;
    }

    /* HERO */
    .hero {
        min-height: 60vh;
        padding-top: 70px;
    }

    .hero-visual {
        min-height: 120px;
    }

    .outline-shape {
        width: 130px;
        height: 130px;
    }

    h1 {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    h2 {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    /* ABOUT */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        max-width: 100%;
    }

    .stats-card {
        padding: 14px 6px;
        border-radius: 14px;
    }

    .stats-number {
        font-size: 1.4rem;
    }

    .stats-title {
        font-size: 0.7rem;
        line-height: 1.3;
    }

    .team-thumbnails {
        gap: 8px;
    }

    .thumbnail-overlay {
        display: none !important;
    }

    /* ICEBERG */
    .iceberg-svg {
        max-width: 100%;
    }

    /* PROJECTS */
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .value-card {
        padding: 24px;
    }

    /* MODALS */
    .modal-content {
        padding: 24px 20px;
        border-radius: 28px;
    }

    .modal-member-layout {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .member-modal-photo {
        width: 100px;
    }

    .gallery-container {
        gap: 8px;
    }

    .gallery-nav {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .gallery-image {
        max-height: 35vh;
    }

    /* TEAM */
    .team-grid:has(.member:nth-child(4):last-child) {
        grid-template-columns: repeat(2, 1fr);
        max-width: 400px;
    }

    .team-grid:has(.member:nth-child(5):last-child),
    .team-grid:has(.member:nth-child(6):last-child) {
        grid-template-columns: repeat(2, 1fr);
        max-width: 450px;
    }

    .cta-section {
        padding: 50px 0 30px;
    }

    .cta-dark-card {
        padding: 2.75rem 1.75rem 2.25rem;
        border-radius: 32px 32px 44px 44px;
    }

    .cta-dark-card__title {
        font-size: clamp(1.35rem, 5.5vw, 1.9rem);
        gap: 0.25em 0.4em;
        max-width: 100%;
    }

    .cta-dark-card__subtitle {
        font-size: 0.85rem;
        max-width: 100%;
    }

    .cta-dark-card__btn {
        padding: 0.85rem 2rem;
        font-size: 0.85rem;
    }
    .footer-card-wrapper {
        padding: 15px 1rem 1rem;
    }
    .footer-card {
        padding: 2rem 1.5rem 0;
        border-radius: 24px;
    }
    .footer-card__nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .footer-card__bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .footer-card__legal {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    /* ICEBERG — уменьшаем SVG */
    .iceberg-visual {
        padding: 0 5px;
    }

    .iceberg-svg {
        max-width: 100%;
        width: 100%;
    }

    /* Выноски айсберга: уменьшаем шрифт через transform */
    .info-branch rect {
        transform-box: fill-box;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    /* HERO */
    .hero {
        min-height: 50vh;
        padding-top: 60px;
    }

    .hero-visual {
        min-height: 80px;
    }

    .outline-shape {
        width: 90px;
        height: 90px;
    }

    h1 {
        font-size: clamp(1.8rem, 9vw, 2.4rem);
        line-height: 1.1;
    }

    h2 {
        font-size: clamp(1.3rem, 6vw, 1.7rem);
    }

    h3 {
        font-size: 1rem;
    }

    /* ABOUT — статистика в строку */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        max-width: 100%;
        width: 100%;
    }

    .stats-card {
        padding: 12px 4px;
        border-radius: 12px;
    }

    .stats-number {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .stats-title {
        font-size: 0.6rem;
        line-height: 1.25;
    }

    /* ABOUT IMAGE */
    .main-team-photo {
        aspect-ratio: 4/3;
    }

    .team-thumbnails {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    /* ICEBERG */
    .iceberg-visual {
        margin: 0 -16px;
        padding: 0;
    }

    .iceberg-svg {
        max-width: 100%;
        width: 100%;
        filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.03));
    }

    /* TEAM */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .member {
        max-width: 140px;
        margin: 0 auto;
    }

    .silhouette {
        width: 80px;
        height: 80px;
    }

    .member h4 {
        font-size: 0.85rem;
    }

    .member p {
        font-size: 0.7rem;
    }

    .member-btn {
        font-size: 0.6rem;
        padding: 3px 12px;
    }

    /* JOIN */
    .join-card {
        padding: 24px 16px;
        border-radius: 28px;
    }

    .join-features {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .join-buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    /* DYNAMIC ITEMS */
    .dynamic-item {
        padding: 14px 16px;
        gap: 12px;
    }

    .dynamic-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .dynamic-content h3 {
        font-size: 0.95rem;
    }

    .dynamic-content p {
        font-size: 0.75rem;
    }

    .legend-btn {
        padding: 4px 12px;
        font-size: 0.65rem;
    }

    /* TEAM GRID overrides */
    .team-grid:has(.member:only-child) {
        grid-template-columns: 1fr;
        max-width: 200px;
    }

    .team-grid:has(.member:nth-child(3):last-child) {
        grid-template-columns: repeat(2, 1fr);
        max-width: 320px;
    }

    .team-grid:has(.member:nth-child(5):last-child),
    .team-grid:has(.member:nth-child(6):last-child) {
        grid-template-columns: repeat(2, 1fr);
        max-width: 320px;
    }

    .cta-section {
        padding: 40px 0 20px;
    }

    .cta-dark-card {
        padding: 2.25rem 1.25rem 2rem;
        border-radius: 28px 28px 36px 36px;
    }

    .cta-dark-card__title {
        font-size: clamp(1.15rem, 6vw, 1.4rem);
        line-height: 1.3;
        gap: 0.2em 0.35em;
    }

    .cta-dark-card__subtitle {
        font-size: 0.8rem;
        margin-bottom: 1.75rem;
    }

    .cta-dark-card__btn {
        padding: 0.8rem 1.8rem;
        font-size: 0.8rem;
        width: 100%;
        max-width: 280px;
    }

    .footer-card-wrapper {
        padding: 10px 0.75rem 0.75rem;
    }
    .footer-card {
        border-radius: 20px;
        padding: 1.75rem 1.25rem 0;
    }
    .footer-card__nav {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 380px) {
    .team-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        max-width: 280px;
    }

    .member {
        max-width: 120px;
    }

    .silhouette {
        width: 70px;
        height: 70px;
    }

    .stats-title {
        font-size: 0.55rem;
    }

    .stats-number {
        font-size: 1.1rem;
    }
}

/* ===== PRINT ===== */
@media print {
    .navbar,
    .hero-visual,
    .team-thumbnails,
    .join-image,
    .cta-section,
    .nav-cta,
    .hero-btn,
    .member-btn,
    .btn,
    .close-modal,
    .modal {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
        padding: 0 16px;
    }

    .about,
    .values,
    .projects,
    .team-members {
        page-break-inside: avoid;
    }
}

@media (max-width: 768px) {
    .nav-right {
        gap: 8px;
    }

    .lang-toggle {
        padding: 4px 9px;
        font-size: 0.65rem;
    }
}

/* ===== Проекты: планшет ===== */
@media (max-width: 992px) {
    .projects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .proj {
        grid-template-columns: 60px 1fr auto;
        gap: 20px;
        padding: 28px 4px 28px 0;
    }

    .proj__index {
        font-size: 1.2rem;
    }
}

/* ===== Проекты: мобильные ===== */
@media (max-width: 768px) {
    .projects {
        padding: 60px 0;
    }

    .projects-header {
        margin-bottom: 28px;
    }

    .projects-filters {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .projects-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        flex-shrink: 0;
        padding: 7px 16px;
        font-size: 0.75rem;
    }

    /* Карточка проекта на мобилке */
    .proj {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 22px 4px 22px 0;
    }

    .proj:hover {
        padding-left: 12px;
    }

    .proj__index {
        font-size: 0.95rem;
        color: var(--accent);
        padding-top: 0;
        transform: none;
    }

    .proj:hover .proj__index {
        transform: none;
    }

    .proj__head {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .proj__title {
        font-size: 1.15rem;
    }

    .proj__desc {
        font-size: 0.85rem;
    }

    .proj__meta {
        justify-content: space-between;
        width: 100%;
        margin-top: 6px;
    }

    .proj__link {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .projects-cta {
        flex-direction: column;
        text-align: center;
        padding: 24px;
        margin-top: 32px;
    }

    .projects-cta p {
        font-size: 0.9rem;
    }

    .projects-cta .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* ===== Проекты: очень маленькие экраны ===== */
@media (max-width: 480px) {
    .proj {
        padding: 18px 2px;
    }

    .proj__title {
        font-size: 1.05rem;
    }

    .proj__tag {
        font-size: 0.62rem;
        padding: 2px 8px;
    }

    .proj__status {
        font-size: 0.62rem;
    }
}