* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --accent: #10b981;
    --accent-light: #d1fae5;
    --dark: #1e293b;
    --gray: #64748b;
    --light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 48px rgba(37,99,235,0.1);
}
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--dark);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}
section { scroll-margin-top: 72px; }
a, button, input, select, textarea { outline: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(37,99,235,0.45);
    outline-offset: 2px;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* NAV */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s;
}
nav.scrolled { box-shadow: var(--shadow); }
.nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.logo {
    font-size: 1.4rem; font-weight: 800; color: var(--primary);
    display: flex; align-items: center; gap: 8px; text-decoration: none;
    white-space: nowrap; overflow: hidden;
}
.logo i { font-size: 1.6rem; flex-shrink: 0; }
.logo .logo-text { overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
    text-decoration: none; color: var(--gray); font-size: 0.9rem;
    font-weight: 500; transition: color 0.2s; position: relative;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 2px; background: var(--primary);
    transition: width 0.3s;
}
.nav-links a:hover::after { width: 100%; }
.nav-cta {
    background: var(--primary); color: var(--white);
    padding: 10px 24px; border-radius: 8px; text-decoration: none;
    font-weight: 600; font-size: 0.9rem; transition: all 0.2s;
}
.nav-cta:hover { background: #1d4ed8; transform: translateY(-1px); }
/* CTA-ссылка внутри мобильного меню: видна только на телефоне */
.nav-cta-mobile { display: none; }
.burger { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--dark); }

/* HERO */
.hero {
    padding: 140px 0 100px;
    background: linear-gradient(135deg, var(--light) 0%, var(--primary-light) 50%, var(--accent-light) 100%);
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -50%; right: -20%;
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, transparent 70%);
}
.hero::after {
    content: ''; position: absolute; bottom: -30%; left: -10%;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(16,185,129,0.08) 0%, transparent 70%);
}

/* живой фон: слои за контентом, не блокируют клики */
.hero-bg {
    position: absolute; inset: 0; z-index: 1;
    pointer-events: none; overflow: hidden;
}
.hero-bg .blob {
    position: absolute; border-radius: 50%;
    will-change: transform;
}
.hero-bg .b1 {
    width: 520px; height: 520px; top: -12%; left: -8%;
    background: radial-gradient(circle, rgba(37,99,235,0.35) 0%, transparent 65%);
    animation: drift1 26s ease-in-out infinite alternate;
}
.hero-bg .b2 {
    width: 460px; height: 460px; bottom: -18%; right: -6%;
    background: radial-gradient(circle, rgba(16,185,129,0.3) 0%, transparent 65%);
    animation: drift2 32s ease-in-out infinite alternate;
}
.hero-bg .b3 {
    width: 380px; height: 380px; top: 22%; right: 22%;
    background: radial-gradient(circle, rgba(124,58,237,0.16) 0%, transparent 65%);
    animation: drift3 22s ease-in-out infinite alternate;
}

/* сетка «код-редактора»: данные текут */
.hero-bg .hero-grid {
    position: absolute; inset: 0;
    background-image:
        repeating-linear-gradient(0deg, rgba(37,99,235,0.07) 0 1px, transparent 1px 56px),
        repeating-linear-gradient(90deg, rgba(37,99,235,0.07) 0 1px, transparent 1px 56px);
    animation: gridMove 16s linear infinite;
}
.hero-bg .hero-grid::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(37,99,235,0.03) 50%, transparent 60%);
    background-size: 300% 300%;
    animation: gridSheen 11s ease-in-out infinite;
}

/* частицы: знания/данные в потоке */
.hero-bg .particle {
    position: absolute; width: 5px; height: 5px; border-radius: 50%;
    background: var(--primary); opacity: 0;
    top: var(--y); left: var(--x);
    animation: floatUp 18s linear infinite;
    animation-delay: var(--d, 0s);
}
.hero-bg .particle:nth-child(3n) { background: var(--accent); }
.hero-bg .particle:nth-child(3n+1) { background: var(--primary); }
.hero-bg .particle:nth-child(3n+2) { background: #7c3aed; }

/* скан-линия: автоматизация/сканер */
.hero-bg .scanline {
    position: absolute; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(37,99,235,0.28), transparent);
    animation: scan 8s ease-in-out infinite;
}

@keyframes drift1 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(60px, 40px, 0) scale(1.12); }
    100% { transform: translate3d(120px, -30px, 0) scale(0.95); }
}
@keyframes drift2 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-70px, -50px, 0) scale(1.15); }
    100% { transform: translate3d(-30px, 40px, 0) scale(0.9); }
}
@keyframes drift3 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-60px, 70px, 0) scale(1.2); }
}
@keyframes gridMove {
    from { background-position: 0 0, 0 0; }
    to { background-position: 0 56px, 56px 0; }
}
@keyframes gridSheen {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
}
@keyframes floatUp {
    0% { opacity: 0; transform: translate3d(0, 40px, 0); }
    15% { opacity: 0.7; }
    50% { opacity: 0.4; transform: translate3d(14px, -60px, 0); }
    85% { opacity: 0.6; }
    100% { opacity: 0; transform: translate3d(0, -140px, 0); }
}
@keyframes scan {
    0% { top: 8%; opacity: 0; }
    12% { opacity: 0.8; }
    88% { opacity: 0.6; }
    100% { top: 92%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-bg .blob, .hero-bg .hero-grid, .hero-bg .hero-grid::after,
    .hero-bg .particle, .hero-bg .scanline { animation: none !important; }
    .hero-bg .particle { opacity: 0.35; }
    .stat-item::before, .stat-item::after { animation: none !important; }
}
.hero-content { position: relative; z-index: 2; max-width: 720px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--white); padding: 6px 16px; border-radius: 100px;
    font-size: 0.85rem; color: var(--primary); font-weight: 600;
    margin-bottom: 24px; box-shadow: var(--shadow);
}
.hero-badge i { color: var(--accent); }
.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800;
    line-height: 1.15; margin-bottom: 20px;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    font-size: 1.15rem; color: var(--gray); margin-bottom: 36px;
    max-width: 560px;
}
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.btn-primary {
    background: var(--primary); color: var(--white);
    padding: 14px 32px; border-radius: 10px; text-decoration: none;
    font-weight: 600; font-size: 1rem; transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer;
}
.btn-primary:hover { background: #1d4ed8; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-outline {
    background: var(--white); color: var(--primary);
    padding: 14px 32px; border-radius: 10px; text-decoration: none;
    font-weight: 600; font-size: 1rem; transition: all 0.2s;
    border: 2px solid var(--primary); display: inline-flex; align-items: center; gap: 8px;
}
.btn-outline:hover { background: var(--primary-light); transform: translateY(-2px); }

.hero-stats {
    display: flex; gap: 20px; flex-wrap: wrap; margin-top: 48px;
}
.stat-item {
    position: relative; overflow: hidden;
    padding: 20px 32px; min-width: 180px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0.28));
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 8px 32px rgba(37,99,235,0.10), inset 0 1px 0 rgba(255,255,255,0.85);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
/* градиентная рамка-перелив (синий → зелёный) */
.stat-item::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    padding: 1px; pointer-events: none;
    background: linear-gradient(135deg, rgba(37,99,235,0.5), rgba(16,185,129,0.4), rgba(37,99,235,0.5));
    background-size: 220% 220%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: borderFlow 9s ease-in-out infinite;
}
/* сдержанный блик-перелив по стеклу */
.stat-item::after {
    content: ''; position: absolute; top: -20%; bottom: -20%; left: -70%;
    width: 45%; pointer-events: none;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,0.5), transparent);
    transform: skewX(-20deg);
    animation: sheen 8s ease-in-out infinite;
}
.stat-item:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(37,99,235,0.16), inset 0 1px 0 rgba(255,255,255,0.85); }
.stat-item h3 { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.stat-item p { font-size: 0.85rem; color: var(--gray); margin-top: 2px; }
@keyframes borderFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
@keyframes sheen {
    0%, 55% { left: -70%; }
    80%, 100% { left: 135%; }
}

/* SECTIONS */
section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-header .tag {
    display: inline-block; background: var(--primary-light);
    color: var(--primary); padding: 4px 14px; border-radius: 100px;
    font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 16px;
}
.section-header h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 800;
    margin-bottom: 16px;
}
.section-header p { color: var(--gray); max-width: 600px; margin: 0 auto; font-size: 1.05rem; }

/* PRODUCTS */
.products { background: var(--light); }
.products-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 32px;
}
.product-card {
    background: var(--white); border-radius: 16px; padding: 36px;
    border: 1px solid var(--border); transition: all 0.3s;
    position: relative; overflow: hidden;
}
.product-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.product-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0; transition: opacity 0.3s;
}
.product-card:hover::before { opacity: 1; }
.product-icon {
    width: 56px; height: 56px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-bottom: 20px;
}
.product-icon.blue { background: var(--primary-light); color: var(--primary); }
.product-icon.green { background: var(--accent-light); color: var(--accent); }
.product-icon.purple { background: #ede9fe; color: #7c3aed; }
.product-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; }
.product-card p { color: var(--gray); font-size: 0.95rem; margin-bottom: 20px; }
.product-features { list-style: none; }
.product-features li {
    padding: 6px 0; font-size: 0.9rem; color: var(--dark);
    display: flex; align-items: center; gap: 8px;
}
.product-features li i { color: var(--accent); font-size: 1rem; }
.product-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--primary); font-weight: 600; font-size: 0.9rem;
    text-decoration: none; margin-top: 20px; transition: gap 0.2s;
}
.product-link:hover { gap: 10px; }

/* PROJECTS */
.projects-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.project-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: 12px; padding: 28px; transition: all 0.3s;
    text-decoration: none; color: inherit; display: block;
}
.project-card:hover {
    border-color: var(--primary); box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.project-card .project-type {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--accent); margin-bottom: 12px;
}
.project-card h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.project-card p { color: var(--gray); font-size: 0.9rem; margin-bottom: 16px; }
.project-card .tech-stack { display: flex; gap: 8px; flex-wrap: wrap; }
.project-card .tech-tag {
    background: var(--light); padding: 4px 10px; border-radius: 6px;
    font-size: 0.75rem; color: var(--gray); font-weight: 500;
}

/* FORM */
.form-section { background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%); }
.form-wrapper {
    max-width: 680px; margin: 0 auto;
    background: var(--white); border-radius: 20px;
    padding: 48px; box-shadow: var(--shadow-lg);
}
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.form-group { display: flex; flex-direction: column; min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
    font-size: 0.85rem; font-weight: 600; color: var(--dark);
    margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; max-width: 100%;
    padding: 12px 16px; border: 1.5px solid var(--border);
    border-radius: 10px; font-size: 0.95rem; transition: border-color 0.2s;
    font-family: inherit; outline: none; background: var(--light);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary); background: var(--white);
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group a { color: var(--primary); }
.form-group input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.form-submit {
    margin-top: 24px; width: 100%;
    background: var(--primary); color: var(--white);
    padding: 16px; border: none; border-radius: 10px;
    font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: all 0.2s;
}
.form-submit:hover { background: #1d4ed8; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.form-success {
    display: none; text-align: center; padding: 40px;
}
.form-success i { font-size: 3rem; color: var(--accent); margin-bottom: 16px; }
.form-success h3 { font-size: 1.4rem; margin-bottom: 8px; }
.form-success p { color: var(--gray); }
.form-error {
    display: none; text-align: center; padding: 16px;
    background: #fef2f2; color: #b91c1c; border-radius: 10px;
    margin-bottom: 16px; font-size: 0.9rem;
}

/* TEAM */
.team { background: var(--light); }
.team-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
}
.team-card {
    background: var(--white); border-radius: 16px; padding: 32px;
    text-align: center; border: 1px solid var(--border); transition: all 0.3s;
}
.team-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.team-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; font-size: 1.2rem; color: var(--white); font-weight: 700;
}
.team-card h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.team-card .role { color: var(--primary); font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; }
.team-card .contacts { display: flex; flex-direction: column; gap: 6px; }
.team-card .contacts a {
    color: var(--gray); text-decoration: none; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: color 0.2s;
}
.team-card .contacts a:hover { color: var(--primary); }

/* TEXT BLOCK */
.text-section .section-header p { max-width: 720px; }
.text-content { max-width: 800px; margin: 0 auto; color: var(--gray); font-size: 1.05rem; overflow-wrap: anywhere; }
.text-content h1, .text-content h2, .text-content h3 { color: var(--dark); margin: 20px 0 10px; }
.text-content p { margin-bottom: 16px; }
.text-content ul, .text-content ol { margin: 0 0 16px 24px; }
.text-content a { color: var(--primary); }
.text-content img { max-width: 100%; border-radius: 12px; }

/* FOOTER */
footer {
    background: var(--dark); color: rgba(255,255,255,0.7);
    padding: 48px 0 24px;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr;
    gap: 48px; margin-bottom: 40px;
}
.footer-brand .logo { color: var(--white); margin-bottom: 12px; }
.footer-brand p { font-size: 0.9rem; max-width: 320px; }
.footer-col h5 { color: var(--white); font-size: 0.9rem; font-weight: 700; margin-bottom: 16px; }
.footer-col a {
    display: block; color: rgba(255,255,255,0.6); text-decoration: none;
    font-size: 0.85rem; padding: 4px 0; transition: color 0.2s;
}
.footer-col a:hover { color: var(--white); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px; text-align: center; font-size: 0.8rem;
}
.footer-bottom a { word-break: break-word; }

/* ANIMATIONS */
.fade-in { opacity: 0; transform: translateY(30px); transition: all 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .burger { display: block; }
    .nav-cta { display: none; }
    .nav-links.open {
        display: flex; flex-direction: column;
        position: absolute; top: 64px; left: 0; right: 0;
        background: var(--white); padding: 24px; gap: 8px;
        border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
        animation: menuDrop 0.25s ease;
    }
    .nav-links.open a { padding: 12px 0; font-size: 1rem; }
    .nav-links.open .nav-cta-mobile {
        display: flex !important;
        justify-content: center; margin-top: 8px; padding: 12px 24px;
        background: var(--primary); color: var(--white);
        border-radius: 8px; text-decoration: none;
        font-weight: 600; font-size: 0.95rem;
    }
    .hero { padding: 120px 0 60px; }
    /* тяжёлые анимации фона не нужны на мобильных: батарея и FPS */
    .hero-bg .particle, .hero-bg .scanline { display: none; }
    .hero-bg .hero-grid, .hero-bg .hero-grid::after { animation: none; }
    .hero-bg .blob { animation: none; }
    .hero-stats { flex-direction: column; gap: 14px; }
    .stat-item { padding: 16px 24px; min-width: 0; width: 100%; }
    .hero-buttons .btn-primary, .hero-buttons .btn-outline {
        width: 100%; justify-content: center;
    }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-wrapper { padding: 28px; }
    /* 16px — чтобы iOS не зумил страницу при фокусе на поле */
    .form-group input, .form-group select, .form-group textarea { font-size: 16px; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .products-grid { grid-template-columns: 1fr; }
    .team-grid { grid-template-columns: 1fr; }
    section { padding: 64px 0; }
}
@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero { padding: 104px 0 48px; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .form-wrapper { padding: 20px; }
    .form-submit { padding: 14px; }
}
@keyframes menuDrop {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
