/* ===== ROOT VARIABLES ===== */
:root {
    --primary-dark: #0a1628;
    --secondary-dark: #0f2847;
    --tertiary-dark: #1a3a5c;
    --accent-blue: #00d4ff;
    --accent-cyan: #00fff9;
    --text-primary: #e8f1ff;
    --text-secondary: #a8c5e8;
    --gradient-primary: linear-gradient(135deg, #0a1628 0%, #1a3a5c 100%);
    --gradient-accent: linear-gradient(135deg, #00d4ff 0%, #00fff9 100%);
}

/* ===== GLOBAL RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== ANIMATED BACKGROUND ===== */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        linear-gradient(135deg, #0a1628 0%, #0f2847 50%, #1a3a5c 100%);
    overflow: hidden;
}

.background-animation::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 50px,
            rgba(0, 212, 255, 0.03) 50px,
            rgba(0, 212, 255, 0.03) 51px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 50px,
            rgba(0, 255, 249, 0.03) 50px,
            rgba(0, 255, 249, 0.03) 51px
        );
    animation: grid-move 20s linear infinite;
}

.background-animation::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(0, 255, 249, 0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===== HEADER & NAVIGATION ===== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    z-index: 1000;
    padding: 1rem 0;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-accent);
    transition: width 0.3s ease;
}

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

.nav-links a:hover::after {
    width: 100%;
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    gap: 4rem;
}

.hero-content {
    flex: 1;
    z-index: 10;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease;
}

.tagline {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    animation: fadeInUp 1s ease 0.4s both;
}

/* ===== 3D CUBE ANIMATION ===== */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.ai-cube {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 20s infinite linear;
}

.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px solid var(--accent-blue);
    background: rgba(0, 212, 255, 0.1);
    backdrop-filter: blur(5px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

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

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

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--primary-dark);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-cyan);
    border: 2px solid var(--accent-cyan);
}

.btn-secondary:hover {
    background: rgba(0, 255, 249, 0.1);
    transform: translateY(-3px);
}

/* ===== SECTIONS ===== */
section {
    padding: 6rem 2rem;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

section h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: -2rem;
    margin-bottom: 3rem;
}

/* ===== ABOUT SECTION ===== */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.about-card {
    background: rgba(26, 58, 92, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease both;
}

.about-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-cyan);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.2);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.about-card h3 {
    color: var(--accent-cyan);
    margin-bottom: 1rem;
}

.about-card p {
    color: var(--text-secondary);
}

/* ===== GAMES SECTION ===== */
.games {
    background: rgba(15, 40, 71, 0.3);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.game-card {
    background: rgba(26, 58, 92, 0.4);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeInUp 0.6s ease both;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent-cyan);
    box-shadow: 0 15px 50px rgba(0, 212, 255, 0.3);
}

.game-placeholder {
    height: 200px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 249, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.game-placeholder::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 212, 255, 0.05) 10px,
        rgba(0, 212, 255, 0.05) 20px
    );
}

.coming-soon {
    background: rgba(0, 212, 255, 0.2);
    color: var(--accent-cyan);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 600;
    border: 1px solid var(--accent-cyan);
    z-index: 1;
}

.game-info {
    padding: 1.5rem;
}

.game-info h3 {
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

.game-info p {
    color: var(--text-secondary);
}

/* ===== CONTACT SECTION ===== */
.contact {
    text-align: center;
}

.contact-info {
    margin-top: 2rem;
}

/* ===== FOOTER ===== */
footer {
    background: rgba(10, 22, 40, 0.9);
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    padding: 2rem;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        translate: 0 30px;
    }
    to {
        opacity: 1;
        translate: 0 0;
    }
}

/* Particles are positioned here so script.js never writes inline styles. */
@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(40px);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.4);
    pointer-events: none;
    animation-name: float;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.particle:nth-child(3n) {
    width: 2px;
    height: 2px;
    animation-duration: 18s;
}

.particle:nth-child(3n+1) {
    width: 3px;
    height: 3px;
    background: rgba(0, 212, 255, 0.55);
    animation-duration: 14s;
}

.particle:nth-child(3n+2) {
    width: 1px;
    height: 1px;
    background: rgba(0, 255, 249, 0.5);
    animation-duration: 22s;
}

.particle:nth-child(6n+1) { left: 8%;  top: 72%; animation-delay: 0s; }
.particle:nth-child(6n+2) { left: 22%; top: 88%; animation-delay: 2s; }
.particle:nth-child(6n+3) { left: 37%; top: 64%; animation-delay: 4s; }
.particle:nth-child(6n+4) { left: 53%; top: 96%; animation-delay: 1s; }
.particle:nth-child(6n+5) { left: 71%; top: 78%; animation-delay: 3s; }
.particle:nth-child(6n+6) { left: 88%; top: 90%; animation-delay: 5s; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        padding: 6rem 1rem 2rem;
        text-align: center;
    }

    .hero h2 {
        font-size: 2.5rem;
    }

    .hero-visual {
        margin-top: 2rem;
    }

    .ai-cube {
        width: 150px;
        height: 150px;
    }

    .cube-face {
        width: 150px;
        height: 150px;
    }

    .front, .back { transform: rotateY(0deg) translateZ(75px); }
    .right { transform: rotateY(90deg) translateZ(75px); }
    .left { transform: rotateY(-90deg) translateZ(75px); }
    .top { transform: rotateX(90deg) translateZ(75px); }
    .bottom { transform: rotateX(-90deg) translateZ(75px); }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

    section h2 {
        font-size: 2rem;
    }

    footer .container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }
}
