/* Включаем Snap на уровне всей страницы */
html, body {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* Привязываем каждую секцию */
.hero, .section {
  height: 100vh; /* Каждая секция должна быть на весь экран */
  scroll-snap-align: start;
  scroll-snap-stop: always; /* Запрещает прокрутку мимо секции */
}

/* Фон с сеткой */
.main-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.02) 0%, transparent 50%),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 60px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 60px);
    background-size: 100% 100%, 100% 100%, 60px 60px, 60px 60px;
    opacity: 0.4;
}

.main-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.08), transparent);
    opacity: 0.6;
}

/* Заголовки и текст */
h1 {
    font-size: 64px;
    font-weight: 300;
    color: #ffffff;
    letter-spacing: -1.5px;
    margin: 0 0 32px 0;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.1;
}

/* Эффект печатной машинки для главного заголовка */
.hero h1 {
    overflow: hidden;
    border-right: 3px solid rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    margin: 0 auto 32px auto;
    animation: typing 2s steps(11) forwards, blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 11ch;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: rgba(255, 255, 255, 0.8);
    }
}

.hero p {
    font-size: 16px;
    color: #b0b0b0;
    text-align: center;
    margin: 0 auto;
    max-width: 600px;
    line-height: 1.8;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background-color: rgba(17, 17, 17, 0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 1000;
    backdrop-filter: blur(6px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Search */
.search-wrapper {
    position: relative;
}

.search-input {
    width: 240px;
    height: 36px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 0 16px 0 40px;
    font-size: 14px;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    width: 280px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-icon::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: relative;
}

.search-icon::after {
    content: '';
    display: block;
    width: 2px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    position: absolute;
    bottom: -2px;
    right: -2px;
    transform: rotate(-45deg);
}

/* Projects button */
.projects-button {
    height: 36px;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.projects-button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.projects-button::before {
    content: '';
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.8)' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 48px;
        margin-bottom: 24px;
    }
    
    .hero p {
        font-size: 15px;
    }
    
    .site-header {
        padding: 0 16px;
    }
    
    .search-input {
        width: 180px;
    }
    
    .search-input:focus {
        width: 200px;
    }
    
    .projects-button {
        padding: 0 16px;
        font-size: 13px;
    }
    
    .header-right {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 36px;
        letter-spacing: -1px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .search-input {
        width: 140px;
        font-size: 13px;
    }
    
    .search-input:focus {
        width: 160px;
    }
    
    .projects-button span {
        display: none;
    }
    
    .projects-button {
        padding: 0 10px;
        width: 36px;
        justify-content: center;
    }
}

/* Исправление для страницы контактов */
.contacts-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 128px); /* Вычитаем хедер и футер */
    padding: 40px 20px;
}

.contacts-page .section-content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.contact-header {
    margin-bottom: 60px;
    text-align: center;
}

.contact-header h1 {
    display: block; /* Убираем typing effect если он ломает ширину */
    width: fit-content;
    margin: 0 auto 20px auto;
    animation: none; 
    border-right: none;
    white-space: normal;
}

.contact-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.contact-text h2 {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.contact-info-footer {
    margin-top: 40px;
    font-size: 12px;
    letter-spacing: 2px;
    opacity: 0.5;
}

/* Стили формы (Glassmorphism) */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.contact-form input, 
.contact-form textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 1px;
    outline: none;
}

.contact-form button {
    background: #fff;
    color: #000;
    border: none;
    padding: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-form button:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* Адаптив для мобилок */
@media (max-width: 768px) {
    .contact-body {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .contact-header h1 {
        font-size: 32px;
    }
}