/* ============================================
   Narwhal Media - 首页样式
   设计语言：Cinematic Dark Studio Style
   ============================================ */

/* --- CSS 变量 --- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(255, 255, 255, 0.06);
    --text-primary: #f0f0f0;
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-tertiary: rgba(255, 255, 255, 0.35);
    --accent: #ffffff;
    --accent-glow: rgba(255, 255, 255, 0.12);
    --gradient-1: linear-gradient(135deg, #ffffff, #aaaaaa);
    --gradient-2: linear-gradient(135deg, #ffffff, #cccccc);
    --gradient-3: linear-gradient(135deg, #ffffff, #aaaaaa);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* --- 全局滚动条 --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
::-webkit-scrollbar-corner {
    background: transparent;
}

@font-face {
    font-family: 'Alimama FangYuanTi';
    src: url('fonts/AlimamaFangYuanTiVF-Thin.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

body {
    font-family: 'Alimama FangYuanTi', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background:
        /* 全局环境光 — 用 body 自身背景替代伪元素，避免影响 IntersectionObserver */
        radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.015) 0%, transparent 40%),
        var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- 粒子背景 --- */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- 导航栏 --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: background var(--transition), padding var(--transition);
}

.navbar.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 12px 0;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    z-index: 10;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 36px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: color var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 导航栏高亮按钮 — 合作 */
.nav-link-cta {
    display: inline-flex;
    align-items: center;
    padding: 7px 20px;
    background: #ffffff;
    color: #0a0a0f !important;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition:
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.nav-link-cta:hover {
    background: #e5e5e5;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    transform: translateY(-1px) scale(1.04);
}

.nav-link-cta:active {
    transform: translateY(0) scale(0.97);
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */
.hero {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 100px 40px 40px;
    overflow: hidden;
}

/* Hero 环境光 — 消除首页顶部空白感 */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 25%, rgba(255, 255, 255, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 40%, rgba(255, 255, 255, 0.03) 0%, transparent 45%),
        radial-gradient(ellipse at 20% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 45%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
}

.hero-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    color: var(--accent);
    margin-bottom: 24px;
    font-weight: 500;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 32px;
}

.title-line {
    display: block;
}

.title-line.accent {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 48px;
}

.hero-cta {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

/* --- 按钮 --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 32px;
    background: #ffffff;
    color: #0a0a0f;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition:
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.25s ease,
        box-shadow 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
    background: #e5e5e5;
    box-shadow: 0 6px 24px rgba(255, 255, 255, 0.25);
    transform: translateY(-2px) scale(1.04);
}

.btn-primary:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 32px;
    background: transparent;
    color: #ffffff;
    text-decoration: none;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition:
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.btn-outline:hover {
    background: #ffffff;
    color: #0a0a0f;
    border-color: #ffffff;
    box-shadow: 0 6px 24px rgba(255, 255, 255, 0.25);
    transform: translateY(-2px) scale(1.04);
}

.btn-outline:active {
    transform: translateY(0) scale(0.97);
}

.btn-large {
    padding: 16px 40px;
    font-size: 1rem;
}

/* 滚动指示器 */
.hero-scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--text-tertiary), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.2); }
}

/* --- 通用 section --- */
.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

.section-header {
    text-align: center;
    margin-bottom: 72px;
}

.section-label {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--accent);
    margin-bottom: 16px;
    font-weight: 600;
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

.section-divider {
    width: 40px;
    height: 2px;
    background: var(--gradient-1);
    margin: 0 auto;
}

.section-desc {
    color: var(--text-secondary);
    margin-top: 24px;
    line-height: 1.8;
}

/* --- 业务能力 --- */
.services {
    position: relative;
    z-index: 1;
    padding: 120px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 48px 32px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    will-change: transform;
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 24px 64px rgba(255, 255, 255, 0.08);
}

.service-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    color: var(--accent);
}

.service-icon svg {
    width: 100%;
    height: 100%;
}

.service-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.03em;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* --- 关于我们 --- */
.about {
    position: relative;
    z-index: 1;
    padding: 120px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.about-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 40px 28px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    will-change: transform;
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease;
}

.about-card:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 24px 64px rgba(255, 255, 255, 0.06);
}

.about-number {
    font-size: 3rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.08);
    line-height: 1;
    margin-bottom: 16px;
}

.about-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.03em;
}

.about-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* --- 案例展示 --- */
.works {
    position: relative;
    z-index: 1;
    padding: 120px 0;
    background: var(--bg-secondary);
}

/* 消除 works 区域与上下 section 之间的硬边界 */
.works::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, var(--bg-primary), transparent);
    pointer-events: none;
    z-index: 2;
}

.works::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    pointer-events: none;
    z-index: 2;
}

.filter-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 22px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.25s ease,
        color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    transform: translateY(-1px) scale(1.05);
}

.filter-btn.active {
    background: #ffffff;
    border-color: #ffffff;
    color: #0a0a0f;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.15);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.work-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    will-change: transform;
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        background-color 0.3s ease;
}

.work-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.065);
    box-shadow: 0 16px 48px rgba(255, 255, 255, 0.06);
}

.work-card.hidden {
    display: none;
}

.work-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.work-placeholder {
    width: 100%;
    height: 100%;
}

.work-placeholder svg {
    width: 100%;
    height: 100%;
}

.work-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.work-card:hover .work-overlay {
    opacity: 1;
}

.work-view {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.work-info {
    padding: 20px 24px;
}

.work-category {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 8px;
}

.work-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.work-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.works-more {
    text-align: center;
    margin-top: 48px;
}

/* --- 合作联系 --- */
.contact {
    position: relative;
    z-index: 1;
    padding: 120px 0;
    text-align: center;
}

/* --- 页脚 --- */
.footer {
    position: relative;
    z-index: 1;
    padding: 60px 0 32px;
    border-top: 1px solid var(--border-glass);
    background: var(--bg-secondary);
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
}

.footer-brand h3 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border-glass);
}

.footer-bottom p {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.footer-icp {
    margin-top: 6px;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    opacity: 0.6;
}

/* --- 弹窗 --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 48px;
    max-width: 480px;
    width: 90%;
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition);
    padding: 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    letter-spacing: 0.03em;
}

.modal-content > p {
    color: var(--text-secondary);
    margin-bottom: 36px;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
}

/* 微信二维码独立区块 */
.qr-section {
    text-align: center;
    margin-bottom: 24px;
}

.qr-code {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    display: block;
    margin: 0 auto 12px;
}

.qr-hint {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.qr-id {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.contact-divider {
    width: 100%;
    height: 1px;
    background: var(--border-glass);
    margin-bottom: 24px;
}

.contact-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.contact-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
}

.contact-value {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.modal-footer-text p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-align: center;
}

/* --- 响应式 --- */
@media (max-width: 1024px) {
    .services-grid,
    .works-grid,
    .about-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        transition: right var(--transition);
    }

    .nav-menu.active {
        right: 0;
    }

    .hamburger {
        display: flex;
    }

    .services-grid,
    .works-grid,
    .about-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 100px 24px 60px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .section-container {
        padding: 0 24px;
    }

    .footer-container {
        padding: 0 24px;
    }

    .modal {
        padding: 32px 24px;
    }
}
