:root {
    /* Theme Variables - Dark (Default) */
    --bg-color: #020617;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --section-bg: rgba(15, 23, 42, 0.4);
    --nav-bg: rgba(2, 6, 23, 0.7);
    --brand-primary: #10b981;
    --brand-accent: #6366f1;
    --card-hover: rgba(16, 185, 129, 0.1);
    --mesh-opacity: 0.15;
    --logo-filter: none;
}

body.light-mode {
    /* Theme Variables - Light Mode */
    --bg-color: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.05);
    --section-bg: #f8fafc;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --card-hover: rgba(16, 185, 129, 0.05);
    --mesh-opacity: 0.05;
    /* Invert light logo for visibility on white background */
    --logo-filter: brightness(0) saturate(100%) invert(30%) sepia(30%) saturate(2460%) hue-rotate(145deg) brightness(89%) contrast(103%);
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s ease;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* Modern Mesh Background */
.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: var(--mesh-opacity);
    background:
        radial-gradient(at 0% 0%, #10b981 0px, transparent 50%),
        radial-gradient(at 100% 0%, #6366f1 0px, transparent 50%),
        radial-gradient(at 100% 100%, #10b981 0px, transparent 50%),
        radial-gradient(at 0% 100%, #6366f1 0px, transparent 50%);
    filter: blur(80px);
    transition: opacity 0.5s ease;
}

.brand-font {
    font-weight: 800;
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.logo-img {
    filter: var(--logo-filter);
    transition: filter 0.5s ease;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
    color: var(--text-muted);
}

.nav-link:hover {
    color: var(--brand-primary);
}

.nav-link.active-link {
    color: var(--brand-primary);
}

.gradient-text {
    background: linear-gradient(135deg, #10b981 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px -10px rgba(16, 185, 129, 0.4);
}

/* Theme Toggle Styling */
.theme-switch {
    width: 52px;
    height: 28px;
    background: #1e293b;
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.light-mode .theme-switch {
    background: #e2e8f0;
    border-color: rgba(0, 0, 0, 0.1);
}

.theme-circle {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 4px;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.light-mode .theme-circle {
    transform: translateX(22px);
    background: #0f172a;
}

.bento-card:hover {
    transform: translateY(-8px);
    background: var(--card-hover);
    border-color: var(--brand-primary);
}

/* High Contrast Visual Cards */
.visual-card {
    background: #ffffff;
    /* Always white */
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: all 0.3s ease;
    color: #0f172a;
    /* Force dark text */
}

/* Ensure text inside visual cards handles specific hierarchies */
.visual-card h3,
.visual-card h4,
.visual-card .font-bold,
.visual-card .text-4xl,
.visual-card .text-xl {
    color: #0f172a !important;
    /* Force dark headings/values */
}

.visual-card .text-sm,
.visual-card .text-xs,
.visual-card p {
    color: #475569 !important;
    /* Slate-600 for secondary text */
}

/* Specific background overrides for nested elements inside visual cards */
.visual-card .bg-slate-50,
.visual-card .dark\:bg-slate-800\/50,
.visual-card .bg-slate-100,
.visual-card .dark\:bg-slate-800 {
    background-color: #f1f5f9 !important;
    /* Slate-100 */
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Gentle border */
}

/* Dark mode specific overrides - Keep Visual Card Light */
body:not(.light-mode) .visual-card {
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}