/* Custom CSS Variables */
:root {
    --primary-bg: #000000;
    --secondary-bg: #0a0a0a;
    --tertiary-bg: #111111;
    --accent-blue: #007AFF;
    --accent-purple: #5856D6;
    --accent-teal: #5AC8FA;
    --text-primary: #ffffff;
    --text-secondary: #8E8E93;
    --text-tertiary: #636366;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --gradient: linear-gradient(135deg, #007AFF, #5856D6, #5AC8FA);
    --gradient-subtle: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(88, 86, 214, 0.1));
    --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-large: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.04);
    --blur: blur(20px);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Bootstrap Overrides */
.bg-secondary-custom {
    background: var(--secondary-bg) !important;
}

.bg-tertiary-custom {
    background: var(--tertiary-bg) !important;
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border);
    border-top: 2px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Header Styles */
header {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
    min-height: 70px;
}

.navbar-brand.logo {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0.5rem 1rem !important;
    margin: 0 0.5rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--text-primary) !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1px;
}

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

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hero Section */
#hero {
    position: relative;
    overflow: hidden;
}

#three-canvas {
    z-index: 1;
}

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

.hero-title {
    font-size: clamp(3.5rem, 8vw, 8rem);
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 0.9;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1.3rem, 3vw, 2.2rem);
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent-blue);
    border: none;
    box-shadow: var(--shadow-medium);
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    background: #0056CC;
    transform: translateY(-2px);
    box-shadow: var(--shadow-large);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    backdrop-filter: var(--blur);
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.scroll-indicator {
    width: 32px;
    height: 52px;
    border: 2px solid var(--text-secondary);
    border-radius: 26px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 3rem;
}

.scroll-indicator:hover {
    border-color: var(--accent-blue);
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent-blue);
    border-radius: 50%;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { top: 12px; opacity: 1; }
    100% { top: 32px; opacity: 0; }
}

/* Section Styles */
section {
    position: relative;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1.5;
}

/* About Section */
.about-text h3 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

.location-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.location-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.location-card:hover {
    transform: translateY(-10px);
    background: var(--surface-hover);
    box-shadow: var(--shadow-large);
}

.location-icon {
    font-size: 3rem !important;
    color: var(--accent-blue);
}

.location-card h4 {
    font-size: 1.4rem;
    color: var(--text-primary);
    font-weight: 600;
}

.location-card p {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Services Section */
.service-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: var(--blur);
    min-height: 300px;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.service-card:hover {
    transform: translateY(-8px);
    background: var(--surface-hover);
    box-shadow: var(--shadow-large);
}

.service-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-subtle);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.service-icon .material-symbols-outlined {
    font-size: 2rem;
    color: var(--accent-blue);
}

.service-card h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Projects Section */
.project-info h3 {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.project-info p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    line-height: 1.7;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-blue);
    display: block;
    letter-spacing: -0.02em;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.project-image {
    background: var(--surface);
    border-radius: 24px;
    height: 400px;
    border: 1px solid var(--border);
    backdrop-filter: var(--blur);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 300" fill="%23007AFF" opacity="0.1"><rect width="400" height="300"/><circle cx="100" cy="75" r="20"/><rect x="50" y="120" width="300" height="10" rx="5"/><rect x="50" y="150" width="200" height="10" rx="5"/><rect x="50" y="180" width="250" height="10" rx="5"/></svg>');
    background-size: cover;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-large);
}

.project-icon {
    font-size: 4rem !important;
    color: var(--accent-blue);
}

.project-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Testimonials Section */
.testimonial {
    background: var(--surface);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: var(--blur);
    position: relative;
    min-height: 280px;
}

.testimonial:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-large);
    background: var(--surface-hover);
}

.testimonial-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.testimonial-author-info h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.testimonial-company {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.star {
    color: #FFD60A;
    font-size: 1.2rem;
}

.testimonial-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    font-style: italic;
}

.testimonial-text::before {
    content: '"';
    font-size: 4rem;
    color: var(--accent-blue);
    position: absolute;
    top: 1rem;
    right: 2rem;
    opacity: 0.3;
    font-family: serif;
}

/* Contact Section */
.contact-form .form-control {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: var(--blur);
}

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

.contact-form .form-control:focus {
    background: var(--surface-hover);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    color: var(--text-primary);
}

/* Footer */
footer {
    background: var(--primary-bg);
    border-top: 1px solid var(--border);
}

.footer-section h4 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--accent-blue);
}

.social-link {
    width: 44px;
    height: 44px;
    background: var(--surface);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    text-decoration: none;
}

.social-link:hover {
    background: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.social-link .material-symbols-outlined {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.social-link:hover .material-symbols-outlined {
    color: white;
}

.footer-bottom {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1.1rem, 4vw, 1.5rem);
    }
    
    .section-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .service-card,
    .testimonial {
        min-height: auto;
    }
    
    .project-image {
        height: 300px;
    }
    
    .navbar-nav {
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: var(--blur);
        border-radius: 12px;
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .navbar-nav .nav-link {
        text-align: center;
        margin: 0.25rem 0;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right.animated {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in.animated {
    opacity: 1;
    transform: scale(1);
}