/* --- Base Theme & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #000000;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Hero Section --- */
.hero {
    display: flex;
    justify-content: center;
    padding: 15vh 1.5rem 4rem;
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

/* Fixed the breaking text issue with fluid typography */
.hero h1 {
    font-size: clamp(3rem, 10vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.hero p {
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: #888888;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 6rem;
    width: 100%;
}

/* --- Sleek, Minimalist Filters --- */
input[type="radio"] {
    display: none;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
    background: #0a0a0a;
    padding: 0.5rem;
    border-radius: 100px;
    border: 1px solid #1a1a1a;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.filters label {
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    color: #666666;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (hover: hover) {
    .filters label:hover {
        color: #ffffff;
    }
}

/* Active State - Subtle Yellowish-Orange/Blue Gradient Text */
#filter-all:checked ~ .filters label[for="filter-all"],
#filter-biology:checked ~ .filters label[for="filter-biology"],
#filter-chemistry:checked ~ .filters label[for="filter-chemistry"],
#filter-physics:checked ~ .filters label[for="filter-physics"] {
    background: #1a1a1a;
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* CSS-Only Filtering Logic */
#filter-physics:checked ~ .grid .card:not(.physics-card),
#filter-chemistry:checked ~ .grid .card:not(.chemistry-card),
#filter-biology:checked ~ .grid .card:not(.biology-card) {
    display: none;
}

/* --- Premium Cards --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    position: relative;
    text-decoration: none;
    border-radius: 20px;
    background: #050505;
    border: 1px solid #1a1a1a;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.card-inner {
    padding: 2.5rem 2rem;
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Card Hover Effect - Subtle Glow based on Subject */
@media (hover: hover) {
    .card:hover {
        transform: translateY(-4px);
        border-color: #333333;
    }
    
    .physics-card:hover {
        box-shadow: 0 10px 40px -10px rgba(37, 99, 235, 0.15); /* Blue glow */
    }
    
    .chemistry-card:hover {
        box-shadow: 0 10px 40px -10px rgba(234, 88, 12, 0.15); /* Yellow/Orange glow */
    }
    
    .biology-card:hover {
        box-shadow: 0 10px 40px -10px rgba(255, 255, 255, 0.05); /* White glow */
    }
}

.card:active {
    transform: scale(0.98);
}

/* --- Card Content --- */
.card-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: inline-block;
}

/* Subject Specific Tag Colors */
.physics-card .card-tag { color: #3b82f6; } /* Precision Blue */
.chemistry-card .card-tag { color: #f59e0b; } /* Yellowish-Orange */
.biology-card .card-tag { color: #e5e5e5; } /* Clean White */

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin-bottom: 1rem;
}

.card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #888888;
    margin: 0;
}

/* --- Mobile Specific Adjustments --- */
@media (max-width: 480px) {
    .hero {
        padding: 10vh 1.25rem 3rem;
    }
    .filters {
        gap: 0.25rem;
        padding: 0.35rem;
        width: 100%;
        justify-content: space-around;
        border-radius: 12px;
    }
    .filters label {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    .grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .card-inner {
        padding: 2rem 1.5rem;
    }
}
