* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0f1a;
    --bg-secondary: #0C2B4E;
    --bg-tertiary: #1A3D64;
    --text-primary: #F4F4F4;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --off-white: #F4F4F4;
    --light-blue: #1D546C;
    --glass-border: rgba(255, 255, 255, 0.25);
    --deep-navy: #0C2B4E;
    --teal: #0d9488;
}

html {
    scroll-behavior: smooth;
    font-size: 14px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Add this at the very top of your mobile media queries to prevent page-wide overflow */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    /* Ensure header stays within bounds */
    header {
        max-width: 100vw;
        overflow: hidden;
    }
    
    /* Ensure mobile nav stays within bounds */
    .mobile-nav {
        max-width: calc(100vw - 30px);
    }
    
    /* Ensure scroll indicator stays within bounds */
    .scroll-indicator {
        right: 15px;
    }
}

/* Loading Screen */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--off-white);
    margin-bottom: 1rem;
}

.loader-bar {
    width: 140px;
    height: 2px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--light-blue), var(--off-white));
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Animated Background (critical) */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 40%, rgba(29, 84, 108, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 85% 70%, rgba(244, 244, 244, 0.03) 0%, transparent 50%),
        linear-gradient(180deg, #0a0f1a 0%, var(--bg-secondary) 100%);
}

/* Header */
header {
    padding: 0.8rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 15, 26, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

header.scrolled {
    padding: 0.7rem 5%;
    background: rgba(10, 15, 26, 0.95);
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: 1.5px;
    color: var(--off-white);
}

.nav-links {
    display: flex;
    gap: 1.6rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover { color: var(--text-primary); }

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--teal), var(--off-white));
    transition: width 0.3s ease;
}

.nav-links a:hover::after { width: 100%; }

.nav-cta {
    padding: 0.5rem 1.2rem;
    background: var(--off-white);
    border: none;
    border-radius: 50px;
    color: var(--deep-navy);
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-size: 0.8rem;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 4px 20px rgba(244, 244, 244, 0.3);
}

.nav-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(244, 244, 244, 0.25);
    background: var(--off-white);
}

/* Mobile Header Bar */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1001;
    padding: 0 5%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.mobile-header > * { flex-shrink: 0; }

.mobile-logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 1.5px;
    color: var(--off-white);
}

.mobile-cta {
    padding: 0.45rem 1rem;
    background: var(--off-white);
    border: none;
    border-radius: 50px;
    color: var(--deep-navy);
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.75rem;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 4px 20px rgba(244, 244, 244, 0.2);
    white-space: nowrap;
}

.mobile-cta:active { transform: scale(0.95); }

.hamburger-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1003;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--off-white);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.hamburger-btn.active .hamburger-line:nth-child(1) { transform: rotate(45deg); }
.hamburger-btn.active .hamburger-line:nth-child(2) { transform: rotate(-45deg); }

/* Hero Section - Cinematic Minimal */
.hero * { font-display: swap; }

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
    position: relative;
    overflow: hidden;
    padding: 8rem 5% 4rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: pulseGlow 8s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

.hero-content {
    max-width: 1200px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.hero-title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.5rem, 8vw, 7rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    opacity: 1;
    transform: translateY(0);
    animation: heroTitleFade 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroTitleFade {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-title .accent {
    background: linear-gradient(135deg, var(--teal) 0%, var(--off-white) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    position: relative;
}

.hero-title .accent::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--teal), var(--off-white));
    border-radius: 2px;
    animation: expandWidth 1.5s ease-out 0.5s forwards;
    transform: scaleX(0);
    transform-origin: left;
}

@keyframes expandWidth { to { transform: scaleX(1); } }

.hero-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 1;
    transform: translateY(0);
    animation: heroSubtitleFade 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes heroSubtitleFade {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 5rem;
    opacity: 1;
    transform: translateY(0);
    animation: heroCtaFade 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

@keyframes heroCtaFade {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-primary,
.btn-secondary {
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    border: none;
    font-family: 'Montserrat', sans-serif;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.btn-arrow { width: 20px; height: 20px; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

.btn-primary {
    background: var(--off-white);
    color: var(--deep-navy);
    box-shadow: 0 8px 32px rgba(244, 244, 244, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before { width: 300px; height: 300px; }

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 48px rgba(244, 244, 244, 0.4);
}

.btn-primary:hover .btn-arrow { transform: translateX(5px); }

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: var(--teal);
    background: rgba(13, 148, 136, 0.1);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 48px rgba(13, 148, 136, 0.2);
}

.btn-secondary:hover .btn-arrow { transform: translateX(5px); }

/* Scroll hint */
.hero-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInUp 1s ease-out 1s forwards, floatUpDown 3s ease-in-out 2s infinite;
}

/* Ensure arrow SVG uses teal color and proper desktop size */
.hero-scroll-hint svg {
    width: 24px;
    height: 24px;
    color: var(--teal);
}

@keyframes floatUpDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Mobile Optimizations for header/hero/buttons */
@media (max-width: 768px) {
    .mobile-header { display: flex; }
    body { padding-top: 60px; }
    .hero { min-height: calc(100vh - 60px); padding: 2rem 5%; }
    .hero::before { width: 500px; height: 500px; }
    .hero-title { font-size: clamp(2.2rem, 10vw, 3.5rem); margin-bottom: 1.2rem; }
    .hero-title .accent::after { bottom: -6px; height: 3px; }
    .hero-subtitle { font-size: clamp(1rem, 4vw, 1.2rem); margin-bottom: 2.5rem; }
    .hero-cta { flex-direction: column; gap: 1rem; margin-bottom: 3rem; width: 100%; max-width: 400px; margin-left: auto; margin-right: auto; }
    .btn-primary, .btn-secondary { width: 100%; justify-content: center; padding: 1rem 2rem; font-size: 0.95rem; }
    .hero-scroll-hint { font-size: 0.75rem; }
    .hero-scroll-hint svg { width: 20px; height: 20px; }
}

@media (max-width: 480px) {
    .hero { padding: 1.5rem 5%; }
    .hero-title { font-size: clamp(2rem, 9vw, 2.8rem); }
    .btn-primary, .btn-secondary { padding: 0.9rem 1.8rem; font-size: 0.9rem; }
    .btn-arrow { width: 18px; height: 18px; }
}
