* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Default Dark Theme Variables */
:root {
    --bg: #0b0f1a;
    --bg-2: #111827;

    --bg-gradient-blend: rgba(11, 15, 26, 0.95);
    --hero-overlay: rgba(0, 0, 0, 0.6); /* High opacity black overlay to blend with dark mode */
    --hero-filter: brightness(0.35) contrast(1.1);

    --hero-text: #f1f5f9;
    --hero-text-muted: #94a3b8;

    --radial-1: rgba(37, 105, 231, 0.1);
    --radial-2: rgba(99, 102, 241, 0.06);

    --card: rgba(255, 255, 255, 0.04);
    --card-solid: #1e293b;
    --card-light: rgba(61, 76, 156, 0.08);

    --primary: #3b82f6;
    --primary-hover: #60a5fa;

    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --nav-bg-scrolled: rgba(11, 15, 26, 0.85);
    --shadow: rgba(0, 0, 0, 0.4);
}

/* System Light Default OR Manual Light Toggle */
@media (prefers-color-scheme: light) {
    :root:not(.dark-theme) {
        --bg: #f5f5f7;
        --bg-2: #f9fafb;

        --bg-gradient-blend: rgba(253, 253, 253, 0.96);
        --hero-filter: brightness(0.9) contrast(1.05) saturate(1.1);
        --hero-overlay: rgba(255, 255, 255, 0.4);

        --radial-1: rgba(37, 105, 231, 0.04);
        --radial-2: rgba(99, 102, 241, 0.03);

        --card: rgba(15, 23, 42, 0.05);
        --card-solid: #ffffff;
        --card-light: rgba(15, 23, 42, 0.08);

        --text: #1e293b;
        --text-muted: #475569;
        --border: rgba(15, 23, 42, 0.1);
        --nav-bg-scrolled: rgba(253, 253, 253, 0.9);
        --shadow: rgba(15, 23, 42, 0.06);
    }
}

/* Manual Light Overrides */
:root.light-theme {
    --bg: #f5f5f7;
    --bg-2: #f9fafb;

    --bg-gradient-blend: rgba(253, 253, 253, 0.96);
    --hero-filter: brightness(0.9) contrast(1.05) saturate(1.1);
    --hero-overlay: rgba(255, 255, 255, 0.4);

    --radial-1: rgba(37, 105, 231, 0.04);
    --radial-2: rgba(99, 102, 241, 0.03);

    --card: rgba(15, 23, 42, 0.05);
    --card-solid: #ffffff;
    --card-light: rgba(15, 23, 42, 0.08);

    --text: #1e293b;
    --text-muted: #475569;
    --border: rgba(15, 23, 42, 0.1);
    --nav-bg-scrolled: rgba(253, 253, 253, 0.9);
    --shadow: rgba(15, 23, 42, 0.06);
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: transparent;
    opacity: 0.5;
}

/* VANTA BACKGROUND LAYER */

#vanta-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;

    opacity: 0.5; /* Adjust opacity for better blending */ 
    pointer-events: none; /* Ensures links, buttons, and hover animations remain clickable */
}

.light-theme #vanta-bg {
    opacity: 0.15; /* Reduce opacity in light mode for better blending */
}

body {
    position: relative;
    background: transparent !important; /* Overrides the static linear-gradient so Vanta is visible */
    /*background: linear-gradient(180deg, var(--bg), var(--bg-2));*/

    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* FONTS */

body {
    font-family: 'Inter', sans-serif;
}

.hero-text h1,
.section-title h2,
.logo a,
.server-box h3,
.about-card h3,
.faq-item h3 {
    font-family: 'Space Grotesk', sans-serif;
}

/* CONTAINER */

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

/* HEADER */

header {
    position: sticky;
    top: 0;
    z-index: 999;
    transition:
        background 0.4s ease,
        border-color 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom: 1px solid transparent; /* Switched hardcoded color to transparent */
}

header.scrolled {
    background: var(--nav-bg-scrolled);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 30px var(--shadow);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 18px 0;
}

.logo a {
    text-decoration: none;
    color: var(--text);

    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: 0.3s ease;
}

.logo a:hover {
    color: var(--primary);
    letter-spacing: 1px;
}

/* NAVIGATION */

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;

    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);

    transition: 0.3s ease;
    font-size: 0.95rem;

    position: relative;
    padding: 5px 0;
}

.nav-links a:hover {
    color: var(--text-muted);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* DROPDOWN */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 35px;
    left: 0;

    min-width: 220px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;

    padding: 10px;
    opacity: 0;
    visibility: hidden;

    transform: translateY(10px);
    transition: 0.25s ease;
    list-style: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.dropdown:hover .dropdown-menu,
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;

    padding: 10px 14px;
    border-radius: 10px;
}

.dropdown-menu li a:hover {
    background: var(--card-light);
}

/* DROPDOWN Arrow Animation */

.dropdown > a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-icon {
    font-size: 0.75rem;
    transition: 0.3s ease;
}

.dropdown:hover .dropdown-icon,
.dropdown.active .dropdown-icon {
    transform: rotate(180deg);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color 0.3s ease,
        transform 0.2s ease;
}

.theme-toggle-btn:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* BUTTONS */

.btn {
    text-decoration: none;

    padding: 14px 24px;
    border-radius: 12px;

    transition: 0.3s ease;

    font-weight: bold;
    font-size: 0.95rem;
}

.primary-btn {
    position: relative;
    overflow: hidden;
    background: var(--primary);
    color: white;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s;
}

.primary-btn:hover::before {
    left: 100%;
}

.secondary-btn {
    border: 1px solid var(--border);
    color: var(--text);
    background: transparent;
    backdrop-filter: blur(5px);
}

.secondary-btn:hover {
    background: rgba(37, 105, 231, 0.15);
    border-color: var(--primary);
}

/* SECTION TITLES */

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.section-title p {
    color: var(--text-muted);
}

/* FOOTER */

footer {
    border-top: 3px solid var(--border);
    padding: 28px 0;
    margin-top: auto;
    z-index: 1;
    
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-content a {
    text-decoration: none;
    color: var(--text-muted);

    transition: 0.3s ease;
}

.footer-content a:hover {
    color: var(--text);
}

.footer-links {
    display: flex;
    gap: 18px;
}

/* Scroll Animations */

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */

@media (max-width: 900px) {
    .hero-content {
        text-align: center;
    }

    .hero-text p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-text h1 {
        font-size: 2.4rem;
    }

    .footer-content,
    .navbar {
        align-items: flex-start;
        flex-direction: row !important; /* Do NOT stack logo and links */
        justify-content: space-between;
        align-items: center;
        padding: 15px 0; /* Shrink padding to save vertical space */
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 12px; /* Tighten space between links */
    }

    .hero {
        padding: 100px 0;
        min-height: 60vh;
    }

    .hero-buttons {
        width: 100%;
        justify-content: center;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .container {
        width: 92%;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    .nav-links {
        gap: 14px;
    }

    .dropdown-menu {
        min-width: 180px;
        background: var(--card-solid);
    }

    .logo a {
        font-size: 1.1rem; /* Shrink logo slightly so everything fits */
    }

    .nav-links a {
        font-size: 0.85rem; /* Make text slightly smaller on tiny screens */
    }

    footer {
        text-align: center;
        line-height: 1;
    }

    .footer-content {
        align-items: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}
