:root {
    --primary: #00f2ff;
    --secondary: #7000ff;
    --bg-dark: #050510;
    --text-light: #ffffff;
    --text-dim: #b0b0b0;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
}

#bg {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -100 !important;
    pointer-events: none;
}

#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    z-index: 100;
    background: rgba(5, 5, 16, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

main {
    width: 100%;
    position: relative;
    z-index: 5;
}

section {
    min-height: 100vh;
    padding: 6rem 5% 4rem;
    /* Reduced top padding from 10rem */
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.hero {
    text-align: center;
    position: relative;
    z-index: 9999 !important;
    pointer-events: none;
    transform: translateZ(10px);
    /* Strong hardware priority */
    will-change: transform, opacity;
}

.hero h1,
.hero p,
.cta .btn {
    opacity: 0;
    /* Hide initially to prevent popping flash */
}

.hero * {
    pointer-events: auto;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20vh;
    /* Slightly tighter from 22vh */
    color: #ffffff;
    /* Solid white fallback */
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    /* Improved readablity */
}

.hero h1 span {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    /* Brighter text */
    max-width: 700px;
    margin: 0 auto 0rem;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    font-weight: 500;
}

.cta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    /* Pull buttons closer */
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.btn.primary {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 10px 20px rgba(0, 242, 255, 0.2);
}

.btn.primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 242, 255, 0.4);
}

.btn.secondary {
    background: var(--glass);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.section-title {
    font-size: 3rem;
    margin-bottom: 3rem;
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--glass);
    padding: 3rem 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: transform 0.3s, border-color 0.3s;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.service-card .icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-card p {
    color: var(--text-dim);
    line-height: 1.6;
}

.contact {
    align-items: center;
}

.contact-card {
    background: var(--glass);
    padding: 4rem;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.contact-card h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-card p {
    color: var(--text-dim);
    margin-bottom: 2.5rem;
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#contact-form input,
#contact-form textarea {
    padding: 1.2rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#contact-form input:focus,
#contact-form textarea:focus {
    border-color: var(--primary);
}

footer {
    padding: 4rem 5%;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: var(--text-dim);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .cta {
        flex-direction: column;
    }

    .contact-card {
        padding: 2rem;
    }
}