:root {
    /* Brand Colors */
    --primary: #6366f1;
    --secondary: #ec4899;
    --accent: #14b8a6;

    /* Dark Theme (Default) */
    --bg-darker: #020617;
    --bg-dark: #0f172a;
    --bg-surface: rgba(255, 255, 255, 0.03);
    --bg-card: rgba(255, 255, 255, 0.03);
    --glass: rgba(15, 23, 42, 0.7);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.05);
    --shadow: rgba(0, 0, 0, 0.5);
    --gradient-hero: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
}

[data-theme="light"] {
    --bg-darker: #f8fafc;
    --bg-dark: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --glass: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: rgba(148, 163, 184, 0.2);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #475569 100%);

    /* Accents for Light Mode */
    --primary: #4f46e5;
    --accent: #0d9488;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-darker);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

/* Ambient Background */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.08), transparent 25%);
    pointer-events: none;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 0.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s, border 0.3s;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img,
footer img {
    /* Precise background removal using luminance masking */
    -webkit-mask-image: url('logo_full.png');
    mask-image: url('logo_full.png');
    -webkit-mask-mode: luminance;
    mask-mode: luminance;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;

    /* Reset previous hacks */
    mix-blend-mode: normal;
    filter: none;
    transition: filter 0.3s ease;
}

[data-theme="light"] .logo img,
[data-theme="light"] footer img {
    filter: invert(1);
    /* Invert colors for light theme visibility */
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Theme Toggle Button */
#theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

#theme-toggle:hover {
    background: var(--bg-surface);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

/* Hero */
.hero {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 100px 20px 60px;
    position: relative;
}

.hero h1 {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 1.5rem;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -2px;
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-muted);
    max-width: 800px;
    margin-bottom: 3rem;
}

/* Cards & Sections */
.card {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow);
}

.section {
    padding: 100px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Footer */
footer {
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    padding: 5rem 5% 2rem;
    margin-top: 100px;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 60px;
    text-align: left;
    margin-bottom: 60px;
}

.footer-col h4 {
    color: var(--text-main);
    margin-bottom: 25px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--primary);
}

.copy {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }

    .nav-links {
        display: none;
    }

    .footer-cols {
        grid-template-columns: 1fr 1fr;
    }
}