:root {
    --bg: #0a0a0f;
    --surface: #12121a;
    --surface2: #1a1a26;
    --accent: #00e6a0;
    --accent2: #6c5ce7;
    --text: #e0e0e0;
    --text2: #a0a0b0;
    --border: #252535;
    --glow: 0 0 20px rgba(0, 230, 160, 0.3);
    --glow-purple: 0 0 20px rgba(108, 92, 231, 0.3);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Grid Background */
.grid-bg {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image:
        linear-gradient(rgba(108,92,231,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(108,92,231,0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, black 30%, transparent 70%);
}

#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* Header */
header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    padding: 16px 0; transition: background 0.3s, backdrop-filter 0.3s;
}
header.scrolled {
    background: rgba(10,10,15,0.85); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border);
}
header .container { display: flex; justify-content: space-between; align-items: center; }

.logo {
    font-family: var(--mono); font-weight: 700; font-size: 1.4rem;
    letter-spacing: -0.5px; color: #fff; text-decoration: none;
    display: flex; align-items: center; gap: 8px;
}
.logo-dot {
    width: 10px; height: 10px; background: var(--accent); border-radius: 50%;
    box-shadow: var(--glow); animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%,100% { box-shadow: 0 0 8px var(--accent); }
    50% { box-shadow: 0 0 24px var(--accent), 0 0 48px rgba(0,230,160,0.4); }
}

.nav-links { display: flex; list-style: none; gap: 32px; align-items: center; }
.nav-links a {
    color: var(--text2); text-decoration: none; font-size: 0.9rem;
    transition: color 0.3s; font-weight: 500;
}
.nav-links a:hover { color: #fff; }
.btn-nav {
    background: var(--surface2); border: 1px solid var(--border); color: #fff;
    padding: 10px 20px; border-radius: 8px; font-size: 0.9rem;
    cursor: pointer; transition: all 0.3s; text-decoration: none; font-weight: 500;
}
.btn-nav:hover { border-color: var(--accent); box-shadow: var(--glow); }

/* Burger */
.burger {
    display: none; flex-direction: column; gap: 5px; cursor: pointer;
    z-index: 101; padding: 8px; background: none; border: none;
}
.burger span { display: block; width: 26px; height: 2px; background: #fff; border-radius: 2px; transition: all 0.3s; }
.burger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* Mobile Menu */
.mobile-menu {
    position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
    background: rgba(18,18,26,0.97); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); z-index: 100;
    padding: 100px 32px 40px; transition: right 0.4s cubic-bezier(0.4,0,0.2,1);
    border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px;
}
.mobile-menu.active { right: 0; }
.mobile-menu a { color: #fff; text-decoration: none; font-size: 1.1rem; font-weight: 600; padding: 12px 0; border-bottom: 1px solid var(--border); transition: color 0.3s; display: block; }
.mobile-menu a:hover { color: var(--accent); }
.mobile-menu .btn-mobile { margin-top: 20px; background: var(--accent); color: #0a0a0f; text-align: center; padding: 14px; border-radius: 10px; font-weight: 700; border: none; font-size: 1rem; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.overlay.active { opacity: 1; pointer-events: all; }

/* Hero */
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 80px; position: relative; z-index: 1; }
.hero-content { max-width: 700px; }
.hero-badge {
    display: inline-block; background: rgba(108,92,231,0.15);
    border: 1px solid rgba(108,92,231,0.3); color: var(--accent2);
    padding: 6px 16px; border-radius: 20px; font-size: 0.85rem;
    font-weight: 600; letter-spacing: 0.5px; margin-bottom: 24px; font-family: var(--mono);
}
.hero h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; line-height: 1.15; margin-bottom: 20px; letter-spacing: -1px; }
.hero h1 .accent { background: linear-gradient(135deg, var(--accent), #00c9ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 1.15rem; color: var(--text2); margin-bottom: 32px; max-width: 500px; line-height: 1.7; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.btn-primary {
    background: var(--accent); color: #0a0a0f; border: none; padding: 14px 32px;
    border-radius: 10px; font-weight: 700; font-size: 1rem; cursor: pointer;
    transition: all 0.3s; text-decoration: none; letter-spacing: 0.3px;
}
.btn-primary:hover { box-shadow: 0 0 40px rgba(0,230,160,0.5); transform: translateY(-2px); }
.btn-outline {
    background: transparent; border: 1px solid var(--border); color: #fff;
    padding: 14px 32px; border-radius: 10px; font-weight: 600; font-size: 1rem;
    cursor: pointer; transition: all 0.3s; text-decoration: none;
}
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,0.03); }
.hero-stats { display: flex; gap: 48px; margin-top: 56px; flex-wrap: wrap; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -1px; font-family: var(--mono); }
.stat-value.green { color: var(--accent); }
.stat-value.purple { color: var(--accent2); }
.stat-label { font-size: 0.85rem; color: var(--text2); margin-top: 4px; }

/* Sections */
section { padding: 100px 0; position: relative; z-index: 1; }
.section-label { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; margin-bottom: 12px; }
.section-title { font-size: clamp(2rem, 3.5vw, 2.8rem); font-weight: 800; letter-spacing: -1px; margin-bottom: 16px; }
.section-subtitle { color: var(--text2); font-size: 1.05rem; max-width: 500px; margin-bottom: 48px; }

/* Services */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.service-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 32px; transition: all 0.4s; position: relative; overflow: hidden;
}
.service-card::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(108,92,231,0.06), transparent 60%);
    pointer-events: none;
}
.service-card:hover { border-color: rgba(108,92,231,0.5); transform: translateY(-4px); box-shadow: var(--glow-purple); }
.service-icon {
    width: 44px; height: 44px; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
}
.service-icon svg { width: 22px; height: 22px; }
.service-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.3px; }
.service-card p { color: var(--text2); font-size: 0.9rem; line-height: 1.6; }
.service-tag { display: inline-block; background: var(--surface2); padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; margin-top: 12px; color: var(--accent2); font-family: var(--mono); }

/* Process */
.process-list { display: flex; flex-direction: column; gap: 24px; max-width: 700px; }
.process-item { display: flex; gap: 20px; align-items: flex-start; }
.process-num { font-family: var(--mono); font-size: 2rem; font-weight: 800; color: var(--accent); min-width: 50px; line-height: 1; opacity: 0.8; }
.process-text h4 { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.process-text p { color: var(--text2); font-size: 0.9rem; }

/* Tech */
.tech-marquee { display: flex; gap: 40px; flex-wrap: wrap; justify-content: center; opacity: 0.6; }
.tech-item { font-family: var(--mono); font-size: 0.9rem; color: var(--text2); padding: 10px 18px; background: var(--surface); border-radius: 8px; border: 1px solid var(--border); }

/* Portfolio */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.portfolio-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; transition: all 0.4s; cursor: pointer; }
.portfolio-card:hover { border-color: var(--accent); box-shadow: var(--glow); transform: translateY(-2px); }
.portfolio-img {
    width: 100%; height: 200px; background: var(--surface2);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.portfolio-img img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: filter 0.3s;
}
/* Затемнение изображений в карточках (для белых сайтов) */
.portfolio-img .img-overlay {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s;
    pointer-events: none;
}
.portfolio-card:hover .img-overlay {
    background: rgba(0, 0, 0, 0.1);
}
/* эффект shimmer поверх всего */
.portfolio-img::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(0,230,160,0.03) 50%, transparent 60%);
    animation: shimmer 3s infinite;
    pointer-events: none;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.portfolio-info { padding: 20px; }
.portfolio-info h4 { font-weight: 700; margin-bottom: 4px; }
.portfolio-info .tags { color: var(--accent2); font-size: 0.8rem; font-family: var(--mono); }

/* Modal (окно просмотра с зумом и панорамированием) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}
.modal-content {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
}
.modal-close:hover {
    color: var(--accent);
    background: rgba(0,0,0,0.8);
}
.modal-zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    background: rgba(0,0,0,0.7);
    padding: 8px 16px;
    border-radius: 40px;
    backdrop-filter: blur(4px);
    z-index: 10;
}
.zoom-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.zoom-btn:hover {
    background: var(--accent);
    color: #0a0a0f;
    border-color: var(--accent);
    transform: scale(1.05);
}
.modal-image-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: grab;
}
.modal-image-container:active {
    cursor: grabbing;
}
.modal-img {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    transition: transform 0.05s linear;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
    transform-origin: center center;
}
.drag-hint {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    color: #ccc;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-family: var(--mono);
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.modal-image-container[data-zoom="true"] .drag-hint {
    opacity: 0;
}
@keyframes modalFade {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-content {
    animation: modalFade 0.3s;
}

/* CTA */
.cta-section { text-align: center; padding: 120px 0; }
.cta-box {
    background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
    padding: 56px 32px; position: relative; overflow: hidden;
}
.cta-box::before {
    content: ''; position: absolute; width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(108,92,231,0.12), transparent 70%);
    top: -50px; right: -50px; pointer-events: none;
}
.cta-box h2 { font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 12px; position: relative; }
.cta-box p { color: var(--text2); margin-bottom: 28px; position: relative; }
.contact-form { display: flex; gap: 12px; max-width: 500px; margin: 0 auto; position: relative; flex-wrap: wrap; justify-content: center; }
.contact-form input {
    flex: 1; min-width: 200px; padding: 14px 18px; background: var(--surface2);
    border: 1px solid var(--border); border-radius: 10px; color: #fff;
    font-family: var(--font); font-size: 0.95rem; outline: none; transition: border 0.3s;
}
.contact-form input:focus { border-color: var(--accent); }
.contact-form button {
    background: var(--accent); color: #0a0a0f; border: none; padding: 14px 28px;
    border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 0.95rem; transition: all 0.3s;
}
.contact-form button:hover { box-shadow: var(--glow); }
.form-status { margin-top: 12px; font-size: 0.9rem; min-height: 24px; position: relative; }
.form-status.success { color: var(--accent); }
.form-status.error { color: #ff6b6b; }
.form-status.loading { color: var(--accent2); }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 32px 0; text-align: center; color: var(--text2); font-size: 0.85rem; position: relative; z-index: 1; }
footer a { color: var(--accent); text-decoration: none; }

/* Cursor Glow */
.cursor-glow {
    position: fixed; width: 400px; height: 400px; border-radius: 50%;
    pointer-events: none; z-index: 0;
    background: radial-gradient(circle, rgba(108,92,231,0.08), transparent 70%);
    transform: translate(-50%, -50%); transition: opacity 0.3s;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .burger { display: flex; }
    .hero-stats { gap: 24px; }
    .stat-value { font-size: 1.5rem; }
    section { padding: 60px 0; }
    .cta-box { padding: 32px 20px; }
    .cta-box h2 { font-size: 1.6rem; }
    .services-grid { grid-template-columns: 1fr; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .tech-marquee { gap: 12px; }
    .tech-item { font-size: 0.8rem; padding: 8px 14px; }
    .contact-form { flex-direction: column; align-items: stretch; }
    .contact-form input { min-width: auto; }
    .modal-close { top: 20px; right: 20px; }
    .modal-zoom-controls { bottom: 20px; }
    .drag-hint { bottom: 70px; font-size: 0.7rem; white-space: nowrap; }
}