/* ML 3D Section – 米白到橙色渐变 */
.ml-section {
    margin: 0;
    padding: 0;
    position: relative;
    width: 100%;
    min-height: 120vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(180deg, #eee0bf 0%, #dbb583 35%, #d8a16ad6 65%, #de8c3fe6 85%, #d26550c8 100%);
    overflow: hidden;
}
@media (max-width: 768px) {
    .ml-section {
        min-height: 72vh;
    }
}

/* ML 星星背景层（闪烁） */
.ml-section .stars-bg {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ml-section .star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(255, 230, 200, 0.7);
    box-shadow: 0 0 4px rgba(255, 210, 170, 0.4);
    animation: ml-star-twinkle 2.5s ease-in-out infinite;
    mix-blend-mode: screen;
}

.ml-section .star.star--small {
    width: 1px;
    height: 1px;
    background: rgba(255, 220, 190, 0.6);
    box-shadow: 0 0 2px rgba(255, 200, 160, 0.35);
}

@keyframes ml-star-twinkle {
    0%, 100% { opacity: 0.25; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* 标题层：sticky 顶部，与 Renaissance In Technology 同逻辑 — scroll 驱动 scale 2→1 */
.ml-titles-layer {
    position: sticky;
    top: 0;
    z-index: 2;
    width: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 24px 16px;
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
}

.ml-title-box {
    position: relative;
    left: auto;
    transform: none;
    padding: 0;
    border: none;
    border-radius: 0;
    text-align: center;
    background: transparent;
    box-shadow: none;
}

/* 主标题：花体字，黑色，打字机效果容器 */
.ml-title-box.ml-title-main {
    top: auto;
    margin-bottom: 12px;
}

.ml-section-title {
    margin: 0;
    color: #1a1a1a;
    font-size: clamp(28px, 4.5vw, 52px);
    font-weight: 500;
    font-family: 'Dancing Script', 'Great Vibes', cursive;
    letter-spacing: 0.02em;
    line-height: 1.2;
    min-height: 1.2em;
    transform: translateZ(0) scale(var(--ml-title-scale, 1));
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
}

.ml-section-title .typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background: #1a1a1a;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: ml-cursor-blink 0.8s step-end infinite;
}

@keyframes ml-cursor-blink {
    50% { opacity: 0; }
}

/* 副标题：花体字，黑色 */
.ml-title-box.ml-title-sub {
    display: block;
    top: auto;
}

.ml-section-subtitle {
    margin: 0;
    color: #1a1a1a;
    font-size: clamp(18px, 2.5vw, 26px);
    font-weight: 500;
    font-family: 'Dancing Script', 'Great Vibes', cursive;
    letter-spacing: 0.02em;
    line-height: 1.4;
    transform: translateZ(0) scale(var(--ml-title-scale, 1));
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
}

.ml-canvas-wrap {
    position: sticky;
    top: 80px;
    z-index: 1;
    width: 100%;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    background: transparent;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.ml-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .ml-section {
        min-height: 100vh;
    }
    .ml-titles-layer {
        padding-top: 12vh;
    }
    .ml-title-box.ml-title-main {
        margin-bottom: 8px;
    }
}

