/* * ==============================================
 * Design Tokens & Configuration
 * ==============================================
 * Centralized variables for easy theming and maintenance.
 */
:root {
    --font-primary: 'Poppins', sans-serif;

    /* Soft background gradient colors */
    --color-bg-start: #cddaf3;
    --color-bg-mid: #dce1e7;
    --color-bg-end: #fbcbd1;

    --color-text: #2c3e50; /* Dark text for better contrast */
    --color-text-muted: #7f8c8d;
    --color-header-text: #34495e;

    --card-bg-color: rgba(255, 255, 255, 0.25); /* More transparent glass effect */
    --card-backdrop-blur: 20px;
    --card-border-color: rgba(255, 255, 255, 0.3);
    --card-shadow-color: rgba(0, 0, 0, 0.1);

    --card-hover-glow-start: #a1c4fd;
    --card-hover-glow-end: #c2e9fb;
    --card-hover-shadow-color: rgba(161, 196, 253, 0.4);

    --card-footer-bg-color: rgba(255, 255, 255, 0.15);
    --card-footer-text-color: #2c3e50;

    --transition-speed: 0.4s;
    --animation-stagger-delay: 100ms;
}

/* * ==============================================
 * General Body & Background Styles
 * ==============================================
 */
body {
    font-family: var(--font-primary);
    color: var(--color-text);
    margin: 0;
    padding: 0 20px; /* Adjust padding to allow container to manage vertical space */
    min-height: 100vh;
    box-sizing: border-box;

    /* Animated Gradient Background */
    background: linear-gradient(315deg, var(--color-bg-start), var(--color-bg-mid), var(--color-bg-end));
    background-size: 400% 400%;
    animation: gradient-animation 10s ease infinite;

    /* Only hide horizontal scroll on body */
    overflow-x: hidden;
    /* Do not set overflow-y here, let the .container handle it */
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* * ==============================================
 * Main Layout & Header
 * ==============================================
 */
.container {
    width: 100%;
    max-width: 1000px;
    text-align: center;
    margin: 0 auto;
    padding: 40px 0; /* Vertical padding now handled by the container itself */
    box-sizing: border-box; /* Ensure padding is included in height calculations */

    /* Make the container a flex column and scrollable */
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px); /* Adjust for body's horizontal padding (20px left + 20px right = 40px, but 100vh refers to viewport height, so minus the padding you want at top/bottom inside the container)
                                       If body has 0 vertical padding, and container has 40px top and 40px bottom padding, total would be 80px */
    max-height: calc(100vh - 80px); /* Limit container height to viewport height minus its own vertical padding */
    overflow-y: auto; /* Enable vertical scrolling when content overflows */
    -webkit-overflow-scrolling: touch; /* Improved scrolling on iOS */
    overflow-x: hidden; /* Prevent horizontal scrolling within the container */
}

.header {
    flex-shrink: 0; /* Prevent header from shrinking */
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 60px;
    color: var(--color-header-text);
    
    /* Gradient Text Effect for header */
    background: linear-gradient(45deg, #1f1d17, #2d2718);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* * ==============================================
 * Navigation Grid & Card Styles
 * ==============================================
 */
.nav-grid {
    flex-grow: 1; /* Allow nav-grid to take up available space */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 35px;
    padding-bottom: 20px; /* Add some padding below the grid for visual comfort before the footer */
}

.card {
    background-color: var(--card-bg-color);
    border-radius: 20px;
    border: 1px solid var(--card-border-color);
    box-shadow: 0 8px 32px 0 var(--card-shadow-color);
    backdrop-filter: blur(var(--card-backdrop-blur));
    -webkit-backdrop-filter: blur(var(--card-backdrop-blur));
    
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1; /* Ensures cards are square */
    justify-content: center;
    position: relative;
    
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;

    /* Staggered Entry Animation for cards */
    opacity: 0;
    transform: translateY(30px);
    animation: card-fade-in 0.6s ease forwards;
}

@keyframes card-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background-image: linear-gradient(var(--card-hover-glow-start), var(--card-hover-glow-end));
    border-radius: 20px;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    z-index: -1; /* Ensures the glow is behind the content */
}

.card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 20px 40px var(--card-hover-shadow-color);
}

.card:hover::before {
    opacity: 1;
}

.card-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-icon {
    font-size: 6rem;
    color: var(--color-text);
    transition: transform var(--transition-speed) ease, color var(--transition-speed) ease;
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(-5deg); /* Subtle rotate on hover */
}

.card-footer {
    background-color: var(--card-footer-bg-color);
    padding: 15px 30px;
    font-weight: 600;
    color: var(--card-footer-text-color);
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card:hover .card-footer {
    background-color: transparent;
    color: #ffffff; /* White text on hover */
    font-weight: 700;
}

/* * ==============================================
 * Floating Text Effect Styles
 * ==============================================
 */
.floating-text {
    position: absolute;
    pointer-events: none; /* Allows clicks to pass through */
    white-space: nowrap; /* Prevents text from wrapping */
    opacity: 0;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3); /* Stronger text shadow */
    z-index: 1000; /* Ensure it's above other content */
    will-change: transform, opacity, filter; /* Optimize for animation performance */
    animation: float-up-fade-out 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; /* Longer, smoother animation */
}

@keyframes float-up-fade-out {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2) rotate(0deg) translateX(0px); /* Start very small */
        filter: blur(0px);
    }
    10% {
        opacity: 0.8; /* Quick fade in */
    }
    30% {
        opacity: 1; /* Fully visible */
        transform: translate(-50%, -100%) scale(1.2) rotate(var(--random-rotation, 0deg)) translateX(var(--random-x-drift, 0px)); /* Peak size and movement */
        filter: blur(0px);
    }
    70% {
        opacity: 0.8; /* Start fading out */
        transform: translate(-50%, -180%) scale(1.0) rotate(var(--random-rotation, 0deg)) translateX(var(--random-x-drift, 0px));
        filter: blur(2px); /* Start blurring */
    }
    100% {
        opacity: 0; /* Fully faded out */
        transform: translate(-50%, -250%) scale(0.7) rotate(var(--random-rotation, 0deg)) translateX(var(--random-x-drift, 0px)); /* Continue floating up, slight shrink, more blur */
        filter: blur(8px); /* Heavily blurred */
    }
}

/* * ==============================================
 * Footer
 * ==============================================
 */
.footer {
    flex-shrink: 0; /* Prevent footer from shrinking */
    margin-top: 40px; /* Adjusted margin for better spacing within the scrollable container */
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
```