/* Global Reset & Typography */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #00f2fe;
    --secondary-color: #4facfe;
    --accent-color: #ff0055;
    --bg-dark: #0a0a0e;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --glass-blur: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Dynamic Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 242, 254, 0.1), transparent 25%);
    pointer-events: none;
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* User Video Background */
.video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -5;
    object-fit: cover;
    opacity: 0.6;
    /* Slight transparency to blend with dark mode */
}

/* Header */
header {
    padding: 3rem 5%;
    text-align: center;
    position: relative;
}

.title-container {
    display: inline-block;
    position: relative;
}

h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a5f3fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    letter-spacing: -2px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease forwards 0.2s;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s ease forwards 0.4s;
}

/* Apps Grid */
.apps-container {
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    perspective: 1000px;
}

/* App Card */
.app-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px;
    opacity: 0;
    transform: translateY(30px) rotateX(10deg);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.app-card:hover {
    transform: translateY(-10px) rotateX(0deg);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(79, 172, 254, 0.2);
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: 0.5s;
}

.app-card:hover::before {
    left: 100%;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.launch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    width: fit-content;
    gap: 0.5rem;
}

.launch-btn:hover {
    background: var(--secondary-color);
    color: #000;
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.4);
    transform: translateX(5px);
}

/* Animations */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-visible {
    animation: cardEntrance 0.6s ease forwards;
}

@keyframes cardEntrance {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* Responsive Design */

/* Large Tablets & Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
    h1 {
        font-size: 3rem;
    }

    .apps-container {
        padding: 2rem 3%;
        gap: 2rem;
    }
}

/* Tablets (max-width: 768px) */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    header {
        padding: 2.5rem 5% 1rem;
    }

    .apps-container {
        /* Allow grid to handle columns naturally but ensure min-width doesn't break layout */
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

/* Mobile Devices (max-width: 480px) */
@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
        letter-spacing: -1px;
    }

    .subtitle {
        font-size: 1rem;
    }

    header {
        padding: 2rem 1.5rem 1rem;
    }

    .apps-container {
        padding: 1.5rem;
        grid-template-columns: 1fr;
        /* Force single column on very small screens */
        gap: 1.25rem;
    }

    .app-card {
        padding: 1.5rem;
        min-height: auto;
        /* Let content dictate height */
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .card-content h2 {
        font-size: 1.5rem;
    }

    .launch-btn {
        width: 100%;
        /* Full width button for easier tapping */
    }
}

/* Other Apps CSS */

.other-apps-title {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}