:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a1a;
    --panel: rgba(255, 255, 255, 0.04);
    --panel-strong: rgba(255, 255, 255, 0.06);
    --text-color: #ffffff;
    --text-muted: #8888aa;
    --accent: #2346FA;
    --accent-strong: #EF55B3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #000008;
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== ANIMATED SPACE BACKGROUND ===== */
.space-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Stars layers */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    will-change: transform;
}

.stars-1 {
    background-image: 
        radial-gradient(1px 1px at 10% 5%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 25% 12%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 40% 8%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 55% 3%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 70% 15%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 85% 7%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 95% 18%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 5% 25%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 20% 32%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 35% 28%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 50% 22%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 65% 35%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 80% 30%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 92% 38%, rgba(255,255,255,0.7), transparent);
    animation: twinkle1 4s ease-in-out infinite;
}

.stars-2 {
    background-image: 
        radial-gradient(1px 1px at 8% 42%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 22% 48%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 38% 45%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 52% 52%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 68% 42%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 82% 55%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 12% 62%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 28% 58%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 45% 65%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 60% 60%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 75% 68%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1.5px 1.5px at 90% 62%, rgba(255,255,255,0.8), transparent);
    animation: twinkle2 5s ease-in-out infinite;
}

.stars-3 {
    background-image: 
        radial-gradient(1.5px 1.5px at 5% 72%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 18% 78%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 32% 75%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 48% 82%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 62% 72%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 78% 85%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1.5px 1.5px at 88% 78%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 15% 92%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 42% 88%, rgba(255,255,255,0.9), transparent),
        radial-gradient(1.5px 1.5px at 58% 95%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 72% 90%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 95% 92%, rgba(255,255,255,0.8), transparent);
    animation: twinkle3 6s ease-in-out infinite;
}

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

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

@keyframes twinkle3 {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.95; }
}

/* Floating 3D cubes - physics controlled by JS */
.floating-cube {
    position: absolute;
    will-change: transform;
    perspective: 400px;
}

.mini-cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: miniSpin var(--spin-duration, 20s) linear infinite;
}

.mini-face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(35, 70, 250, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 8px rgba(35, 70, 250, 0.15), inset 0 0 6px rgba(239, 85, 179, 0.05);
}

/* Cube positions and sizes */
.cube-1 {
    width: 45px;
    height: 45px;
    top: 8%;
    left: 5%;
    --spin-duration: 18s;
    --cube-depth: 22.5px;
}

.cube-2 {
    width: 28px;
    height: 28px;
    top: 15%;
    right: 12%;
    --spin-duration: 25s;
    --cube-depth: 14px;
}

.cube-3 {
    width: 60px;
    height: 60px;
    top: 35%;
    left: 8%;
    --spin-duration: 22s;
    --cube-depth: 30px;
}

.cube-4 {
    width: 35px;
    height: 35px;
    top: 45%;
    right: 6%;
    --spin-duration: 28s;
    --cube-depth: 17.5px;
}

.cube-5 {
    width: 20px;
    height: 20px;
    top: 60%;
    left: 15%;
    --spin-duration: 15s;
    --cube-depth: 10px;
}

.cube-6 {
    width: 50px;
    height: 50px;
    top: 70%;
    right: 10%;
    --spin-duration: 30s;
    --cube-depth: 25px;
}

.cube-7 {
    width: 25px;
    height: 25px;
    top: 25%;
    left: 85%;
    --spin-duration: 20s;
    --cube-depth: 12.5px;
}

.cube-8 {
    width: 40px;
    height: 40px;
    top: 80%;
    left: 3%;
    --spin-duration: 24s;
    --cube-depth: 20px;
}

/* 3D face transforms - using CSS custom property for depth */
.cube-1 .mini-face.front { transform: translateZ(22.5px); }
.cube-1 .mini-face.back { transform: rotateY(180deg) translateZ(22.5px); }
.cube-1 .mini-face.right { transform: rotateY(90deg) translateZ(22.5px); }
.cube-1 .mini-face.left { transform: rotateY(-90deg) translateZ(22.5px); }
.cube-1 .mini-face.top { transform: rotateX(90deg) translateZ(22.5px); }
.cube-1 .mini-face.bottom { transform: rotateX(-90deg) translateZ(22.5px); }

.cube-2 .mini-face.front { transform: translateZ(14px); }
.cube-2 .mini-face.back { transform: rotateY(180deg) translateZ(14px); }
.cube-2 .mini-face.right { transform: rotateY(90deg) translateZ(14px); }
.cube-2 .mini-face.left { transform: rotateY(-90deg) translateZ(14px); }
.cube-2 .mini-face.top { transform: rotateX(90deg) translateZ(14px); }
.cube-2 .mini-face.bottom { transform: rotateX(-90deg) translateZ(14px); }

.cube-3 .mini-face.front { transform: translateZ(30px); }
.cube-3 .mini-face.back { transform: rotateY(180deg) translateZ(30px); }
.cube-3 .mini-face.right { transform: rotateY(90deg) translateZ(30px); }
.cube-3 .mini-face.left { transform: rotateY(-90deg) translateZ(30px); }
.cube-3 .mini-face.top { transform: rotateX(90deg) translateZ(30px); }
.cube-3 .mini-face.bottom { transform: rotateX(-90deg) translateZ(30px); }

.cube-4 .mini-face.front { transform: translateZ(17.5px); }
.cube-4 .mini-face.back { transform: rotateY(180deg) translateZ(17.5px); }
.cube-4 .mini-face.right { transform: rotateY(90deg) translateZ(17.5px); }
.cube-4 .mini-face.left { transform: rotateY(-90deg) translateZ(17.5px); }
.cube-4 .mini-face.top { transform: rotateX(90deg) translateZ(17.5px); }
.cube-4 .mini-face.bottom { transform: rotateX(-90deg) translateZ(17.5px); }

.cube-5 .mini-face.front { transform: translateZ(10px); }
.cube-5 .mini-face.back { transform: rotateY(180deg) translateZ(10px); }
.cube-5 .mini-face.right { transform: rotateY(90deg) translateZ(10px); }
.cube-5 .mini-face.left { transform: rotateY(-90deg) translateZ(10px); }
.cube-5 .mini-face.top { transform: rotateX(90deg) translateZ(10px); }
.cube-5 .mini-face.bottom { transform: rotateX(-90deg) translateZ(10px); }

.cube-6 .mini-face.front { transform: translateZ(25px); }
.cube-6 .mini-face.back { transform: rotateY(180deg) translateZ(25px); }
.cube-6 .mini-face.right { transform: rotateY(90deg) translateZ(25px); }
.cube-6 .mini-face.left { transform: rotateY(-90deg) translateZ(25px); }
.cube-6 .mini-face.top { transform: rotateX(90deg) translateZ(25px); }
.cube-6 .mini-face.bottom { transform: rotateX(-90deg) translateZ(25px); }

.cube-7 .mini-face.front { transform: translateZ(12.5px); }
.cube-7 .mini-face.back { transform: rotateY(180deg) translateZ(12.5px); }
.cube-7 .mini-face.right { transform: rotateY(90deg) translateZ(12.5px); }
.cube-7 .mini-face.left { transform: rotateY(-90deg) translateZ(12.5px); }
.cube-7 .mini-face.top { transform: rotateX(90deg) translateZ(12.5px); }
.cube-7 .mini-face.bottom { transform: rotateX(-90deg) translateZ(12.5px); }

.cube-8 .mini-face.front { transform: translateZ(20px); }
.cube-8 .mini-face.back { transform: rotateY(180deg) translateZ(20px); }
.cube-8 .mini-face.right { transform: rotateY(90deg) translateZ(20px); }
.cube-8 .mini-face.left { transform: rotateY(-90deg) translateZ(20px); }
.cube-8 .mini-face.top { transform: rotateX(90deg) translateZ(20px); }
.cube-8 .mini-face.bottom { transform: rotateX(-90deg) translateZ(20px); }

/* Different rotation directions */
.cube-1 .mini-cube { animation-direction: normal; }
.cube-2 .mini-cube { animation-direction: reverse; animation-name: miniSpinAlt; }
.cube-3 .mini-cube { animation-direction: normal; }
.cube-4 .mini-cube { animation-direction: reverse; }
.cube-5 .mini-cube { animation-name: miniSpinAlt; }
.cube-6 .mini-cube { animation-direction: reverse; }
.cube-7 .mini-cube { animation-name: miniSpinAlt; animation-direction: reverse; }
.cube-8 .mini-cube { animation-direction: normal; }

@keyframes miniSpin {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

@keyframes miniSpinAlt {
    0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(360deg) rotateY(180deg) rotateZ(360deg); }
}

/* ===== PAGE CONTENT ===== */
.page {
    position: relative;
    z-index: 1;
    max-width: 620px;
    margin: 0 auto;
    padding: 2.5rem 2.5rem 3rem;
    background: rgba(0, 0, 8, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
}

.hero {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 1.5rem 0 1rem;
    position: relative;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #d0d0e0;
    font-size: 1.02rem;
}

.hero-content p {
    margin-bottom: 0.4rem;
}

/* Footer cube section */
.footer-cube-section {
    margin-top: 3rem;
    padding: 2rem 0;
    display: flex;
    justify-content: center;
}

.cube-wrapper {
    height: 200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    perspective: 800px;
}

.cube {
    width: 160px;
    height: 160px;
    position: relative;
    animation: spin 18s linear infinite;
    transform-style: preserve-3d;
    pointer-events: none;
}

/* Wireframe cube - transparent with only lines */
.cube.wireframe .face {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

.face {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 0;
}

.face.front { transform: translateZ(80px); }
.face.back { transform: rotateY(180deg) translateZ(80px); }
.face.right { transform: rotateY(90deg) translateZ(80px); }
.face.left { transform: rotateY(-90deg) translateZ(80px); }
.face.top { transform: rotateX(90deg) translateZ(80px); }
.face.bottom { transform: rotateX(-90deg) translateZ(80px); }

@keyframes spin {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.panel-strip {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 14px;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #2346FA;
    color: #ffffff;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 2.5rem 0 1rem;
}

.panel-card {
    background: rgba(0, 0, 8, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    padding: 1.35rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.panel-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.panel-card p {
    color: #a0a0b8;
    font-size: 0.98rem;
}

.blog-posts {
    margin-top: 2.5rem;
}

.section-header h2 {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
}

.section-header p {
    color: #c0c0d0;
    margin-bottom: 1.25rem;
}

.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-card {
    background: rgba(0, 0, 8, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    padding: 1rem 1rem 0.9rem;
    transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(4px);
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: #2346FA;
    box-shadow: 0 0 24px rgba(35, 70, 250, 0.2);
}

.tool-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.45rem;
}

.post-date {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.tool-head a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
}

.tool-head a:hover {
    color: #EF55B3;
}

.post-desc {
    color: #9090a8;
    font-size: 0.97rem;
    margin-top: 0.1rem;
}

#scroll-to-tools {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #2346FA;
    border-radius: 0;
    font-size: 1.9rem;
    color: #2346FA;
    box-shadow: 0 0 20px rgba(35, 70, 250, 0.25);
    text-decoration: none;
    transition: background 0.2s, border 0.2s, box-shadow 0.2s, transform 0.2s;
    opacity: 0.95;
    backdrop-filter: blur(3px);
    font-weight: 700;
}

#scroll-to-tools:hover {
    background: rgba(35, 70, 250, 0.12);
    border-color: #EF55B3;
    color: #EF55B3;
    transform: translateY(-2px);
}

@media (max-width: 960px) {
    .cube-wrapper {
        height: 180px;
    }
    
    .cube {
        width: 120px;
        height: 120px;
    }
    
    .face.front { transform: translateZ(60px); }
    .face.back { transform: rotateY(180deg) translateZ(60px); }
    .face.right { transform: rotateY(90deg) translateZ(60px); }
    .face.left { transform: rotateY(-90deg) translateZ(60px); }
    .face.top { transform: rotateX(90deg) translateZ(60px); }
    .face.bottom { transform: rotateX(-90deg) translateZ(60px); }
}

@media (max-width: 640px) {
    .page {
        padding: 1.5rem 1.5rem 2.5rem;
        margin: 1rem;
        background: rgba(0, 0, 8, 0.75);
    }

    #scroll-to-tools {
        right: 14px;
        bottom: 14px;
        width: 44px;
        height: 44px;
        font-size: 1.6rem;
    }
    
    /* Keep cubes visible on mobile but smaller */
    .floating-cube {
        opacity: 0.8;
    }
    
    .cube-1 { width: 30px; height: 30px; top: 5%; left: 3%; }
    .cube-2 { width: 20px; height: 20px; top: 12%; right: 5%; }
    .cube-3 { width: 35px; height: 35px; top: 30%; left: 2%; }
    .cube-4 { width: 22px; height: 22px; top: 40%; right: 3%; }
    .cube-5 { width: 15px; height: 15px; top: 55%; left: 8%; }
    .cube-6 { width: 28px; height: 28px; top: 65%; right: 5%; }
    .cube-7 { width: 18px; height: 18px; top: 20%; right: 8%; }
    .cube-8 { width: 25px; height: 25px; top: 75%; left: 2%; }
    
    /* Adjust mini cube face transforms for smaller sizes on mobile */
    .cube-1 .mini-face.front, .cube-1 .mini-face.back { transform: translateZ(15px); }
    .cube-1 .mini-face.right { transform: rotateY(90deg) translateZ(15px); }
    .cube-1 .mini-face.left { transform: rotateY(-90deg) translateZ(15px); }
    .cube-1 .mini-face.top { transform: rotateX(90deg) translateZ(15px); }
    .cube-1 .mini-face.bottom { transform: rotateX(-90deg) translateZ(15px); }
    .cube-1 .mini-face.back { transform: rotateY(180deg) translateZ(15px); }
    
    .cube-2 .mini-face.front, .cube-2 .mini-face.back { transform: translateZ(10px); }
    .cube-2 .mini-face.right { transform: rotateY(90deg) translateZ(10px); }
    .cube-2 .mini-face.left { transform: rotateY(-90deg) translateZ(10px); }
    .cube-2 .mini-face.top { transform: rotateX(90deg) translateZ(10px); }
    .cube-2 .mini-face.bottom { transform: rotateX(-90deg) translateZ(10px); }
    .cube-2 .mini-face.back { transform: rotateY(180deg) translateZ(10px); }
    
    .cube-3 .mini-face.front { transform: translateZ(17.5px); }
    .cube-3 .mini-face.back { transform: rotateY(180deg) translateZ(17.5px); }
    .cube-3 .mini-face.right { transform: rotateY(90deg) translateZ(17.5px); }
    .cube-3 .mini-face.left { transform: rotateY(-90deg) translateZ(17.5px); }
    .cube-3 .mini-face.top { transform: rotateX(90deg) translateZ(17.5px); }
    .cube-3 .mini-face.bottom { transform: rotateX(-90deg) translateZ(17.5px); }
    
    .cube-4 .mini-face.front { transform: translateZ(11px); }
    .cube-4 .mini-face.back { transform: rotateY(180deg) translateZ(11px); }
    .cube-4 .mini-face.right { transform: rotateY(90deg) translateZ(11px); }
    .cube-4 .mini-face.left { transform: rotateY(-90deg) translateZ(11px); }
    .cube-4 .mini-face.top { transform: rotateX(90deg) translateZ(11px); }
    .cube-4 .mini-face.bottom { transform: rotateX(-90deg) translateZ(11px); }
    
    .cube-5 .mini-face.front { transform: translateZ(7.5px); }
    .cube-5 .mini-face.back { transform: rotateY(180deg) translateZ(7.5px); }
    .cube-5 .mini-face.right { transform: rotateY(90deg) translateZ(7.5px); }
    .cube-5 .mini-face.left { transform: rotateY(-90deg) translateZ(7.5px); }
    .cube-5 .mini-face.top { transform: rotateX(90deg) translateZ(7.5px); }
    .cube-5 .mini-face.bottom { transform: rotateX(-90deg) translateZ(7.5px); }
    
    .cube-6 .mini-face.front { transform: translateZ(14px); }
    .cube-6 .mini-face.back { transform: rotateY(180deg) translateZ(14px); }
    .cube-6 .mini-face.right { transform: rotateY(90deg) translateZ(14px); }
    .cube-6 .mini-face.left { transform: rotateY(-90deg) translateZ(14px); }
    .cube-6 .mini-face.top { transform: rotateX(90deg) translateZ(14px); }
    .cube-6 .mini-face.bottom { transform: rotateX(-90deg) translateZ(14px); }
    
    .cube-7 .mini-face.front { transform: translateZ(9px); }
    .cube-7 .mini-face.back { transform: rotateY(180deg) translateZ(9px); }
    .cube-7 .mini-face.right { transform: rotateY(90deg) translateZ(9px); }
    .cube-7 .mini-face.left { transform: rotateY(-90deg) translateZ(9px); }
    .cube-7 .mini-face.top { transform: rotateX(90deg) translateZ(9px); }
    .cube-7 .mini-face.bottom { transform: rotateX(-90deg) translateZ(9px); }
    
    .cube-8 .mini-face.front { transform: translateZ(12.5px); }
    .cube-8 .mini-face.back { transform: rotateY(180deg) translateZ(12.5px); }
    .cube-8 .mini-face.right { transform: rotateY(90deg) translateZ(12.5px); }
    .cube-8 .mini-face.left { transform: rotateY(-90deg) translateZ(12.5px); }
    .cube-8 .mini-face.top { transform: rotateX(90deg) translateZ(12.5px); }
    .cube-8 .mini-face.bottom { transform: rotateX(-90deg) translateZ(12.5px); }
    
    /* Stars more visible */
    .stars-1, .stars-2, .stars-3 {
        opacity: 1;
    }
    
    .footer-cube-section {
        margin-top: 2rem;
        padding: 1.5rem 0;
    }
    
    .cube-wrapper {
        height: 150px;
    }
    
    .cube {
        width: 100px;
        height: 100px;
    }
}
