/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Roboto+Mono:wght@400;700&display=swap');

/* --- CSS Variables --- */
:root {
    --font-main: 'Inter', sans-serif;
    --font-headings: 'Roboto Mono', monospace;

    --color-bg: #121212;
    --color-text: #EAEAEA;
    --color-text-muted: #A0A0A0;
    --color-primary: #00f5d4;
    --color-secondary: #9b5de5;
    --color-surface: #1E1E1E;
    
    --container-width: 1200px;
    --container-padding: 1rem;
}

/* --- Global & Reset Styles --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* --- Header Styles --- */
.header {
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__logo {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}
.header__logo:hover {
    color: var(--color-text);
}


.header__nav-list {
    display: flex;
    gap: 2rem;
}

.header__nav-link {
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.header__nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease;
}

.header__nav-link:hover::after {
    width: 100%;
}

.header__burger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
}

/* --- Footer Styles --- */
.footer {
    background-color: var(--color-surface);
    padding-top: 4rem;
    padding-bottom: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__container {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer__logo {
    font-family: var(--font-headings);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
    display: inline-block;
}
.footer__logo:hover {
    color: var(--color-primary);
}


.footer__description {
    color: var(--color-text-muted);
    max-width: 300px;
}

.footer__title {
    font-family: var(--font-headings);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

.footer__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer__link {
    color: var(--color-text-muted);
}
.footer__link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer__address {
    color: var(--color-text-muted);
    font-style: normal;
}

.footer__bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}


/* --- Responsive (Mobile-First) --- */

/* For tablets and smaller devices */
@media (max-width: 992px) {
    .footer__container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* For mobile devices */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .header__nav {
        display: none; /* Will be handled by JS for mobile menu */
    }

    .header__burger-btn {
        display: block;
    }
    
    .lucide-menu {
        width: 32px;
        height: 32px;
    }

    .footer__container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

/* --- Button Styles --- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    background-color: var(--color-primary);
    color: var(--color-bg);
    border: 2px solid transparent;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.button:hover {
    background-color: transparent;
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 245, 212, 0.1);
}

.button__icon {
    transition: transform 0.3s ease;
}

.button:hover .button__icon {
    transform: translateX(5px);
}


/* --- Hero Section Styles --- */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 4rem 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, var(--color-surface) 0%, var(--color-bg) 70%);
}

.hero__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3rem;
}

.hero__title {
    font-family: var(--font-headings);
    font-size: 3.5rem;
    line-height: 1.2;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
    min-height: 135px; /* Резервируем высоту для предотвращения "прыжка" контента */
}

.hero__description {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 500px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero__image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero__image {
    border-radius: 20px;
    max-width: 100%;
    filter: grayscale(30%) opacity(0.9);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* --- Hero Animations --- */
.hero__description {
    animation: fadeInSlideUp 0.8s ease 1s forwards;
    opacity: 0;
}
.hero__cta {
    animation: fadeInSlideUp 0.8s ease 1.2s forwards;
    opacity: 0;
}
.hero__image-wrapper {
    animation: fadeIn 1s ease 0.5s forwards;
    opacity: 0;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* --- Responsive for Hero --- */
@media (max-width: 992px) {
    .hero__title {
        font-size: 2.8rem;
        min-height: 100px;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 5rem 0;
        text-align: center;
    }
    .hero__container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .hero__text-content {
        order: 2;
    }
    .hero__image-wrapper {
        order: 1;
    }
    .hero__description {
        margin-left: auto;
        margin-right: auto;
    }
    .hero__title {
        font-size: 2.5rem;
        min-height: 120px; /* Адаптируем высоту */
    }
}

/* --- Global Section Header --- */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-header__title {
    font-family: var(--font-headings);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.section-header__subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* --- Concepts Section Styles --- */
.concepts {
    padding: 6rem 0;
    background-color: var(--color-bg);
}

.concepts__grid {
    display: grid;
    /* This creates a responsive grid without media queries */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.concept-card {
    background-color: var(--color-surface);
    padding: 2.5rem 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    
    /* Styles for scroll animation */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* This class will be added by JS */
.concept-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}


.concept-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.concept-card__icon {
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

.concept-card__icon .lucide {
    width: 48px;
    height: 48px;
}

.concept-card__title {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.concept-card__description {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

/* --- Responsive for Concepts Section --- */
@media (max-width: 768px) {
    .concepts {
        padding: 4rem 0;
    }
    .section-header__title {
        font-size: 2rem;
    }
}

/* --- Tech Section Styles --- */
.tech {
    padding: 6rem 0;
    background-color: var(--color-surface);
}

.tech__main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: flex-start;
}

.tech-step {
    padding: 1.5rem;
    margin-bottom: 20vh; /* Creates scroll space between steps */
    border-radius: 12px;
    border: 1px solid transparent;
    transition: border-color 0.4s ease, background-color 0.4s ease;
}

.tech-step:last-child {
    margin-bottom: 0;
}

/* State when a step is focused by scroll */
.tech-step.is-focused {
    border-color: var(--color-primary);
    background-color: rgba(0, 245, 212, 0.05);
}

.tech-step__title {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.tech-step__description {
    color: var(--color-text-muted);
    line-height: 1.7;
}

.tech__visuals {
    height: 100%; /* Important for sticky behavior */
}

.tech__visuals-sticky-wrapper {
    position: sticky;
    top: 120px; /* Space for the sticky header */
    height: 70vh;
    border-radius: 16px;
    overflow: hidden;
    background-color: var(--color-bg);
}

.tech__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    transform: scale(1.05);
}

.tech__image.is-active {
    opacity: 1;
    transform: scale(1);
    transition-duration: 0.8s;
}

/* --- Responsive for Tech Section --- */
@media (max-width: 768px) {
    .tech {
        padding: 4rem 0;
    }
    .tech__main-content {
        grid-template-columns: 1fr;
    }

    .tech__steps {
        margin-bottom: 2rem;
    }

    .tech-step {
        margin-bottom: 2rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .tech__visuals-sticky-wrapper {
        position: static;
        height: 300px; /* A fixed height for the single image on mobile */
    }

    /* On mobile, only show the first image statically */
    .tech__image {
        position: relative;
        display: none;
    }
    .tech__image[data-image="1"] {
        display: block;
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Cases Section Styles --- */
.cases {
    padding: 6rem 0;
    background-color: var(--color-bg);
    overflow: hidden; /* Prevents unwanted scrollbars on the body */
}

.cases__scroll-wrapper {
    overflow-x: auto;
    padding: 2rem 0; /* Space for shadow and scrollbar */
    margin: 0 -1rem; /* Extend wrapper to hide scrollbar if needed */
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.cases__scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.cases__grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 85%; /* Each card takes up 85% of the viewport width */
    gap: 2rem;
}

.case-card {
    background-color: var(--color-surface);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    /* Animation setup */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Re-using the visibility class from before */
.case-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.case-card__image-wrapper {
    height: 250px;
}

.case-card__image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.case-card__content {
    padding: 1.5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.case-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background-color: var(--color-primary);
    color: var(--color-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
}

.case-card__title {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.case-card__description {
    color: var(--color-text-muted);
    line-height: 1.6;
}


/* --- Responsive for Cases Section --- */
@media (min-width: 769px) {
    /* On larger screens, make cards a bit smaller */
    .cases__grid {
        grid-auto-columns: 450px;
    }
}

@media (max-width: 768px) {
    .cases {
        padding: 4rem 0;
    }
    .cases__scroll-wrapper {
        overflow-x: visible;
        padding: 0;
        margin: 0;
    }
    .cases__grid {
        grid-auto-flow: row;
        grid-auto-columns: 1fr; /* Full width */
        gap: 2.5rem;
    }
    .case-card {
        margin-left: auto;
        margin-right: auto;
        max-width: 450px; /* Limit width on mobile for better readability */
    }
}

/* --- Process Section Styles --- */
.process {
    padding: 6rem 0;
    background-color: var(--color-surface);
}

.process__timeline {
    max-width: 650px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* The connecting line */
.process__timeline::before {
    content: '';
    position: absolute;
    top: 24px; /* Start below the first icon */
    bottom: 24px; /* End above the last icon */
    left: 23px;
    width: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(-50%);
}

.process-step {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 1.5rem;
    align-items: flex-start;
    position: relative;
    /* Animation setup */
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Re-using the visibility class again */
.process-step.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.process-step__icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-bg);
    z-index: 1; /* To be on top of the line */
}

.process-step__icon-wrapper .lucide {
    width: 24px;
    height: 24px;
}

.process-step__number {
    display: block;
    font-family: var(--font-headings);
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.process-step__title {
    font-family: var(--font-headings);
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.process-step__description {
    color: var(--color-text-muted);
    line-height: 1.7;
}


/* --- Responsive for Process Section --- */
@media (max-width: 768px) {
    .process {
        padding: 4rem 0;
    }
    .process__timeline::before {
        left: 24px;
    }
    .process-step {
        grid-template-columns: 48px 1fr;
    }
    .process-step__title {
        font-size: 1.5rem;
    }
}

/* --- Contact Section Styles --- */
.contact {
    padding: 6rem 0;
    background-color: var(--color-bg);
}

.contact__container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

.contact__title {
    font-family: var(--font-headings);
    font-size: 2.5rem;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.contact__description {
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.contact__direct-links {
    font-size: 1.1rem;
}
.contact__direct-links a {
    display: block;
    margin-top: 0.5rem;
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 500;
}
.contact__direct-links a:hover {
    color: var(--color-text);
}


/* Form Styles */
.contact__form-wrapper {
    background-color: var(--color-surface);
    padding: 3rem;
    border-radius: 16px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--color-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.2);
}

/* Custom Checkbox */
.form-group--checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.form-group--checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-text-muted);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}
.form-group--checkbox input[type="checkbox"]:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.form-group--checkbox input[type="checkbox"]:checked::after {
    content: '✔';
    position: absolute;
    color: var(--color-bg);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
}
.form-group--checkbox label a {
    color: var(--color-text);
    text-decoration: underline;
}

.contact-form__submit {
    width: 100%;
    padding: 1rem;
}

/* Success Message */
.form-success-message {
    display: none; /* Hidden by default */
    text-align: center;
    padding: 2rem;
}
.form-success-message__icon {
    color: var(--color-primary);
    margin-bottom: 1rem;
}
.form-success-message__icon .lucide {
    width: 60px;
    height: 60px;
}
.form-success-message__title {
    font-family: var(--font-headings);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 992px) {
    .contact__container {
        grid-template-columns: 1fr;
    }
    .contact__text-content {
        text-align: center;
    }
}

/* --- Cookie Pop-up Styles --- */
.cookie-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-surface);
    padding: 1.5rem 0;
    z-index: 200;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.2);
    transform: translateY(0);
    transition: transform 0.5s ease-in-out;
}

.cookie-popup.is-hidden {
    transform: translateY(150%);
}

.cookie-popup__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.cookie-popup__text {
    color: var(--color-text-muted);
}
.cookie-popup__text a {
    color: var(--color-text);
    text-decoration: underline;
}

.cookie-popup__btn {
    flex-shrink: 0; /* Prevent button from shrinking */
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-popup__container {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

/* --- Styles for Static Policy Pages --- */
.pages {
    padding: 5rem 0;
}

.pages .container {
    max-width: 800px; /* Limit width for better readability */
}

.pages h1,
.pages h2 {
    font-family: var(--font-headings);
    line-height: 1.3;
    margin-bottom: 1rem;
}

.pages h1 {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 2rem;
}

.pages h2 {
    font-size: 1.8rem;
    margin-top: 3rem;
}

.pages p {
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.pages ul,
.pages ol {
    color: var(--color-text-muted);
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.pages li {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.pages a {
    color: var(--color-primary);
    text-decoration: underline;
}

.pages a:hover {
    text-decoration: none;
}

.pages strong {
    color: var(--color-text);
    font-weight: 700;
}