/* ------------------- */
/* 0. GLOBAL STYLES   */
/* ------------------- */
:root {
    --bg-dark: #111827;
    --bg-element: #1F2937;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --accent: #2DD4BF;
    --accent-hover: #5EEAD4;

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

ul {
    list-style: none;
}

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

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


/* ------------------- */
/* 1. HEADER        */
/* ------------------- */
.header {
    padding: 20px 0;
    background-color: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bg-element);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header__logo {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}
.header__logo:hover {
    color: var(--text-primary);
}

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

.header__nav ul {
    display: flex;
    gap: 30px;
}

.header__nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.header__nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

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

.header__nav a:hover::after {
    width: 100%;
}

.header__burger {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 5px;
}

.header__burger svg {
    width: 28px;
    height: 28px;
}

/* Desktop styles */
@media (min-width: 768px) {
    .header__nav {
        display: block;
    }
    .header__burger {
        display: none;
    }
}


/* ------------------- */
/* 2. FOOTER        */
/* ------------------- */
.footer {
    background-color: var(--bg-element);
    padding: 60px 0 20px;
    border-top: 1px solid #374151;
}

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

.footer__logo {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    display: inline-block;
    margin-bottom: 10px;
}
.footer__logo:hover {
    color: var(--text-primary);
}

.footer__tagline {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 250px;
}

.footer__heading {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

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

.footer__list--contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer__address {
    align-items: flex-start;
}

.footer__icon {
    flex-shrink: 0;
    margin-top: 3px;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.footer__link {
    color: var(--text-secondary);
    font-size: 14px;
}
.footer__link:hover {
    color: var(--accent);
}

.footer__bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #374151;
    font-size: 14px;
    color: var(--text-secondary);
}

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

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

/* ------------------- */
/* 3. HERO SECTION     */
/* ------------------- */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 0;
    overflow: hidden;
    text-align: center;
}

.hero__animation-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    /* JS будет устанавливать grid-template-columns/rows */
    z-index: 0;
    opacity: 0.3;
}

.hero__animation-bg .dot {
    width: 2px;
    height: 2px;
    background-color: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: pulse 10s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    10% { opacity: 1; transform: scale(1); }
    20% { opacity: 0; transform: scale(0.5); }
}

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

.hero__content {
    max-width: 750px;
    margin: 0 auto;
}

.hero__title {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 20px;
    min-height: 80px; /* Резервируем место под заголовок */
}

.hero__title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInChar 0.5s forwards;
}

@keyframes fadeInChar {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero__subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 30px;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.button--primary {
    background-color: var(--accent);
    color: var(--bg-dark);
}

.button--primary:hover {
    background-color: var(--accent-hover);
    color: var(--bg-dark);
    transform: translateY(-3px);
}

/* Адаптивность для Hero */
@media (min-width: 768px) {
    .hero__title {
        font-size: 4.5rem;
        min-height: 120px;
    }
    .hero__subtitle {
        font-size: 1.25rem;
    }
}

/* ------------------------- */
/* 4. FEATURES SECTION (CARDS) */
/* ------------------------- */
.features-section {
    padding: 80px 0;
    background-color: var(--bg-dark);
}

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

.section-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--bg-element);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
}

.feature-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: rgba(45, 212, 191, 0.1);
    border-radius: 10px;
    margin-bottom: 20px;
}

.feature-card__icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.feature-card__title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .features-section {
        padding: 60px 0;
    }
    .section-title {
        font-size: 2rem;
    }
    .section-header {
        margin-bottom: 40px;
    }
}

/* ------------------------- */
/* 5. SHOWCASE SECTION      */
/* ------------------------- */
.showcase-section {
    padding: 80px 0;
    background-color: var(--bg-dark); /* Можно заменить на var(--bg-element) для контраста */
}

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

/* Добавляем отступ между showcase-item'ами */
.showcase-item + .showcase-item {
    margin-top: 80px;
}

.showcase-item__image-wrapper img {
    border-radius: 12px;
    width: 100%;
    height: auto;
    object-fit: cover;
    box-shadow: 0 0 35px rgba(45, 212, 191, 0.15);
    border: 1px solid var(--bg-element);
}

.showcase-item__title {
    font-size: 2rem;
    margin-bottom: 15px;
}

.showcase-item__description {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.7;
}

.showcase-item__list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.showcase-item__list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.showcase-item__list svg {
    color: var(--accent);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Модификатор для реверса колонок */
.showcase-item--reverse .showcase-item__image-wrapper {
    order: 2;
}
.showcase-item--reverse .showcase-item__text-wrapper {
    order: 1;
}


/* Адаптивность для Showcase */
@media (max-width: 992px) {
    .showcase-item {
        gap: 30px;
    }
    .showcase-item__title {
        font-size: 1.75rem;
    }
}


@media (max-width: 768px) {
    .showcase-section {
        padding: 60px 0;
    }
    .showcase-item,
    .showcase-item--reverse {
        grid-template-columns: 1fr;
    }

    .showcase-item--reverse .showcase-item__image-wrapper,
    .showcase-item--reverse .showcase-item__text-wrapper {
        order: 0; /* Сбрасываем порядок для мобильных */
    }

    .showcase-item__image-wrapper {
        margin-bottom: 30px;
    }
    
    .showcase-item + .showcase-item {
        margin-top: 60px;
    }
}

/* ------------------------- */
/* 6. EXAMPLES SECTION (TABS) */
/* ------------------------- */

.examples-section {
    padding: 80px 0;
    background-color: var(--bg-element); /* Слегка другой фон для выделения секции */
}

/* Навигация табов */
.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.tabs-nav__button {
    padding: 10px 20px;
    font-size: 1rem;
    font-family: var(--font-heading);
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.tabs-nav__button:hover {
    color: var(--text-primary);
}

.tabs-nav__button--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Панели табов */
.tab-pane {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

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

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

/* Сетка для примеров */
.example-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    background-color: var(--bg-dark);
    padding: 30px;
    border-radius: 12px;
}

.example-grid__title {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-family: var(--font-body);
    font-weight: 500;
}

.example-grid__text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.example-grid__image {
    width: 100%;
    border-radius: 8px;
}

.code-block {
    display: block;
    background-color: #0d1117; /* GitHub-like dark */
    color: var(--text-primary);
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid var(--bg-element);
}

pre {
    margin: 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .example-grid {
        grid-template-columns: 1fr;
    }
}

/* ------------------------- */
/* 7. CONTACT SECTION        */
/* ------------------------- */

.contact-section {
    padding: 80px 0;
}

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

.contact-grid__text .section-title,
.contact-grid__text .section-subtitle {
    text-align: left;
    margin: 0 0 15px 0;
    max-width: none;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-input {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-element);
    border: 1px solid #374151;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

.form-group--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group--checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.form-group--checkbox a {
    text-decoration: underline;
}

.button--full {
    width: 100%;
    justify-content: center;
    padding: 15px;
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Сообщение об успехе */
.form-message {
    padding: 30px;
    border: 1px solid var(--accent);
    background-color: rgba(45, 212, 191, 0.1);
    border-radius: 12px;
    text-align: center;
}

.form-message.form-message--hidden {
    display: none;
}

.form-message svg {
    color: var(--accent);
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
}

.form-message h4 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.form-message p {
    color: var(--text-secondary);
}


/* Адаптивность */
@media (max-width: 992px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .contact-grid__text {
        text-align: center;
    }
     .contact-grid__text .section-title,
    .contact-grid__text .section-subtitle {
        text-align: center;
    }
}
/* ------------------------- */
/* 8. COOKIE POP-UP          */
/* ------------------------- */

.cookie-popup {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background-color: var(--bg-element);
    padding: 20px 25px;
    border-radius: 12px;
    border: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    transform: translateY(150%);
    transition: transform 0.5s ease-in-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.cookie-popup__text {
    color: var(--text-secondary);
    margin: 0;
}

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

.button--secondary {
    background-color: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    flex-shrink: 0; /* Чтобы кнопка не сжималась */
}
.button--secondary:hover {
    background-color: rgba(45, 212, 191, 0.1);
    color: var(--accent);
    transform: none; /* Убираем эффект подпрыгивания для этой кнопки */
}

/* Адаптивность для попапа */
@media (max-width: 768px) {
    .cookie-popup {
        flex-direction: column;
        text-align: center;
        bottom: 10px;
        left: 10px;
        right: 10px;
    }
}
/* ------------------------- */
/* 9. STATIC PAGES STYLES    */
/* ------------------------- */

.pages {
    padding: 60px 0;
}

.pages .container {
    max-width: 800px; /* Делаем контейнер уже для лучшей читабельности текста */
}

.pages h1 {
    font-size: 3rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-element);
    color: var(--text-primary);
}

.pages h2 {
    font-size: 2rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.pages p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.pages ul, .pages ol {
    color: var(--text-secondary);
    padding-left: 25px;
    margin-bottom: 20px;
}

.pages li {
    margin-bottom: 10px;
    line-height: 1.8;
}

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

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

/* Адаптивность для текстовых страниц */
@media (max-width: 768px) {
    .pages h1 {
        font-size: 2.25rem;
    }
    .pages h2 {
        font-size: 1.75rem;
    }
}