/* Подключаем шрифты с Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Montserrat:wght@700&display=swap');

/* CSS-переменные для удобного управления цветами */
:root {
    --primary-color: #0088cc;
    --primary-hover: #0077b3;
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --border-color: #333333;
}

/* Глобальный сброс стилей и базовые настройки */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--heading-color);
    line-height: 1.2;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
}

p {
    margin-bottom: 1rem;
}

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

/* --- Стили для шапки (Header) --- */
.header {
    background-color: rgba(30, 30, 30, 0.8);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

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

.logo-link {
    display: flex;
    align-items: center;
    z-index: 101;
}

.logo-image {
    height: 40px;
    width: auto;
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-left: 12px;
}

/* --- Стили для навигации (ФИНАЛЬНЫЕ) --- */
.nav {
    display: flex;
    align-items: center;
}

.nav-item {
    position: relative;
    margin: 0 15px;
}

.nav-item a {
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    display: block;
    padding: 10px 0;
}

.nav-item a:hover {
    color: var(--primary-color);
}

/* Стили для выпадающего меню */
.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle::after {
    content: ' ▼';
    font-size: 0.7em;
    display: inline-block;
    margin-left: 5px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 250px;
    z-index: 100;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    padding: 10px 20px;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: rgba(0, 136, 204, 0.1);
}

/* Бургер-меню */
.burger-menu {
    display: none;
    cursor: pointer;
    z-index: 101;
}

.burger-menu div {
    width: 25px;
    height: 3px;
    background-color: var(--heading-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* --- Стили для главного экрана (Hero) --- */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding: 60px 0;
}

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

.hero .subtitle {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    color: #b0b0b0;
}

.social-proof {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #a0a0a0;
    opacity: 0.8;
}

/* --- Стили для кнопок --- */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

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

/* --- Общие стили для секций --- */
.section {
    padding: 80px 0;
}

.section-dark {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

#about p {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
}

.more-link-container {
    margin-top: 30px;
    font-size: 1.1rem;
}

.link {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

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

/* --- Стили для сетки портфолио и карточек-аккордеонов --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    cursor: pointer;
}

.card-title {
    flex-grow: 1;
}

.project-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.card-body {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s ease-out, opacity 0.3s ease-in-out, padding 0.5s ease-out;
    padding: 0 30px;
    overflow: hidden;
}

.project-card.active .card-body {
    max-height: 1000px;
    opacity: 1;
    padding: 0 30px 30px;
    transition: max-height 0.5s ease-in, opacity 0.5s ease-in, padding 0.5s ease-in;
}

.card-toggle-icon {
    width: 12px;
    height: 12px;
    border-right: 3px solid var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    transform: rotate(45deg);
    transition: transform 0.4s ease;
    margin-left: 20px;
}

.project-card.active .card-toggle-icon {
    transform: rotate(-135deg);
}

.project-card .project-description {
    margin-bottom: 20px;
}

.project-card .project-features {
    list-style-position: inside;
    padding-left: 5px;
    margin-bottom: 20px;
}

.project-card .project-features li {
    margin-bottom: 8px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.tech-stack span {
    background-color: rgba(0, 136, 204, 0.1);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- Стили для стека технологий --- */
.stack-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}
.stack-item {
    background-color: var(--surface-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
}

/* --- Секция "Процесс работы" --- */
.process-grid {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.process-step {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    flex-basis: 23%;
    flex-grow: 1;
}

.step-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    opacity: 0.5;
}

.process-step h4 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

/* --- Стили для секции "Наши клиенты" --- */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.client-item {
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.client-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* --- Секция FAQ --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: var(--surface-color);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
}

.faq-answer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out, padding 0.4s ease-out;
    padding: 0 25px;
}

.faq-answer p {
    margin: 0;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    opacity: 1;
    padding: 0 25px 25px;
    transition: max-height 0.4s ease-in, opacity 0.4s ease-in, padding 0.4s ease-in;
}

.faq-icon {
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(-135deg);
    margin-top: -5px;
}

/* --- Стили для контактов --- */
.contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-content h2 {
    margin-bottom: 15px;
}

.contact-content p {
    max-width: 600px;
    margin-bottom: 30px;
    color: #b0b0b0;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-secondary {
    background-color: #333;
    color: #fff;
}
.btn-secondary:hover {
    background-color: #444;
}

/* --- Стили для подвала сайта --- */
.footer {
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    color: #888;
}

.footer p {
    text-align: center;
}

/* --- Стили для страницы статьи в блоге --- */
.article-page .container {
    max-width: 800px;
}

.article-content h1 {
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 20px;
}

.article-intro {
    text-align: center;
    font-size: 1.2rem;
    color: #b0b0b0;
    margin-bottom: 40px;
}

.article-content h2 {
    text-align: left;
    margin-top: 40px;
    margin-bottom: 20px;
    border-left: 3px solid var(--primary-color);
    padding-left: 15px;
}

.article-content ul, .article-content ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.article-content li {
    margin-bottom: 10px;
}

.price-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.price-item {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.price-item h4 {
    margin-bottom: 10px;
}

.price-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* --- Стили для страницы Калькулятора --- */
.calculator-container {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.calc-step {
    display: none;
}

.calc-step.active {
    display: block;
}

.calc-step h2 {
    text-align: center;
    margin-bottom: 10px;
}

.step-subtitle {
    text-align: center;
    color: #a0a0a0;
    margin-bottom: 30px;
}

.calc-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.calc-option {
    border: 2px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.calc-option:hover {
    border-color: var(--primary-hover);
}

.calc-option.checkbox.selected {
    background-color: rgba(0, 136, 204, 0.1);
    border-color: var(--primary-color);
}

.calc-summary-text {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 30px;
    color: #b0b0b0;
}

.calc-result {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.calc-result h4 {
    margin-bottom: 10px;
}

#summary {
    white-space: pre-wrap;
    font-family: 'Inter', sans-serif;
    color: #b0b0b0;
    font-size: 0.9rem;
}

#send-to-telegram {
    display: block;
    width: 100%;
    text-align: center;
}

.calc-footer {
    margin-top: 40px;
}

.progress-bar-container {
    width: 100%;
    background-color: var(--border-color);
    border-radius: 5px;
    height: 8px;
    margin-bottom: 20px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 5px;
    transition: width 0.4s ease-in-out;
}

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

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

.btn-prev:hover {
    background-color: var(--surface-color);
}


/* --- Адаптивность для мобильных устройств --- */
@media (max-width: 1024px) {
    .nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(18, 18, 18, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 15px;
        transform: translateY(-100%);
        transition: transform 0.4s ease-in-out;
    }

    .nav.active {
        transform: translateY(0);
    }
    
    .nav-item {
        margin: 0;
    }

    .nav-item a {
        font-size: 1.5rem;
        padding: 15px 0;
    }
    
    .dropdown-toggle::after { display: none; }
    .dropdown-menu { 
        position: static; 
        display: block; 
        background: none; 
        border: none; 
        padding: 0; 
        min-width: auto;
        box-shadow: none;
        text-align: center;
    }
    .dropdown-menu a {
        font-size: 1.2rem;
        color: #a0a0a0;
    }

    .burger-menu {
        display: block;
    }

    .burger-menu.active .line1 { transform: rotate(-45deg) translate(-5px, 6px); }
    .burger-menu.active .line2 { opacity: 0; }
    .burger-menu.active .line3 { transform: rotate(45deg) translate(-5px, -6px); }
}

@media (max-width: 992px) {
    .process-grid {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    .logo-text {
        display: none;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .price-table {
        grid-template-columns: 1fr;
    }

    .calculator-container {
        padding: 20px;
    }
    
    .calc-options {
        grid-template-columns: 1fr;
    }
}