/* ================================
   CASE STUDY PAGE
   ================================ */

.case-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ================================
   АНИМАЦИЯ ПОЯВЛЕНИЯ
   ================================ */
@keyframes caseFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* ================================
   ЛЕВАЯ КОЛОНКА
   ================================ */
.case-info {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 40px 50px 60px 70px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Кнопка "Назад" --- */
.case-back {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 60px;
    transition: all 0.4s ease;
    animation: caseFadeIn 1.4s cubic-bezier(0.19, 1, 0.22, 1) 0s both;
}

.case-back .back-text {
    color: #fff;
    font-size: 14px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.case-back .back-arrow line,
.case-back .back-arrow polyline {
    stroke: #fff;
    transition: stroke 0.4s ease;
}

.case-back:hover .back-arrow line,
.case-back:hover .back-arrow polyline {
    stroke: url(#gradient);
}

.case-back:hover .back-text {
    background: linear-gradient(135deg, #00ff88, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Заголовок проекта --- */
.case-layout .case-title {
    font-size: 4vw !important;
    line-height: 1.1 !important;
    letter-spacing: 0.04em !important;
    margin-bottom: 20px !important;
    font-weight: bold !important;
    white-space: normal !important;
    text-align: left !important;
    animation: caseFadeIn 1.6s cubic-bezier(0.19, 1, 0.22, 1) 0.2s both !important;
}

.case-accent {
    background: linear-gradient(135deg, #00ff88, #00d4ff) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* --- Тип проекта --- */
.case-type {
    font-size: 1.1vw;
    letter-spacing: 0.4em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 50px;
    animation: caseFadeIn 1.4s cubic-bezier(0.19, 1, 0.22, 1) 0.4s both;
}

/* --- Детали (Role, Tools) --- */
.case-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
    animation: caseFadeIn 1.4s cubic-bezier(0.19, 1, 0.22, 1) 0.6s both;
}

.case-detail-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.case-label {
    font-size: 1.1vw;
    letter-spacing: 0.15em;
    color: #fff;
}

.case-value {
    font-size: 1.3vw;
    letter-spacing: 0.15em;
    color: #fff;
    text-align: right;
}

/* --- Описание проекта --- */
.case-description {
    font-size: 1.3vw;
    line-height: 1.5;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.7);
    text-transform: none;
    margin-bottom: 20px;
    animation: caseFadeIn 1.4s cubic-bezier(0.19, 1, 0.22, 1) 0.8s both;
}

.case-description:last-of-type {
    margin-bottom: 0;
}

/* ================================
   ПРАВАЯ КОЛОНКА
   ================================ */
.case-gallery {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 40px;
    padding-bottom: 100px;
}

.case-gallery img {
    width: 100%;
    display: block;
}

/* ================================
   CTA БЛОК
   ================================ */
.case-cta {
    background: #fff;
    padding: 120px 5vw;
    text-align: center;
}

.case-cta-title {
    font-size: 5vw;
    color: #000;
    letter-spacing: 0.05em;
    margin-bottom: 30px;
    line-height: 1.2;
}

.case-cta-title .accent-text {
    background: linear-gradient(135deg, #00ff88, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.case-cta-subtitle {
    font-size: 1.4vw;
    color: rgba(0, 0, 0, 0.8);
    letter-spacing: 0.15em;
    margin-bottom: 50px;
    text-transform: none;
}

.case-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 20px 50px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    letter-spacing: 0.2em;
    border-radius: 60px;
    transition: all 0.4s ease;
    cursor: none;
}

.case-cta-button:hover {
    background: linear-gradient(135deg, #00ff88, #00d4ff);
    color: #000;
    transform: scale(1.05);
}

/* ================================
   ФУТЕР КЕЙСА
   ================================ */
footer .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

footer .footer-social {
    justify-content: center;
}

/* ================================
   TRACING BEAM
   ================================ */
.tracing-beam {
    position: fixed;
    left: 24px;
    top: 60px;
    height: calc(100vh - 120px);
    width: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.beam-line {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(100% - 60px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.beam-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, #00ff88, #00d4ff);
    border-radius: 2px;
    transition: height 0.1s ease-out;
    box-shadow:
        0 0 10px rgba(0, 255, 136, 0.5),
        0 0 20px rgba(0, 212, 255, 0.3);
}

.beam-dot {
    position: absolute;
    top: 54px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #000;
    border: 2px solid #00ff88;
    border-radius: 50%;
    transition: top 0.1s ease-out;
    box-shadow:
        0 0 10px rgba(0, 255, 136, 0.6),
        0 0 20px rgba(0, 255, 136, 0.3);
}

.beam-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, #00ff88, #00d4ff);
    border-radius: 50%;
}

/* ================================
   АДАПТИВ — Планшеты
   ================================ */
@media (max-width: 1024px) {
    .case-layout {
        grid-template-columns: 1fr;
    }

    .case-info {
        position: relative;
        height: auto;
        padding: 50px 30px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .case-back {
        margin-bottom: 40px;
    }

    .case-layout .case-title {
        font-size: 8vw !important;
    }

    .case-type {
        font-size: 2vw;
    }

    .case-label {
        font-size: 2vw;
    }

    .case-value {
        font-size: 2.2vw;
    }

    .case-description {
        font-size: 2.2vw;
    }

    .case-cta {
        padding: 80px 5vw;
    }

    .case-cta-title {
        font-size: 7vw;
    }

    .case-cta-subtitle {
        font-size: 2.5vw;
    }

    .tracing-beam {
        display: none;
    }

    .case-info {
        padding-left: 30px !important;
    }

    .case-gallery {
        padding-top: 0;
    }
}

/* ================================
   АДАПТИВ — Мобилки
   ================================ */
@media (max-width: 768px) {
    .case-info {
        padding: 40px 20px;
    }

    .case-back {
        margin-bottom: 30px;
    }

    /* Заголовок — принудительно по левому краю */
    .case-layout .case-info .case-title {
        font-size: 9vw !important;
        text-align: left !important;
        padding: 0 !important;
        white-space: normal !important;
        word-spacing: normal !important;
        letter-spacing: 0.04em !important;
    }

    .case-type {
        font-size: 14px;
        letter-spacing: 0.2em;
        margin-bottom: 35px;
    }

    .case-details {
        gap: 15px;
        margin-bottom: 35px;
    }

    .case-detail-item {
        flex-direction: row;
        justify-content: space-between;
    }

    .case-label {
        font-size: 12px;
    }

    .case-value {
        font-size: 14px;
    }

    .case-description {
        font-size: 16px;
        line-height: 1.5;
        letter-spacing: 0.08em;
    }

    .case-cta {
        padding: 60px 20px;
    }

    .case-cta-title {
        font-size: 9vw;
    }

    .case-cta-subtitle {
        font-size: 14px;
        margin-bottom: 40px;
    }

    .case-cta-button {
        padding: 16px 40px;
        font-size: 14px;
    }
}
