/* --- VARIABLES --- */
:root {
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Space Grotesk', sans-serif;

    /* Palette: Dark Tech */
    --color-bg: #0b1121;       /* Very dark blue/slate */
    --color-bg-secondary: #151e32;
    --color-text: #e2e8f0;     /* Light slate */
    --color-text-muted: #94a3b8;
    
    --color-primary: #38bdf8;  /* Cyan/Light Blue */
    --color-primary-hover: #0ea5e9;
    --color-accent: #6366f1;   /* Indigo/Purple */

    --border-radius: 8px;
    --transition: all 0.3s ease;
    --container-width: 1200px;
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: #fff;
    line-height: 1.2;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn--primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(56, 189, 248, 0.3);
}

.btn--primary:hover {
    box-shadow: 0 6px 20px 0 rgba(56, 189, 248, 0.5);
    transform: translateY(-2px);
}

/* --- HEADER --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(11, 17, 33, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.header__nav {
    display: flex;
}

.header__menu {
    display: flex;
    gap: 32px;
}

.header__link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-text);
    position: relative;
}

.header__link:hover,
.header__link.active {
    color: var(--color-primary);
}

.header__link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-primary);
    transition: var(--transition);
}

.header__link:hover::after {
    width: 100%;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header__burger {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .header__nav {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--color-bg);
        flex-direction: column;
        padding: 40px 20px;
        transition: var(--transition);
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .header__nav.is-open {
        right: 0;
    }

    .header__menu {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .header__link {
        font-size: 1.2rem;
    }

    .header__burger {
        display: block;
    }
    
    .header__actions .btn {
        display: none; /* Hide standard button on mobile, add to menu if needed or keep header clean */
    }
}

/* --- MAIN (Padding for fixed header) --- */
.main {
    padding-top: var(--header-height);
    min-height: 60vh; /* Temporary min-height */
}

/* --- FOOTER --- */
.footer {
    background-color: var(--color-bg-secondary);
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer__logo {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

.footer__desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    max-width: 300px;
}

.footer__title {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: #fff;
}

.footer__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer__link {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer__link:hover {
    color: var(--color-primary);
    padding-left: 4px;
}

.footer__contacts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer__icon {
    width: 20px;
    height: 20px;
    color: var(--color-primary);
    flex-shrink: 0;
}

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

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

@media (max-width: 576px) {
    .footer__grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    min-height: 85vh; /* Almost full screen but leaving a peek for next section */
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 60px 0;
}

.hero__canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6; /* Slight transparency so text pops */
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--color-primary);
    margin-bottom: 24px;
    font-weight: 500;
}

.hero__badge i {
    width: 16px;
    height: 16px;
}

.hero__title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.1;
}

/* Gradient Text Effect */
.text-gradient {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__desc {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    line-height: 1.6;
}

.hero__actions {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 60px;
}

.btn--lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.hero__info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.hero__info i {
    width: 18px;
    height: 18px;
    color: var(--color-accent);
}

/* Stats Row */
.hero__stats {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 16px;
    gap: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.stat-divider {
    width: 1px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Responsive Hero */
@media (max-width: 768px) {
    .hero__title {
        font-size: 2.5rem;
    }
    
    .hero__actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .hero__stats {
        width: 100%;
        justify-content: space-between;
        padding: 15px;
        gap: 10px;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}

/* --- GLOBAL SECTION STYLES --- */
.section {
    padding: 100px 0;
    position: relative;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

/* Decorative underline for titles */
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
}

.section-subtitle {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.highlight {
    color: var(--color-primary);
    font-weight: 600;
}

/* --- SERVICES GRID --- */
.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--color-bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 40px 30px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Hover Effect: Glow & Lift */
.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 20px 40px -15px rgba(56, 189, 248, 0.15);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent 40%);
    opacity: 0;
    transition: var(--transition);
}

.service-card:hover::before {
    opacity: 1;
}

/* Active/Featured Card Style */
.service-card.active {
    border-color: rgba(56, 189, 248, 0.4);
    background: linear-gradient(145deg, var(--color-bg-secondary), rgba(56, 189, 248, 0.05));
}

.service-card__icon {
    width: 60px;
    height: 60px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--color-primary);
    transition: var(--transition);
}

.service-card__icon i {
    width: 32px;
    height: 32px;
}

.service-card:hover .service-card__icon {
    background: var(--color-primary);
    color: #fff;
    transform: rotateY(180deg); /* Small micro-interaction */
}

.service-card__title {
    font-size: 1.5rem;
    margin-bottom: 16px;
    color: #fff;
}

.service-card__desc {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 30px;
    flex-grow: 1; /* Pushes the link to bottom */
}

.service-card__link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.service-card__link i {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.service-card__link:hover i {
    transform: translateX(5px);
}

/* --- AI SOLUTIONS (Split Layout) --- */
.solution-wrapper {
    display: flex;
    align-items: center;
    gap: 60px;
}

.solution-content {
    flex: 1;
}

.solution-visual {
    flex: 1;
}

.badge-tech {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 215, 0, 0.1); /* Gold tint */
    color: #ffd700;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.badge-tech i {
    width: 16px;
    height: 16px;
}

.section-desc {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.7;
}

.solution-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
}

.solution-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.solution-item i {
    color: var(--color-primary);
    width: 20px;
    height: 20px;
}

/* Code Window Mockup */
.code-window {
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid #333;
    overflow: hidden;
    font-family: 'Consolas', 'Monaco', monospace;
    transition: transform 0.3s ease;
}

.code-window:hover {
    transform: translateY(-5px) scale(1.02);
}

.code-header {
    background: #252526;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #333;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.code-title {
    color: #999;
    font-size: 0.8rem;
    margin-left: 10px;
}

.code-body {
    padding: 20px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-line { display: block; }
.indent { padding-left: 20px; }
.empty { height: 10px; }

/* Syntax Highlighting */
.c-purple { color: #c678dd; }
.c-blue { color: #61afef; }
.c-yellow { color: #e5c07b; }
.c-green { color: #98c379; }
.c-orange { color: #d19a66; }
.comment { color: #5c6370; font-style: italic; }
.success { color: #98c379; margin-top: 10px; font-weight: bold; }


/* --- BLOG SECTION --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.blog-card {
    background: var(--color-bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.3);
}

.blog-card__image {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.blog-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card__image img {
    transform: scale(1.05);
}

.blog-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(11, 17, 33, 0.8);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.blog-card__content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.blog-meta i {
    width: 14px;
    height: 14px;
}

.blog-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: #fff;
    line-height: 1.4;
}

.blog-excerpt {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

.blog-link {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-link:hover {
    color: var(--color-accent);
}

/* Responsive for Split Section */
@media (max-width: 992px) {
    .solution-wrapper {
        flex-direction: column;
    }
    
    .solution-visual {
        width: 100%;
    }
}

/* --- CONTACT SECTION --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.contact-form-wrapper {
    background: var(--color-bg-secondary);
    padding: 40px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.form-title {
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

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

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #64748b;
    transition: var(--transition);
}

.form-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    background: rgba(11, 17, 33, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    color: #fff;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--color-primary);
}

/* Captcha Styles */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.captcha-problem {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 2px;
    background: rgba(255,255,255,0.05);
    padding: 10px 16px;
    border-radius: 8px;
}

.captcha-input {
    padding-left: 12px; /* Reset padding for number input */
    width: 80px;
    text-align: center;
}

.error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.form-checkbox input {
    margin-top: 3px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

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

/* Button & Loader */
.btn--full {
    width: 100%;
}

.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: rotation 1s linear infinite;
    margin-left: 10px;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn.loading .btn-text {
    display: none;
}
.btn.loading .loader {
    display: block;
}

/* Success Message */
.success-message {
    display: none; /* Hidden strictly */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg-secondary);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    z-index: 10;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 20px;
}

/* --- COOKIE POPUP --- */
.cookie-popup {
    position: fixed;
    bottom: -100px; /* Hidden initially */
    left: 20px;
    right: 20px;
    max-width: 400px;
    background: rgba(21, 30, 50, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    padding: 20px;
    z-index: 9999;
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

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

.cookie-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cookie-content p {
    font-size: 0.9rem;
    color: #e2e8f0;
}

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

.btn--sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    align-self: flex-end;
}

/* --- LEGAL PAGES STYLES --- */
/* Ці стилі для сторінок типу privacy.html */
.pages {
    padding: 120px 0 80px;
}

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

.pages h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 16px;
    color: #fff;
}

.pages p {
    margin-bottom: 16px;
    color: var(--color-text-muted);
}

.pages ul {
    margin-bottom: 16px;
    padding-left: 20px;
    list-style: disc;
    color: var(--color-text-muted);
}

.pages li {
    margin-bottom: 8px;
}

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

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