/* Enhanced Premium Styles - World-Class UX/UI */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Properties for Dynamic Theming */
:root {
    /* Colors - Apple-inspired palette */
    --primary-black: #1d1d1f;
    --primary-gray: #86868b;
    --light-gray: #f5f5f7;
    --white: #ffffff;
    --accent-blue: #0066cc;
    --accent-blue-hover: #0051a2;
    --text-dark: #1d1d1f;
    --text-light: #6e6e73;
    --border-light: #d2d2d7;
    
    /* Shadows - Multi-layered for realism */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.08);
    
    /* Spacing - 8-point grid */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
    
    /* Typography - Fluid scaling */
    --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --font-size-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --font-size-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --font-size-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --font-size-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --font-size-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --font-size-3xl: clamp(2rem, 1.7rem + 1.5vw, 2.5rem);
    --font-size-4xl: clamp(2.5rem, 2rem + 2.5vw, 3.5rem);
    
    /* Layout */
    --max-width: 1200px;
    --header-height: 4rem;
    
    /* Animations */
    --transition-base: 150ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
    --transition-slower: 500ms ease-in-out;
    
    /* Easing functions */
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Selection */
::selection {
    background-color: var(--accent-blue);
    color: var(--white);
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Smooth Scrolling */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Body with Noise Texture */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    font-weight: 400;
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: tabular-nums;
    position: relative;
    overflow-x: hidden;
}

/* Subtle noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.015;
    z-index: 1;
    pointer-events: none;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(0,0,0,.01) 35px, rgba(0,0,0,.01) 70px);
}

/* All content above noise */
body > * {
    position: relative;
    z-index: 2;
}

/* Container with responsive padding */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 max(var(--space-lg), 5vw);
}

/* Typography with Fluid Scaling */
h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--text-dark) 0%, #2d2d2f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-md);
}

h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-sm);
}

p {
    font-size: var(--font-size-base);
    line-height: 1.75;
    color: var(--text-light);
}

.lead {
    font-size: var(--font-size-lg);
    line-height: 1.6;
    font-weight: 300;
    margin-bottom: var(--space-md);
    color: var(--text-dark);
}

/* Skip Navigation Link */
.skip-nav {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-blue);
    color: var(--white);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 0 0 4px 0;
    text-decoration: none;
    z-index: 100;
    transition: top var(--transition-base);
}

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

/* Enhanced Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    transition: all var(--transition-slow);
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 0 0 var(--border-light), var(--shadow-sm);
}

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

/* Desktop only nav styles */
@media (min-width: 769px) {
    .nav-header {
        display: contents;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
}

.logo {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: transform var(--transition-base);
}

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

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

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 400;
    position: relative;
    transition: color var(--transition-base);
    padding: var(--space-xs) 0;
}

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

.nav-links a:hover {
    color: var(--accent-blue);
}

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

.nav-links a.active {
    color: var(--accent-blue);
}

/* Hero Section with Animations */
.hero {
    padding-top: var(--header-height);
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--white) 0%, var(--light-gray) 100%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.hero-text {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-text h1 {
    margin-bottom: var(--space-sm);
}

.hero-text h2 {
    font-size: var(--font-size-2xl);
    font-weight: 400;
    color: var(--primary-gray);
    margin-bottom: var(--space-sm);
}

.location {
    font-size: var(--font-size-base);
    color: var(--text-light);
    margin-bottom: var(--space-xl);
}

/* Enhanced CTA Button */
.cta-button {
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--accent-blue) 0%, #0055b3 100%);
    color: var(--white);
    text-decoration: none;
    border-radius: 980px;
    font-size: var(--font-size-base);
    font-weight: 500;
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px 0 rgba(0, 102, 204, 0.3);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(0, 102, 204, 0.4);
}

.cta-button:hover::before {
    width: 300px;
    height: 300px;
}

.cta-button:active {
    transform: translateY(-1px);
}

/* Hero Image with Parallax */
.hero-image {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.2s forwards;
    will-change: transform;
    overflow: hidden;
    border-radius: 24px;
    max-width: 400px;
    max-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-width: 400px;
    height: 500px;
    object-fit: cover;
    object-position: center center;
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    transition: transform var(--transition-slower);
}

.hero-image:hover img {
    transform: scale(1.02) rotate(1deg);
}

/* About Section with Premium Feel */
.about {
    padding-top: var(--header-height);
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-color: var(--light-gray);
    position: relative;
    overflow: hidden;
}

.about::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 102, 204, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.about .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.about h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.about p {
    max-width: 800px;
    margin: 0 auto var(--space-md);
    text-align: center;
}

/* Services Grid with Hover Effects */
.services {
    padding-top: var(--header-height);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.services .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.services h2 {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
}

.service-item {
    padding: var(--space-lg);
    background-color: var(--light-gray);
    border-radius: 16px;
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 102, 204, 0.02) 100%);
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.service-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.service-item:hover::before {
    opacity: 1;
}

.service-item h3 {
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
    position: relative;
    z-index: 1;
}

.service-item p {
    font-size: var(--font-size-sm);
    position: relative;
    z-index: 1;
}

/* Contact Section */
.contact {
    padding-top: var(--header-height);
    min-height: calc(100vh - 100px); /* Account for footer */
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--light-gray) 0%, #f0f0f2 100%);
    text-align: center;
}

.contact .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.contact h2 {
    margin-bottom: var(--space-md);
}

.contact-intro {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-xl);
    color: var(--text-light);
}

.contact-info {
    display: flex;
    gap: var(--space-xl);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.contact-link {
    font-size: var(--font-size-base);
    color: var(--accent-blue);
    text-decoration: none;
    transition: all var(--transition-base);
    position: relative;
    padding: var(--space-xs) var(--space-sm);
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--accent-blue);
    transform: translateX(-50%);
    transition: width var(--transition-base);
}

.contact-link:hover::after {
    width: 100%;
}

/* Footer */
.footer {
    padding: var(--space-xl) 0;
    text-align: center;
    border-top: 1px solid var(--border-light);
}

.footer p {
    font-size: var(--font-size-xs);
    color: var(--text-light);
}

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

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

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

/* Loading State */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--white);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity var(--transition-slow);
}

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

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom Scrollbar */
@supports (scrollbar-width: thin) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--border-light) transparent;
    }
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--border-light);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-gray);
}

/* Responsive Design with Better Breakpoints */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-2xl);
    }
    
    .hero-text {
        order: 2;
    }
    
    .hero-image {
        order: 1;
    }
    
    .hero-image img {
        max-width: 300px;
        height: 375px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 3.5rem;
    }
    
    .nav-links {
        gap: var(--space-lg);
    }
    
    .hero {
        padding-top: var(--header-height);
        min-height: 100vh;
    }
    
    .about,
    .services,
    .contact {
        min-height: auto;
        padding: calc(var(--header-height) + var(--space-xl)) 0 var(--space-xl);
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .contact-info {
        flex-direction: column;
        gap: var(--space-md);
    }
}

/* Small mobile adjustments handled in styles-mobile.css */

/* Print Styles */
@media print {
    .navbar,
    .cta-button,
    .loading {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .hero,
    .about,
    .services,
    .contact {
        page-break-inside: avoid;
        padding: 1rem 0;
    }
}

/* Reduced Motion Preferences */
@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;
    }
}