/* --- Змінні та налаштування --- */
:root {
    --color-primary: #0f172a; /* Темний Slate */
    --color-secondary: #1e293b; /* Трохи світліший темний */
    --color-accent: #7c3aed; /* Electric Violet */
    --color-accent-hover: #6d28d9;
    --color-text: #334155; /* Основний текст */
    --color-text-light: #94a3b8; /* Світлий текст */
    --color-bg: #f8fafc; /* Дуже світлий фон сторінки */
    --color-white: #ffffff;
    
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    --container-width: 1240px;
    --header-height: 80px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

ul {
    list-style: none;
}

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

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

/* --- Container --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: var(--color-accent);
    color: var(--color-white);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: var(--font-body);
}

.btn:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* --- Header --- */
.header {
    height: var(--header-height);
    background-color: var(--color-white);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}

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

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

.logo__img {
    width: 40px;
    height: 40px;
}

.header__nav {
    display: flex;
}

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

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

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

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

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

.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.burger span {
    width: 25px;
    height: 3px;
    background-color: var(--color-primary);
    transition: var(--transition);
}

/* --- Main --- */
.main {
    flex: 1; /* Притискає футер до низу */
}

/* --- Footer --- */
.footer {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    padding: 60px 0 30px;
    margin-top: auto;
}

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

.logo--footer .logo__text {
    color: var(--color-white);
}

.footer__desc {
    margin-top: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 300px;
}

.footer__copy {
    margin-top: 24px;
    font-size: 0.85rem;
    opacity: 0.6;
}

.footer__title {
    font-family: var(--font-heading);
    color: var(--color-white);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

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

.footer__link {
    font-size: 0.95rem;
}

.footer__link:hover {
    color: var(--color-accent);
    padding-left: 5px;
}

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

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.contact-item__icon {
    color: var(--color-accent);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.contact-item__link:hover {
    color: var(--color-white);
    text-decoration: underline;
}

/* --- Adaptive (Mobile) --- */
@media (max-width: 992px) {
    .header__nav {
        display: none; /* Тут можна реалізувати JS toggle пізніше */
    }
    
    .footer__container {
        grid-template-columns: 1fr 1fr;
    }
    
    .burger {
        display: flex;
    }
    
    .btn--header {
        display: none; /* Ховаємо кнопку на мобільному для простоти, або можна перенести в меню */
    }
}

@media (max-width: 576px) {
    .footer__container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 90vh; /* Майже на весь екран */
    display: flex;
    align-items: center;
    background-color: var(--color-bg);
    overflow: hidden;
    padding: 60px 0;
}

.hero__canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Найнижчий шар */
    opacity: 0.6; /* Щоб не заважало читати текст */
}

.hero__container {
    position: relative;
    z-index: 2; /* Контент поверх анімації */
    display: flex;
    justify-content: flex-start; /* Вирівнювання вліво */
}

.hero__content {
    max-width: 650px;
    background: radial-gradient(circle at center, rgba(248, 250, 252, 0.8) 0%, rgba(248, 250, 252, 0) 100%); /* Легка підсвітка під текстом для читабельності */
    backdrop-filter: blur(2px);
    padding: 20px;
    border-radius: 20px;
}

/* Бейдж зверху */
.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: rgba(124, 58, 237, 0.1);
    color: var(--color-accent);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(124, 58, 237, 0.2);
}

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

.hero__title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--color-primary);
    margin-bottom: 24px;
}

.text-accent {
    color: var(--color-accent);
    position: relative;
    display: inline-block;
}

/* Підкреслення для акценту */
.text-accent::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 12px;
    background-color: rgba(124, 58, 237, 0.2);
    z-index: -1;
    transform: skewX(-15deg);
}

.hero__desc {
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: 40px;
    max-width: 90%;
}

/* Кнопки */
.hero__actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

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

.btn--outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 14px 30px;
}

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

/* Блок довіри */
.hero__trust {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.avatars {
    display: flex;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #cbd5e1;
    border: 2px solid var(--color-white);
    margin-left: -10px;
}

.avatar:first-child {
    margin-left: 0;
    background-color: #94a3b8;
}

/* Адаптив Hero */
@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 100px 0 60px;
        text-align: center;
    }

    .hero__container {
        justify-content: center;
    }

    .hero__content {
        align-items: center;
        display: flex;
        flex-direction: column;
    }
    
    .hero__title {
        font-size: 2.5rem;
    }
    
    .hero__actions {
        justify-content: center;
    }
}

/* --- Services (Protocol List) --- */
.services {
    padding: 100px 0;
    background-color: var(--color-white);
}

.section-header {
    margin-bottom: 60px;
    max-width: 700px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 16px;
}

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

/* Список */
.service-list {
    border-top: 1px solid #e2e8f0;
}

.service-row {
    display: grid;
    grid-template-columns: 80px 2fr 1fr 80px; /* Структура колонок */
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding: 40px 0;
    transition: var(--transition);
    cursor: default;
}

.service-row:hover {
    background-color: #f8fafc;
    padding-left: 20px; /* Ефект зсуву */
    padding-right: 20px;
    border-color: var(--color-accent);
}

/* Номер */
.service-row__id {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-text-light);
    opacity: 0.5;
}

.service-row:hover .service-row__id {
    color: var(--color-accent);
    opacity: 1;
}

/* Основний контент */
.service-row__title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 8px;
    transition: var(--transition);
}

.service-row:hover .service-row__title {
    color: var(--color-accent);
}

.service-row__desc {
    font-size: 0.95rem;
    color: var(--color-text);
    max-width: 90%;
}

.highlight-bg {
    background: linear-gradient(120deg, rgba(124, 58, 237, 0.1) 0%, rgba(124, 58, 237, 0) 100%);
    padding: 2px 4px;
    border-radius: 4px;
}

/* Мета-дані (теги) */
.service-row__meta {
    text-align: right;
    padding-right: 20px;
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-light);
    background-color: var(--color-white);
}

/* Кнопка дії */
.service-row__action {
    display: flex;
    justify-content: flex-end;
}

.btn-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.service-row:hover .btn-icon {
    background-color: var(--color-accent);
    color: var(--color-white);
    transform: rotate(45deg); /* Поворот стрілки */
}

/* Адаптив Services */
@media (max-width: 768px) {
    .service-row {
        grid-template-columns: 1fr auto; /* Спрощуємо грід */
        grid-template-areas: 
            "id action"
            "main main"
            "meta meta";
        gap: 16px;
        padding: 30px 0;
    }

    .service-row:hover {
        padding-left: 10px;
        padding-right: 10px;
    }

    .service-row__id {
        grid-area: id;
    }

    .service-row__action {
        grid-area: action;
    }

    .service-row__main {
        grid-area: main;
    }
    
    .service-row__meta {
        grid-area: meta;
        text-align: left;
        padding-right: 0;
    }
}

/* --- Technology (IDE Style) --- */
.technology {
    padding: 100px 0;
    background-color: #f1f5f9; /* Трохи темніший за основний фон для контрасту */
}

.ide-wrapper {
    display: flex;
    background-color: var(--color-primary); /* Темний фон IDE */
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
    min-height: 400px;
}

/* Sidebar */
.ide-sidebar {
    width: 250px;
    background-color: #0f172a; /* Темний */
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
}

.ide-header {
    padding: 15px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #334155;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.red { background-color: #ef4444; }
.yellow { background-color: #eab308; }
.green { background-color: #22c55e; }

.ide-tabs {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ide-tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 10px 15px;
    text-align: left;
    cursor: pointer;
    border-radius: 6px;
    font-family: 'Courier New', monospace; /* Моноширинний для коду */
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.ide-tab:hover {
    background-color: rgba(255,255,255,0.05);
    color: var(--color-white);
}

.ide-tab.active {
    background-color: rgba(124, 58, 237, 0.2);
    color: var(--color-accent);
}

.ide-tab i {
    width: 16px;
    height: 16px;
}

/* Content Pane */
.ide-content {
    flex: 1;
    padding: 40px;
    background-color: #1e293b; /* Трохи світліший темний для контенту */
    color: #cbd5e1;
    position: relative;
}

.ide-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}

.ide-pane.active {
    display: block;
}

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

/* Code Syntax Highlighting Style */
.code-line {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    margin-bottom: 5px;
    color: #e2e8f0;
}

.code-comment {
    font-family: 'Courier New', monospace;
    color: #64748b;
    margin-bottom: 20px;
    font-style: italic;
}

.c-purple { color: #c084fc; }
.c-blue { color: #60a5fa; }
.c-green { color: #4ade80; }
.c-orange { color: #fb923c; }

.ide-pane h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

.ide-pane p {
    line-height: 1.7;
    color: #94a3b8;
}

/* --- Blog Section --- */
.blog {
    padding: 100px 0;
    background-color: var(--color-bg);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.blog-card {
    background-color: var(--color-white);
    border: 1px solid #e2e8f0;
    padding: 30px;
    border-radius: 12px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-color: var(--color-accent);
}

.blog-card__date {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 15px;
}

.blog-card__title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

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

.blog-card__excerpt {
    font-size: 0.95rem;
    color: var(--color-text);
    margin-bottom: 25px;
    flex: 1; /* Притискає лінк до низу */
}

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

.blog-card__link:hover {
    gap: 10px;
}

.blog-card__link i {
    width: 16px;
    height: 16px;
}

/* --- Adaptive --- */
@media (max-width: 992px) {
    .blog-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .ide-wrapper {
        flex-direction: column;
    }
    
    .ide-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #334155;
    }
    
    .ide-tabs {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .ide-tab {
        white-space: nowrap;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* --- FAQ (Accordion) --- */
.faq {
    padding: 80px 0;
    background-color: var(--color-white);
}

.accordion {
    max-width: 800px;
    margin: 0 auto;
    border-top: 1px solid #e2e8f0;
}

.accordion-item {
    border-bottom: 1px solid #e2e8f0;
}

.accordion-header {
    width: 100%;
    padding: 20px 0;
    background: none;
    border: none;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-primary);
    cursor: pointer;
    transition: var(--color-transition);
}

.accordion-header:hover {
    color: var(--color-accent);
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
    color: var(--color-accent);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-body {
    padding-bottom: 20px;
    color: var(--color-text);
    line-height: 1.6;
}

/* --- Contact Section --- */
.contact {
    padding: 100px 0;
    background-color: var(--color-primary); /* Темний фон для контактів */
    color: var(--color-white);
}

.contact__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.contact__title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.contact__desc {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 30px;
}

.contact__list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.05rem;
}

.contact__list li i {
    color: var(--color-accent);
}

/* Form Styles */
.contact__form-wrapper {
    background-color: var(--color-white);
    padding: 40px;
    border-radius: 16px;
    color: var(--color-text);
}

.form__group {
    margin-bottom: 20px;
}

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

.form__input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.form__input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.captcha-group label {
    color: var(--color-accent);
    font-weight: 700;
}

.form__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 0.85rem;
}

.form__checkbox a {
    color: var(--color-accent);
    text-decoration: underline;
}

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

.form-message {
    margin-top: 15px;
    text-align: center;
    font-weight: 500;
    min-height: 24px;
}
.form-message.success { color: #22c55e; }
.form-message.error { color: #ef4444; }

/* --- Cookie Popup --- */
.cookie-popup {
    position: fixed;
    bottom: -100px; /* Сховано */
    left: 0;
    width: 100%;
    background-color: var(--color-white);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    padding: 20px;
    z-index: 9999;
    transition: bottom 0.5s ease;
}

.cookie-popup.show {
    bottom: 0;
}

.cookie-content {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cookie-content p {
    font-size: 0.9rem;
    margin: 0;
}

.btn--sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* --- Pages Styles (Privacy, Terms etc) --- */
/* Ці стилі будуть працювати, коли ти створиш privacy.html з <main><section class="pages">... */
.pages {
    padding: 80px 0;
    background-color: var(--color-white);
}

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

.pages h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--color-secondary);
}

.pages p {
    margin-bottom: 16px;
    line-height: 1.7;
}

.pages ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 20px;
}

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

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

/* --- Adaptive --- */
@media (max-width: 768px) {
    .contact__container {
        grid-template-columns: 1fr;
    }
    
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
}