/* Critical CSS - Above the fold content */
:root {
    --gray-700: rgba(255, 255, 255, 0.7);
    --primary-white: #ffffff;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #000;
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Prevent media from overflowing on small screens */
img { max-width: 100%; height: auto; }

/* Header Critical Styles - Modern Pill Design */
.header {
    position: fixed;
    top: calc(20px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 40px);
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Compact state when scrolled */
.header--scrolled {
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.08);
    max-width: 1100px;
}

.header--scrolled .nav__container {
    height: 58px;
    padding: 0 1.25rem;
}

.header--scrolled .nav__logo-icon {
    width: 28px;
    height: 28px;
}

.header--scrolled .nav__logo-text {
    font-size: 1.25rem;
}

/* Expanded state at very top */
.header--top {
    border-radius: 56px;
    max-width: 1280px;
}

.header--top .nav__container {
    height: 78px;
    padding: 0 2.25rem;
}

.header--top .nav__logo-icon {
    width: 34px;
    height: 34px;
}

.header--top .nav__logo-text {
    font-size: 1.6rem;
}

.nav__container {
    max-width: none;
    margin: 0;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: relative;
    transition: height 0.25s ease, padding 0.25s ease;
}

.nav__logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.nav__logo-icon {
    width: 32px;
    height: 32px;
    transition: width 0.25s ease, height 0.25s ease, transform 0.25s ease;
}

.nav__logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    transition: font-size 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
}

/* Override browser default link styles */
.header a,
.nav a,
.nav__link,
.nav__login {
    color: inherit !important;
    text-decoration: none !important;
}

.nav__link {
    color: var(--gray-700) !important;
}

.nav__link:hover {
    color: var(--primary-white) !important;
}

.nav__login {
    color: var(--gray-700) !important;
}

.nav__login:hover {
    color: var(--primary-white) !important;
}

/* Hero Critical Styles */
.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 120px;
}

.hero__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.hero__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: calc(100svh - 80px);
}

.hero__title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 0.9;
    margin: 2rem 0;
    letter-spacing: -0.04em;
}

.hero__subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3rem;
    max-width: 500px;
}

@media (max-width: 768px) {
    .hero { padding-top: 96px; }
}

/* Button Critical Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.btn span,
.btn i,
.btn svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease, opacity 0.3s ease;
}

.btn:hover span,
.btn:hover i,
.btn:hover svg {
    transform: translateX(4px);
}

.btn--primary {
    background: #fff !important;
    color: #000 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    opacity: 1 !important;
}

.btn--primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -200%;
    width: 80%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 0, 0, 0.3) 50%, 
        transparent 100%);
    transform: skewX(-15deg);
    transition: left 1.0s ease-out;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
}

.btn--primary:hover::before {
    left: 200%;
    opacity: 1;
}

.btn--primary:hover {
    background: #fff !important;
    color: #000 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(255, 255, 255, 1) !important;
}

.btn--primary span {
    position: relative;
    z-index: 2;
}

/* Specific override for small primary buttons */
.btn.btn--primary.btn--small {
    background: #fff !important;
    color: #000 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    opacity: 1 !important;
    font-weight: 600 !important;
}

.btn--small {
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
}

/* Outline/Ghost variants alignment */
.btn--ghost,
.btn--outline {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--primary-white) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.btn--secondary {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--primary-white) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.btn--ghost::before,
.btn--outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -200%;
    width: 80%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
    transform: skewX(-15deg);
    transition: left 1.0s ease-out;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
}

.btn--ghost:hover::before,
.btn--outline:hover::before,
.btn--secondary:hover::before {
    left: 200%;
    opacity: 1;
}

.btn--ghost:hover,
.btn--outline:hover,
.btn--secondary:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

/* Add sweep effect for secondary as well */
.btn--secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -200%;
    width: 80%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
    transform: skewX(-15deg);
    transition: left 1.0s ease-out;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
}

/* Mobile Critical */
@media (max-width: 768px) {
    .header {
        top: calc(10px + env(safe-area-inset-top));
        width: calc(100% - 20px);
        border-radius: 40px;
    }
    
    .nav__container {
        padding: 0 1.5rem;
        height: 60px;
    }

    /* Mobile variants for scroll states */
    .header--scrolled .nav__container {
        height: 54px;
        padding: 0 1rem;
    }

    .header--top {
        border-radius: 44px;
    }

    .header--top .nav__container {
        height: 64px;
        padding: 0 1.75rem;
    }
    
    .hero {
        padding-top: 100px;
    }
    
    .hero__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero__container {
        padding: 0 1rem;
    }
}