/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    /* Colors - inspired by the logo's blue gradient */
    --color-primary: #0A84FF;
    --color-primary-dark: #0066CC;
    --color-primary-light: #5AC8FA;
    --color-secondary: #30D158;

    --color-text: #1D1D1F;
    --color-text-muted: #6E6E73;
    --color-text-light: #86868B;

    --color-bg: #FFFFFF;
    --color-bg-alt: #F5F5F7;
    --color-bg-dark: #1D1D1F;

    --color-border: #D2D2D7;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-size-base: 1rem;
    --font-size-sm: 0.875rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3rem;

    --line-height: 1.6;
    --line-height-tight: 1.3;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Layout */
    --container-max: 1200px;
    --header-height: 72px;

    /* Effects */
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fixed Background Image */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

a:hover {
    color: var(--color-primary-dark);
}

ul {
    list-style: none;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    line-height: var(--line-height-tight);
    font-weight: 600;
    color: var(--color-text);
}

h1 { font-size: clamp(var(--font-size-3xl), 5vw, var(--font-size-5xl)); }
h2 { font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-4xl)); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p {
    color: var(--color-text-muted);
}

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

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

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

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

.section-header p {
    font-size: var(--font-size-lg);
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
    font-weight: 500;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    color: white;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(210, 210, 215, 0.5);
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.logo:hover {
    color: var(--color-text);
}

.logo img {
    width: 48px;
    height: 48px;
}

.logo-text {
    display: none;
}

@media (min-width: 640px) {
    .logo-text {
        display: inline;
    }
}

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

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

.nav-links a {
    color: var(--color-text);
    font-weight: 500;
    position: relative;
}

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

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

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

/* Mobile Navigation Toggle */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    transition: all var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--color-bg);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: var(--header-height);
    background: transparent;
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    padding: var(--space-3xl) var(--space-2xl);
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@media (min-width: 1024px) {
    .hero-content {
        max-width: 1000px;
        padding: var(--space-4xl) var(--space-3xl);
    }
}

.hero h1 {
    margin-bottom: var(--space-lg);
    color: var(--color-text);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2xl);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: var(--color-text-muted);
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   Services Section
   ========================================================================== */
.services {
    background: rgba(255, 255, 255, 0.85);
}

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

.service-card {
    padding: var(--space-xl);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(210, 210, 215, 0.5);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-lg);
    color: white;
}

.service-card h3 {
    margin-bottom: var(--space-sm);
}

.service-card p {
    font-size: var(--font-size-sm);
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about {
    background: transparent;
}

.about .container {
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    padding: var(--space-3xl) var(--space-xl);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
}

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

.about-text p {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-lg);
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-xl);
    text-align: center;
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--color-border);
}

.stat-number {
    display: block;
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
.contact {
    background: transparent;
}

.contact .container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

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

.contact-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    text-align: left;
}

.contact-item svg {
    flex-shrink: 0;
    color: var(--color-primary);
}

.contact-item h3 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xs);
}

.contact-item p,
.contact-item a {
    font-size: var(--font-size-sm);
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
}

.form-group input,
.form-group textarea {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: var(--font-size-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.contact-form .btn {
    align-self: center;
}

.contact-form .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-status {
    text-align: center;
    padding: var(--space-sm) 0;
    font-size: var(--font-size-sm);
    min-height: 1.5em;
}

.form-status.success {
    color: var(--color-secondary);
    font-weight: 500;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background-color: var(--color-bg-dark);
    color: white;
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.footer-brand img {
    width: 40px;
    height: 40px;
}

.footer-nav {
    display: flex;
    gap: var(--space-xl);
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
}

.footer-nav a:hover {
    color: white;
}

.footer-social {
    display: flex;
    gap: var(--space-md);
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all var(--transition);
}

.footer-social a:hover {
    background-color: var(--color-primary);
    color: white;
}

.footer-social svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    padding-top: var(--space-xl);
    text-align: center;
}

.footer-bottom p {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.5);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Elements start hidden, animate when in view */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animations for cards */
.service-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.service-card.in-view {
    opacity: 1;
    transform: translateY(0);
}

.service-card:nth-child(1) { transition-delay: 0.1s; }
.service-card:nth-child(2) { transition-delay: 0.2s; }
.service-card:nth-child(3) { transition-delay: 0.3s; }
.service-card:nth-child(4) { transition-delay: 0.4s; }

/* Hero animations */
.hero-content {
    animation: scaleIn 0.8s ease-out;
}

.hero h1 {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-actions {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* Section header animations */
.section-header {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-header.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* About section animations */
.about-text {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out 0.2s, transform 0.6s ease-out 0.2s;
}

.about-text.in-view {
    opacity: 1;
    transform: translateY(0);
}

.about-stats {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out 0.4s, transform 0.6s ease-out 0.4s;
}

.about-stats.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Stat number count-up effect */
.stat-number {
    display: inline-block;
    transition: transform 0.3s ease;
}

.stat:hover .stat-number {
    transform: scale(1.1);
}

/* Contact section animations */
.contact-info {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out 0.1s, transform 0.5s ease-out 0.1s;
}

.contact-info.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Form field animations */
.form-group {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.form-group.in-view {
    opacity: 1;
    transform: translateX(0);
}

.form-group:nth-child(1) { transition-delay: 0.1s; }
.form-group:nth-child(2) { transition-delay: 0.2s; }
.form-group:nth-child(3) { transition-delay: 0.3s; }
.form-group:nth-child(4) { transition-delay: 0.4s; }

/* Form input focus animations */
.form-group input,
.form-group textarea {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    transform: scale(1.01);
}

/* Button hover animations */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Footer animation */
.site-footer {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

.site-footer.in-view {
    opacity: 1;
}

/* ==========================================================================
   Utilities & Accessibility
   ========================================================================== */
.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-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduced motion preference */
@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;
    }
}

/* Print styles */
@media print {
    .site-header,
    .hero-actions,
    .contact-form,
    .footer-social {
        display: none;
    }

    body {
        font-size: 12pt;
    }

    section {
        padding: 1rem 0;
    }
}
