/* ============================================================
   全局 Reset & Base
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* FLYNN Mono 本地字体声明 */
@font-face {
    font-family: 'FLYNN Mono';
    src: url('Flynnmono.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ============================================================
   Base
   ============================================================ */
body, html {
    margin: 0;
    padding: 0;
    overscroll-behavior: none;
    overflow: hidden;
    background-color: #000;
    font-family: 'FLYNN Mono', monospace;
}

/* ============================================================
   Loading 遮罩
   ============================================================ */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-box {
    border: 2px solid rgba(255, 255, 255, 0.15);
    padding: 28px 48px;
    text-align: center;
}

.loading-text {
    font-family: 'FLYNN Mono', monospace;
    font-size: 28px;
    color: #fff;
    letter-spacing: 4px;
    display: flex;
    align-items: baseline;
    justify-content: center;
}

#loading-percent {
    min-width: 3ch;
    text-align: right;
}

.loading-cursor {
    color: #00FFBF;
    animation: cursorBlink 0.75s step-end infinite;
}

/* ============================================================
   背景视频
   ============================================================ */
.bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
    will-change: transform;
}

/* ============================================================
   鼠标效果 canvas
   ============================================================ */
canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 30px;
    border-radius: 50px;
    font-family: 'FLYNN Mono', monospace;
    font-size: 12px;
    letter-spacing: 1px;
    pointer-events: none;
    transition: opacity 0.5s ease;
    z-index: 100;
}

/* ============================================================
   导航栏
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 48px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
}

.navbar:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 首页：完全透明，无模糊，无边框，hover 也不出现背景 */
.homepage .navbar,
.homepage .navbar:hover {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom-color: transparent;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 18px;
    width: auto;
    object-fit: contain;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: 2px;
    filter: brightness(0);
    transition: opacity 0.2s ease, filter 0.4s ease;
}

/* 首页：Logo 为米白色，直接显示 */
.homepage .logo-img {
    filter: none;
    color: #fff;
}

.logo-img:hover {
    opacity: 0.7;
}

/* 导航链接列表 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    font-family: 'FLYNN Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: rgba(20, 20, 20, 0.85);
    letter-spacing: 2px;
    position: relative;
    transition: color 0.25s ease;
}

/* 下划线动画 */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #1a1a1a;
    transition: width 0.3s ease, background 0.4s ease;
}

.nav-links a:hover {
    color: #1a1a1a;
}

.nav-links a:hover::after {
    width: 100%;
}

/* 首页：文字白色 */
.homepage .nav-links a {
    color: rgba(255, 255, 255, 0.9);
}

.homepage .nav-links a::after {
    background: #fff;
}

.homepage .nav-links a:hover {
    color: #fff;
}

/* 隐藏 lil-gui 调试面板 */
.lil-gui {
    display: none !important;
}

/* ============================================================
   Hero 主标题
   ============================================================ */
.hero-title-wrapper {
    position: fixed;
    bottom: 56px;
    left: 0;
    width: 100%;
    z-index: 10;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 52px;
    pointer-events: none;
}

.hero-title {
    font-family: 'FLYNN Mono', monospace;
    font-weight: 400;
    font-size: clamp(18px, 2vw, 28px);
    color: #ffffff;
    text-align: left;
    line-height: 1.2;
    letter-spacing: 0.06em;
    white-space: nowrap;
    text-shadow:
        0 0 30px rgba(255, 255, 255, 0.12),
        0 2px 30px rgba(0, 0, 0, 0.5);
    opacity: 1;
    transform: none;
    animation: none;
}

/* 打字机光标 */
.typewriter-cursor {
    display: inline-block;
    color: #00FFBF;
    font-weight: 300;
    margin-left: 2px;
    animation: cursorBlink 0.75s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ============================================================
   响应式适配
   ============================================================ */
@media (max-width: 768px) {
    .navbar {
        padding: 16px 24px;
    }

    .nav-links {
        gap: 24px;
    }

    .nav-links a {
        font-size: 13px;
    }

    .hero-title {
        font-size: clamp(18px, 4vw, 28px);
        padding: 0;
    }

    .hero-title-wrapper {
        padding: 0 24px;
        bottom: 40px;
    }
}


@media (max-width: 480px) {
    .navbar {
        padding: 14px 20px;
    }

    .nav-links {
        gap: 18px;
    }
}

.mute-btn {
    position: fixed;
    bottom: 52px;
    right: 52px;
    z-index: 20;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.mute-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
    .mute-btn {
        bottom: 36px;
        right: 24px;
        width: 34px;
        height: 34px;
    }
}

/* 过渡动画 overlay */
#transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    display: none;
}
