/* =========================================
   VARIABLES & RANDOMIZED THEME
   Theme: Neon Cyber-Tech (Dark Mode)
   Font: 'Outfit', sans-serif
   ========================================= */
:root {
    /* Color Palette */
    --color-bg: #0f172a;
    /* Slate 900 */
    --color-bg-alt: #1e293b;
    /* Slate 800 */
    --color-text: #f8fafc;
    /* Slate 50 */
    --color-text-muted: #94a3b8;

    --color-primary: #8b5cf6;
    /* Violet 500 */
    --color-primary-hover: #7c3aed;
    --color-secondary: #14b8a6;
    /* Teal 500 */

    --color-error: #ef4444;
    --color-success: #22c55e;

    /* Layout & UI */
    --border-radius: 1rem;
    /* 2xl radius look */
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --font-main: 'Outfit', sans-serif;
    /* Google Font */
    --container-width: 1200px;
    --header-height: 80px;
}

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

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;
    overflow-x: hidden;
}

/* Prevent background scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

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

ul {
    list-style: none;
    margin-top: 20px;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 4rem 0;
}

.text-center {
    text-align: center;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1,
h2,
h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--color-text);
}

h3 {
    font-size: 1.5rem;
}

/* =========================================
   COMPONENTS
   ========================================= */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn--primary {
    background-color: var(--color-primary);
    color: white;
}

.btn--secondary {
    background-color: var(--color-secondary);
    color: var(--color-bg);
}

.btn--outline {
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn--outline:hover {
    background-color: var(--color-primary);
    color: white;
}

.btn--sm {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

.btn--full {
    width: 100%;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(139, 92, 246, 0.15);
    color: var(--color-secondary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =========================================
   HEADER
   ========================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.logo__accent {
    color: var(--color-primary);
}

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

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

.nav__link--cta {
    background: var(--color-primary);
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
}

.nav__link--cta:hover {
    color: white;
    background: var(--color-primary-hover);
}

.nav__close {
    display: none;
}

/* =========================================
   BURGER MENU & MOBILE NAV
   ========================================= */

/* 1. Сховати бургер на великих екранах */
.burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 200;
}

.burger__line {
    display: block;
    width: 30px;
    height: 3px;
    background-color: white;
    /* Колір ліній */
    margin: 5px 0;
    transition: 0.3s;
    border-radius: 3px;
}

/* Кнопка закриття всередині меню */
.nav__close {
    display: none;
    /* Ховаємо на десктопі */
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
}

/* 2. Стилі для мобільних пристроїв (планшети та телефони) */
@media (max-width: 1024px) {

    /* Показуємо бургер */
    .burger {
        display: block;
    }

    /* Ховаємо звичайне меню і робимо його виїжджаючим */
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        /* Ховаємо за межі екрану праворуч */
        width: 100%;
        max-width: 350px;
        /* Ширина шторки меню */
        height: 100vh;
        background-color: #0f172a;
        /* Темний фон (slate-900) */
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
        padding: 80px 40px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 150;
        display: flex;
        flex-direction: column;
    }

    /* Клас active додається через JS для відкриття */
    .nav.active {
        right: 0;
    }

    /* Вертикальний список посилань */
    .nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: 2rem;
    }

    .nav__link {
        font-size: 1.5rem;
        font-weight: 500;
    }

    /* Показуємо хрестик закриття */
    .nav__close {
        display: block;
    }
}

/* =========================================
   HERO
   ========================================= */
.hero {
    margin-top: var(--header-height);
    min-height: 90vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at top right, #1e293b 0%, var(--color-bg) 60%);
    position: relative;
    overflow: hidden;
}

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

.hero__subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.hero__note {
    font-size: 0.85rem;
    color: var(--color-secondary);
    font-style: italic;
}

.hero__visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero__img {
    width: 100%;
    max-width: 500px;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@media (max-width: 768px) {
    .hero__container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero__subtitle {
        margin: 0 auto 2rem;
    }

    .hero__actions {
        justify-content: center;
    }
}

/* =========================================
   SERVICES
   ========================================= */
.services__grid {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: nowrap;
}

.service-card {
    background: var(--color-bg-alt);
    padding: 2rem;
    border-radius: var(--border-radius);
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    flex: 1 1 calc((100% - 6rem) / 4);
    min-width: 0;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
}

.service-card--highlight {
    background: linear-gradient(145deg, var(--color-bg-alt), #2e1065);
}

.service-card__icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.service-card__desc {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.link-arrow {
    color: var(--color-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.link-arrow:hover {
    text-decoration: underline;
}

.center-cta {
    text-align: center;
    margin-top: 3rem;
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

.center-cta a {
    color: var(--color-primary);
    font-weight: 600;
}

/* =========================================
   ABOUT
   ========================================= */
.about__wrapper {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.feature-list li {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    color: var(--color-text-muted);
}

.about__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-card {
    background: var(--color-bg-alt);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card__num {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-secondary);
}

@media (max-width: 768px) {
    .about__wrapper {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   REVIEWS
   ========================================= */
.reviews__container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding-bottom: 1rem;
}

.review-card {
    background: var(--color-bg-alt);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: 0.3s;
}

.review-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
}

.review-card__text {
    font-style: italic;
    margin-bottom: 2rem;
    color: var(--color-text-muted);
    flex-grow: 1;
}

.review-card__author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.avatar {
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================
   CONTACT & FORM
   ========================================= */
.contact__container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    background: var(--color-bg-alt);
    padding: 3rem;
    border-radius: var(--border-radius);
}

.contact__list li {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.form__group {
    margin-bottom: 1.5rem;
}

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

.form__input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--color-bg);
    color: white;
    font-family: inherit;
}

.form__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form__textarea {
    resize: vertical;
    min-height: 100px;
}

.error-msg {
    color: var(--color-error);
    font-size: 0.8rem;
    display: block;
    margin-top: 0.3rem;
}

.checkbox-group {
    display: flex;
    gap: 0.5rem;
    align-items: start;
}

.checkbox-group input {
    margin-top: 4px;
}

.link-btn {
    color: var(--color-primary);
    text-decoration: underline;
    padding: 0;
}

@media (max-width: 768px) {
    .contact__container {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
}

/* Make services responsive: stack on small screens to avoid horizontal scroll */
@media (max-width: 900px) {
    .services__grid {
        flex-direction: column;
        gap: 1.5rem;
        flex-wrap: nowrap;
    }

    .service-card {
        flex: 0 0 auto;
        width: 100%;
    }
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    background: #020617;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer h4 {
    color: white;
    margin-bottom: 1.2rem;
}

.footer ul li {
    color: var(--color-text-muted);
    margin-bottom: 0.6rem;
}

.footer ul li a,
.footer ul li button {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    text-align: left;
}

.footer ul li a:hover,
.footer ul li button:hover {
    color: var(--color-primary);
}

.footer__bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    color: #64748b;
    font-size: 0.85rem;
}

/* =========================================
   MODALS & COOKIES
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--color-bg-alt);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 92%;
    max-width: 760px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Modal typography: slightly smaller body text and tuned headings for readability */
.modal,
.modal__body {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text);
}

.modal h1 {
    font-size: clamp(1.25rem, 3.2vw, 1.8rem);
    margin-bottom: 0.6rem;
}

.modal h2 {
    font-size: clamp(1rem, 2.4vw, 1.2rem);
    margin-bottom: 0.5rem;
}

.modal h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

.modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--color-text-muted);
}

.modal__body {
    max-height: calc(100vh - 160px);
    overflow: auto;
    padding-right: 0.5rem;
}

.cookie-popup {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: white;
    color: #0f172a;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 800;
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-popup.active {
    bottom: 20px;
}

.cookie-actions {
    display: flex;
    gap: 0.5rem;
}

/* Spinner for Form */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   BURGER ANIMATION (FIX)
   ========================================= */

/* Додаємо плавність для ліній */
.burger .burger__line {
    transition: all 0.3s ease-in-out;
    transform-origin: center;
}

/* Коли меню відкрите (aria-expanded="true"), перетворюємо бургер на хрестик */

/* 1. Верхня лінія повертається і опускається */
.burger[aria-expanded="true"] .burger__line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

/* 2. Середня лінія зникає */
.burger[aria-expanded="true"] .burger__line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

/* 3. Нижня лінія повертається і піднімається */
.burger[aria-expanded="true"] .burger__line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Додатково: якщо у вас є окрема кнопка хрестика (.nav__close), 
   яка заважає або накладається, можна її приховати, 
   оскільки сам бургер тепер стає хрестиком */
@media (max-width: 1024px) {
    .nav__close {
        display: none;
        /* Прибираємо зайвий хрестик, якщо він заважає */
    }

    /* Переконуємось, що бургер поверх меню */
    .burger {
        z-index: 200;
        position: relative;
    }
}