* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Geologica", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow: hidden;
    background: #f0f0f0;
    height: 100vh;
    width: 100vw;
}

canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
}

.sidebar {
    position: fixed;
    left: 20px;
    top: 20px;
    width: 500px;
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.screens-wrapper {
    position: relative;
    width: 100%;
    z-index: 1;
    display: block;
    /* ВАЖНО: Даем обертке высоту, чтобы абсолютные дети знали, от чего отталкиваться */
    flex-grow: 1; 
    min-height: 400px; 
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* Гарантируем, что блоки не растягивают контейнер невидимым контентом */
    display: flex;
    flex-direction: column;
    gap: 10px;
    
    visibility: hidden;
    opacity: 0; /* Добавляем прозрачность для мягкости */
    pointer-events: none;
    
    /* При исчезновении: сначала ждем (0s), потом скрываем */
    transition: visibility 0s linear 0.5s, opacity 0.3s ease 0.2s;
}

.screen.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    z-index: 2; /* Активный экран всегда выше */
    transition: visibility 0s linear 0s, opacity 0.3s ease 0s;
}

.glass {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
}

.screen .glass {
    opacity: 0;
    /* Уводим влево и немного уменьшаем, чтобы не мелькало */
    transform: translateX(-120%) scale(0.95);
    /* Анимация УХОДА: быстрая и без задержек */
    transition: transform 0.4s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.3s ease;
}

.screen.is-active .glass {
    opacity: 1;
    transform: translateX(0) scale(1);
    /* Анимация ПОЯВЛЕНИЯ: плавная и пружинистая */
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease;
}

.screen-about.is-active .logo-block { transition-delay: 0.3s; }
.screen-about.is-active .companies { transition-delay: 0.45s; }
.screen-about.is-active .placeholder { transition-delay: 0.6s; }

.screen-contacts.is-active .contact-form-block { transition-delay: 0.3s; }
.screen-contacts.is-active .social-block { transition-delay: 0.45s; }

/* При уходе (нет is-active) задержки обнуляются, чтобы улетели сразу */
.screen:not(.is-active) .glass {
    transition-delay: 0s !important;
}


.buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    z-index: 20;
}

.buttons button {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.3s, color 0.3s;
    background: #ffffff;
    color: #000000;
}

.buttons button.active {
    background: #e6a6ff;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(230, 166, 255, 0.45);
}

.buttons button:not(.active):hover {
    background: #f0d0ff;
    color: #ffffff;
}

.logo {
    width: 300px;
    margin-bottom: 12px;
}
.logo img {
    width: 100%;
    height: auto;
    display: block;
}

.tagline-right {
    text-align: right;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
    color: #111;
    letter-spacing: -0.02em;
}

.tagline-left {
    font-weight: 300;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.companies {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    padding: 10px 0;
}

.marquee-content {
    display: inline-flex;
    gap: 40px;
    animation: scroll-marquee 20s linear infinite;
    padding-left: 20px;
}

.marquee-content span {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #111;
}

@keyframes scroll-marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.placeholder {
    display: flex;
    flex-direction: column;
    gap: 10px !important;
}


.service-card {
    display: grid;
    grid-template-rows: auto 0fr; /* Магия: анимация к 0fr */
    border: 1.5px solid rgba(230, 166, 255, 0.4);
    border-radius: 12px;
    padding: 14px 18px;
    transition: 
        grid-template-rows 0.6s cubic-bezier(0.33, 1, 0.68, 1),
        background-color 0.4s ease;
    cursor: pointer;
    overflow: hidden;
}

.service-card.is-active {
    grid-template-rows: auto 1fr; /* Плавное расширение до содержимого */
    background: rgba(230, 166, 255, 0.1);
    border-color: rgba(230, 166, 255, 0.8);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
    height: 26px;
}

.content-wrapper {
    min-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.service-card.is-active .content-wrapper {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s; /* Текст появляется чуть позже расширения */
}

/* Иконка плюсика */
.plus-icon {
    width: 22px;
    height: 22px;
    border: 1.5px solid #e6a6ff;
    border-radius: 50%;
    position: relative;
    transition: transform 0.5s ease, background 0.3s;
}

.plus-icon::before, .plus-icon::after {
    content: '';
    position: absolute;
    background: #e6a6ff;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

.plus-icon::before { width: 10px; height: 1.5px; } /* Горизонтальная */
.plus-icon::after { width: 1.5px; height: 10px; }  /* Вертикальная */

.service-card.is-active .plus-icon {
    transform: rotate(135deg); /* Превращается в крестик */
    background: #e6a6ff;
}

.service-card.is-active .plus-icon::before,
.service-card.is-active .plus-icon::after {
    background: white;
}



.service-list {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    list-style: none;
    padding-left: 0;
}
.service-list li {
    position: relative;
    padding-left: 15px;
    font-size: 14px;
    font-weight: 400;
    color: #444;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
}
.service-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #444;
    font-weight: bold;
    font-size: 14px;
    line-height: 1.4;
    top: 0;
}
.service-card:hover {
    background: rgba(230, 166, 255, 0.08);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    min-height: 30px;
}
.tag {
    background: transparent !important;
    color: #000000 !important;
    border: 1px dashed rgba(0, 0, 0, 0.5);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tag.selected {
    background: #e6a6ff !important;
    color: #ffffff !important;
    border: 1px solid #e6a6ff;
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.contact-form input,
.contact-form textarea {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(230, 166, 255, 0.3);
    padding: 10px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    max-height: 300px;
}
.submit-btn {
    background: transparent !important;
    color: #000000;
    border: 1.5px solid #e6a6ff !important;
    padding: 8px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    align-self: flex-start;
    transition: all 0.3s ease;
}
.submit-btn:hover {
    background: #e6a6ff !important;
    color: #ffffff;
}
.email-text {
    border: 1.5px solid #e6a6ff;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.social-links {
    display: flex;
    gap: 10px;
}
.social-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.social-btn img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}



/* ПАНЕЛЬ ДЕТАЛЕЙ */
.details-panel {
    position: fixed;
    top: 20px;
    bottom: 20px;
    right: 20px;
    /* Расчет: 20px (отступ слева) + 500px (ширина сайдбара) + 10px (зазор) = 530px */
    left: 530px; 
    z-index: 120;
    display: flex;
    flex-direction: column;
    padding: 30px;
    
    /* Анимация появления */
    transform: translateX(calc(100% + 20px));
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.details-panel.is-open {
    transform: translateX(0);
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.details-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.details-content {
    flex: 1;
    overflow-y: auto;
}

.details-description {
    font-size: 16px;
    color: #444;
    line-height: 1.6;
}

.details-visual {
    width: 100%;
    height: 300px;
    background: rgba(230, 166, 255, 0.05);
    border: 2px dashed #e6a6ff;
    border-radius: 15px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e6a6ff;
    font-weight: 600;
}

/* Адаптивность для небольших экранов */
@media (max-width: 1100px) {
    .details-panel {
        left: 20px; /* На маленьких экранах перекрывает сайдбар */
    }
}






/* Стили для блока инфо о проекте (Premium Glassmorphism) */
.project-info {
    position: fixed;
    right: 0; 
    top: 50%;
    /* Скрываем за правым краем */
    transform: translateY(-50%) translateX(100%);
    
    width: 350px;
    z-index: 110;
    
    /* Большой отступ справа для эффекта 'ухода' в край экрана */
    padding: 40px 60px 40px 30px; 
    text-align: left;

    /* Эффект стекла: комбинируем полупрозрачный белый и затемнение у края */
    background: linear-gradient(
        to right, 
        rgba(255, 255, 255, 0.4) 0%,   /* Светлое стекло слева */
        rgba(255, 255, 255, 0.2) 60%,  /* Прозрачнее в центре */
        rgba(0, 0, 0, 0.15) 100%       /* Затемнение у самого правого края */
    );
    
    /* Размытие того, что находится ПОД плашкой */
    backdrop-filter: blur(25px) saturate(150%);
    -webkit-backdrop-filter: blur(25px) saturate(150%);
    
    /* Скругления только с левой стороны */
    border-radius: 25px 0 0 25px; 
    
    /* Светлая кайма для эффекта грани стекла */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-right: none; 
    
    /* Мягкая тень слева */
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.1);
    
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
    overflow: hidden;
}

/* Эффект блика на стекле (дополнительный лоск) */
.project-info::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    pointer-events: none;
}

.project-info.is-visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: auto;
}

#project-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #000;
    letter-spacing: -0.01em;
    /* Чтобы текст не сливался с бликами */
    text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

#project-desc {
    font-size: 15px;
    color: #222;
    line-height: 1.6;
    font-weight: 400;
}