/* Critical path CSS for above-the-fold content */
body {
    font-family: 'Inter', sans-serif;
    background-color: #0a0a23; 
    color: #e0e0e0; 
    overflow-x: hidden; 
    /* Improve text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid #2575fc;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #2575fc;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1; 
}

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; 
    z-index: 1;
    /* Performance optimizations */
    transform: translateZ(0);
    will-change: transform;
}

.btn-primary {
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    /* Optimize button interactions */
    will-change: transform, box-shadow;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.section-title { 
    background: -webkit-linear-gradient(#6a11cb, #2575fc);
    background: linear-gradient(#6a11cb, #2575fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a23;
}

::-webkit-scrollbar-thumb {
    background: #2575fc;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6a11cb;
}

.input-field {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-field:focus {
    border-color: #2575fc;
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.3);
    outline: none;
}

/* Accessibility improvements for form validation */
.input-field:invalid {
    border-color: #ef4444;
}

.input-field:valid {
    border-color: #10b981;
}

header, section, footer {
    position: relative;
    z-index: 1;
}

.header-logo-svg { 
    height: 40px; 
    width: auto;
}

.interactive-logo-svg .interactive-path-element, 
.interactive-logo-svg .interactive-arrow-path,
.interactive-logo-svg .interactive-pulse-path { 
    transition: stroke-width 0.2s ease-in-out; 
}

.interactive-logo-container:hover .interactive-logo-svg .interactive-path-element,
.interactive-logo-container:hover .interactive-logo-svg .interactive-arrow-path,
.interactive-logo-container:hover .interactive-logo-svg .interactive-pulse-path {
    stroke-width: 3px; 
}

.interactive-logo-svg .interactive-logo-text {
    transition: transform 0.3s ease-out, fill 0.3s ease-out, filter 0.3s ease-out;
    transform-origin: 50% 50%; 
}

.interactive-logo-container:hover .interactive-logo-svg .interactive-logo-text {
    fill: #ffffff;
    filter: drop-shadow(0 0 4px rgba(106, 27, 203, 0.6)); 
    transform: scale(1.03);
}

.pulse-dot {
    opacity: 0; 
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(10, 10, 35, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

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

.modal-content {
    background-color: #0f0f2e;
    padding: 2rem 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 550px;
    width: 100%;
    text-align: center;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: #ffffff;
}

/* Performance optimizations */
/* Improve image loading performance */
img {
    loading: lazy;
    decoding: async;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-gray-300 {
        color: #ffffff;
    }
    
    .text-gray-400 {
        color: #e5e5e5;
    }
    
    .border-gray-700 {
        border-color: #ffffff;
    }
}

/* Enhanced responsive design */
@media (max-width: 480px) {
    .text-5xl {
        font-size: 2.5rem;
    }
    
    .hero-section {
        min-height: calc(100vh - 4rem);
        padding-top: 4rem;
    }
    
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
}

/* Print styles */
@media print {
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .btn-primary,
    .modal-overlay,
    footer nav {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

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

/* Loading state styles */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid transparent;
    border-top: 2px solid #2575fc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error state styles */
.error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.success {
    color: #10b981;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Social media hover effects */
footer nav a {
    transition: all 0.2s ease;
}

footer nav a:hover {
    transform: translateY(-2px);
}

/* Content Security Policy inline style alternatives */
.gradient-text {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Container query support for modern browsers */
@supports (container-type: inline-size) {
    .hero-section {
        container-type: inline-size;
    }
    
    @container (max-width: 768px) {
        .text-5xl {
            font-size: 3rem;
        }
    }
}
