:root {
    --bg-light: #f3f4f6;
    --bg-dark: #0f172a;
    --text-light: #1e293b;
    --text-dark: #f8fafc;
    --card-bg-light: rgba(255, 255, 255, 0.6);
    --card--bg-black: rgba(30,41,59,0.4);
}

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

body {
    font-family: 'Condiment', sans-serif;
    background: #e9d2a8;
    background-size: center;
    background-size: contain;
    background-repeat: no-repeat;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #88800e;
    font-size: 1.2rem;
    text-align: center;
    transition: background 0.4s ease, color 0.4s ease;
    animation: bgShift 15s ease infinite;
    cursor: auto;
}

/* Dark Mode */
body.dark {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #034353;
    background-image: url('cbc.webp');
    background-size: cover;
    animation: bgShift 15s ease infinite;
}

h1 {
    font-size: 2.9rem;
    background: linear-gradient(to right, #795f30, #df9c5e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
body.dark h1 {
    font-size: 3rem;
    background: linear-gradient(to right, #64688f, #034353);
    -webkit-background-clip: text;
    -webkit-text-clip: transparent;
 } 
 
 body.dark .card {
    color: #1c2852;
 }

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.2; transform: scale(1);
    } 50% {
        opacity: 1; transform: scale(1.1);
    }
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin-top: 2rem;
    padding: 0 1rem;
    width: 100%;
}

a {
    text-decoration: none;
}

.card {
    position: relative;
    background: #885f3a;
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    color: #d8ae77;
    box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.15),
    0 0 30px rgba(94, 234, 212, 0.1);
    border: 1px solid rgba(114, 73, 19, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    font-size: 1.3rem;
}

body.dark .card:hover {
    color: #1c2447;
}
body.dark .open-btn:hover {
    color: #17314e;
}

@keyframes borderPulse {
    0% {
        filter: blur(10px) hue-rotate(0deg);
    } 100% {
        filter: blur(10px) hue-rotate(360deg);
    }
}

.card h2 {
    font-size: 1.7rem;
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 1.5rem;
    opacity: 0.85;
    margin-bottom: 1rem;
}

.open-btn {
    font-weight: bold;
    color: #bbbe88;
    font-size: 1.3rem;
}

body.dark .card {
    background: var(--card-bg-dark);
    color: #babaf8;
}
body.dark .open-btn {
    color: #afbbf3;
}

#themeToggle {
    position: relative;
    background: #81663e;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    font-family: 'condiment', sans-serif;
    color: #e0bca4;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    float: right;
    margin: 20px;
}

nav {
    background: #885f3a;
    width: 100%;
    font-size: 1.5rem;

}
nav ul {
    list-style: none;
    display: flex;
    justify-content: space-around;
    gap: 20px;
    font-size: 1.5rem;
    padding: 1.2rem 0;
}
nav a {
    text-decoration: wavy underline;
    color: beige;
    font-size: 1.5rem;
}

body.dark nav {
    background: rgb(118, 158, 196);
    color: #2e7596;
}
body.dark nav a {
    color: #034353;
}

body.dark #themeToggle {
    background: #023c7e;
    color: white;
}

footer {
    margin-top: 3rem;
    font-size: 1.3rem;
    opacity: 0.7;
    padding: 10px 30px;
    width: 100%;
    background: #3f1e01;
    color: beige;
}
body.dark footer {
    color: rgb(11, 11, 46);
    background: rgb(148, 195, 250);
}

footer a {
    color: #3b82f6;
    text-decoration: none;
}

button:hover {
    cursor: grab;
    transform: scale(1.03);
}

@keyframes bgShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 59%;
    }
}

.card {
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 0 30px rgba(94, 234, 212, 0.25);
}

.card {
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    z-index: -1;
    filter: blur(10px);
    animation: borderPulse 6s infinite linear;
}

@keyframes borderPulse {
    0% {
        filter: blur(10px) hue-rotate(0deg);
    }
    100% {
        filter: blur(10px) hue-rotate(360deg);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.2; transform: scale(1);
       }  50% {
            opacity: 1; translate: scale(1.1);
        }
   
}


/*Sparkle animation*/
@keyframes twinkle {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/*Glow-pulse animation*/
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 5px #fac960, 0 0 10px #f0c91c;
    }
    50% {
        box-shadow: 0 0 15px, 0 0 25px #fac460;
    }
}