/* SpectraVix - Mosaic to Torus Smooth Animation */
/* Optimiert für flüssige 60fps Animationen */

:root {
    --bg-dark: #050810;
    --bg-section: #060912;
    --tile-border: rgba(59, 130, 246, 0.25);
    --tile-bg: rgba(15, 23, 42, 0.6);
}

/* ==================== BASE ==================== */
html {
    background: var(--bg-dark);
}

body {
    background: var(--bg-dark);
}

/* Scroll Spacer */
.scroll-spacer {
    height: 100vh;
    background: var(--bg-dark);
}

/* ==================== HEADER - Erscheint erst bei Torus ==================== */
.mosaic-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 64px;
    background: rgba(5, 8, 16, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    will-change: transform, opacity;
}

.mosaic-header.visible {
    transform: translateY(0);
    opacity: 1;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
}

.header-logo svg {
    width: 28px;
    height: 28px;
    color: #60a5fa;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-nav a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: white;
}

.header-nav .btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
}

/* ==================== MOSAIC SECTION ==================== */
.mosaic-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: var(--bg-dark);
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
}

.mosaic-grid {
    position: absolute;
    inset: 0;
}

/* ==================== MOSAIC TILES - GPU-beschleunigt ==================== */
.mosaic-tile {
    position: absolute;
    background: var(--tile-bg);
    border: 1px solid var(--tile-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: auto;
    /* GPU-Beschleunigung */
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.mosaic-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.2s;
}

.mosaic-tile:hover::before {
    opacity: 1;
}

.mosaic-tile:hover {
    border-color: rgba(96, 165, 250, 0.4);
    z-index: 100;
}

.tile-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.5rem;
    text-align: center;
    transition: opacity 0.2s ease;
}

/* Orbit-Mode: Details ausblenden */
.mosaic-tile.orbit-mode .tile-inner {
    opacity: 0.9;
}

.mosaic-tile.orbit-mode .tile-inner span,
.mosaic-tile.orbit-mode .tile-inner .tile-status,
.mosaic-tile.orbit-mode .tile-inner .tile-value,
.mosaic-tile.orbit-mode .tile-inner .tile-badge {
    display: none;
}

.mosaic-tile svg {
    width: 28px;
    height: 28px;
    color: #60a5fa;
    filter: drop-shadow(0 0 4px rgba(96, 165, 250, 0.3));
    flex-shrink: 0;
}

.mosaic-tile:hover svg {
    color: #93c5fd;
}

.mosaic-tile.orbit-mode svg {
    width: 20px;
    height: 20px;
}

.mosaic-tile span {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tile-status {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.tile-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #60a5fa;
    font-family: 'SF Mono', 'Consolas', monospace;
}

.tile-badge {
    font-size: 0.45rem;
    text-transform: uppercase;
    padding: 0.1rem 0.25rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 2px;
}

/* ==================== SCROLL HINT ==================== */
.scroll-hint {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 100;
    pointer-events: auto;
    cursor: pointer;
    animation: hintPulse 2s ease-in-out infinite;
}

.scroll-hint svg {
    width: 20px;
    height: 20px;
    animation: hintBounce 1.5s ease-in-out infinite;
}

.scroll-hint.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

@keyframes hintPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

@keyframes hintBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ==================== TORUS SECTION ==================== */
.torus-section {
    position: relative;
    min-height: 100vh;
    background: var(--bg-section);
    display: flex;
    align-items: center;
    padding: 4rem 0;
}

.torus-area {
    position: absolute;
    left: 50%; /* Start: Zentrum, wird per JS nach links bewegt */
    top: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    height: 420px;
    pointer-events: none;
    transition: left 0.1s linear; /* Smooth aber schnell für JS-Animation */
}

/* ==================== TORUS VISUALIZATION ==================== */
.torus-visualization {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.torus-visualization.visible {
    opacity: 1;
    transform: scale(1);
}

.torus-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.torus-visualization.visible .torus-ring {
    opacity: 1;
}

.torus-ring-outer {
    width: 380px;
    height: 380px;
    border-color: rgba(59, 130, 246, 0.12);
    animation: ringRotate 40s linear infinite;
}

.torus-ring-middle {
    width: 320px;
    height: 320px;
    border-color: rgba(96, 165, 250, 0.15);
    animation: ringRotate 30s linear infinite reverse;
}

.torus-ring-inner {
    width: 260px;
    height: 260px;
    border-color: rgba(147, 197, 253, 0.18);
    animation: ringRotate 22s linear infinite;
}

@keyframes ringRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.torus-core {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 50%, #1e3a8a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 40px rgba(59, 130, 246, 0.4),
        0 0 80px rgba(59, 130, 246, 0.2);
    animation: corePulse 4s ease-in-out infinite;
    z-index: 10;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.4s ease 0.2s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
}

.torus-visualization.visible .torus-core {
    opacity: 1;
    transform: scale(1);
}

.torus-core svg {
    width: 36px;
    height: 36px;
    color: white;
    opacity: 0.9;
}

@keyframes corePulse {
    0%, 100% { 
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.4), 0 0 80px rgba(59, 130, 246, 0.2);
    }
    50% { 
        box-shadow: 0 0 60px rgba(59, 130, 246, 0.5), 0 0 100px rgba(59, 130, 246, 0.3);
    }
}

/* Pulse Rings */
.pulse-ring {
    position: absolute;
    width: 90px;
    height: 90px;
    border: 1px solid rgba(59, 130, 246, 0.5);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.torus-visualization.visible .pulse-ring {
    animation: pulseExpand 3.5s ease-out infinite;
}

@keyframes pulseExpand {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(4.5); opacity: 0; }
}

/* ==================== TORUS CONTENT ==================== */
.torus-content {
    position: relative;
    z-index: 10;
    max-width: 440px;
    margin-left: auto;
    margin-right: 8%;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.torus-content.visible {
    opacity: 1;
    transform: translateX(0);
}

.torus-content .section-label {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    margin-bottom: 1.25rem;
}

.torus-content h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.torus-content .gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.torus-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.7;
    margin-bottom: 1.75rem;
}

.torus-features {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.torus-feature {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
}

.torus-feature svg {
    width: 18px;
    height: 18px;
    color: #60a5fa;
    flex-shrink: 0;
}

/* ==================== OTHER SECTIONS ==================== */
.why-section,
.what-section,
.how-section,
.use-cases-section,
.value-section,
.cta-section {
    position: relative;
    z-index: 5;
    background: var(--bg-section);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .torus-area {
        width: 400px;
        height: 400px;
        left: 5%;
    }
    
    .torus-ring-outer { width: 320px; height: 320px; }
    .torus-ring-middle { width: 270px; height: 270px; }
    .torus-ring-inner { width: 220px; height: 220px; }
    
    .torus-content {
        max-width: 380px;
        margin-right: 5%;
    }
}

@media (max-width: 1024px) {
    .torus-section {
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        padding: 5rem 2rem;
    }
    
    .torus-area {
        position: relative;
        transform: none;
        left: auto;
        top: auto;
        margin: 0 auto;
        width: 320px;
        height: 320px;
    }
    
    .torus-ring-outer { width: 280px; height: 280px; }
    .torus-ring-middle { width: 240px; height: 240px; }
    .torus-ring-inner { width: 200px; height: 200px; }
    
    .torus-content {
        margin: 0 auto;
        text-align: center;
        max-width: 500px;
    }
    
    .torus-features {
        align-items: center;
    }
}

@media (max-width: 768px) {
    .mosaic-tile svg {
        width: 22px;
        height: 22px;
    }
    
    .mosaic-tile span {
        font-size: 0.55rem;
    }
    
    .torus-area {
        width: 260px;
        height: 260px;
    }
    
    .torus-ring-outer { width: 220px; height: 220px; }
    .torus-ring-middle { width: 180px; height: 180px; }
    .torus-ring-inner { width: 140px; height: 140px; }
    .torus-core { width: 60px; height: 60px; }
    .torus-core svg { width: 24px; height: 24px; }
    
    .header-nav a:not(.btn) {
        display: none;
    }
    
    .torus-content h2 {
        font-size: 1.75rem;
    }
}

/* ==================== HIDE DEFAULT NAVBAR ==================== */
body[data-page="/Index"] .navbar {
    display: none;
}
