@font-face {
    font-family: 'Roboto Flex';
    src: url("fonts/RobotoFlex-latin-cyrillic-gHTkI9x.woff2") format('woff2');
    font-weight: 100 1000;
    font-display: swap;
}

:root {
    --primary: hsl(283, 52%, 56%);
    --primary-hover: hsl(283, 52%, 50%);
    --primary-focus: hsl(283, 52%, 45%);
    --accent: #7fff00;
    --second-bgc: #202020;

    --cc-primary: var(--primary);
    --cc-primary-hover: var(--primary-hover);
    --cc-primary-focus: var(--primary-focus);
    --cc-primary-invert: white;

}

html,
body {
    min-height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: 'Roboto Flex', system-ui, sans-serif;
    background: #171717;
    box-sizing: border-box;
    scroll-behavior: smooth;

    * {
        box-sizing: border-box;
    }
}

.fancy-text {
    color: transparent;
    background: linear-gradient(to left, white 0%, white 50%, var(--primary) 50%, var(--primary) 100%);
    background-size: 200% 100%;
    background-position: right;
    background-clip: text;
    transition: background-position 0.5s ease;
    text-decoration: none;
    appearance: none;

    &:hover {
        background-position: left;
    }
}

.line-section {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--primary);
    font-size: 12px;

    h2 {
        margin: 0;
        font: inherit;
    }

    .line {
        height: 80px;
        width: 1px;
        background: var(--primary);
        margin-bottom: .5em;
    }
}

#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 5px;
    background: var(--primary);
    background: linear-gradient(to right, var(--primary) 10%, var(--primary) 80%, var(--accent) 100%);
    width: 0;
    z-index: 100;
    transition: width 0.1s ease-out;
}

.input {
    position: relative;
    display: grid;
    gap: .5em;

    label {
        font-size: 1em;
        color: hsla(0, 0%, 100%, .5);
        pointer-events: none;
        transition: all 0.2s ease;
        position: absolute;
        top: 11px;
        left: 15px;

        &.is-active {
            top: -5px;
            font-size: .75em;
            color: var(--accent);
        }


        &.is-active-textarea {
            top: -20px;
            font-size: .75em;
            color: var(--accent);
        }
    }

    textarea,
    input {
        min-width: 240px;
        appearance: none;
        background: transparent;
        color: white;
        border: none;
        border-bottom: 1px solid var(--primary);
        padding: .5em 1em;
        line-height: 1.45;
        box-shadow: 0 1px 2px rgba(var(--accent), .06);
        outline: none;
        transition: border-color .2s ease, box-shadow .2s ease;
        font-size: 16px;

        &:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent), var(--accent);
        }

        &::placeholder {
            color: hsla(0, 0%, 100%, .5);
        }
    }
}

.button {
    cursor: pointer;
    text-decoration: none;

    padding: 12px 28px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 50px;
    background: linear-gradient(45deg, var(--primary) 0%, var(--primary) 40%, var(--accent) 60%, var(--accent) 100%);
    transition: all 0.3s ease;
    background-size: 200% auto; /* для анимации */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

    &:hover {
        background-position: right center; /* двигаем градиент */
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
        filter: brightness(1);
    }

    &:active {
        transform: translateY(0);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        filter: brightness(1);
    }
}

.welcome {
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    padding: 1em;
    overflow: hidden;

    video {
        position: absolute;
        z-index: 1;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        object-fit: cover;
        pointer-events: none;
    }

    .welcome__company {
        position: relative;
        z-index: 2;

        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        flex: 1;
    }

    .welcome__company__name {
        font-size: 48px;
        line-height: 60px;
        font-weight: 400;

        max-width: 750px;
        border: 1px var(--accent) solid;
        padding: .5em;

        text-align: center;
        text-wrap: pretty;
        color: white;
        position: relative;

        h1 {
            margin: 0;
            font: inherit;
        }

        span {
            color: var(--primary) !important;
        }

        @media (max-width: 860px) {
            font-size: 36px;
            line-height: 50px;
        }

        @media (max-width: 600px) {
            font-size: 24px;
            line-height: 36px;
        }
    }

    .welcome__company__links {
        display: flex;
        justify-content: center;
        gap: .5em;
        color: white;
        user-select: none;
        position: absolute;
        font-size: 14px;
        bottom: -5em;
        left: 0;
        right: 0;
        margin: 1em auto;
        white-space: nowrap;

        span {
            color: var(--accent) !important;
        }

        @media (max-width: 600px) {
            font-size: 12px;
        }

        @media (max-width: 350px) {
            font-size: 10px;
        }
    }

    .welcome__footer {
        position: relative;
        z-index: 2;
        max-width: 750px;
        width: 100%;

        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        margin-bottom: 1em;

        font-size: 16px;

        a:nth-child(2) {
            margin-bottom: 1px;
        }

        @media (max-width: 350px) {
            justify-content: center;
            a:nth-child(1) {
                display: none;
            }
        }
    }
}

.directions {
    background: var(--second-bgc);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 70vh;
    border-top: 1px solid var(--primary);
    border-bottom: 1px solid var(--primary);
    position: relative;
    overflow: hidden;
    padding: 1em;

    .directions__title {
        margin: 0;
        font-weight: inherit;
        top: 120px;
        position: relative;
        font-size: 48px;
        color: white;
        margin-bottom: 2em;

        @media (max-width: 875px) {
            margin-bottom: 1em;
        }

        @media (max-width: 690px) {
            top: 90px;
        }

        @media (max-width: 570px) {
            margin-bottom: .5em;
        }
    }

    .directions__list {
        position: relative;
        color: white;
        display: flex;
        width: 100%;
        max-width: 1200px;
        margin-top: 5em;
        gap: 2em;
        justify-content: space-between;
        align-items: stretch;
        flex-wrap: wrap;

        &.has-info {
            margin-top: 0;
        }

        @media (max-width: 850px) {
            margin-top: 7em;
        }
    }

    .directions__item {
        flex: 1;
        gap: 1em;
        display: flex;
        flex-direction: column;
        min-width: 260px;
    }

    .directions__item__title {
        font-size: 26px;
        line-height: 36px;
        display: flex;
        align-items: center;
        gap: .5em;

        div {
            display: flex;
            align-items: center;
            height: 40px;
        }
    }

    .directions__item__description {
        font-size: 16px;
        opacity: .75;
        flex: 1;
    }

    .directions__item__footer {
        cursor: pointer;
        font-size: 18px;
    }

    .directions__info {
        width: fit-content;
        display: flex;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        max-width: 1200px;
        margin: 0 auto;
        background-color: #202020;
        z-index: 2;
        max-height: 70vh;

        @media (max-width: 960px) {
            max-height: 100vh;
        }

        @media (max-width: 875px) {
            max-height: none;
        }

        > div {
            flex: 1;
        }
    }

    .directions__info__content {
        display: flex;
        flex-direction: column;
        padding: 1em 1em 0;
        gap: 1em;

        div:nth-child(1) {
            font-size: 24px;
        }

        div:nth-child(2) {
            opacity: .75;
        }

        div:nth-child(3) {
            flex: 1;
        }

        li {
            line-height: 30px;
        }

        div:last-child {
            display: flex;
            align-items: center;
            gap: 1em;
        }

        a:nth-child(1) {
            display: none;
        }

        a:nth-child(2) {
            cursor: pointer;
            text-decoration: none;

            padding: 12px 28px;
            font-size: 16px;
            font-weight: bold;
            color: white;
            border: none;
            border-radius: 50px;
            background: linear-gradient(45deg, var(--primary) 0%, var(--primary) 40%, var(--accent) 60%, var(--accent) 100%);
            transition: all 0.3s ease;
            background-size: 200% auto; /* для анимации */
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

            &:hover {
                background-position: right center; /* двигаем градиент */
                transform: translateY(-2px);
                box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
                filter: brightness(1);
            }

            &:active {
                transform: translateY(0);
                box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
                filter: brightness(1);
            }
        }


        @media (max-width: 875px) {
            a:nth-child(1) {
                display: block;
            }
        }
    }

    .directions__info__image {
        position: relative;

        @media (max-width: 875px) {
            display: none;
        }

        img {
            height: 100%;
            object-fit: cover;
            width: 100%;
            opacity: .75;
        }

        div {
            z-index: 1;
            font-size: 48px;
            color: #171717;
            padding: .5em;
            font-weight: bold;
            background-color: white;
            position: absolute;
            right: 0;
            top: 1em;
        }

        a {
            position: absolute;
            z-index: 1;
            left: 1em;
            bottom: 1em;
            height: 50px;
        }
    }
}

.contacts {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    flex-direction: column;
    position: relative;
    padding: 1em;
    overflow: hidden;

    video {
        position: absolute;
        z-index: 1;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        object-fit: cover;
        pointer-events: none;
    }

    .contacts__content {
        position: relative;
        z-index: 2;
        margin-top: 100px;

        p {
            font-size: 48px;
            color: white;
            text-align: center;
        }
    }

    .contacts__form {
        display: grid;
        gap: 3em;
        padding: 3em;
        background: #202020;
        box-shadow: 0 0 15px #171717;
        grid-template-areas:    'name       email'
                            'company    phone'
                            'comment    comment'
                            'captcha    captcha'
                            'send    send'
                            'docs    docs';

        @media (max-width: 700px) {
            gap: 2em;
            padding: 2em;
            grid-template-areas:    'name'
                                'email'
                                'company'
                                'phone'
                                'comment'
                                'captcha'
                                'send'
                                'docs';
        }

        .name {
            grid-area: name;
        }

        .email {
            grid-area: email;
        }

        .company {
            grid-area: company;
        }

        .phone {
            grid-area: phone;
        }

        .comment {
            grid-area: comment;
        }

        .captcha {
            grid-area: captcha;
        }

        .docs {
            grid-area: docs;
        }

        .send {
            grid-area: send;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        label > span {
            color: red;
            margin-left: .25em;
        }
    }
}

.projects {
    height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: relative;
    padding: 1em;
    overflow: hidden;

    .swiper {
        width: 100%;
        max-width: 1200px;
        height: auto;
        aspect-ratio: 16 / 9;

        .swiper-button-prev,
        .swiper-button-next {
            color: var(--primary);
            transition: color 0.3s, transform 0.3s;
        }

        .swiper-pagination-bullet {
            background-color: white;
        }
        .swiper-pagination-bullet-active {
            background: var(--accent);
        }

        .swiper-slide {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 1rem;

            p {
                font-size: clamp(1.2rem, 2vw + 0.5rem, 2rem);
                color: white;
                text-align: center;
                margin-bottom: 1rem;
                line-height: 1.4;
            }

            img {
                width: 80%;
                height: auto;
                max-height: 60vh;
                object-fit: contain;
            }
        }

        @media (max-width: 900px) {
            aspect-ratio: 4 / 3;

            .swiper-slide img {
                width: 100%;
                max-height: 40vh;
            }

            .swiper-slide p {
                font-size: clamp(1rem, 4vw, 1.5rem);
            }
        }

        @media (max-width: 600px) {
            aspect-ratio: auto;

            .swiper-slide {
                padding: 0.5rem;
            }

            .swiper-slide img {
                width: 100%;
                max-height: 35vh;
            }

            .swiper-slide p {
                font-size: clamp(0.9rem, 4vw, 1.2rem);
            }
        }
    }
}

.footer {
    /*border-top: 1px solid var(--primary);*/
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    max-width: 100%;
    padding: 1em;
    position: relative;
    overflow: hidden;
    z-index: 2;

    > img:first-child {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        height: 100%;
        width: 100%;
        opacity: 0.09;
        object-fit: cover;
        z-index: 1;
        display: none;
    }

    .footer__container {
        position: relative;
        z-index: 2;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        max-width: 1200px;
        width: 100%;

        > div {
            min-width: 250px;
        }

        h2 {
            color: white;
        }

        td {
            vertical-align: baseline;
        }

        @media (max-width: 685px) {
            justify-content: center;
        }
    }

    p {
        margin: .25em 0;
        color: hsla(0, 0%, 100%, .75);
    }

    .footer__logo {
        margin: 1em 0;
        width: 250px;
        object-fit: contain;
    }
}

.main {
    position: relative;

    .main__container {
        display: flex;
        flex-direction: column;
        z-index: 2;
    }

    > video {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
    }
}

.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 9999;

    img {
        max-width: 90%;
        max-height: 90%;
        border-radius: 12px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
        object-fit: contain;
        animation: zoomIn 0.3s ease;
    }

    .close {
        position: absolute;
        top: 20px;
        right: 30px;
        font-size: 40px;
        color: white;
        cursor: pointer;
        user-select: none;
        transition: transform 0.2s;
        &:hover {
            transform: scale(1.2);
        }
    }

    &.open {
        opacity: 1;
        pointer-events: all;
    }

    @keyframes zoomIn {
        from {
            transform: scale(0.9);
            opacity: 0;
        }
        to {
            transform: scale(1);
            opacity: 1;
        }
    }
}
