/* ======== GLOBAL STYLES & SETUP ======== */

/* 1. FONT IMPORT */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Manrope:wght@700;800&display=swap');

/* 2. CSS VARIABLES */
:root {
    --font-heading: 'Manrope', sans-serif;
    --font-body: 'Inter', sans-serif;

    --color-bg: #F8F9FA;
    --color-text: #1E293B;
    --color-primary: #6A11CB;
    --color-primary-light: #8A4FFF;
    --color-footer-bg: #111827;
    --color-footer-text: #9CA3AF;

    --gradient-primary: linear-gradient(to right, var(--color-primary), #2575FC);
}

/* 3. BASE & RESET */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

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

ul {
    list-style: none;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 800;
}

/* ======== HEADER ======== */
.header {
    background-color: var(--color-bg);
    padding: 1rem 0;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background-color: rgba(248, 249, 250, 0.8);
}

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

.header__logo {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
}

.header__nav {
    display: none; /* Mobile first: nav is hidden */
}

@media (min-width: 768px) {
    .header__nav {
        display: block; /* Show nav on larger screens */
    }
}

.header__menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header__menu-link {
    font-weight: 500;
    position: relative;
    padding-bottom: 0.5rem;
}

.header__menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease-out;
}

.header__menu-link:hover {
    color: var(--color-primary);
}

.header__menu-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}


/* ======== FOOTER ======== */
.footer {
    background-color: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 4rem 0 2rem 0;
    margin-top: 5rem; /* To separate from future content */
}

.footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 640px) {
    .footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer__logo {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    display: inline-block;
}

.footer__tagline {
    font-size: 0.9rem;
    max-width: 250px;
}

.footer__heading {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

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

.footer__link:hover {
    color: #fff;
}

.footer__column--contact .footer__list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer__column--contact i {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
    flex-shrink: 0;
    color: var(--color-primary-light);
}

.footer__bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    font-size: 0.9rem;
}

/* ======== HERO SECTION ======== */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    text-align: center;
    overflow: hidden; /* Важно, чтобы canvas не выходил за пределы */
    color: #fff; /* Текст будет на темном фоне canvas */
}

.hero__canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Помещаем canvas за контентом */
    background-color: var(--color-footer-bg);
}

.hero__container {
    position: relative;
    z-index: 1;
}

.hero__title {
    font-size: clamp(2.5rem, 7vw, 4.5rem); /* Адаптивный размер шрифта */
    font-weight: 800;
    line-height: 1.2;
    background: linear-gradient(to right, #ffffff, #dcdcdc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    max-width: 900px;
    margin: 0 auto;
}

.hero__subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    max-width: 650px;
    margin: 1.5rem auto 2.5rem auto;
    color: var(--color-footer-text);
    font-weight: 400;
}

/* ======== GLOBAL BUTTON STYLE ======== */
.button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 500;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.button:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(44, 102, 228, 0.3);
}

.hero__cta {
    font-weight: 500;
}

/* ======== GLOBAL SECTION STYLES ======== */
.section {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.section__title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 2.75rem);
    text-align: center;
    margin-bottom: 4rem;
    line-height: 1.3;
}

/* ======== CONCEPTS SECTION ======== */
.concepts {
    background-color: var(--color-bg);
}

.concepts__grid {
    display: grid;
    gap: 1.5rem;
    /* Mobile: 1 column */
    grid-template-columns: 1fr;
}

/* Tablet: 2 columns */
@media (min-width: 640px) {
    .concepts__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 4 columns */
@media (min-width: 1024px) {
    .concepts__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.concepts__card {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.concepts__card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(30, 41, 59, 0.08);
}

.concepts__card-icon {
    margin-bottom: 1.5rem;
    display: inline-block;
}

.concepts__card-icon i {
    width: 48px;
    height: 48px;
    color: var(--color-primary);
    stroke-width: 1.5;
}

.concepts__card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.concepts__card-description {
    font-size: 0.95rem;
    color: #4B5563;
    line-height: 1.6;
}

/* ======== CASES SECTION ======== */
.cases {
    background-color: #ffffff; /* Белый фон для контраста */
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.cases__wrapper {
    display: flex;
    flex-direction: column;
    gap: 5rem; /* Увеличим отступ между кейсами */
}

.cases__item {
    display: grid;
    align-items: center;
    gap: 2rem;
    grid-template-columns: 1fr; /* 1 колонка на мобильных */
}

@media (min-width: 768px) {
    .cases__item {
        grid-template-columns: 1fr 1fr; /* 2 колонки на десктопе */
        gap: 3rem;
    }
}

/* Модификатор для чередования колонок */
@media (min-width: 768px) {
    .cases__item--reversed .cases__image-wrapper {
        order: 2;
    }
    .cases__item--reversed .cases__content {
        order: 1;
    }
}

.cases__image-wrapper img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(30, 41, 59, 0.07);
}

.cases__tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(106, 17, 203, 0.1);
    color: var(--color-primary);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.cases__title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 1.25rem;
}

.cases__content p {
    color: #4B5563;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.cases__content p:last-child {
    margin-bottom: 0;
}

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

/* ======== TOOLS SECTION ======== */
.tools {
    background-color: var(--color-footer-bg);
}

.section__title--light {
    color: #fff;
}

.tools__scroller {
    width: 100%;
    overflow: hidden;
    /* Маска с градиентом для плавного исчезновения по краям */
    -webkit-mask: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    mask: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}

.tools__list {
    display: flex;
    gap: 3rem;
    list-style: none;
    padding: 1rem 0;
    /* Анимация будет добавлена после дублирования элементов */
    animation: scroll 40s linear infinite;
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }
    to {
        /* Сдвигаем на половину ширины, так как список удвоен */
        transform: translateX(-50%);
    }
}

.tools__list:hover {
    animation-play-state: paused;
}

.tools__list li {
    flex-shrink: 0; /* Запрещаем элементам сжиматься */
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--color-footer-text);
    transition: color 0.3s ease;
    cursor: default;
}

.tools__list li:hover {
    color: #fff;
}

/* ======== PROCESS SECTION ======== */
.process {
    background-color: var(--color-bg);
}

.process__timeline {
    position: relative;
    max-width: 650px; /* Ограничиваем ширину для лучшей читаемости */
    margin: 0 auto;
}

.process__item {
    display: flex;
    gap: 1.5rem;
    position: relative;
}

@media (min-width: 768px) {
    .process__item {
        gap: 2.5rem;
    }
}

.process__visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.process__icon {
    width: 60px;
    height: 60px;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1; /* Чтобы иконка была над линией */
}

.process__icon i {
    width: 28px;
    height: 28px;
    color: var(--color-primary);
    stroke-width: 2;
}

.process__line {
    width: 2px;
    flex-grow: 1;
    background-color: #e5e7eb;
}

/* У последнего элемента нет линии */
.process__item:last-child .process__line {
    display: none;
}

.process__content {
    padding-bottom: 3.5rem;
}

/* Убираем нижний отступ у последнего элемента */
.process__item:last-child .process__content {
    padding-bottom: 0;
}

.process__title {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    margin-bottom: 0.75rem;
}

.process__description {
    color: #4B5563;
    line-height: 1.7;
}

/* ======== CONTACT SECTION ======== */
.contact {
    background-color: #f9fafb; /* Слегка сероватый фон для выделения */
    border-top: 1px solid #e5e7eb;
}

.section__subtitle {
    text-align: center;
    max-width: 500px;
    margin: -3rem auto 3rem auto;
    color: #4B5563;
}

.contact__wrapper {
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

@media (min-width: 768px) {
    .contact__wrapper {
        padding: 3rem;
    }
}

.form__group {
    margin-bottom: 1.5rem;
}

.form__label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form__input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.15);
}

.form__input.is-invalid {
    border-color: #ef4444; /* Красный для ошибок */
}

.form__group--checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form__group--checkbox input[type="checkbox"] {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.form__label--checkbox {
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 0;
    color: #4B5563;
}

.form__label--checkbox a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

.contact__button {
    width: 100%;
    padding: 1rem;
}

/* Success Message */
.form__success-message {
    display: none; /* Изначально скрыто */
    text-align: center;
    padding: 2rem;
}
.form__success-icon {
    color: #10b981; /* Зеленый цвет успеха */
    margin-bottom: 1rem;
}
.form__success-icon i {
    width: 60px;
    height: 60px;
}
.form__success-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
/* ======== COOKIE POPUP ======== */
.cookie-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 1rem;
    
    display: none; /* Изначально скрыт */
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    
    z-index: 200;
    border-top: 1px solid #374151;
    transition: transform 0.3s ease-in-out;
    transform: translateY(100%);
}

.cookie-popup.is-visible {
    display: flex;
    transform: translateY(0);
}

.cookie-popup__text {
    margin: 0;
    text-align: center;
}

.cookie-popup__text a {
    color: #fff;
    text-decoration: underline;
}

.cookie-popup__button {
    padding: 0.5rem 1.5rem;
    flex-shrink: 0; /* Чтобы кнопка не сжималась */
}

/* ======== STYLES FOR STATIC PAGES (TERMS, PRIVACY, ETC.) ======== */
.pages {
    padding: 4rem 0;
    background-color: #fff;
}

.pages .container {
    max-width: 800px; /* Ограничиваем ширину для комфортного чтения */
}

.pages h1, .pages h2 {
    color: var(--color-text);
}

.pages h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    margin-bottom: 2rem;
}

.pages h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

.pages p {
    color: #4B5563;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.pages ul, .pages ol {
    color: #4B5563;
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

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

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

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

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