:root {
    --bg-primary: #05060a;
    --bg-secondary: #0d1117;
    --bg-contrast: #161b22;
    --border: rgba(148, 163, 184, 0.12);
    --text-main: #e6edf3;
    --text-muted: #9ba3af;
    --accent: #58a6ff;
    --accent-strong: #79c0ff;
    --accent-soft: rgba(88, 166, 255, 0.15);
    --danger: #ff7b72;
    --success: #3fb950;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-strong: 0 30px 60px rgba(5, 6, 10, 0.65);
    --shadow-soft: 0 12px 32px rgba(5, 6, 10, 0.45);
    --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-base);
    color: var(--text-main);
    background-color: var(--bg-primary);
    line-height: 1.6;
}

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

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

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

main {
    background-color: var(--bg-primary);
}

.container {
    width: min(1200px, 92vw);
    margin: 0 auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #2b79ff, #8bd6ff);
    color: #05060a;
    box-shadow: 0 14px 30px rgba(88, 166, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(88, 166, 255, 0.35);
}

.btn-secondary {
    background-color: rgba(148, 163, 184, 0.16);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: rgba(148, 163, 184, 0.3);
    transform: translateY(-1px);
}

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

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

.section-title {
    font-size: clamp(1.9rem, 1.2rem + 1.5vw, 2.6rem);
    font-weight: 800;
    text-align: center;
    margin: 0 0 50px 0;
}

.bg-light {
    background: linear-gradient(180deg, rgba(22, 27, 34, 0.7) 0%, rgba(5, 6, 10, 0.95) 100%);
}

/* Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(5, 6, 10, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.main-header.is-scrolled {
    background-color: rgba(5, 6, 10, 0.95);
    border-color: rgba(148, 163, 184, 0.25);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 18px 0;
}

.logo img {
    width: 132px;
    height: auto;
}

.nav-menu {
    flex: 1;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--text-main);
}

.header-contact {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header-phone {
    color: var(--text-main);
    font-weight: 600;
}

.nav-button,
.nav-button-lk {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-button {
    background-color: rgba(148, 163, 184, 0.16);
    color: var(--text-main);
}

.nav-button:hover {
    background-color: rgba(148, 163, 184, 0.3);
}

.nav-button-lk {
    background: linear-gradient(135deg, #2b79ff, #8bd6ff);
    color: #05060a;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    width: 44px;
    height: 44px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.is-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.is-active span:nth-child(2) {
    opacity: 0;
}

.hamburger.is-active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Hero */
.hero {
    background: radial-gradient(circle at top right, rgba(88, 166, 255, 0.12), transparent 45%),
        linear-gradient(180deg, rgba(13, 17, 23, 0.8) 0%, rgba(5, 6, 10, 0.95) 100%);
    padding: 120px 0 100px 0;
}

.hero-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 60px;
    align-items: center;
}

.hero-text h1 {
    font-size: clamp(2.4rem, 1.6rem + 2vw, 3.4rem);
    margin: 0 0 18px 0;
    line-height: 1.15;
}

.hero-text .slogan {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0 0 24px 0;
}

.hero-advantages {
    display: grid;
    gap: 12px;
    margin-bottom: 36px;
}

.hero-advantage-item {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background-color: rgba(148, 163, 184, 0.08);
    font-weight: 500;
}

.hero-image {
    justify-self: center;
}

.hero-image img {
    width: min(420px, 90%);
    filter: drop-shadow(0 24px 40px rgba(88, 166, 255, 0.3));
}

/* Grid sections */
.competencies-grid,
.target-groups-grid,
.portfolio-grid,
.cooperation-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.competency-card,
.target-card,
.cooperation-card,
.case-card {
    background: var(--bg-contrast);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 26px 28px;
    box-shadow: var(--shadow-soft);
}

.competency-card h4,
.target-card h4,
.cooperation-card h4,
.case-card h4 {
    margin: 0 0 14px 0;
}

.competency-card ul,
.case-card ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-muted);
}

.case-card {
    position: relative;
    overflow: hidden;
}

.case-card .case-meta {
    margin-top: 22px;
    display: flex;
    gap: 18px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Work stages */
.stages-timeline {
    display: grid;
    gap: 18px;
    margin-bottom: 40px;
}

.stage-item {
    padding: 18px 22px;
    background-color: rgba(148, 163, 184, 0.08);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
}

.prototype-info {
    background: var(--bg-contrast);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-soft);
}

/* Guarantees */
.guarantees-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.guarantee-card {
    background: var(--bg-contrast);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 28px;
    box-shadow: var(--shadow-soft);
}

/* FAQ */
.faq-accordion {
    display: grid;
    gap: 16px;
}

.faq-item {
    background: var(--bg-contrast);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.faq-item.is-open {
    border-color: var(--accent);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 18px 22px;
    font-size: 1rem;
    font-weight: 600;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 22px;
    color: var(--text-muted);
    transition: max-height 0.3s ease;
}

.faq-item.is-open .faq-answer {
    max-height: 200px;
    padding-bottom: 20px;
}

/* Forms */
.form-container-box {
    background: var(--bg-contrast);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 40px;
    box-shadow: var(--shadow-strong);
}

.form-title {
    margin: 0 0 30px 0;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-group,
.form-group-multi {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label,
.form-group-multi label {
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group-multi input {
    background-color: rgba(15, 21, 32, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.checkbox-group {
    display: grid;
    gap: 12px;
}

.checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(148, 163, 184, 0.1);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.checkbox-item input {
    accent-color: var(--accent);
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.form-policy {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Page headers */
.page-header {
    padding: 100px 0 80px 0;
    background: linear-gradient(180deg, rgba(45, 67, 120, 0.25) 0%, rgba(5, 6, 10, 0.95) 100%);
}

.page-title {
    font-size: clamp(2rem, 1.3rem + 1.8vw, 3rem);
    font-weight: 800;
    margin: 0 0 16px 0;
}

.page-subtitle {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 680px;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.service-card {
    background: var(--bg-contrast);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.service-card h3 {
    margin: 0 0 14px 0;
    font-size: 1.35rem;
}

.service-description {
    color: var(--text-muted);
    margin: 0;
}

/* Portfolio filters */
.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 10px 20px;
    border-radius: 999px;
    background-color: rgba(148, 163, 184, 0.12);
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: var(--accent);
    color: #05060a;
}

.portfolio-gallery {
    display: grid;
    gap: 24px;
}

.portfolio-card-detailed {
    background: var(--bg-contrast);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-shadow: var(--shadow-soft);
}

.portfolio-card-detailed .card-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-strong);
}

.portfolio-card-detailed ul {
    margin: 0;
    padding-left: 18px;
    color: var(--text-muted);
}

.portfolio-card-detailed .card-footer {
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Contacts */
.contact-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.contact-page-section {
    background: linear-gradient(180deg, rgba(13, 17, 23, 0.85) 0%, rgba(5, 6, 10, 0.95) 100%);
}

.contact-info,
.contact-form-container {
    background: var(--bg-contrast);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 32px;
    box-shadow: var(--shadow-soft);
}

.contact-info h3,
.contact-form-container h3 {
    margin-top: 0;
    font-size: 1.4rem;
}

.info-item {
    margin-bottom: 20px;
    color: var(--text-muted);
}

.info-item strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 6px;
}

.map-placeholder iframe {
    width: 100%;
    height: 320px;
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(5, 6, 10, 0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
}

.modal .modal-content {
    background: var(--bg-contrast);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 30px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.modal-close-button {
    position: absolute;
    top: 16px;
    right: 20px;
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--text-muted);
}

/* About */
.about-us {
    background: linear-gradient(180deg, rgba(88, 166, 255, 0.08) 0%, rgba(5, 6, 10, 1) 100%);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    align-items: center;
}

.about-text p {
    color: var(--text-muted);
}

.about-image img {
    width: min(360px, 100%);
    margin: 0 auto;
    filter: drop-shadow(0 20px 40px rgba(88, 166, 255, 0.32));
}

.our-values {
    background-color: rgba(15, 21, 32, 0.9);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.value-card {
    background: var(--bg-contrast);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 26px;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.value-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.call-to-action .btn-primary {
    margin-top: 10px;
}

/* Portfolio page */
.portfolio-page {
    background: linear-gradient(180deg, rgba(13, 17, 23, 0.9) 0%, rgba(5, 6, 10, 1) 100%);
}

.portfolio-page .portfolio-card-detailed {
    min-height: 360px;
}

.portfolio-page h3 {
    margin: 0;
}

/* Footer */
.main-footer {
    background-color: #04050a;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
    padding: 60px 0;
}

.main-footer h4 {
    margin-top: 0;
    font-size: 1.1rem;
}

.main-footer p,
.main-footer li,
.main-footer span {
    color: var(--text-muted);
    margin: 0;
    line-height: 1.7;
}

.footer-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu li + li {
    margin-top: 10px;
}

.footer-tags .tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-tags span {
    background-color: rgba(148, 163, 184, 0.12);
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    padding: 20px 0 40px 0;
    text-align: center;
    color: var(--text-muted);
}

/* Auth pages */
.page-content.auth-page {
    padding: 80px 0;
}

.auth-form-container {
    width: min(420px, 90vw);
    margin: 0 auto;
    background: var(--bg-contrast);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 40px;
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.auth-form-container .page-title {
    margin: 0 0 26px 0;
}

.auth-form-container .form-group {
    text-align: left;
    margin-bottom: 18px;
}

.auth-form-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.auth-form-container input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.2);
    background-color: rgba(15, 21, 32, 0.72);
    color: var(--text-main);
}

.auth-form-container input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.auth-form-container .btn {
    width: 100%;
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 992px) {
    .main-nav {
        gap: 16px;
    }
    .nav-links {
        position: absolute;
        top: 68px;
        right: 20px;
        left: 20px;
        flex-direction: column;
        align-items: flex-start;
        background: rgba(5, 6, 10, 0.92);
        border: 1px solid rgba(148, 163, 184, 0.2);
        border-radius: var(--radius-md);
        padding: 24px;
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
    .nav-links.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    .header-contact {
        display: none;
    }
    .hamburger {
        display: flex;
    }
    .hero {
        padding-top: 100px;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 60px 0;
    }
    .form-container-box {
        padding: 28px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .hero-container {
        gap: 40px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 80px 0 70px 0;
    }
    .form-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .auth-form-container {
        padding: 28px;
    }
}
