/* --- CSS Variables & Resets --- */
:root {
    --bg-gradient-1: #0f172a;
    --bg-gradient-2: #1e1b4b;
    --bg-gradient-3: #312e81;
    --accent-color: #3b82f6;
    --text-light: #f8fafc;
    --text-muted: #cbd5e1;
    
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --glass-blur: blur(12px);
    
    --radius-lg: 24px;
    --radius-md: 16px;
    --transition: 0.3s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

/* --- Safari Viewport Fix --- */
html {
    height: -webkit-fill-available;
}

body {
    background-color: var(--bg-gradient-1); /* Fallback */
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.6;
    padding-bottom: 80px; /* Space for mobile nav */
    
    /* Safari Fix: Prevents UI collapse on scroll */
    min-height: 100vh;
    min-height: -webkit-fill-available; 
}

/* --- GPU-Accelerated Background Animation --- */
/* Placed on a pseudo-element so it doesn't force the whole page to repaint */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: linear-gradient(-45deg, var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-gradient-3), #000000);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    
    /* Hardware Acceleration for low RAM devices */
    transform: translateZ(0);
    will-change: background-position;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Global Utilities --- */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 2rem; }
.text-accent { color: var(--accent-color); }

/* --- Glassmorphism Base Classes --- */
.glass-panel, .glass-card, .glass-nav {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.glass-text {
    background: linear-gradient(to right, #ffffff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Top Navigation --- */
.top-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-top: none;
    border-left: none;
    border-right: none;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    text-decoration: none;
    z-index: 1001; 
}

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

/* --- Mobile Side Menu (Slides from Left) --- */
.nav-links {
    position: fixed;
    top: 0;
    left: -100%; 
    width: 280px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    padding: 6rem 2rem 2rem 2rem;
    gap: 1.5rem;
    list-style: none;
    transition: left var(--transition);
    border-right: 1px solid var(--glass-border);
    z-index: 999;
    
    /* Hardware acceleration for smooth slide */
    transform: translateZ(0); 
}

.nav-links.active {
    left: 0; 
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.nav-links i { color: var(--accent-color); width: 24px; text-align: center; }

/* Hamburger Icon */
.hamburger {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1001; 
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-light);
    border-radius: 3px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --- Mobile Bottom Navigation --- */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    z-index: 1000;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    
    /* Ensures bottom nav stays above address bar issues on Safari */
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    gap: 4px;
    transition: var(--transition);
}

.nav-item i { font-size: 1.2rem; }
.nav-item:active, .nav-item:focus { color: var(--accent-color); }

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7rem 1.5rem 3rem 1.5rem;
}

.hero-content {
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    max-width: 900px;
}

.hero-content h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtext {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.hero-split-pitch {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.pitch-box {
    background: rgba(0,0,0,0.2);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.pitch-box h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Buttons */
.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-primary, .btn-secondary, .btn-glass-sm {
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary { background: var(--accent-color); color: white; border: none; }
.btn-secondary { background: rgba(255, 255, 255, 0.1); color: var(--text-light); border: 1px solid var(--glass-border); }
.btn-glass-sm { padding: 0.6rem 1.5rem; border: 1px solid var(--glass-border); border-radius: var(--radius-md); }

/* --- Trust Section (Upgraded Cards) --- */
.trust-section, .categories-section {
    padding: 4rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title { text-align: center; margin-bottom: 0.5rem; font-size: 1.8rem; }
.section-subtitle { color: var(--text-muted); }

.trust-grid {
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-bottom: 1.5rem;
}

.trust-item { text-align: left; }
.icon-wrapper {
    width: 50px; height: 50px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
}

.icon-wrapper i { font-size: 1.5rem; color: var(--accent-color); }
.trust-item h3 { margin-bottom: 1.5rem; font-size: 1.3rem; }

/* Sub-cards for Worker/Employer Types */
.trust-list { 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
}

.trust-sub-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: var(--transition);
}

.sub-icon {
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sub-icon i { color: var(--accent-color); font-size: 1.1rem; }

.sub-text h4 {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0.2rem;
}

.sub-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.approval-notice {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(59, 130, 246, 0.1);
}

.approval-notice i { font-size: 1.5rem; color: var(--accent-color); flex-shrink: 0; }
.approval-notice p { font-size: 0.95rem; }

/* --- Categories Section --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.glass-card {
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    transition: transform var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.glass-card i { font-size: 2rem; margin-bottom: 0.8rem; color: var(--text-light); }
.glass-card h3 { font-size: 1.1rem; }
.glass-card:active { transform: scale(0.96); }

/* Animations */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* =========================================
   DESKTOP OPTIMIZATION (min-width: 768px) 
   ========================================= */
@media (min-width: 768px) {
    body { padding-bottom: 0; }
    
    .hamburger, .mobile-bottom-nav { display: none; }
    
    .nav-links {
        position: static;
        display: flex;
        flex-direction: row;
        height: auto;
        background: transparent;
        padding: 0;
        width: auto;
        border: none;
    }
    
    .nav-links a { font-size: 1rem; gap: 8px; }
    .nav-links a:hover { color: var(--accent-color); }

    .hero-content { padding: 4rem; }
    .hero-content h1 { font-size: 3rem; }
    .hero-subtext { font-size: 1.2rem; }
    
    .hero-split-pitch { flex-direction: row; }
    .pitch-box { flex: 1; }
    .hero-buttons { flex-direction: row; justify-content: center; }

    .btn-primary:hover, .btn-secondary:hover { transform: translateY(-3px); }

    .trust-grid { flex-direction: row; justify-content: space-between; gap: 3rem; padding: 3rem; }
    .trust-item { flex: 1; }
    .trust-sub-card:hover { transform: translateX(10px); background: rgba(255, 255, 255, 0.08); }

    .category-grid { grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
    .glass-card:hover { transform: translateY(-10px); background: rgba(255, 255, 255, 0.1); }
}