/**
 * En Masse - Main Stylesheet
 * Consolidated styles for optimal performance
 * 
 * @author En Masse Development Team
 * @version 2.0.0
 */

/* ========================================================================
   CSS Custom Properties (Design Tokens)
   ======================================================================== */
:root {
    /* Brand Colors */
    --primary-color: #1a2332;
    --secondary-color: #0f1419;
    --accent-color: #1dd1a1;
    --accent-hover: #00d4aa;
    --text-white: #ffffff;
    --text-light: #a0aec0;
    --text-muted: #718096;
    
    /* Gradients */
    --gradient-dark: linear-gradient(135deg, #1a2332 0%, #0f1419 100%);
    --gradient-accent: linear-gradient(135deg, #1dd1a1 0%, #00d4aa 100%);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Monaco', 'Menlo', monospace;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Breakpoints */
    --breakpoint-sm: 480px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    
    /* Animation */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Layout */
    --header-height: 70px;
    --container-max: 1200px;
    --container-padding: 20px;
}

/* ========================================================================
   Base Reset & Typography
   ======================================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-white);
    background: var(--primary-color);
    overflow-x: hidden;
    position: relative;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h5 { font-size: clamp(1.125rem, 2vw, 1.5rem); }
h6 { font-size: clamp(1rem, 1.5vw, 1.25rem); }

p {
    margin-bottom: var(--space-md);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-base);
}

/* ========================================================================
   Layout Components
   ======================================================================== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

.section {
    padding: var(--space-3xl) 0;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-color);
    color: var(--primary-color);
    padding: var(--space-sm) var(--space-md);
    z-index: 9999;
    font-weight: 600;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    top: 0;
}

/* ========================================================================
   Header & Navigation
   ======================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(26, 35, 50, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(29, 209, 161, 0.1);
    z-index: 1000;
    transition: all var(--transition-base);
}

.header.scrolled {
    background: rgba(26, 35, 50, 0.98);
    box-shadow: 0 4px 20px rgba(29, 209, 161, 0.15);
}

.nav {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    height: 40px;
    transition: transform var(--transition-base);
}

.logo:hover {
    transform: scale(1.05);
}

.logo img,
.logo svg {
    height: 100%;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: var(--space-xl);
}

.nav-link {
    color: var(--text-light);
    font-weight: 500;
    position: relative;
    transition: color var(--transition-base);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-cta {
    background: var(--accent-color);
    color: var(--primary-color);
    padding: var(--space-sm) var(--space-lg);
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    transition: all var(--transition-base);
}

.nav-cta:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(29, 209, 161, 0.3);
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    width: 30px;
    height: 24px;
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.nav-toggle span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    left: 0;
    transition: all var(--transition-base);
}

.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 10px; }
.nav-toggle span:nth-child(3) { top: 20px; }

.nav-toggle.active span:nth-child(1) {
    top: 10px;
    transform: rotate(135deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.nav-toggle.active span:nth-child(3) {
    top: 10px;
    transform: rotate(-135deg);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: var(--primary-color);
    transition: right var(--transition-base);
    z-index: 1001;
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================================================
   Main Content Area
   ======================================================================== */
main {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ========================================================================
   Hero Sections
   ======================================================================== */
.hero {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    position: relative;
    background: var(--gradient-dark);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="grid" width="50" height="50" patternUnits="userSpaceOnUse"><path d="M 50 0 L 0 0 0 50" fill="none" stroke="rgba(29,209,161,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    to { transform: translate(50px, 50px); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* ========================================================================
   Cards & Components
   ======================================================================== */
.card {
    background: rgba(26, 35, 50, 0.8);
    border: 1px solid rgba(29, 209, 161, 0.2);
    border-radius: 16px;
    padding: var(--space-xl);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px rgba(29, 209, 161, 0.15);
}

.card:hover::before {
    transform: scaleX(1);
}

/* ========================================================================
   Buttons
   ======================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(29, 209, 161, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(29, 209, 161, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
}

.btn-secondary:hover {
    background: rgba(29, 209, 161, 0.1);
}

/* ========================================================================
   Forms
   ======================================================================== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-white);
}

.form-control {
    width: 100%;
    padding: var(--space-md);
    background: rgba(26, 35, 50, 0.8);
    border: 1px solid rgba(29, 209, 161, 0.3);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-base);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(29, 209, 161, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ========================================================================
   Footer
   ======================================================================== */
.footer {
    background: var(--secondary-color);
    border-top: 1px solid rgba(29, 209, 161, 0.2);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-logo {
    height: 35px;
    margin-bottom: var(--space-md);
}

.footer-section h3 {
    color: var(--accent-color);
    margin-bottom: var(--space-lg);
}

.footer-section a {
    color: var(--text-light);
    display: block;
    margin-bottom: var(--space-sm);
    transition: color var(--transition-base);
}

.footer-section a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(29, 209, 161, 0.2);
    padding-top: var(--space-xl);
    text-align: center;
    color: var(--text-muted);
}

/* ========================================================================
   Animations
   ======================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================================
   Responsive Design
   ======================================================================== */
@media (max-width: 968px) {
    .nav-links,
    .nav-cta:not(.mobile-only) {
        display: none !important;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    :root {
        --container-padding: 15px;
    }
    
    .mobile-menu {
        max-width: 100%;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* ========================================================================
   Utility Classes
   ======================================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-accent { color: var(--accent-color); }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }

.bg-primary { background: var(--primary-color); }
.bg-secondary { background: var(--secondary-color); }
.bg-accent { background: var(--accent-color); }

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.grid { display: grid; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }
.gap-4 { gap: var(--space-xl); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
