/* ========================================
   灵柏科技 - 沉浸式开场动画 & 品牌展示
   ======================================== */

/* === Loading / Brand Reveal Overlay === */
.brand-reveal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s;
    overflow: hidden;
}
.brand-reveal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.brand-reveal-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.brand-reveal-content {
    position: relative;
    z-index: 2;
    text-align: center;
    /* Force true vertical centering */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}
.brand-reveal-logo {
    width: 180px;
    height: 180px;
    margin: 0 auto 32px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.2rem;
    font-weight: 900;
    animation: reveal-logo-pulse 2s ease-in-out infinite;
    opacity: 0;
    transform: scale(0.5);
    background: none;
    box-shadow: none;
    /* Enable sub-pixel antialiasing for crisp scaling */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.brand-reveal-title {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    letter-spacing: 8px;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(30px);
}
.brand-reveal-sub {
    font-family: var(--font-en);
    font-size: clamp(0.8rem, 2vw, 1.1rem);
    font-weight: 400;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-top: 12px;
    opacity: 0;
    transform: translateY(20px);
}
.brand-reveal-tagline {
    margin-top: 32px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    opacity: 0;
    letter-spacing: 3px;
}
.brand-reveal-progress {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 1px;
    overflow: hidden;
    z-index: 2;
}
.brand-reveal-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 1px;
    transition: width 0.3s ease;
}

.brand-reveal.stage-1 .brand-reveal-logo {
    opacity: 1;
    transform: scale(1);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand-reveal.stage-2 .brand-reveal-title {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}
.brand-reveal.stage-3 .brand-reveal-sub {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s ease 0.4s;
}
.brand-reveal.stage-4 .brand-reveal-tagline {
    opacity: 1;
    transition: all 0.6s ease 0.2s;
}

.brand-reveal-logo-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: brightness(1.05) contrast(1.02);
    /* High-DPI crisp rendering */
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
@keyframes reveal-logo-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ========================================
   Interactive Project Mind Map
   — Floating Constellation Network
   ======================================== */
.project-map-section {
    position: relative;
    overflow: hidden;
    padding: 100px 0 120px;
}

/* Grid background for tech feel */
.project-map-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(168,85,247,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168,85,247,0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 30%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}
.project-map-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 35%, rgba(168,85,247,0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 65%, rgba(59,130,246,0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(239,68,68,0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.project-map-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}
.project-map-canvas-wrap {
    position: relative;
    width: 100%;
    min-height: 780px;
}
.project-map-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* === Center hub === */
.map-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    text-align: center;
    cursor: pointer;
}
.map-hub-inner {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--bg-card);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: var(--glass-blur);
    box-shadow:
        0 0 40px var(--accent-glow),
        0 0 80px rgba(168,85,247,0.1),
        inset 0 0 30px rgba(168,85,247,0.08);
    transition: all 0.4s;
    position: relative;
}
.map-hub-inner::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1px solid rgba(168,85,247,0.2);
    animation: hub-ring-spin 20s linear infinite;
}
.map-hub-inner::after {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 1px dashed rgba(168,85,247,0.12);
    animation: hub-ring-spin 30s linear infinite reverse;
}
@keyframes hub-ring-spin { to { transform: rotate(360deg); } }
.map-hub:hover .map-hub-inner {
    transform: scale(1.1);
    box-shadow: 0 0 60px var(--accent-glow), 0 0 120px rgba(168,85,247,0.15);
}
.map-hub-name {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--accent-primary);
}
.map-hub-sub {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-family: var(--font-en);
    letter-spacing: 2px;
}

/* === Project nodes === */
.project-node {
    position: absolute;
    z-index: 4;
    text-align: center;
    cursor: pointer;
    /* JS will control position via left/top */
    transition: transform 0.3s ease;
}
.project-node:hover {
    transform: scale(1.18) !important;
    z-index: 10;
}

/* Node inner — no border, glassmorphism + glow */
.project-node-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.02);
    margin: 0 auto 8px;
    transition: all 0.4s;
    position: relative;
    font-size: 1.6rem;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.project-node:hover .project-node-inner {
    background: rgba(255,255,255,0.04);
}

/* Node sizes — much larger */
.node-lg .project-node-inner { width: 104px; height: 104px; font-size: 2rem; }
.node-md .project-node-inner { width: 88px; height: 88px; font-size: 1.7rem; }
.node-sm .project-node-inner { width: 72px; height: 72px; font-size: 1.4rem; }

/* === Shape: Circle (all nodes) === */
.shape-circle .project-node-inner {
    border-radius: 50%;
}
.shape-circle .project-node-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(ellipse, var(--node-color, rgba(168,85,247,0.15)) 0%, transparent 70%);
    opacity: 0.5;
    z-index: -1;
}
.shape-circle:hover .project-node-inner::before {
    opacity: 0.8;
}

/* === Labels === */
.project-node-label {
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
    transition: all 0.3s;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
    letter-spacing: 1px;
}
.project-node:hover .project-node-label {
    text-shadow: 0 0 16px var(--node-color, var(--accent-primary));
}
.project-node-family {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    opacity: 0.6;
    margin-top: 2px;
    transition: all 0.3s;
}
.project-node:hover .project-node-family {
    opacity: 1;
}

/* Pulse ring — very subtle, no border feel */
.project-node::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    animation: node-pulse-ring 4s ease-in-out infinite;
    pointer-events: none;
    background: radial-gradient(circle, var(--node-color, rgba(168,85,247,0.08)) 0%, transparent 70%);
}
@keyframes node-pulse-ring {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
}

/* Second pulse ring — very subtle glow, no border */
.project-node::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
    animation: node-pulse-ring-2 5s ease-in-out infinite;
    pointer-events: none;
    background: radial-gradient(circle, var(--node-color, rgba(168,85,247,0.04)) 0%, transparent 60%);
}
@keyframes node-pulse-ring-2 {
    0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.6); }
}

/* === Sub-nodes (larger, no white border) === */
.project-sub-node {
    position: absolute;
    min-width: 72px;
    height: 32px;
    border-radius: 16px;
    background: rgba(255,255,255,0.03);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    pointer-events: auto;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: none;
    white-space: nowrap;
    padding: 0 14px;
    letter-spacing: 0.5px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.project-sub-node.show {
    opacity: 1;
    transform: scale(1);
}
.project-sub-node:hover {
    background: rgba(255,255,255,0.05);
}

/* === SVG Connection Lines === */
.map-line {
    stroke: rgba(168, 85, 247, 0.1);
    stroke-width: 1;
    fill: none;
    transition: all 0.5s;
}
.map-line.active {
    stroke: var(--accent-primary);
    opacity: 1;
    stroke-width: 1.5;
    stroke-dasharray: 6 4;
    animation: dash-flow 0.8s linear infinite;
}
.map-line.map-line-sub {
    stroke: rgba(168, 85, 247, 0.06);
    stroke-width: 0.8;
}
.map-line.map-line-sub.active {
    stroke: var(--accent-primary);
    opacity: 0.5;
    stroke-width: 1;
}

/* Orbit ring circle */
.map-orbit-ring {
    fill: none;
    stroke: rgba(168, 85, 247, 0.15);
    stroke-width: 1;
    stroke-dasharray: 8 6;
    animation: ring-rotate 20s linear infinite;
    opacity: 0.6;
    transition: opacity 1s ease;
}
.map-gather-ring {
    fill: none;
    stroke: rgba(168, 85, 247, 0.08);
    stroke-width: 0.5;
    stroke-dasharray: 4 8;
    animation: ring-rotate 30s linear infinite reverse;
    opacity: 0.4;
}
@keyframes ring-rotate {
    to { stroke-dashoffset: -100; }
}

/* Traveling data dot */
.map-line-dot {
    fill: var(--accent-primary);
    opacity: 0;
    transition: opacity 0.5s;
}
.map-line-dot.active {
    opacity: 0.5;
}

@keyframes dash-flow { to { stroke-dashoffset: -10; } }

/* === Node entrance === */
.project-node {
    opacity: 0;
    animation: node-enter 1s ease-out forwards;
}
@keyframes node-enter {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* === Scan line effect across section === */
.project-map-section .scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(168,85,247,0.15), transparent);
    animation: scan-move 8s linear infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes scan-move {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* === Responsive === */
@media (max-width: 768px) {
    .project-map-canvas-wrap {
        min-height: 560px;
        overflow-x: auto;
    }
    .map-hub-inner { width: 80px; height: 80px; }
    .map-hub-name { font-size: 1rem; }
    .node-lg .project-node-inner { width: 80px; height: 80px; font-size: 1.6rem; }
    .node-md .project-node-inner { width: 68px; height: 68px; font-size: 1.4rem; }
    .node-sm .project-node-inner { width: 56px; height: 56px; font-size: 1.2rem; }
    .project-node-label { font-size: 0.8rem; }
    .project-sub-node { min-width: 56px; height: 26px; font-size: 0.6rem; padding: 0 10px; }
}
