/* ============================================================
   MOBILE.CSS
   Адаптация сайта для экранов до 768px
   ============================================================ */

/* ============================================================
   1. БАЗОВЫЕ МОБИЛЬНЫЕ ФИКСЫ
   ============================================================ */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-width: 320px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
video,
iframe {
    max-width: 100%;
}

img,
video {
    height: auto;
}

button,
a,
input,
textarea,
select {
    -webkit-tap-highlight-color: transparent;
}

button,
a {
    touch-action: manipulation;
}

/* ============================================================
   2. ШАПКА
   ============================================================ */

header .container {
    height: 68px;
    padding: 0 16px;
}

.desktop-nav,
header .container .button.call-btn {
    display: none !important;
}

.logo-text {
    font-size: 22px;
}

.logo svg {
    width: 28px;
    height: 28px;
}

/* ============================================================
   3. ГАМБУРГЕР
   ============================================================ */

.hamburger {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;

    min-width: 44px;
    min-height: 44px;

    padding: 8px 6px;

    background: transparent;
    border: 0;

    cursor: pointer;

    position: relative;
    z-index: 10001;

    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-line {
    display: block;

    width: 26px;
    height: 2.5px;

    flex-shrink: 0;

    background: #fff;
    border-radius: 4px;

    transform-origin: center;

    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease;

    will-change: transform, opacity;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ============================================================
   4. МОБИЛЬНОЕ МЕНЮ
   ============================================================ */

.mobile-menu {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100dvh;
    min-height: 100dvh;

    margin: 0;
    padding: 86px 20px 30px;

    display: flex;
    align-items: flex-start;
    justify-content: flex-start;

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;

    background: rgba(7, 11, 20, 0.985);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    z-index: 10000;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-inner {
    width: 100%;
    max-width: 360px;

    margin: 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    gap: 22px;

    text-align: center;

    opacity: 0;
    transform: translateY(-10px);

    transition:
        opacity 0.3s ease,
        transform 0.35s ease;
}

.mobile-menu.active .mobile-menu-inner {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav {
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 2px;

    margin: 0;
    padding: 0;
}

.mobile-nav a {
    width: 100%;
    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 10px 15px;

    color: #fff;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0;

    text-decoration: none;
    text-align: center;

    border-bottom: 1px solid rgba(255, 255, 255, 0.06);

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.mobile-nav a:hover,
.mobile-nav a:focus-visible {
    color: #4F8CFF;
    background: rgba(79, 140, 255, 0.06);
}

.mobile-nav a:last-child {
    border-bottom: 0;
}

.mobile-call-btn {
    width: 100%;
    max-width: 240px;
    min-height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-top: 8px;
    padding: 14px 28px;

    border: 0;
    border-radius: 50px;

    background: #4F8CFF;
    color: #fff;

    font-size: 16px;
    font-weight: 600;
    line-height: 1;

    text-align: center;

    cursor: pointer;

    box-shadow: 0 8px 30px rgba(79, 140, 255, 0.35);

    transition:
        background-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.mobile-call-btn:hover,
.mobile-call-btn:focus-visible {
    background: #3A7AE8;
    transform: translateY(-1px);
    box-shadow: 0 10px 34px rgba(79, 140, 255, 0.4);
}

body.menu-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ============================================================
   5. HERO — ИЗМЕНЕНО: отступ под шапку + нормальный letter-spacing
   ============================================================ */

.hero {
    padding: 100px 0 60px;   /* ИЗМЕНЕНО: зазор под фиксированную шапку */
    min-height: auto;
}

.hero .container {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 0 16px;
}

.hero-left h1 {
    /* ИЗМЕНЕНО: переопределяем жёсткий letter-spacing и line-height из style.css */
    font-size: clamp(28px, 8vw, 44px);
    line-height: 1.15;
    letter-spacing: -1px;
    max-width: 100%;
    margin: 22px 0 20px;
}

.hero-left p {
    padding: 0;
    font-size: 15px;
    line-height: 1.7;
    max-width: 100%;
}

.hero-right {
    min-height: 400px;
    padding: 20px 0;
}

.main-card {
    min-height: 350px;
    padding: 25px;
    max-width: 100%;
    transform: none;   /* ИЗМЕНЕНО: убираем 3D-перспективу на мобильном */
}

.main-card::after,
.card-reflection {
    width: 200px;
    height: 200px;
}

.main-card-top {
    margin-bottom: 20px;
}

.main-card-top span {
    font-size: 15px;
}

.main-chart {
    height: 160px;
    border-radius: 16px;
}

.stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.stats div {
    padding: 16px;
}

.stats h2 {
    font-size: 22px;
    margin-top: 6px;
}

.stats small {
    font-size: 12px;
}

.scroll-down,
.cursor-glow,
.floating-card {
    display: none;
}

/* ============================================================
   6. ОБЩИЕ СЕКЦИИ
   ============================================================ */

section {
    padding: 80px 0;
}

section h2 {
    margin-bottom: 50px;
    font-size: 32px;
}

.cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    min-height: 200px;
    padding: 25px;
}

.about-video {
    height: 300px;
}

/* ============================================================
   7. ТАЙМЛАЙН
   ============================================================ */

.timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
}

.timeline::before {
    display: none;
}

/* ============================================================
   8. ПОРТФОЛИО
   ============================================================ */

.portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project {
    height: 240px;
}

/* ============================================================
   9. КОНТАКТЫ
   ============================================================ */

#contacts .container {
    grid-template-columns: 1fr;
}

.contact-form {
    padding: 30px;
}

/* ============================================================
   10. ФУТЕР
   ============================================================ */

footer .container:first-of-type {
    grid-template-columns: 1fr;
    gap: 30px;
}

.copyright {
    padding-top: 30px;
    font-size: 14px;
}

/* ============================================================
   11. МОДАЛЬНЫЕ ОКНА
   ============================================================ */

.modal {
    padding: 35px 25px;
}

.modal h2 {
    font-size: 26px;
}

/* ============================================================
   12. УВЕДОМЛЕНИЯ
   ============================================================ */

.notification {
    bottom: 20px;
    padding: 14px 24px;
    font-size: 14px;
}

/* ============================================================
   13. КАРТА
   ============================================================ */

.map-wrapper iframe {
    height: 250px;
}

/* ============================================================
   14. ABOUT — HERO — ИЗМЕНЕНО: градиент на <b> (iOS-safe)
   ============================================================ */

.about-hero {
    min-height: auto;
    padding: 112px 0 70px;
}

.about-hero-number {
    top: 72px;
    right: -3px;
    font-size: 100px;
    letter-spacing: -8px;
}

.about-hero-layout {
    grid-template-columns: 1fr;
}

.about-hero-content h1 {
    margin: 22px 0;
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: -1px;
}

.hero-lead {
    font-size: 15px;
    line-height: 1.75;
}

.hero-actions {
    flex-direction: column;
    align-items: stretch;
}

.hero-actions .button {
    width: 100%;
}

.hero-proof {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 40px;
}

.hero-proof strong {
    font-size: 20px;
}

.hero-proof span {
    font-size: 9px;
    letter-spacing: 0.7px;
}

.about-hero-visual {
    width: min(330px, 90vw);
}

.visual-core {
    width: 135px;
    height: 135px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* ИЗМЕНЕНО: с родителя снят background-clip:text; градиент — на <b> */
.visual-core strong {
    display: inline-flex !important;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    font-size: 28px !important;
    line-height: 1.2;
    letter-spacing: -2px;
    margin: 0;
    padding: 0;
    width: auto !important;
    min-width: 0 !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    color: #fff !important;
    transition: opacity .25s ease;
}

.visual-core strong b {
    display: inline-block !important;
    font-size: inherit !important;
    min-width: 0 !important;
    background: linear-gradient(135deg, #fff, #8AB8FF) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

.about-hero-line {
    display: none;
}

/* ============================================================
   15. ABOUT — ЦИФРЫ
   ============================================================ */

.numbers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.number-item {
    min-height: 155px;
    padding: 25px 20px;
}

.number-item:nth-child(2) {
    border-right: 0;
}

.number-item:nth-child(-n + 2) {
    border-bottom: 1px solid var(--about-line);
}

.number-item strong {
    font-size: 42px;
}

/* ============================================================
   16. ABOUT — СЕКЦИИ
   ============================================================ */

.about-intro,
.about-story,
.about-directions-new,
.about-tech {
    padding: 90px 0;
}

.about-documents {
    padding: 60px 0 40px;
}

.about-intro-grid {
    grid-template-columns: 1fr;
    gap: 40px;
}

.directions-new-grid {
    grid-template-columns: 1fr;
}

.dir-card {
    padding: 28px 24px;
}

/* ============================================================
   17. ABOUT — ТЕХНОЛОГИИ
   ============================================================ */

.tech-box {
    grid-template-columns: 1fr;
    padding: 30px 22px;
}

.tech-stats {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;

    margin-top: 10px;
    padding: 30px 0 0;

    border-left: 0;
    border-top: 1px solid var(--about-line);
}

.tech-stats strong {
    font-size: 30px;
}

.tech-box ul {
    grid-template-columns: 1fr;
}

/* ============================================================
   18. ABOUT — ДОКУМЕНТЫ
   ============================================================ */

.documents-box {
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 22px;
}

.documents-box .button {
    align-self: flex-start;
}

.documents-box > div h2 {
    font-size: 28px;
}

/* ============================================================
   19. ABOUT — ИСТОРИЯ
   ============================================================ */

.story-track::before {
    left: 13px;
}

.story-item {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: 0;
    padding-left: 42px;
    padding-bottom: 42px;
}

.story-year {
    font-size: 38px;
}

.story-dot {
    top: 9px;
    left: 13px;
}

.story-card {
    min-height: 0;
}

/* ============================================================
   20. ПЛАНШЕТЫ / БОЛЕЕ УЗКИЕ ЭКРАНЫ
   ============================================================ */

@media (max-width: 600px) {

    .cards,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .card {
        min-height: 0;
    }

    .portfolio-grid {
        gap: 16px;
    }

    .project {
        height: 210px;
    }

    .timeline {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   21. ТЕЛЕФОНЫ — ДО 480PX
   ============================================================ */

@media (max-width: 480px) {

    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .hero .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* ---------- Шапка ---------- */

    header .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .logo-text {
        font-size: 20px;
    }

    /* ---------- Меню ---------- */

    .mobile-menu {
        padding:
            82px
            15px
            max(25px, env(safe-area-inset-bottom));
    }

    .mobile-menu-inner {
        max-width: 330px;
        gap: 18px;
    }

    .mobile-nav {
        gap: 2px;
    }

    .mobile-nav a {
        min-height: 44px;
        padding: 8px 10px;
        font-size: 18px;
    }

    .mobile-call-btn {
        max-width: 220px;
        min-height: 48px;
        padding: 13px 24px;
        font-size: 14px;
    }

    .hamburger-line {
        width: 22px;
        height: 2px;
    }

    .hamburger.active .hamburger-line:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .hamburger.active .hamburger-line:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    /* ---------- Hero ---------- */

    .hero {
        padding-top: 90px;
        padding-bottom: 50px;
    }

    .hero-left h1 {
        font-size: clamp(26px, 8.5vw, 36px);
        letter-spacing: -0.8px;
        line-height: 1.18;
        margin: 18px 0 16px;
    }

    .hero-left p {
        padding: 0;
        font-size: 14px;
        line-height: 1.65;
    }

    .hero-right {
        min-height: 340px;
    }

    .main-card {
        min-height: 300px;
        padding: 20px;
        border-radius: 24px;
    }

    .main-card-top span {
        font-size: 14px;
    }

    .main-chart {
        height: 130px;
        border-radius: 14px;
    }

    .stats {
        gap: 10px;
        margin-top: 14px;
    }

    .stats div {
        padding: 14px;
    }

    .stats h2 {
        margin-top: 6px;
        font-size: 20px;
    }

    .stats small {
        font-size: 11px;
    }

    /* ---------- Секции ---------- */

    section {
        padding: 65px 0;
    }

    section h2 {
        margin-bottom: 35px;
        font-size: 28px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .project {
        height: 200px;
    }

    /* ---------- Таймлайн ---------- */

    .timeline {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .timeline-item {
        display: flex;
        align-items: center;
        gap: 20px;
        text-align: left;
    }

    .timeline-dot {
        width: 56px;
        height: 56px;
        margin: 0;
        flex-shrink: 0;
        font-size: 20px;
    }

    /* ---------- Кнопки ---------- */

    .button {
        padding: 12px 24px;
        font-size: 14px;
    }

    .hero-tag {
        padding: 8px 14px;
        font-size: 13px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .hero-buttons .button {
        width: 100%;
        min-width: 0;            /* ИЗМЕНЕНО: снимаем min-width:180px */
        max-width: 100%;
        text-align: center;
    }

    /* ---------- About ---------- */

    #about h2 {
        font-size: 28px;
    }

    .about-content p {
        font-size: 15px;
    }

    .about-video {
        height: 220px;
    }

    .contact-info h2 {
        font-size: 28px;
    }

    .contact-form {
        padding: 20px;
    }

    .map-wrapper iframe {
        height: 200px;
    }

    .about-hero {
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .about-hero-number {
        top: 65px;
        font-size: 82px;
    }

    .about-hero-content h1 {
        font-size: 30px;
        letter-spacing: -1px;
        line-height: 1.18;
    }

    .hero-proof {
        gap: 10px;
    }

    .hero-proof strong {
        font-size: 18px;
    }

    .hero-proof span {
        font-size: 8px;
    }

    /* ИЗМЕНЕНО: градиент снят с родителя, оставлен только на <b> */
    .visual-core strong {
        font-size: 26px !important;
        letter-spacing: -1px;
        display: inline-flex !important;
        align-items: baseline;
        justify-content: center;
        gap: 2px;
        background: none !important;
        -webkit-text-fill-color: currentColor !important;
        color: #fff !important;
        min-width: 0 !important;
        width: auto !important;
    }

    .visual-core strong b {
        display: inline-block !important;
        font-size: inherit !important;
        min-width: 0 !important;
        background: linear-gradient(135deg, #fff, #8AB8FF) !important;
        -webkit-background-clip: text !important;
        background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        color: transparent !important;
    }

    .number-item {
        min-height: 135px;
        padding: 20px 15px;
    }

    .number-item strong {
        font-size: 36px;
    }

    .about-intro,
    .about-story,
    .about-directions-new,
    .about-tech {
        padding: 70px 0;
    }

    .tech-box {
        padding: 25px 18px;
    }

    .documents-box {
        padding: 25px 18px;
    }

    .documents-box > div h2 {
        font-size: 25px;
    }

    /* ---------- Заголовки секций ---------- */

    .section-heading {
        margin-bottom: 40px;
    }

    .section-heading h2 {
        font-size: 28px;
        letter-spacing: -1.5px;
        max-width: 100%;
    }

    .section-heading > span,
    .section-heading > div > span {
        font-size: 10px;
        letter-spacing: 2.5px;
        margin-bottom: 10px;
    }
}

/* ============================================================
   22. ОЧЕНЬ МАЛЕНЬКИЕ ТЕЛЕФОНЫ — ДО 360PX
   ============================================================ */

@media (max-width: 360px) {

    .mobile-menu {
        padding-top: 76px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .mobile-menu-inner {
        max-width: 280px;
        gap: 12px;
    }

    .mobile-nav a {
        min-height: 40px;
        padding: 6px 8px;
        font-size: 16px;
    }

    .mobile-call-btn {
        min-height: 44px;
        max-width: 190px;
        padding: 11px 18px;
        font-size: 13px;
    }

    .hero-left h1 {
        font-size: 26px;
    }

    .hero-left p {
        font-size: 14px;
    }

    .main-card {
        padding: 16px;
    }

    .stats div {
        padding: 13px 10px;
    }

    .stats h2 {
        font-size: 20px;
    }

    .about-hero-content h1 {
        font-size: 26px;
    }

    .hero-proof strong {
        font-size: 16px;
    }

    .number-item strong {
        font-size: 32px;
    }

    .visual-core {
        width: 115px;
        height: 115px;
    }

    .visual-core strong {
        font-size: 24px !important;
        letter-spacing: -0.5px;
    }

    .section-heading h2 {
        font-size: 24px;
    }
}

/* ============================================================
   23. УСТРОЙСТВА С ВЫРЕЗОМ / SAFE AREA
   ============================================================ */

@supports (padding: max(0px)) {

    .mobile-menu {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
        padding-bottom: max(25px, env(safe-area-inset-bottom));
    }

    /* ИЗМЕНЕНО: учитываем safe area для шапки и hero (вырез/динамический остров) */
    header {
        padding-top: env(safe-area-inset-top);
    }

    .hero {
        padding-top: calc(100px + env(safe-area-inset-top));
    }
}

/* ============================================================
   24. REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    .mobile-menu,
    .mobile-menu-inner,
    .mobile-nav a,
    .mobile-call-btn,
    .hamburger-line {
        transition: none !important;
    }
}