/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

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

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #6366f1;
}

.nav-brand i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #6366f1;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    /* Было: padding: 0 2rem; чтобы текст не прятался под фиксированной шапкой, добавляем верхний отступ */
    padding: 120px 2rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    /* Улучшаем читаемость на градиенте */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.highlight {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    /* Небольшая тень для контраста */
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

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

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.code-animation {
    width: 300px;
    height: 200px;
    position: relative;
}

.code-line {
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    margin: 10px 0;
    border-radius: 10px;
    animation: codeTyping 3s infinite;
}

.code-line:nth-child(1) { width: 80%; animation-delay: 0s; }
.code-line:nth-child(2) { width: 60%; animation-delay: 0.5s; }
.code-line:nth-child(3) { width: 90%; animation-delay: 1s; }
.code-line:nth-child(4) { width: 70%; animation-delay: 1.5s; }

@keyframes codeTyping {
    0%, 50% { width: 0; }
    100% { width: var(--line-width, 80%); }
}

/* Services Section */
.services {
    padding: 5rem 0;
    background: #f8fafc;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #1e293b;
}

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

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.service-card p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.service-features {
    list-style: none;
    text-align: left;
}

.service-features li {
    padding: 0.5rem 0;
    color: #64748b;
    position: relative;
    padding-left: 1.5rem;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Portfolio Section */
.portfolio {
    padding: 5rem 0;
    background: white;
}

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

.portfolio-item {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    height: 250px;
    cursor: pointer;
}

.portfolio-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    position: relative;
    transition: all 0.3s ease;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    opacity: 1; /* было 0: делаем всегда видимым */
    transition: all 0.3s ease;
}

/* Убираем эффект наведения только в секции портфолио */
.portfolio-item:hover .portfolio-overlay {
    opacity: 1; /* принудительно всегда видим */
}
.portfolio-item:hover .portfolio-image {
    transform: none; /* на всякий случай, если где-то был масштаб */
}

.portfolio-overlay h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* New: price badge for portfolio overlays */
.portfolio-overlay .price-badge {
    margin-top: 0.5rem;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* New: spacing for buttons inside overlay */
.portfolio-overlay .btn {
    margin-top: 0.9rem;
}

/* About Section */
.about {
    padding: 5rem 0;
    background: #f8fafc;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.about-text p {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.achievements {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.achievement {
    text-align: center;
    flex: 1;
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.achievement h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.achievement p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.4;
}

.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.team-placeholder {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
}

/* Contact Section */
.contact {
    padding: 5rem 0;
    background: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h3 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.contact-info p {
    color: #64748b;
    margin-bottom: 2rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #64748b;
}

.contact-method i {
    width: 20px;
    color: #6366f1;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #6366f1;
}

/* Footer */
.footer {
    background: #1e293b;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: #334155;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-social a:hover {
    background: #6366f1;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #334155;
    color: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .hero {
        flex-direction: column;
        text-align: center;
        /* Было: padding: 2rem 1rem; добавим запас под шапку и безопасную область iOS */
        padding: calc(90px + 1rem + env(safe-area-inset-top)) 1rem 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-visual {
        margin-top: 2rem;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .achievements {
        justify-content: center;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .service-card,
    .portfolio-item {
        margin: 0 10px;
    }
    
    .achievements {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }
    
    .achievement {
        max-width: 300px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-card,
.portfolio-item {
    animation: fadeInUp 0.6s ease forwards;
}

.service-card:nth-child(2) { animation-delay: 0.1s; }
.service-card:nth-child(3) { animation-delay: 0.2s; }
.service-card:nth-child(4) { animation-delay: 0.3s; }

/* Pricing Section */
.pricing {
    padding: 5rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.pricing-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.pricing-card.featured {
    border-color: #6366f1;
    transform: scale(1.05);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-8px);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.pricing-header {
    text-align: center;
    margin-bottom: 2rem;
}

.pricing-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.price .currency {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
}

.price .amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: #6366f1;
}

.pricing-features {
    list-style: none;
    margin-bottom: 2rem;
}

.pricing-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    color: #475569;
}

.pricing-features li:before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-note {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #6366f1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pricing-note p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

.pricing-note strong {
    color: #1e293b;
}

/* Pricing Animation */
.pricing-card {
    animation: fadeInUp 0.6s ease forwards;
}

.pricing-card:nth-child(1) { animation-delay: 0.1s; }
.pricing-card:nth-child(2) { animation-delay: 0.2s; }
.pricing-card:nth-child(3) { animation-delay: 0.3s; }
.pricing-card:nth-child(4) { animation-delay: 0.4s; }

/* Responsive Pricing */
@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .pricing-card.featured {
        transform: none;
    }
    
    .pricing-card.featured:hover {
        transform: translateY(-8px);
    }
    
    .price .amount {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
}