@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;800&display=swap');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
}

html {
    scroll-snap-type: y mandatory;
}
body {
    margin: 0;
    padding: 0;
    /* 设置初始背景色为红色 */
    background-color: #ff4d4d; 
    /* 核心：颜色变化时持续 1.5 秒，让切换变丝滑 */
    transition: background-color 1.5s ease; 
    font-family: 'Arial', sans-serif;
}

/* 确保每个 section 是全屏透明的，这样才能看到 body 的背景色 */
.section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 10%;
    color: white; /* 文字设为白色，在深色背景上更好看 */
    background: transparent; 
}
body {
    background: #ffc0cb;
    position: relative;
    height: 100%;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}

body.loaded {
    overflow: auto;
}

.webgl {
    position: fixed;
    top: 0;
    left: 0;
    outline: none;
}

section {
    height: 100vh;
    width: 100vw;
    scroll-snap-align: start;
    position: relative;
}

section .container {
    max-width: 1360px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 15px;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    justify-content: flex-start;
}

section.one .container {
    grid-template-areas: 'content ..'
}

section.two .container {
    grid-template-areas: '.. content'
}

.hero {
    width: 100%;
    height: 100%;
    margin-bottom: 50px;

    grid-area: content;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
}

h1 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 90px;
    line-height: 100px;
    font-weight: 700;
    height: 100px;
    width: 100%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

h2 {
    font-size: 60px;
    font-weight: 600;
    line-height: 70px;
    font-family: inherit;
    display: block;
    width: 100%;
}

h3 {
    font-size: 50px;
    font-weight: 400;
    line-height: 60px;
    margin-bottom: 30px;
    display: block;
    width: 100%;
}

p {
    font-size: 16px;
    line-height: 26px;
    font-weight: 300;
    display: block;
    width: 100%;
}

.loading-bar {
    position: fixed;
    top: 50%;
    width: 100%;
    height: 2px;
    z-index: 99;
    background: #ffffff;
    transform: scaleX(0);
    transition: transform 0.5s;
    transform-origin: top left;
}

.loading-bar.ended {
    transform: scaleX(0);
    transform-origin: 100% 0;
    transition: transform 1.5s ease-in-out;
}
/* style.css */
canvas.webgl {
    position: fixed;
    top: 0;
    left: 0;
    outline: none;
    /* 核心：确保 Canvas 在文字上面，可以接收点击 */
    z-index: 5; 
    /* 或者如果你的文字 z-index 是 10，这里设为 11 */
}

/* 确保文字内容在 Canvas 下面，但依然可见（因为 3D 场景是透明的） */
.content-wrapper {
    position: relative;
    z-index: 10; 
    pointer-events: none; /* 关键：文字层不接收鼠标事件，透给下面的 Canvas */
}

/* 但标题需要单独设置，防止它变得不可见 */
#final-title {
    pointer-events: auto; /* 允许标题接收滚动事件 */
    /* 添加过渡动画，让 JS 改变透明度时更丝滑 */
    transition: opacity 0.8s ease; 
}