/* 
 * THEME: Bot Dev / Dark Obsidian & Neon Purple
 * FONT: Space Grotesk (CHANGE_FONT_HERE - замените на другой Google Font кроме Inter)
 * 
 * Цветовая палитра:
 * --primary: Vivid Violet (#8b5cf6) - основной акцентный цвет
 * --accent: Mint Green (#34d399) - вторичный акцент
 * --bg: Deep Obsidian (#0b0f19) - темный фон
 * --bg-card: (#151b2b) - фон карточек
 * --text: (#f3f4f6) - основной текст
 * --text-muted: (#9ca3af) - приглушенный текст
 */
:root {
    --primary: #8b5cf6;
    /* Vivid Violet */
    --primary-hover: #7c3aed;
    --accent: #34d399;
    /* Mint Green */
    --bg: #0b0f19;
    /* Deep Obsidian */
    --bg-card: #151b2b;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --border: #1f2937;
    --success: #10b981;
    --error: #ef4444;

    --radius: 8px;
    --radius-xl: 16px;
    --font-main: 'Space Grotesk', monospace, sans-serif;
    --header-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

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

h1 {
    font-size: 2.5rem;
    letter-spacing: -0.05em;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    h1 {
        font-size: 3.5rem;
    }

    h2 {
        font-size: 2.5rem;
    }
}

.text-accent {
    color: var(--primary);
}

.text-gradient {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn--primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.39);
}

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

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

.btn--outline:hover {
    background: rgba(139, 92, 246, 0.1);
}

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

.btn--small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(52, 211, 153, 0.1);
    color: var(--accent);
    border-radius: 50px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(11, 15, 25, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo__img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    display: block;
}

.logo:hover .logo__img {
    transform: scale(1.1) rotate(5deg);
}

/* Nav */
.nav__list {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav__link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

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

.nav__link.btn-nav {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Mobile Nav */
.burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.burger span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    transition: 0.3s;
}

@media (max-width: 1024px) {
    .burger {
        display: block;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: 0.4s ease-in-out;
    }

    .nav.active {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .nav__link {
        font-size: 1.5rem;
    }

    .burger[aria-expanded="true"] span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .burger[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .burger[aria-expanded="true"] span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
}

/* Hero */
.hero {
    position: relative;
    padding: 160px 0 100px;
    min-height: 80vh;
    display: flex;
    align-items: center;
    /* Fallback gradient */
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.1), transparent 40%);
    /* Background image with lazy loading support */
    background-image: url('./images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.7);
    z-index: 0;
}

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

.hero__note {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1rem;
    display: block;
    padding: 0.5rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--error);
    border-radius: var(--radius);
    display: inline-block;
}

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

@media (min-width: 768px) {
    .hero__content--split {
        grid-template-columns: 1.2fr 1fr;
        text-align: left;
    }
}

.hero__text {
    z-index: 1;
}

.hero__visual {
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    max-width: 300px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

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

.hero-card__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

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

.hero__actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .hero__actions {
        justify-content: flex-start;
    }
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-header p {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Masonry Services Grid - Unique Layout */
.services__masonry {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: minmax(200px, auto);
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .services__masonry {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, auto);
    }

    .service-card--large {
        grid-column: span 2;
        grid-row: span 1;
    }

    .service-card--tall {
        grid-column: span 1;
        grid-row: span 2;
    }

    .service-card--wide {
        grid-column: span 2;
        grid-row: span 1;
    }
}

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

    .service-card--large {
        grid-column: span 2;
    }

    .service-card--tall {
        grid-column: span 1;
        grid-row: span 2;
    }

    .service-card--wide {
        grid-column: span 3;
    }
}

.service-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    transition: var(--transition);
}

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

.service-card .icon-box {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.service-card.highlight {
    background: linear-gradient(145deg, var(--bg-card), rgba(139, 92, 246, 0.1));
    border-color: rgba(139, 92, 246, 0.3);
}

/* Features Split */
.features__wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

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

    .features__wrapper--reversed {
        grid-template-columns: 1fr 1fr;
    }

    .features__wrapper--reversed .features__visual {
        order: -1;
    }
}

.feature-list {
    list-style: none;
    margin-top: 2rem;
}

.feature-list li {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--accent);
}

.feature-list strong {
    display: block;
    color: var(--text);
}

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

/* Abstract Visual for Features */
.abstract-bot {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    position: relative;
    border: 1px solid var(--border);
}

.bot-ui .msg {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    width: fit-content;
}

.bot-ui .reply {
    background: rgba(139, 92, 246, 0.2);
    margin-left: auto;
    color: white;
}

/* Masonry Blog/Reviews */
.masonry-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.blog-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 0;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 350px;
    transition: var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.blog-card__image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
    background: var(--bg);
}

.blog-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transition: transform 0.5s ease;
    display: block;
    filter: none !important;
    -webkit-filter: none !important;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

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

.blog-card__image::after {
    display: none;
}

.blog-card>.blog-meta,
.blog-card>h3,
.blog-card>p,
.blog-card>.author {
    padding: 0 1.5rem;
}

.blog-card>.blog-meta {
    padding-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.blog-card>h3 {
    margin-bottom: 0.5rem;
}

.blog-card>p {
    margin-bottom: 1rem;
    flex-grow: 1;
}

.blog-card>.author {
    padding-bottom: 1.5rem;
}

.blog-card.accent-card {
    border-top: 4px solid var(--accent);
}

.blog-meta {
    font-size: 0.8rem;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.blog-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.blog-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-style: italic;
}

.author {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
}

/* Contact Form */
.contact__container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
    padding: 3rem;
    border-radius: var(--radius-xl);
}

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

.contact-details {
    list-style: none;
    margin-top: 2rem;
    color: var(--text-muted);
    line-height: 2;
}

.contact-details li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.contact-icon {
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 0.2rem;
}

.contact-details a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-details a:hover {
    color: var(--primary);
}

.contact-details span {
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.error-msg {
    color: var(--error);
    font-size: 0.8rem;
    position: absolute;
    bottom: -20px;
    left: 0;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

/* Footer */
.footer {
    background: #05070a;
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

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

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer a,
.footer button {
    color: var(--text-muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    text-align: left;
    padding: 0;
}

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

.footer__col p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.footer__col p:last-child {
    margin-bottom: 0;
    margin-top: 1rem;
    font-size: 0.85rem;
}

/* Cookie Popup */
.cookie-popup {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--primary);
    padding: 1.5rem;
    border-radius: var(--radius);
    z-index: 9999;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s, transform 0.3s;
}

.cookie-popup.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-card);
    padding: 2rem;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: var(--radius-xl);
    z-index: 2001;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.modal.active,
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    margin-top: 1rem;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    color: var(--text-muted);
    line-height: 1.7;
    padding-right: 0.5rem;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.modal-body h4 {
    color: var(--text);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.modal-body h4:first-of-type {
    margin-top: 0.5rem;
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-body ul,
.modal-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.modal-body a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

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

.modal-body strong {
    color: var(--text);
    font-weight: 600;
}

.success-icon {
    font-size: 3rem;
    color: var(--success);
    margin-bottom: 1rem;
}

/* Lazy loading images - без blur для отзывов */
.blog-card__image img[loading="lazy"] {
    filter: none !important;
    opacity: 1;
}

img[loading="lazy"]:not(.blog-card__image img) {
    filter: blur(5px);
    transition: filter 0.3s;
}

img[loading="lazy"]:not(.blog-card__image img).loaded {
    filter: blur(0);
}

/* Form status messages */
.form-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.9rem;
}

.form-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.form-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Spinner for form submission */
.btn--loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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