/* ===== CSS Variables ===== */
:root {
    /* Colors - Natural wood theme */
    --bg-primary: #FEFEFE;
    --bg-secondary: #F7F4F0;
    --text-primary: #2C2416;
    --text-secondary: #6B5D4F;
    --accent: #8B6F47;
    --accent-hover: #6F5838;
    --accent-light: #D4C4B0;
    --border: #E5DDD3;
    --shadow: rgba(44, 36, 22, 0.1);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Плавный скролл */
    scroll-padding-top: 120px; /* Отступ для навигации при скролле */
    overflow-x: hidden;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===== Typography ===== */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: clamp(3rem, 10vw, 6rem);
}

h2 {
    font-size: clamp(2rem, 6vw, 3.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

/* ===== Language Switcher ===== */
.lang-switcher {
    position: fixed;
    top: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 1000;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lang-current:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
    border-color: var(--accent);
}

.lang-flag {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 2px;
}

.lang-code {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.lang-code-dropdown {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 12px;
    min-width: 30px;
    text-align: center;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    min-width: 200px;
    box-shadow: 0 8px 32px var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateY(-10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown,
.lang-switcher.active .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 14px;
    width: 100%;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background: var(--bg-secondary);
    border-color: var(--border);
    transform: translateX(4px);
}

.lang-option.active {
    background: var(--accent-light);
    border-color: var(--accent);
}

.lang-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 100px; /* Отступ для glassmorphism навигации */
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(254, 254, 254, 0.92) 0%, rgba(247, 244, 240, 0.88) 100%);
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    margin: 0 auto;
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
}

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

.hero-title {
    color: var(--accent);
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.05em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.hero-title:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.hero-logo {
    max-width: min(500px, 80vw);
    height: auto;
    margin-bottom: var(--spacing-sm);
    filter: drop-shadow(2px 2px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
    user-select: none;
}

.hero-logo:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-weight: 300;
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.feature-icon {
    color: var(--accent);
    font-weight: bold;
    font-size: 1.25rem;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 111, 71, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-secondary:hover {
    background-color: var(--accent);
    color: white;
    transform: translateY(-2px);
}

/* ===== Sections ===== */
.fullpage-section {
    min-height: 100vh;
    padding: var(--spacing-md) 0;
    display: flex;
    align-items: center;
    position: relative;
}

/* Contact section needs more space */
.contact.fullpage-section {
    min-height: auto;
    padding: var(--spacing-lg) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-sm);
    color: var(--accent);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 300;
}

/* ===== About Section ===== */
.about {
    background-color: var(--bg-secondary);
}

/* ===== About Cards Carousel ===== */
.about-carousel-wrapper {
    position: relative;
    margin: var(--spacing-xl) 0;
    padding: 0 60px 60px 60px;
    overflow: visible;
    width: 100%;
}

.about-carousel-container {
    position: relative;
    width: 100%;
    min-height: 480px;
    max-height: 480px;
    max-width: 100%;
}

.about-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: none;
    grid-template-columns: 350px 1fr;
    gap: var(--spacing-md);
    align-items: center;
    background: white;
    padding: var(--spacing-md) var(--spacing-md);
    border-radius: 16px;
    border: 2px solid var(--border);
    box-shadow: 0 4px 16px var(--shadow);
    height: 480px;
    max-height: 480px;
    opacity: 0;
    transition: opacity 0.4s ease;
    overflow: hidden;
}

.about-card.active {
    display: grid;
    opacity: 1;
}

.about-card-image {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.about-card-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    transition: transform 0.4s ease;
    border-radius: 18px;
}

.about-card:hover .about-card-image img {
    transform: scale(1.05);
}

.about-card-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.about-card-title {
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: var(--font-serif);
    line-height: 1.2;
    text-align: left;
    width: 100%;
}

.about-card-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    padding-right: 10px;
    max-height: 300px;
    text-align: left;
    width: 100%;
    min-height: 0;
    word-wrap: break-word;
}

/* Кнопка "Читать далее" для About Cards - показывается всегда (как в Portfolio) */
.about-expand-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 6px 0;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.about-expand-btn:hover {
    opacity: 0.7;
}

.about-expand-btn .expand-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.about-description-wrapper.expanded .about-expand-btn .expand-icon {
    transform: rotate(180deg);
}

/* Скрываем кнопку разворота на десктопе (>768px) - она нужна только на мобильных */
@media (min-width: 769px) {
    .about-expand-btn {
        display: none !important;
    }

    .about-carousel-container {
        min-width: 800px;
    }

    .about-carousel-wrapper {
        min-width: 800px;
    }
}

/* Стилизуем скроллбар */
.about-card-description::-webkit-scrollbar {
    width: 6px;
}

.about-card-description::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.about-card-description::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

.about-card-description::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}


/* Image on right side - зеркальная копия первой карточки */
.about-card-right {
    grid-template-columns: 1fr 350px;
    gap: var(--spacing-lg);
}

.about-card-right .about-card-image {
    order: 2;
    position: relative;
}

.about-card-right .about-card-content {
    order: 1;
    padding-left: 0;
}

/* Navigation buttons */
.about-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--shadow);
}

.about-nav-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-50%) scale(1.1);
}

.about-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.about-nav-prev {
    left: 0;
}

.about-nav-next {
    right: 0;
}

.about-nav-btn svg {
    width: 24px;
    height: 24px;
}

/* Dots indicator */
.about-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: var(--spacing-md);
}

.about-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.about-dot.active {
    background: var(--accent);
    transform: scale(1.3);
}

.about-dot:hover {
    background: var(--accent);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.about-text p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.stat-box {
    background: white;
    padding: var(--spacing-md);
    border-radius: 16px;
    text-align: center;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
    border-color: var(--accent);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-serif);
}

.stat-label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Placeholder для загрузки */
.about-placeholder {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-xl);
}

/* ===== Portfolio Section ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.portfolio-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-primary);
    transition: all 0.4s ease;
    box-shadow: 0 4px 16px var(--shadow);
    display: flex;
    flex-direction: column;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* Portfolio Carousel - УВЕЛИЧЕННЫЙ РАЗМЕР */
.portfolio-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    min-height: 450px;
    overflow: hidden;
}

/* Переопределение для about-card carousel */
.about-card-image.portfolio-carousel {
    aspect-ratio: unset;
    min-height: 400px !important;
    height: 400px !important;
    max-height: 400px !important;
    width: 100% !important;
}

.portfolio-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.4s ease;
    transform: scale(1);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
}

.portfolio-image.active {
    opacity: 1;
    z-index: 1;
}

.portfolio-item:hover .portfolio-image.active {
    transform: scale(1.05);
}

/* Carousel Navigation Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    opacity: 1; /* Changed from 0 to 1 - always visible */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.portfolio-item:hover .carousel-btn {
    opacity: 1;
}

.carousel-prev {
    left: 8px;
}

.carousel-next {
    right: 8px;
}

.carousel-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

/* Carousel Dots */
.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .carousel-dots {
    opacity: 1;
}

.carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.carousel-dot.active,
.carousel-dot:hover {
    background: white;
    transform: scale(1.2);
}

/* Portfolio Info (below image) */
.portfolio-info {
    padding: var(--spacing-md) var(--spacing-sm);
    background: var(--bg-primary);
    width: 100%;
    box-sizing: border-box;
}

.portfolio-title {
    color: var(--accent);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    width: 100%;
    max-width: none;
}

.portfolio-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    white-space: pre-wrap;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 4.8rem;
    transition: max-height 0.3s ease;
    width: 100%;
    max-width: none;
}

/* Wrapper для описания и кнопки */
.portfolio-description-wrapper {
    position: relative;
    width: 100%;
    max-width: none;
}

/* Когда текст развёрнут */
.portfolio-description-wrapper.expanded .portfolio-description {
    display: block;
    -webkit-line-clamp: unset;
    max-height: none;
    overflow: visible;
}

/* Кнопка "Читать далее" / "Скрыть" */
.portfolio-expand-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 0;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.portfolio-expand-btn:hover {
    opacity: 0.7;
}

.portfolio-expand-btn .expand-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.portfolio-description-wrapper.expanded .portfolio-expand-btn .expand-icon {
    transform: rotate(180deg);
}

.portfolio-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

/* ===== Contact Section ===== */
.contact {
    background-color: var(--bg-secondary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

.contact-info h3,
.contact-form-wrapper h3 {
    margin-bottom: var(--spacing-md);
    color: var(--accent);
}

/* ===== Social Media Buttons ===== */
.social-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.social-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Full-width social buttons */
.social-btn.full-width {
    width: 100%;
    justify-content: flex-start;
    margin-bottom: var(--spacing-sm);
}

.social-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.social-name {
    font-weight: 600;
    font-size: 1rem;
}

.social-handle {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Viber - Purple */
.viber-btn {
    background: linear-gradient(135deg, #7360f2 0%, #6c5ce7 100%);
    color: white;
}

.viber-btn:hover {
    background: linear-gradient(135deg, #6c5ce7 0%, #5f51d8 100%);
}

/* Telegram - Blue */
.telegram-btn {
    background: linear-gradient(135deg, #0088cc 0%, #006ba6 100%);
    color: white;
}

.telegram-btn:hover {
    background: linear-gradient(135deg, #006ba6 0%, #005580 100%);
}

/* WhatsApp - Green */
.whatsapp-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
}

/* Instagram - Gradient */
.instagram-btn {
    background: linear-gradient(135deg, #833AB4 0%, #FD1D1D 50%, #FCB045 100%);
    color: white;
}

.instagram-btn:hover {
    background: linear-gradient(135deg, #6929a0 0%, #e31b1b 50%, #e3a03e 100%);
}

/* Facebook - Blue */
.facebook-btn {
    background: linear-gradient(135deg, #1877F2 0%, #0d66d0 100%);
    color: white;
}

.facebook-btn:hover {
    background: linear-gradient(135deg, #0d66d0 0%, #0a56b8 100%);
}

/* Phone - Gray/Accent */
.phone-btn {
    background: linear-gradient(135deg, #8B6F47 0%, #6F5838 100%);
    color: white;
}

.phone-btn:hover {
    background: linear-gradient(135deg, #6F5838 0%, #5a4529 100%);
}

/* Zoom Button (Desktop) */
.zoom-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--accent);
    border-radius: 50%;
    cursor: pointer;
    z-index: 15;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.zoom-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portfolio-item:hover .zoom-btn {
    opacity: 1;
}

.zoom-btn:hover {
    transform: scale(1.1);
    background: white;
}

/* Image Zoom Modal */
.zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.zoom-modal.active {
    display: flex;
}

.zoom-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.zoom-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s ease;
}

.zoom-close:hover {
    background: white;
    transform: scale(1.1);
}

.zoom-prev,
.zoom-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent);
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.3s ease;
}

.zoom-prev {
    left: 20px;
}

.zoom-next {
    right: 20px;
}

.zoom-prev:hover,
.zoom-next:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.zoom-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10001;
}

.zoom-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.zoom-dot.active {
    background: white;
    transform: scale(1.3);
}

/* ===== Contact Form ===== */
.contact-form {
    background: white;
    padding: var(--spacing-md);
    border-radius: 16px;
    border: 2px solid var(--border);
}

.form-group {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -0.75rem;
    left: 0.75rem;
    font-size: 0.875rem;
    background: white;
    padding: 0 0.5rem;
    color: var(--accent);
}

.contact-form .btn {
    width: 100%;
}

/* ===== Contact Map ===== */
.contact-map-wrapper {
    background: white;
    padding: var(--spacing-md);
    border-radius: 16px;
    border: 2px solid var(--border);
}

.contact-map-wrapper h3 {
    margin-bottom: var(--spacing-md);
    color: var(--accent);
    font-size: 1.5rem;
}

.contact-map-wrapper iframe {
    width: 100%;
    height: 450px;
    border: 0;
    border-radius: 12px;
}

/* ===== Footer ===== */
.footer {
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}

/* ===== Fullpage Navigation ===== */
/* Old navigation - hidden, replaced by glassmorphism nav */
.fullpage-nav {
    display: none !important;
}

.nav-dot {
    display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 100px; /* Отступ для мобильной */
    }

    .fullpage-nav {
        display: none;
    }

    .lang-switcher {
        top: auto;
        bottom: var(--spacing-md);
        right: var(--spacing-sm);
    }

    .lang-current {
        padding: 8px 12px;
    }

    .lang-dropdown {
        bottom: calc(100% + 8px);
        top: auto;
    }

    .hero-features {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .hero {
        padding-top: 80px !important;
        padding-bottom: 40px !important;
        min-height: auto !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        position: relative !important;
    }

    /* Убираем белый overlay на мобильной */
    .hero-overlay {
        display: none !important;
    }

    /* Убираем absolute positioning у фона на мобильной */
    .hero-background {
        position: relative !important;
        height: 100% !important;
        bottom: auto !important;
    }

    .hero-content {
        margin-top: 0px !important;
        padding-top: 0 !important;
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .about-content {
        grid-template-columns: 1fr;
        margin-top: 100px !important;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .contact-map-wrapper {
        padding: var(--spacing-sm);
    }

    .contact-map-wrapper iframe {
        height: 350px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .fullpage-section {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-md: 1rem;
        --spacing-lg: 2rem;
        --spacing-xl: 3rem;
    }

    /* Social buttons on mobile */
    .social-buttons {
        grid-template-columns: 1fr;
    }

    .social-btn {
        width: 100%;
        padding: 0.875rem;
    }

    .social-icon {
        width: 20px;
        height: 20px;
    }

    /* Carousel controls always visible on mobile */
    .carousel-btn {
        opacity: 1;
    }

    .carousel-dots {
        opacity: 1;
    }

    /* Hide zoom button on mobile (tap on image works instead) */
    .zoom-btn {
        display: none;
    }

    /* Make images clickable on mobile */
    .portfolio-image {
        cursor: pointer;
    }

    /* Zoom modal adjustments for mobile */
    .zoom-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
        font-size: 1.5rem;
    }

    .zoom-prev,
    .zoom-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .zoom-prev {
        left: 10px;
    }

    .zoom-next {
        right: 10px;
    }

    .zoom-dots {
        bottom: 20px;
        gap: 8px;
    }

    .zoom-dot {
        width: 10px;
        height: 10px;
    }
}

/* ===== КАРУСЕЛЬ ПОРТФОЛИО (3 КАРТОЧКИ В РЯД НА ПК) ===== */
.portfolio-carousel-wrapper {
    position: relative;
    width: 100%;
}

.portfolio-carousel-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    transition: none;
}

/* Кнопки навигации карусели */
.portfolio-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.portfolio-nav-btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.portfolio-nav-btn:hover:not(:disabled) svg {
    stroke: white;
}

.portfolio-nav-btn:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.portfolio-nav-btn svg {
    transition: stroke 0.3s ease;
}

.portfolio-nav-prev {
    left: -28px;
}

.portfolio-nav-next {
    right: -28px;
}

/* Десктоп: карусель с 3 карточками */
@media (min-width: 1024px) {
    .portfolio-carousel-wrapper {
        overflow: hidden;
        position: relative;
        margin: 0 auto;
        max-width: 1400px;
        padding: 0 100px; /* Одинаковые отступы слева и справа для стрелок */
    }

    /* Гарантируем правильный padding для десктопа */
    .portfolio-info {
        padding: var(--spacing-sm) var(--spacing-sm) !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .portfolio-title {
        font-size: 1.5rem !important;
        margin-bottom: 0.75rem !important;
        width: 100% !important;
        text-align: left !important;
    }

    .portfolio-description {
        font-size: 1.05rem !important;
        line-height: 1.7 !important;
        width: 100% !important;
        text-align: left !important;
        max-width: none !important;
    }

    .portfolio-description-wrapper {
        width: 100% !important;
        max-width: none !important;
    }

    /* Белые маски по краям - от самого края */
    .portfolio-carousel-wrapper::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0; /* От самого края */
        width: 120px; /* Увеличили чтобы закрыть gap */
        background: linear-gradient(to right, var(--bg-primary) 0%, var(--bg-primary) 60%, transparent 100%);
        z-index: 100;
        pointer-events: none;
    }

    .portfolio-carousel-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0; /* От самого края */
        width: 120px; /* Увеличили чтобы закрыть gap */
        background: linear-gradient(to left, var(--bg-primary) 0%, var(--bg-primary) 60%, transparent 100%);
        z-index: 100;
        pointer-events: none;
    }

    .portfolio-carousel-container {
        display: flex;
        flex-wrap: nowrap;
        gap: 24px;
        transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
        padding: 0; /* Убираем padding, он теперь в wrapper */
    }

    .portfolio-item {
        flex: 0 0 calc((100% - 48px) / 3); /* 48px = gap между 3 карточками */
        min-width: 0;
    }

    .portfolio-nav-btn {
        display: flex;
        z-index: 200;
    }

    /* Стрелки ОДИНАКОВО по краям */
    .portfolio-nav-prev {
        left: 20px;
    }

    .portfolio-nav-next {
        right: 20px;
    }
}

/* Планшет: карусель с 2 карточками */
@media (min-width: 768px) and (max-width: 1023px) {
    .portfolio-carousel-wrapper {
        overflow: hidden;
        position: relative;
        padding: 0 40px;
    }

    .portfolio-carousel-container {
        display: flex;
        flex-wrap: nowrap;
        gap: 20px;
        transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
    }

    .portfolio-item {
        flex: 0 0 calc((100% - 20px) / 2);
        min-width: 0;
    }

    /* Адаптируем высоту для планшетов */
    .portfolio-carousel {
        aspect-ratio: 4 / 3;
        max-height: 40vh;
    }
}

/* Мобильный: карусель с 1 карточкой */
@media (max-width: 768px) {
    /* Секция портфолио */
    #portfolio {
        padding: 40px 0 60px 0 !important;
        display: block !important;
        min-height: auto !important;
        position: relative !important;
        z-index: 1 !important;
    }

    #portfolio .container {
        padding: 0 20px;
    }

    /* ЗАГОЛОВКИ - делаем их видимыми */
    #portfolio .section-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
        text-align: center;
        color: var(--accent);
        display: block !important;
        visibility: visible !important;
    }

    #portfolio .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
        text-align: center;
        display: block !important;
        visibility: visible !important;
    }

    /* Wrapper карусели */
    .portfolio-carousel-wrapper {
        overflow: hidden;
        position: relative;
        padding: 0 47px; /* Место для стрелок по бокам (42px кнопка + 5px отступ) */
        margin: 0 auto;
        width: 100%;
    }

    /* Контейнер карточек */
    .portfolio-carousel-container {
        display: flex !important;
        flex-wrap: nowrap;
        gap: 15px;
        transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
        overflow: visible;
        align-items: flex-start;
    }

    /* Карточка - ровно 100% ширины wrapper (без gap в размере) */
    .portfolio-item {
        flex: 0 0 100%;
        min-width: 100%;
        max-width: 100%;
        display: block !important;
        visibility: visible !important;
        padding: 0;
    }

    /* Изображение карточки - немного больше для лучшего вида */
    .portfolio-carousel {
        aspect-ratio: 4 / 3;
        height: auto;
        max-height: none;
        min-height: 280px;
        width: 100%;
        border-radius: 16px;
    }

    /* Показываем стрелки портфолио на мобильной */
    .portfolio-nav-btn {
        display: flex !important;
        width: 42px;
        height: 42px;
        z-index: 200;
    }

    .portfolio-nav-prev {
        left: 0;
    }

    .portfolio-nav-next {
        right: 0;
    }

    /* Текст карточки - компактный, БЛИЖЕ к фото */
    .portfolio-info {
        padding: 0.5rem 0.5rem 0.8rem 0.5rem;
        display: block;
    }

    .portfolio-title {
        font-size: 1rem;
        margin-bottom: 0.4rem;
        font-weight: 600;
        line-height: 1.3;
    }

    /* На мобильных делаем текст еще меньше */
    .portfolio-description {
        font-size: 0.82rem;
        line-height: 1.4;
        margin-bottom: 0.5rem;
    }

    /* Кнопка на мобильных с touch-action */
    .portfolio-expand-btn {
        touch-action: manipulation;
    }

    /* About Cards - КАРУСЕЛЬ на мобильных (как портфолио) */
    .about-carousel-wrapper {
        padding: 0 47px;
        margin: var(--spacing-md) 0;
        overflow: hidden;
        position: relative;
    }

    .about-carousel-container {
        min-height: auto;
        max-height: none;
        display: flex !important;
        flex-wrap: nowrap;
        gap: 15px;
        transition: transform 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
        overflow: visible;
    }

    .about-card {
        flex: 0 0 100%;
        min-width: 100%;
        position: relative !important;
        display: grid !important;
        opacity: 1 !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 280px auto;
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
        padding: 0 !important;
        gap: 0.5rem;
    }

    /* На мобильной всегда фото сверху, текст снизу */
    .about-card-right {
        grid-template-columns: 1fr !important;  /* Одна колонка на мобильных */
        grid-template-rows: 280px auto !important; /* Фиксируем высоту для стабильности */
        gap: 0.5rem !important;
    }

    .about-card-right .about-card-image {
        order: 0 !important;
        position: static !important;
        right: auto !important;
    }

    .about-card-right .about-card-content {
        order: 1 !important;
        padding: 0 0.8rem !important;
        position: relative;
        z-index: 2;
    }

    .about-card-image {
        height: 280px !important;
        max-height: 280px !important;
        min-height: 280px !important;
        width: 100%;
        order: 0;
        position: relative;
        overflow: hidden;
        border-radius: 16px;
        margin-top: 0 !important;
        isolation: isolate;
        z-index: 1;
    }

    /* Изображения внутри about-card на мобильной */
    .about-card-image img,
    .about-card-image .portfolio-image {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        min-height: 280px !important;
        object-fit: cover !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }

    /* Применяем к контейнеру carousel внутри about-card */
    .about-card-image.portfolio-carousel {
        height: 280px !important;
        max-height: 280px !important;
        min-height: 280px !important;
        position: relative !important;
    }

    .about-card-content {
        padding: 0 0.8rem !important;
        order: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .about-card-title {
        font-size: 1rem !important;
        margin-bottom: 0.4rem;
        font-weight: 600;
        line-height: 1.3;
    }

    .about-card-description {
        font-size: 0.82rem !important;
        line-height: 1.4;
        margin-bottom: 0.5rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        position: relative;
        z-index: 1;
    }

    /* Стили для развернутого описания */
    .about-description-wrapper {
        position: relative;
        width: 100%;
        z-index: 3;
    }

    .about-description-wrapper.expanded .about-card-description {
        display: block;
        -webkit-line-clamp: unset;
        max-height: none;
        overflow: visible;
    }

    /* Кнопка "Читать далее" для About Cards */
    .about-expand-btn {
        display: inline-flex;
        align-items: center;
        position: relative;
        z-index: 4;
        gap: 0.3rem;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
        background: rgba(139, 92, 62, 0.1);
        color: var(--accent);
        border: none;
        border-radius: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
        touch-action: manipulation;
        font-weight: 500;
    }

    .about-expand-btn:hover {
        background: rgba(139, 92, 62, 0.2);
    }

    .about-expand-btn .expand-icon {
        transition: transform 0.3s ease;
    }

    .about-description-wrapper.expanded .about-expand-btn .expand-icon {
        transform: rotate(180deg);
    }

    /* ПОКАЗЫВАЕМ кнопки навигации */
    .about-nav-btn {
        display: flex !important;
        width: 42px;
        height: 42px;
    }

    .about-nav-prev {
        left: 0;
    }

    .about-nav-next {
        right: 0;
    }

    /* Скрываем точки */
    .about-carousel-dots {
        display: none !important;
    }

    .about-content {
        grid-template-columns: 1fr;
        margin-top: var(--spacing-xl);
    }
}

/* ===================================
   DESKTOP: Стили для развёртывания текста
   =================================== */
@media (min-width: 1024px) {
    /* На десктопе тоже укорачиваем текст, как на мобильной */
    .portfolio-description {
        -webkit-line-clamp: 3;
    }

    /* About Cards - убираем централизацию текста на десктопе */
    .about-card {
        grid-template-columns: 320px 1fr !important;
    }

    .about-card-right {
        grid-template-columns: 1fr 320px !important;
    }

    .about-card-title {
        text-align: left !important;
        width: 100% !important;
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }

    .about-card-description {
        text-align: left !important;
        width: 100% !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
        white-space: pre-wrap !important;
        overflow-y: auto !important;
        flex: 1 1 auto !important;
        padding-right: 10px !important;
        max-height: 300px !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        word-wrap: break-word !important;
    }

    .about-card-content {
        align-items: flex-start !important;
        text-align: left !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
    }

    .about-card-image {
        margin-top: 50px !important;
        margin-left: 0 !important;
    }

    .about-card-right .about-card-image {
        margin-top: 50px !important;
        margin-left: 0 !important;
        margin-right: -50px !important;
    }
}

/* Индикаторы точек для планшетов (на мобильных и ПК - стрелки) */
.portfolio-carousel-dots {
    display: none; /* По умолчанию скрыты */
}

/* Показываем точки только на планшетах */
@media (min-width: 768px) and (max-width: 1023px) {
    .portfolio-carousel-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        margin-top: 20px;
        padding-bottom: 10px;
    }

    .portfolio-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--border);
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .portfolio-dot.active {
        background: var(--accent);
        transform: scale(1.3);
    }

    .portfolio-dot:hover {
        background: var(--accent);
        opacity: 0.7;
    }
}

/* ===== PORTFOLIO GRID (старая версия, для совместимости) ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

/* Десктоп: 3 карточки */
@media (min-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Планшет: 2 карточки */
@media (min-width: 768px) and (max-width: 1023px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Мобильный: 1 карточка */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Запрет zoom при двойном клике на кнопки ===== */
.portfolio-nav-btn,
.carousel-btn,
.zoom-btn,
button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* ===== ЗАПАСНОЙ ВАРИАНТ: Модалка с деталями проекта ===== */
/* Отключена, стили оставлены на будущее */
/*
.project-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-details-modal.active {
    opacity: 1;
}

.project-details-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.project-details-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 100%;
    margin: 0 auto;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.project-details-modal.active .project-details-content {
    transform: translateY(0);
}

.project-details-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.project-details-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.project-details-image {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    background: #000;
}

.project-details-text {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-primary);
}

.project-details-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 15px;
}

.project-details-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}

@media (max-width: 768px) {
    .project-details-content {
        max-width: 100%;
    }

    .project-details-image {
        max-height: 50vh;
    }

    .project-details-text {
        padding: 15px;
    }

    .project-details-title {
        font-size: 1.3rem;
    }

    .project-details-description {
        font-size: 0.95rem;
    }
}
*/
