:root {
    --bg-color: #0a0a0a;
    --text-color: #ffffff;
    --accent-color: #6C5CE7;
    --accent-gradient: linear-gradient(45deg, #6C5CE7, #00CEC9);

    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;

    --easing: cubic-bezier(0.19, 1, 0.22, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Prevent navbar occlusion for standard pages */
body:not(.home-page):not(.viz-page) {
    padding-top: 120px;
}

/* Visualization pages specific fix */
.viz-page header {
    padding-top: 120px;
}


/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-100%);
    transition: transform 0.8s var(--easing);
}

.menu-overlay.active {
    transform: translateY(0);
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
}

.menu-link {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.3s;
    line-height: 1.1;
    margin-bottom: 20px;
}

.menu-link:hover {
    color: white;
}

/* --- 3D Background --- */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none; /* Allow clicks to pass through */
}

/* --- Navigation --- */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 5vw;
    transition: all 0.3s var(--easing);
    background: rgba(10, 10, 10, 0.5); /* Subtle glass background */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    z-index: 101;
}

.nav-logo span {
    color: var(--accent-color);
}

.nav-links-desktop {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover {
    color: white;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s var(--easing);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-menu-btn {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 101;
    width: 30px;
    padding: 5px;
}

.line {
    width: 100%;
    height: 2px;
    background-color: white;
    transition: transform 0.3s var(--easing), opacity 0.3s;
    display: block;
}

/* --- Hero Section --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5vw; /* Adjusted for better vertical centering */
    position: relative;
    flex-wrap: wrap;
}

.hero-content {
    flex: 1;
    min-width: 300px;
    z-index: 2;
    /* Ensure above background */
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 6rem;
    /* Fixed max size for desktop */
    line-height: 0.95;
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: -2px;
}

.line-mask {
    overflow: hidden;
}

.line-mask span {
    display: block;
    transform: translateY(100%);
}

.highlight {
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 400px;
    margin-bottom: 60px;
    opacity: 0;
    color: rgba(255, 255, 255, 0.7);
}

/* About Social Buttons */
.about-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 40px 0;
}

.social-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s var(--easing);
    background: rgba(255, 255, 255, 0.05);
}

.social-button:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

/* Hero Featured Card */
.hero-featured {
    flex: 0 0 300px;
    margin-top: 40px;
    opacity: 0;
    animation: fadeIn 1s ease 1s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.featured-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.featured-card {
    display: block;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 20px;
    text-decoration: none;
    color: white;
    transition: transform 0.3s var(--easing), background 0.3s;
}

.featured-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.featured-card h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.featured-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.featured-arrow {
    margin-top: 15px;
    font-size: 1.2rem;
}

/* Magnetic Button */
.btn-magnetic {
    display: inline-block;
    padding: 20px 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: white;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: border-color 0.3s;
}

.btn-magnetic:hover {
    border-color: white;
}

.btn-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    transform: translateY(100%);
    transition: transform 0.4s var(--easing);
    z-index: -1;
}

.btn-magnetic:hover .btn-fill {
    transform: translateY(0);
}

.btn-magnetic:hover .btn-text {
    color: black;
}

.btn-text {
    position: relative;
    z-index: 1;
    transition: color 0.4s;
}

.btn-secondary:hover .btn-text {
    color: black;
}

/* --- Gallery Section --- */
.gallery-section {
    padding: 100px 5vw;
    min-height: 100vh;
    scroll-margin-top: 100px;
    /* Fix navbar occlusion on scroll */
}

#gallery {
    scroll-margin-top: 120px;
}

.section-header {
    margin-bottom: 80px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 10px;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    /* Better responsive wrapping */
    gap: 30px;
}

/* Glass Cards */
.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.4s var(--easing);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: white;
    height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.3);
}

.card-tags {
    display: flex;
    gap: 10px;
}

.tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1.1;
}

.card-arrow {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    transition: all 0.3s;
}

.card:hover .card-arrow {
    background: white;
    color: black;
    transform: rotate(-45deg);
}

/* --- Footer --- */
.main-footer {
    padding: 50px 5vw;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 100px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
}

.footer-socials {
    display: flex;
    gap: 20px;
}

.social-link {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.3s;
}

.social-link:hover {
    color: white;
}

/* --- Mobile Optimizations --- */
@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        padding-top: 140px;
        /* More space for navbar */
        padding-bottom: 100px;
    }

    .hero-featured {
        width: 100%;
        flex: none;
        margin-top: 40px;
        margin-bottom: 20px;
    }

    .hero-title {
        font-size: 3.5rem;
        /* Readable size on mobile */
        line-height: 1.1;
        margin-bottom: 20px;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .main-nav {
        padding: 20px;
        background: rgba(10, 10, 10, 0.8);
        /* Slight background for readability */
        backdrop-filter: blur(10px);
    }

    .menu-link {
        font-size: 2.5rem;
    }

    .cursor-dot,
    .cursor-outline {
        display: none;
    }

    * {
        cursor: auto;
    }

    .gallery-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card {
        height: auto;
        min-height: 350px;
    }

    .hero-cta {
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .btn-magnetic {
        width: 100%;
        text-align: center;
        margin-left: 0 !important;
        /* Override inline style */
    }
}