@layer utilities {
    .glass {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    .dark .glass {
        background: rgba(11, 15, 25, 0.8);
    }
    
    .perspective-container {
        perspective: 1200px;
        -webkit-perspective: 1200px;
    }
    
    .transform-style-3d {
        transform-style: preserve-3d;
        -webkit-transform-style: preserve-3d;
    }

    .clip-triangle {
        clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
        -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    }

    /* --- 3D Solar System Architecture --- */
    .solar-system-3d {
        transform-style: preserve-3d;
        transform: rotateX(60deg) rotateZ(-10deg);
    }

    .sun-tilter {
        transform: rotateX(-60deg);
        transform-style: preserve-3d;
    }

    .sun-core {
        filter: drop-shadow(0 0 30px rgba(234, 179, 8, 0.8));
    }

    .planet-wrapper {
        position: absolute;
        transform: translate(-50%, -50%);
        transform-style: preserve-3d;
    }

    .planet-counter-rotator {
        width: 100%;
        height: 100%;
        transform-style: preserve-3d;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .planet-tilter {
        transform: rotateX(-60deg);
        transform-style: preserve-3d;
        position: relative;
    }

    .planet-3d-sphere {
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: radial-gradient(circle at 35% 25%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 25%),
                    linear-gradient(135deg, var(--tw-gradient-from), var(--tw-gradient-to));
        box-shadow: inset -5px -5px 12px rgba(0,0,0,0.5), inset 2px 2px 5px rgba(255,255,255,0.4);
    }

    .planet-shadow {
        position: absolute;
        bottom: -20px;
        left: 50%;
        transform: translateX(-50%) rotateX(60deg);
        width: 80%;
        height: 20%;
        background: radial-gradient(ellipse at center, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 70%);
        filter: blur(4px);
        z-index: -1;
    }
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    scroll-padding-top: 80px;
}

.dark html {
    scrollbar-color: #334155 #0B0F19;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes hazard-sway {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    20% { transform: translateY(-3px) rotate(-5deg); }
    40% { transform: translateY(0) rotate(0deg); }
    60% { transform: translateY(-3px) rotate(5deg); }
    80% { transform: translateY(0) rotate(0deg); }
}

@keyframes spin-orbit-cw {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); } 
}

@keyframes spin-orbit-ccw {
    from { transform: rotate(360deg); } 
    to { transform: rotate(0deg); } 
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.8); } 
    50% { opacity: 1; transform: scale(1.2); } 
}

@keyframes scan {
    0% { top: 0%; opacity: 0; } 
    10% { opacity: 1; } 
    90% { opacity: 1; } 
    100% { top: 100%; opacity: 0; } 
}

@keyframes meteor {
    0% {
        transform: rotate(215deg) translateX(0);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: rotate(215deg) translateX(-500px);
        opacity: 0;
    }
}

.meteor {
    position: absolute;
    height: 2px;
    width: 120px;
    border-radius: 9999px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0) 100%);
    animation: meteor 3s linear infinite;
    pointer-events: none;
    opacity: 0;
}

.meteor::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 4px;
    width: 4px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8);
}

.dynamic-star {
    position: absolute;
    border-radius: 50%;
    background: white;
    animation: twinkle 4s ease-in-out infinite;
}

.animate-spin-orbit-cw {
    animation: spin-orbit-cw linear infinite;
}

.animate-spin-orbit-ccw {
    animation: spin-orbit-ccw linear infinite;
}

.animate-hazard {
    animation: hazard-sway 4s ease-in-out infinite;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-slow {
    animation: float 10s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulse-glow 3s infinite;
}

.animate-scan {
    animation: scan 3s linear infinite;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}
.dark ::-webkit-scrollbar-thumb {
    background-color: #334155;
}
