/* =========================================
   PUBLIC-LAYOUT.CSS (Shared Styles)
   ========================================= */

/* 1. Remove the blue flash when tapping links/buttons on mobile */
* {
    -webkit-tap-highlight-color: transparent;
}

/* 2. Disable the "Pull-to-Refresh" browser behavior */
html, body {
    overscroll-behavior-y: contain;
}

:root {
    --bg-base: #FFFFFF;
    --bg-surface: #F8FAFC;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-light: #E2E8F0;
    --bg-dark: #0F172A;
    --accent-primary: #2563EB;
    --accent-hover: #1D4ED8;
    --accent-glow: rgba(37, 99, 235, 0.15);
    
    --radius-full: 9999px;
    --radius-lg: 24px;
    --max-width: 1200px;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* Ambient background gradient so the glassmorphism has something to blur! */
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.08) 0px, transparent 50%), 
        radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

/* --- TYPOGRAPHY & BUTTONS --- */
h1, h2, h3 { font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary), #06B6D4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px; border-radius: var(--radius-full);
    font-weight: 600; font-size: 15px; text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer; border: none; white-space: nowrap;
}

.btn-primary { background: var(--accent-primary); color: white; box-shadow: 0 8px 20px -6px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 12px 25px -6px rgba(37, 99, 235, 0.3); }

.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border-light); }
.btn-outline:hover { border-color: var(--text-main); background: var(--bg-surface); }

/* --- ENHANCED GLASSMORPHIC NAVBAR --- */
.navbar {
    position: fixed;
    top: 0; 
    left: 0; 
    right: 0;
    margin: 0 auto;
    
    /* CRITICAL FIXES FOR SMOOTH ANIMATION */
    width: 100%; 
    max-width: 100%; /* Gives the browser a math starting point */
    height: 80px; 
    border-radius: 0px; /* Gives the radius a starting point */
    border: 1px solid transparent; /* Prevents 1px layout shift */
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    
    z-index: 1000;
    display: flex; 
    align-items: center;
    
    /* Using 'all' with a custom curve ensures nothing snaps instantly */
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Scrolled 'Pill' State */
.navbar.scrolled {
    top: 20px;
    width: calc(100% - 48px);
    max-width: 1100px;
    height: 70px;
    border-radius: 40px;
    
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 15px 35px -10px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}

.nav-container {
    width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 24px;
    display: flex; justify-content: space-between; align-items: center;
}

.brand-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--text-main); text-decoration: none; letter-spacing: -0.02em; }
.brand-logo i { color: var(--accent-primary); fill: var(--accent-glow); }

.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-link { text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 15px; transition: color 0.2s; }
.nav-link:hover { color: var(--text-main); }

/* --- MOBILE MENU BUTTON --- */
.mobile-menu-btn {
    display: none;
    background: none; border: none; cursor: pointer;
    color: var(--text-main); padding: 8px;
    border-radius: 8px; transition: 0.2s;
}
.mobile-menu-btn:hover { background: var(--bg-surface); }

/* --- FOOTER --- */
.footer { background: #0B1120; color: #F8FAFC; padding: 80px 24px 32px; margin-top: 100px; position: relative; }
.footer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-primary), transparent); opacity: 0.4; }
.footer-container { max-width: var(--max-width); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; }
.footer-brand p { color: #94A3B8; margin-top: 16px; max-width: 320px; font-size: 15px; line-height: 1.6; }
.footer-links h4 { margin-bottom: 20px; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; color: #F8FAFC; font-weight: 700; }
.footer-links a { display: block; color: #94A3B8; text-decoration: none; margin-bottom: 12px; transition: all 0.2s ease; font-size: 14px; font-weight: 500; }
.footer-links a:hover { color: white; transform: translateX(4px); }
.footer-bottom { max-width: var(--max-width); margin: 60px auto 0; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; color: #64748B; font-size: 13px; }

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    
    .nav-links {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 32px 24px;
        gap: 24px;
        border-bottom: 1px solid var(--border-light);
        box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        
        /* Animation setup */
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* When menu is active */
    .navbar.menu-active .nav-links {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .navbar.scrolled .nav-links { border-radius: 0 0 32px 32px; }

    .footer-container { grid-template-columns: 1fr; gap: 40px; }
    .footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
}

/* --- ANIMATION UTILITIES --- */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Page-specific: transparent header for hero pages only when at top */
body.hero-top .navbar:not(.scrolled) {
    background: transparent;
    border-bottom: none;
    backdrop-filter: none;
}

body.hero-top .navbar:not(.scrolled) .brand-logo,
body.hero-top .navbar:not(.scrolled) .nav-link,
body.hero-top .navbar:not(.scrolled) .mobile-menu-btn {
    color: #FFFFFF;
}

body.hero-top .navbar:not(.scrolled) .nav-link:hover { color: #FFFFFF; }

/* Default active link styling (dark when navbar has background) */
.nav-link.active { color: var(--text-main); font-weight: 700; }

/* On hero pages when at top, active link should be white for contrast */
body.hero-top .navbar:not(.scrolled) .nav-link.active { color: #FFFFFF; }