/* --- CSS Reset & Variables --- */
:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --accent: #E2E2E2;
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    /* 
     * CRITICAL SPLINE FIX:
     * Prevent scroll hijacking from Spline's default behavior 
     */
    overflow-x: hidden;
    overflow-y: auto !important;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Spline 3D Integration --- */

/* Fallback shown while Spline loads. Needs a gradient or image. */
.spline-fallback {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    /* Subtle premium gradient for fallback */
    background: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%);
    display: none;
    /* hidden by default, shown via JS if Spline fails/slow */
}

.spline-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    /* 
     * If the scene is decorative: pointer-events: none;
     * If we want mouse-tracking: pointer-events: all;
     */
    pointer-events: all;
}

/* Fix CSS Layout Shift (CLS) */
spline-viewer {
    display: block;
    width: 100%;
    height: 100vh;
    contain: strict;
    /* Reserves space */
}

/* Hide Spline Logo natively if possible (needs Paid plan usually) */
/* spline-viewer::part(logo) { display: none; } */

/* --- Content Overlay --- */
.content {
    position: relative;
    z-index: 10;
    /* Make sure content doesn't get blocked by spline */
    pointer-events: none;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Re-enable pointer events for actual clickable items */
a,
button,
.nav-links,
.nav-logo {
    pointer-events: auto;
}

/* --- Navbar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 4rem;
    width: 100%;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-secondary);
}

.btn-primary {
    background: white;
    color: black;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: transform 0.3s ease, background 0.3s ease;
}

.btn-primary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* --- Hero Section --- */
.hero {
    flex: 1;
    display: flex;
    justify-content: space-between;
    /* Push left and right containers apart */
    align-items: flex-start;
    /* Move them to the top */
    padding: 10rem 10rem 0 10rem;
    /* Pushed inward and downward to position correctly */
}

.hero-left {
    max-width: 600px;
    position: relative;
    z-index: 10;
}

.hero-right {
    max-width: 800px;
    /* Increased to allow single line */
    text-align: center;
    /* Move text to center instead of right */
    position: relative;
    z-index: 10;
    white-space: nowrap;
    /* FORCE everything on ONE line */
}

.hero-title {
    font-size: 6rem;
    line-height: 1.1;
    font-weight: 400;
    letter-spacing: -0.03em;
    margin-bottom: 0;

    /* Reveal Animation Prep */
    overflow: hidden;
    /* Hide text before it slides up */
    display: block;
    /* Ensure it behaves as a block for transform */
    padding-bottom: 0.2em;
    /* Prevent descendant letters (g, p, q, y) from being clipped */
}

/* Individual text chunk animations */
.hero-title .text-reveal {
    display: inline-block;
    transform: translateY(100%);
    /* Start completely out of view below */
    opacity: 0;
    animation: revealText 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-title .thin-text {
    font-weight: 200;
    color: var(--accent);
}



/* --- Animations --- */

/* Initial states */
.animate-fade-down {
    opacity: 0;
    animation: fadeDown 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Read delay from inline variable style="--delay: X" */
.animate-slide-up {
    animation-delay: var(--delay, 0s);
}

.animate-fade-in {
    animation-delay: var(--delay, 0s);
}

@keyframes fadeDown {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* New custom text reveal */
@keyframes revealText {
    0% {
        opacity: 0;
        transform: translateY(100%);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .navbar {
        padding: 1.5rem;
    }

    .nav-links {
        display: none;
        /* Hide on mobile for now */
    }

    .hero {
        flex-direction: column;
        justify-content: flex-start;
        padding: 4rem 1.5rem 0 1.5rem;
        gap: 2rem;
    }

    .hero-right {
        text-align: left;
    }

    .hero-title {
        font-size: 3.8rem;
    }
}