:root {
    --text-bg: #CFCFCF;
    --text-fg: #000000;
    --bg-color: #ffffff;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    /* Цвет фона совпадает с цветом контента */
    overflow-x: hidden;
    color: var(--text-fg);
}

.page-wrapper {
    max-width: 1920px;
    margin: 0 auto;
    background-color: var(--bg-color);
    /* Убрали тень для чистого эффекта "белое на белом" */
}

.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5vw;
    position: relative;
    border-bottom: 1px solid #eee;
}

.section-intro {
    background-color: var(--text-fg);
    color: var(--bg-color);
}

.section-intro h1 {
    font-size: 8rem;
    line-height: 0.95;
    text-transform: uppercase;
    font-weight: 800;
    text-align: center;
    max-width: 1000px;
}

/* Анимация 1: Проявление цвета текста */
.reveal-text-container {
    position: relative;
    max-width: 1000px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reveal-line {
    position: relative;
    white-space: nowrap;
}

.reveal-text-bg,
.reveal-text-fg {
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.reveal-text-bg {
    color: var(--text-bg);
}

.reveal-text-fg {
    color: var(--text-fg);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    z-index: 1;
}

/* Анимация 2: Появление текста снизу */
.section-text-appear {
    text-align: center;
    background-color: var(--bg-color);
}

.appear-mask {
    overflow: hidden;
    margin-bottom: 2rem;
    display: block;
    width: 100%;
}

.appear-text {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 0.95;
    text-transform: uppercase;
    transform: translateY(110%);
    opacity: 0;
    will-change: transform, opacity;
}

/* Анимация 3: Окно с изображением */
.section-image-window {
    height: 100vh;
    padding: 0;
    overflow: hidden;
}

.section-window {
    width: 100%;
    height: 100vh;
    padding: 0 !important;
    overflow: hidden;
    position: relative;
    background: white;
}

.window-frame {
    width: 100%;
    height: 100%;
    position: relative;
    background: white;
    /* Должен совпадать с фоном страницы */

    /* Используем маску для проявления слайдера под ней. Не используем preserveAspectRatio='none', чтобы избежать искажений фигуры */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M 25 95 L 75 95 L 75 35 Q 75 5 50 5 Q 25 5 25 35 Z' fill='black'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M 25 95 L 75 95 L 75 35 Q 75 5 50 5 Q 25 5 25 35 Z' fill='black'/%3E%3C/svg%3E");
    -webkit-mask-size: 300px;
    mask-size: 300px;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    will-change: mask-size, -webkit-mask-size;
}

.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Заполнение всей области (от края до края) */
}

.reveal-wrapper-white {
    position: absolute;
    bottom: 15%;
    left: 25%;
    /* Сбалансированная позиция в углу */
    color: white;
    z-index: 999;
    /* Слой должен быть поверх всего остального */
}

.reveal-line-white {
    overflow: hidden;
    height: 100px;
    /* Высота уменьшена, чтобы строки текста были ближе друг к другу */
    line-height: 1;
    margin-bottom: 0px;
}

.reveal-line-white span {
    display: block;
    font-size: 90px;
    /* Фиксированный размер в пикселях для стабильности верстки */
    font-weight: 800;
    transform: translateY(110%);
    will-change: transform;
    opacity: 1 !important;
    /* Принудительная видимость */
}

.section-spacer {
    height: 100px;
    background-color: white;
    width: 100%;
}

/* Анимация 4: Морфинг фигур */
.section-morphing {
    max-width: 1920px;
    margin: 0 auto;
    height: 100vh;
    /* GSAP автоматически добавит высоту прокрутки через pin-spacer */
    padding: 0;
    position: relative;
    background-color: transparent;
    color: #E6D5B8;
    overflow: visible;
}

.morph-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1A1815;
    z-index: -1;
}

.morph-sticky {
    position: relative;
    /* Фиксацию (pinning) берет на себя GSAP */
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4%;
    z-index: 1;
    overflow: hidden;
}

.morph-text-column {
    width: 30%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Заголовок сверху, описание снизу */
    padding: 6vh 0;
    position: relative;
}

.morph-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.6;
    font-weight: 600;
}

.morph-text-wrap {
    position: relative;
    min-height: 180px;
}

.morph-item {
    position: absolute;
    bottom: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    width: 100%;
}

.morph-item.active {
    opacity: 1;
    pointer-events: auto;
}

.morph-item h3 {
    font-size: clamp(1.4rem, 2vw, 2rem);
    margin-bottom: 0.75rem;
    line-height: 1.2;
    font-weight: 700;
}

.morph-item p {
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    line-height: 1.6;
    opacity: 0.75;
}

.morph-svg-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.morph-svg {
    width: 100%;
    max-width: 800px;
    height: auto;
    overflow: visible;
}

.shape-path {
    fill: currentColor;
    /* По умолчанию используется цвет #E6D5B8 */
}

.morph-numbers-corner {
    position: absolute;
    top: 4vh;
    right: 4%;
    pointer-events: none;
}

.morph-num {
    position: absolute;
    top: 0;
    right: 0;
    font-size: clamp(6rem, 12vw, 14rem);
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    color: currentColor;
    user-select: none;
}

.footer-spacer {
    background-color: #fafafa;
}

/* --- Адаптивность (Медиа-запросы) --- */

/* Планшеты (768px) */
@media (max-width: 768px) {

    .reveal-text-bg,
    .reveal-text-fg {
        font-size: clamp(2.2rem, 8vw, 4rem);
    }

    .appear-text {
        font-size: clamp(2rem, 9vw, 4rem);
    }

    /* Animation 3: Window */
    .reveal-wrapper-white {
        left: 10%;
        bottom: 15%;
    }

    .reveal-line-white {
        height: 60px;
    }

    .reveal-line-white span {
        font-size: 50px;
    }

    /* Animation 4: Morphing */
    .morph-sticky {
        flex-direction: column;
        justify-content: center;
        padding: 40px 20px;
        gap: 5vh;
    }

    .morph-text-column {
        width: 100%;
        height: auto;
        order: 3;
        padding: 0;
        text-align: left;
    }

    .morph-svg-wrap {
        width: 100%;
        order: 2;
    }

    .morph-numbers-corner {
        position: relative;
        top: 0;
        right: 0;
        order: 1;
        align-self: flex-end;
        height: 80px;
        margin-bottom: -20px;
    }

    .morph-num {
        font-size: 6rem;
    }

    .morph-label {
        font-size: 0.75rem;
        margin-bottom: 5px;
    }

    .morph-text-wrap {
        min-height: 120px;
    }
}

/* Мобильные устройства (цель — 393px, как указано в ТЗ) */
@media (max-width: 480px) {

    .reveal-text-bg,
    .reveal-text-fg {
        font-size: 2.2rem;
    }

    .appear-text {
        font-size: 2rem;
    }

    /* Анимация 3: Окно (Правка: текст меньше, смещен левее и ниже) */
    .window-frame {
        mask-size: 180px;
    }

    .reveal-wrapper-white {
        left: 8%;
        bottom: 6vh;
    }

    .reveal-line-white {
        height: 44px;
    }

    .reveal-line-white span {
        font-size: 38px;
    }

    /* Animation 4: Morphing Numbers */
    .morph-num {
        font-size: 4rem;
    }

    .morph-sticky {
        gap: 2vh;
    }
}