:root {
    --bg-gradient-start: #d4fc79;
    --bg-gradient-end: #96e6a1;
    --card-bg: rgba(255, 255, 255, 0.25);
    --card-border: rgba(255, 255, 255, 0.4);
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --accent-color: #ff7675;
    --font-main: 'Outfit', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    /* Blueprint Grid + Gradient Background */
    background-color: #f0f4f8;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
    /* Soft Purple-Blue Gradient */
    background-size: 20px 20px, 20px 20px, cover;
    background-attachment: scroll, scroll, fixed;
}

header {
    text-align: center;
    padding: 60px 20px;
    animation: fadeInDown 1s ease-out;
}

header h1 {
    font-size: 4rem;
    margin: 0;
    color: #2d3436;
    letter-spacing: -2px;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.5);
}

header p {
    color: var(--text-secondary);
    font-size: 1.3rem;
    margin-top: 10px;
    font-weight: 300;
}

main {
    flex: 1;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
}

.exercise-card {
    background: rgba(255, 255, 255, 0.1);
    /* Frosted glass as requested */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Softer border to match frost */
    border-radius: 24px;
    padding: 0;
    /* Remove padding so image fills card */
    text-align: center;
    text-decoration: none;
    color: #fff;
    /* White text */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy transition */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Push content to bottom */
    align-items: center;
    min-height: 250px;
    /* Slightly taller */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);

    /* Continuous floating animation */
    animation: fadeInUp 0.6s ease-out backwards, floatCard 6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    /* Ensure text is above image */
    z-index: 1;
}

.exercise-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0.8;
    /* Make it clearer */
    transition: transform 0.5s ease, opacity 0.5s ease, filter 0.5s ease;
    filter: blur(0px) grayscale(20%);
    /* Less blur/grayscale */
}

.exercise-card:hover img {
    transform: scale(1.1);
    opacity: 1;
    filter: grayscale(0%);
    /* Clear on hover */
}

/* Subtle internal shine effect */
.exercise-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-25deg);
    animation: shine 8s infinite;
}

@keyframes floatCard {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    /* Fast pass */
    100% {
        left: 200%;
    }

    /* Long pause */
}

.exercise-card:hover {
    transform: translateY(-20px) scale(1.05);
    /* Override float on hover */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.5);
    border-color: #fff;
    animation-play-state: paused;
    /* Pause float so it doesn't jitter */
}

.exercise-card h2 {
    font-size: 1.5rem;
    margin: 0;
    text-transform: uppercase;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    /* Requested text shadow */

    /* Bottom Glass Strip */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);

    display: flex;
    /* For letter animation flex container */
    justify-content: center;
}

/* Letter Animation */
.exercise-card h2 span {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.exercise-card:hover h2 span {
    color: var(--accent-color);
}

.exercise-card:hover h2 span:nth-child(odd) {
    transform: translateY(-8px) rotate(-5deg);
}

.exercise-card:hover h2 span:nth-child(even) {
    transform: translateY(-4px) rotate(5deg);
}

footer {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

footer a {
    color: var(--accent-color);
    /* Changed to accent color */
    text-decoration: none;
    font-weight: 500;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}