:root {
    --bg-color: #0d0f1a;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary-gradient: linear-gradient(135deg, #FF6B6B 0%, #845EC2 100%);
    --hover-glow: rgba(132, 94, 194, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite alternate linear;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: #845EC2;
    top: -10%;
    left: -10%;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: #008F7A;
    bottom: -20%;
    right: -10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: #FF9671;
    top: 40%;
    left: 40%;
    opacity: 0.2;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.main-header {
    text-align: center;
    padding: 6rem 2rem 4rem;
    position: relative;
    z-index: 1;
}

.main-header h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.main-header h1 span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.main-header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    padding: 0 2rem 6rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.animal-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.animal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.animal-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                0 0 20px var(--hover-glow);
}

.animal-card:hover::before {
    opacity: 0.05;
}

.icon-wrapper {
    font-size: 4rem;
    line-height: 1;
    position: relative;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3));
}

.animal-card:hover .icon-wrapper {
    transform: scale(1.15) rotate(5deg);
}

.animal-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    position: relative;
    z-index: 1;
    letter-spacing: 0.5px;
}

/* Entrance Animation for Cards */
.calculator-grid .animal-card {
    animation: fadeInUp 0.6s ease-out backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation delays for the first 20 items to make loading feel dynamic */
.calculator-grid .animal-card:nth-child(1) { animation-delay: 0.05s; }
.calculator-grid .animal-card:nth-child(2) { animation-delay: 0.10s; }
.calculator-grid .animal-card:nth-child(3) { animation-delay: 0.15s; }
.calculator-grid .animal-card:nth-child(4) { animation-delay: 0.20s; }
.calculator-grid .animal-card:nth-child(5) { animation-delay: 0.25s; }
.calculator-grid .animal-card:nth-child(6) { animation-delay: 0.30s; }
.calculator-grid .animal-card:nth-child(7) { animation-delay: 0.35s; }
.calculator-grid .animal-card:nth-child(8) { animation-delay: 0.40s; }
.calculator-grid .animal-card:nth-child(9) { animation-delay: 0.45s; }
.calculator-grid .animal-card:nth-child(10) { animation-delay: 0.50s; }
.calculator-grid .animal-card:nth-child(n+11) { animation-delay: 0.55s; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-header {
        padding: 4rem 1rem 3rem;
    }
    .main-header h1 {
        font-size: 2.8rem;
    }
    .calculator-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1rem;
        padding: 0 1rem 4rem;
    }
    .icon-wrapper {
        font-size: 3rem;
    }
    .animal-card {
        padding: 1.5rem 1rem;
        gap: 0.8rem;
    }
}
