:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #10b981;
    --bg-color: #0f172a;
    --surface-color: rgba(30, 41, 59, 0.7);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Mesh Gradient */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        radial-gradient(circle at 15% 50%, rgba(37, 99, 235, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 25%);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

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

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn i,
.btn svg,
.btn i::before {
    margin-right: 12px !important;
}

.btn i:last-child {
    margin-right: 0 !important;
    margin-left: 12px !important;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.23);
    transform: translateY(-2px);
}

.btn-outline {
    border-color: var(--surface-border);
    background: transparent;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 0;
    height: 80px;
    /* Fixed height for CLS prevention */
    display: flex;
    align-items: center;
    transition: background 0.3s, border-bottom 0.3s, backdrop-filter 0.3s;
}

#scroll-sentinel {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100px;
    /* Достаточно, чтобы засечь прокрутку */
    pointer-events: none;
    visibility: hidden;
}

/* Смещение для якорей, чтобы липкая шапка не перекрывала контент */
[id] {
    scroll-margin-top: 100px;
}

@media (max-width: 768px) {
    [id] {
        scroll-margin-top: 40px;
    }
}

.header.scrolled {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--surface-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.logo {
    display: flex;
    flex-direction: column;
    min-height: 40px;
    contain: layout;
}

.logo-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(to right, #60a5fa, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-title {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav a:not(.btn) {
    font-weight: 500;
    position: relative;
}

.nav a:not(.btn)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary);
    transition: var(--transition);
}

.nav a:not(.btn):hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    /* Fix to top */
    padding-top: 12rem;
    /* Stable top padding instead of centering */
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: flex-start;
    /* Avoid jitter from content height changes */
}

.subtitle {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero-content .title {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    min-height: 14.4rem;
    /* Reserve space for 3 lines */
    contain: layout;
}

.accent {
    color: var(--primary);
    position: relative;
    white-space: nowrap;
}

.hero-content .description {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* Contact Card (Hero Right) */
.contact-card {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-wrapper.primary {
    background: rgba(37, 99, 235, 0.1);
    color: #60a5fa;
}

.icon-wrapper.secondary {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.contact-item .label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.contact-item .value {
    font-size: 1.125rem;
    font-weight: 600;
    font-family: var(--font-heading);
}

.lang-switcher {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-link {
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    transition: var(--transition);
    text-transform: uppercase;
}

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

.lang-link.active {
    pointer-events: none;
}

.social-links {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--surface-border);
}

.social-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    font-size: 1.2rem;
    color: var(--text-muted);
}

.footer .btn svg,
.social-btn svg {
    filter: grayscale(100%) brightness(0.8) opacity(0.7);
    transition: var(--transition);
}

.footer .btn:hover svg,
.social-btn:hover svg {
    filter: grayscale(0%) brightness(1) opacity(1);
}

.social-btn:hover {
    transform: translateY(-3px);
}

.social-btn.tg:hover {
    background: #0088cc;
    color: #fff;
}

.social-btn.wa:hover {
    background: #25D366;
    color: #fff;
}

.social-btn.ig:hover {
    background: #E1306C;
    color: #fff;
}

.social-btn.max:hover {
    background: #6200EA;
    color: #fff;
}

/* Footer Helpers */
.justify-center {
    justify-content: center;
}

.mt-2 {
    margin-top: 2rem;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* Services Summary */
.services {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

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

.service-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Portfolio Slider */
.portfolio {
    padding: 6rem 0;
    background: rgba(0, 0, 0, 0.2);
}

.portfolio-slider-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.slider-wrapper {
    display: flex;
    transition: transform 0.5s ease;
}

.slide {
    min-width: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: auto;
    display: block;
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
}

.slider-controls button {
    pointer-events: auto;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.7);
    color: white;
    backdrop-filter: blur(4px);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.slider-controls button:hover {
    background: var(--primary);
    transform: scale(1.1);
}

/* Footer */
.footer {
    padding: 4rem 0 2rem;
    text-align: center;
}

.footer h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.footer p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.copyright {
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--surface-border);
    padding-top: 2rem;
}

/* Reviews Section */
.reviews {
    padding: 6rem 0;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.review-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-decoration: none;
}

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

.platform-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

.stars {
    color: #fbbf24;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-card p {
    color: var(--text-muted);
    font-size: 1rem;
    flex-grow: 1;
}

.review-card .btn-text {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-card:hover .btn-text {
    color: var(--primary);
}

.expertise {
    padding: 6rem 0;
    background: rgba(255, 255, 255, 0.02);
}

.expertise-content {
    column-count: 2;
    column-gap: 4rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.expertise-content p {
    margin-bottom: 1.5rem;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.2s;
}

.delay-2 {
    transition-delay: 0.4s;
}

.delay-3 {
    transition-delay: 0.6s;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-container {
        gap: 2rem;
    }

    .hero-content .title {
        font-size: 3.5rem;
    }
}

@media (max-width: 900px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .hero-content .description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-content .title {
        font-size: 3rem;
    }

    .expertise-content {
        column-count: 1;
        column-gap: 0;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .hero-content .title {
        font-size: 2.5rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .header-inner {
        justify-content: center;
    }

    .logo {
        align-items: center;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .portfolio-slider-container {
        border-radius: 10px;
        margin: 0 -1rem;
        width: calc(100% + 2rem);
    }

    .slide img {
        border-radius: 0;
    }

    .slider-controls button {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1.25rem;
    }

    .hero-content .title {
        font-size: 2.1rem;
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }

    .accent {
        white-space: normal;
    }

    .contact-item {
        gap: 1rem;
    }

    .icon-wrapper {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }

    .contact-card {
        padding: 1.5rem;
    }
}